integrate AquaeAtrae work - add ROOT_SITE_SUBFOLDER

This commit is contained in:
bunkerity 2021-05-03 10:31:37 +02:00
parent 83841b290a
commit 062a39c63a
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
7 changed files with 74 additions and 1 deletions

View File

@ -258,7 +258,7 @@ docker run -p 80:8080 \
-e MULTISITE=yes \
-e AUTO_LETS_ENCRYPT=yes \
-e REDIRECT_HTTP_TO_HTTPS=yes \
-l bunkerized.nginx.AUTOCONF \
-l bunkerized-nginx.AUTOCONF \
bunkerity/bunkerized-nginx
```
@ -568,6 +568,12 @@ Default value : */www*
Context : *global*
The default folder where nginx will search for web files. Don't change it unless you want to make your own image.
`ROOT_SITE_SUBFOLDER`
Values : *\<any valid directory name\>*
Default value :
Context : *global*, *multisite*
The subfolder where nginx will search for site web files.
`LOG_FORMAT`
Values : *\<any values accepted by the log_format directive\>*
Default value : *$host $remote_addr - $remote_user \[$time_local\] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"*

View File

@ -87,6 +87,7 @@ AUTH_BASIC_USER="${AUTH_BASIC_USER-changeme}"
AUTH_BASIC_PASSWORD="${AUTH_BASIC_PASSWORD-changeme}"
USE_CUSTOM_HTTPS="${USE_CUSTOM_HTTPS-no}"
ROOT_FOLDER="${ROOT_FOLDER-/www}"
ROOT_SITE_SUBFOLDER="${ROOT_SITE_SUBFOLDER-}"
LOGROTATE_MINSIZE="${LOGROTATE_MINSIZE-10M}"
LOGROTATE_MAXAGE="${LOGROTATE_MAXAGE-7}"
LOGROTATE_CRON="${LOGROTATE_CRON-0 0 * * *}"

View File

@ -22,6 +22,10 @@ if [ "$MULTISITE" = "yes" ] ; then
done
fi
if [ "$ROOT_SITE_SUBFOLDER" != "" ] ; then
ROOT_FOLDER="${ROOT_FOLDER}/${ROOT_SITE_SUBFOLDER}"
fi
set | grep -E -v "^(HOSTNAME|PWD|PKG_RELEASE|NJS_VERSION|SHLVL|PATH|_|NGINX_VERSION|HOME)=" > "${NGINX_PREFIX}nginx.env"
if [ "$MULTISITE" = "yes" ] ; then
for server in $SERVER_NAME ; do

View File

@ -0,0 +1,5 @@
<?php
echo "welcome to app1 !";
?>

View File

@ -0,0 +1,5 @@
<?php
echo "welcome to app2 !";
?>

View File

@ -0,0 +1,5 @@
<?php
echo "welcome to app3 !";
?>

View File

@ -0,0 +1,47 @@
version: '3'
services:
myreverse:
image: bunkerity/bunkerized-nginx
restart: always
ports:
- 80:8080
- 443:8443
volumes:
- ./apps:/www:ro
- ./letsencrypt:/etc/letsencrypt
environment:
- MULTISITE=yes
- SERVER_NAME=app1.website.com app2.website.com app3.website.com # replace with your domains
- DISABLE_DEFAULT_SERVER=yes
- REDIRECT_HTTP_TO_HTTPS=yes
- AUTO_LETS_ENCRYPT=yes
- USE_CLIENT_CACHE=yes
- USE_GZIP=yes
- ROOT_SITE_SUBFOLDER=web-files
- app1.website.com_REMOTE_PHP=app1
- app1.website.com_REMOTE_PHP_PATH=/var/www/html
- app2.website.com_REMOTE_PHP=app2
- app2.website.com_REMOTE_PHP_PATH=/var/www/html
- app3.website.com_REMOTE_PHP=app3
- app3.website.com_REMOTE_PHP_PATH=/var/www/html
- app3.website.com_ROOT_SITE_SUBFOLDER=another-folder
app1:
image: php:fpm
restart: always
volumes:
- ./apps/app1.website.com/web-files:/var/www/html
app2:
image: php:fpm
restart: always
volumes:
- ./apps/app2.website.com/web-files:/var/www/html
app3:
image: php:fpm
restart: always
volumes:
- ./apps/app3.website.com/another-folder:/var/www/html