From b55f138b84991260b11ba7f40c46744d1414dc10 Mon Sep 17 00:00:00 2001 From: Frank Kloeker Date: Mon, 5 May 2025 16:58:51 +0200 Subject: [PATCH] prevent replace of existing vars Signed-off-by: Frank Kloeker --- root/entrypoint.sh | 2 +- root/etc/wallabag/nginx.template.conf | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/root/entrypoint.sh b/root/entrypoint.sh index 8d95a8a..b5a777c 100755 --- a/root/entrypoint.sh +++ b/root/entrypoint.sh @@ -29,7 +29,7 @@ provisioner() { # Replace environment variables envsubst < /etc/wallabag/parameters.template.yml > app/config/parameters.yml envsubst < /etc/wallabag/php-wallabag.template.ini > /etc/php81/conf.d/50_wallabag.ini - envsubst '${FASTCGI_READ_TIMEOUT}' < /etc/wallabag/nginx.template.conf > /etc/nginx/nginx.conf + envsubst '${FASTCGI_READ_TIMEOUT}' < /etc/wallabag/nginx.template.conf | sed 's/\$\${/\${/g' > /etc/nginx/nginx.conf # Wait for external database if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_mysql" ] || [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_pgsql" ] ; then diff --git a/root/etc/wallabag/nginx.template.conf b/root/etc/wallabag/nginx.template.conf index ffb0f7e..f12dae9 100644 --- a/root/etc/wallabag/nginx.template.conf +++ b/root/etc/wallabag/nginx.template.conf @@ -25,8 +25,8 @@ http { open_file_cache max=100; client_max_body_size 100M; - map $http_x_forwarded_proto $fe_https { - default $https; + map $$http_x_forwarded_proto $$fe_https { + default $$https; https on; } @@ -41,12 +41,12 @@ http { location / { # try to serve file directly, fallback to app.php - try_files $uri /app.php$is_args$args; + try_files $$uri /app.php$$is_args$$args; } - location ~ ^/app\.php(/|$) { + location ~ ^/app\.php(/|$$) { fastcgi_pass php-upstream; - fastcgi_split_path_info ^(.+\.php)(/.*)$; + fastcgi_split_path_info ^(.+\.php)(/.*)$$; include fastcgi_params; # When you are using symlinks to link the document root to the # current version of your application, you should pass the real @@ -55,8 +55,8 @@ http { # Otherwise, PHP's OPcache may not properly detect changes to # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 # for more information). - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; - fastcgi_param DOCUMENT_ROOT $realpath_root; + fastcgi_param SCRIPT_FILENAME $$realpath_root$$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $$realpath_root; fastcgi_read_timeout ${FASTCGI_READ_TIMEOUT:-300s}; # Prevents URIs that include the front controller. This will 404: # http://domain.tld/app.php/some-path