From 829c1c6974b611e781693a2913de494ef3228ffd Mon Sep 17 00:00:00 2001 From: bunkerity Date: Tue, 29 Sep 2020 23:37:07 +0200 Subject: [PATCH] some fixes and README update --- README.md | 11 ++++++++--- confs/nginx.conf | 1 - entrypoint.sh | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2582cde..c4f945b 100644 --- a/README.md +++ b/README.md @@ -150,9 +150,9 @@ Default value : *no* If set to yes, enables HTTP basic authentication at the location `AUTH_BASIC_LOCATION` with user `AUTH_BASIC_USER` and password `AUTH_BASIC_PASSWORD`. `AUTH_BASIC_LOCATION` -Values : */* | */subdir/* | *\* -Default value : */* -The location to restrict when `USE_AUTH_BASIC` is set to *yes*. By default, all the website is restricted (*/*). +Values : *sitewide* | */somedir* | *\* +Default value : *sitewide* +The location to restrict when `USE_AUTH_BASIC` is set to *yes*. If the special value *sitewide* is used then auth basic will be set at server level outside any location context. `AUTH_BASIC_USER` Values : *\* @@ -318,6 +318,11 @@ Values : *\* Default value : Set the IP/hostname address of a remote PHP-FPM to execute .php files. See `USE_PHP` if you want to run a PHP-FPM instance on the same container as bunkerized-nginx. +`REMOTE_PHP_PATH` +Values : *\* +Default value : */app* +The path where the PHP files are located inside the server specified in `REMOTE_PHP`. + `USE_PHP` Values : *yes* | *no* Default value : *yes* diff --git a/confs/nginx.conf b/confs/nginx.conf index ebccf45..fc3bc8d 100644 --- a/confs/nginx.conf +++ b/confs/nginx.conf @@ -68,7 +68,6 @@ http { # lua path lua_package_path "/usr/local/lib/lua/?.lua;;"; %DNSBL_CACHE% - lua_shared_dict dnsblcache 10m; # server config include /etc/nginx/server.conf; diff --git a/entrypoint.sh b/entrypoint.sh index b2c4b91..4f1dbbd 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -38,7 +38,7 @@ function replace_in_file() { function spaces_to_lua() { for element in $1 ; do if [ "$result" = "" ] ; then - result="$element" + result="\"${element}\"" else result="${result}, \"${element}\"" fi @@ -71,6 +71,7 @@ GZIP_COMP_LEVEL="${GZIP_COMP_LEVEL-6}" GZIP_MIN_LENGTH="${GZIP_MIN_LENGTH-10240}" GZIP_TYPES="${GZIP_TYPES-text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml application/atom+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml}" USE_PHP="${USE_PHP-yes}" +REMOTE_PHP_PATH="${REMOTE_PHP_PATH-/app}" HEADER_SERVER="${HEADER_SERVER-no}" X_FRAME_OPTIONS="${X_FRAME_OPTIONS-DENY}" X_XSS_PROTECTION="${X_XSS_PROTECTION-1; mode=block}" @@ -177,6 +178,7 @@ if [ "$USE_PHP" = "yes" ] ; then elif [ "$REMOTE_PHP" != "" ] ; then replace_in_file "/etc/nginx/server.conf" "%USE_PHP%" "include /etc/nginx/php.conf;" replace_in_file "/etc/nginx/php.conf" "%REMOTE_PHP%" "$REMOTE_PHP" + replace_in_file "/etc/nginx/fastcgi.conf" "\$document_root" "${REMOTE_PHP_PATH}/" else replace_in_file "/etc/nginx/server.conf" "%USE_PHP%" "" fi