diff --git a/README.md b/README.md index 10bc665..4fc3aa1 100644 --- a/README.md +++ b/README.md @@ -1226,6 +1226,7 @@ The number of days before rotated files are deleted. Custom configurations files (ending with .conf suffix) can be added in some directory inside the container : - /http-confs : http context - /server-confs : server context + - /pre-server-confs : before server context (add map or upstream config) You just need to use a volume like this : ```shell diff --git a/confs/site/server.conf b/confs/site/server.conf index 2a23a4f..ef90871 100644 --- a/confs/site/server.conf +++ b/confs/site/server.conf @@ -1,3 +1,5 @@ +%PRE_SERVER_CONF% + server { %FASTCGI_PATH% %SERVER_CONF% diff --git a/entrypoint/site-config.sh b/entrypoint/site-config.sh index 03d0324..1df2fd8 100644 --- a/entrypoint/site-config.sh +++ b/entrypoint/site-config.sh @@ -47,8 +47,10 @@ cp /opt/confs/site/* "$NGINX_PREFIX" replace_in_file "${NGINX_PREFIX}server.conf" "%MAIN_LUA%" "include ${NGINX_PREFIX}main-lua.conf;" if [ "$MULTISITE" = "yes" ] ; then replace_in_file "${NGINX_PREFIX}server.conf" "%SERVER_CONF%" "include /server-confs/*.conf;\ninclude /server-confs/${1}/*.conf;" + replace_in_file "${NGINX_PREFIX}server.conf" "%PRE_SERVER_CONF%" "include /pre-server-confs/*.conf;\ninclude /pre-server-confs/${1}/*.conf;" else replace_in_file "${NGINX_PREFIX}server.conf" "%SERVER_CONF%" "include /server-confs/*.conf;" + replace_in_file "${NGINX_PREFIX}server.conf" "%PRE_SERVER_CONF%" "include /pre-server-confs/*.conf;\ninclude /pre-server-confs/${1}/*.conf;" fi # max body size