From fd43b6408c73addb048fef396e30dff02fcc3d91 Mon Sep 17 00:00:00 2001 From: SebastianRzk Date: Thu, 20 Mar 2025 22:17:27 +0100 Subject: [PATCH] allow dynamic ip resolve on php handler Signed-off-by: SebastianRzk --- .../docker-compose/insecure/mariadb/fpm/web/nginx.conf | 8 +++----- .../docker-compose/insecure/postgres/fpm/web/nginx.conf | 8 +++----- .../with-nginx-proxy/mariadb/fpm/web/nginx.conf | 8 +++----- .../with-nginx-proxy/postgres/fpm/web/nginx.conf | 8 +++----- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf index 6e0ad588..841eb1ae 100644 --- a/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf @@ -10,6 +10,7 @@ events { http { + resolver 127.0.0.11 valid=1s; include mime.types; default_type application/octet-stream; types { @@ -39,12 +40,9 @@ http { #gzip on; - upstream php-handler { - server app:9000; - } - server { listen 80; + set $php_handler app:9000; # HSTS settings # WARNING: Only add the preload option once you read about @@ -158,7 +156,7 @@ http { fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls - fastcgi_pass php-handler; + fastcgi_pass $php_handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; diff --git a/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf b/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf index 6e0ad588..841eb1ae 100644 --- a/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf +++ b/.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf @@ -10,6 +10,7 @@ events { http { + resolver 127.0.0.11 valid=1s; include mime.types; default_type application/octet-stream; types { @@ -39,12 +40,9 @@ http { #gzip on; - upstream php-handler { - server app:9000; - } - server { listen 80; + set $php_handler app:9000; # HSTS settings # WARNING: Only add the preload option once you read about @@ -158,7 +156,7 @@ http { fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls - fastcgi_pass php-handler; + fastcgi_pass $php_handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf index a0db1a1c..8221e7d4 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf @@ -10,6 +10,7 @@ events { http { + resolver 127.0.0.11 valid=1s; include mime.types; default_type application/octet-stream; types { @@ -39,12 +40,9 @@ http { #gzip on; - upstream php-handler { - server app:9000; - } - server { listen 80; + set $php_handler app:9000; # HSTS settings # WARNING: Only add the preload option once you read about @@ -158,7 +156,7 @@ http { fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls - fastcgi_pass php-handler; + fastcgi_pass $php_handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf index a0db1a1c..8221e7d4 100644 --- a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf @@ -10,6 +10,7 @@ events { http { + resolver 127.0.0.11 valid=1s; include mime.types; default_type application/octet-stream; types { @@ -39,12 +40,9 @@ http { #gzip on; - upstream php-handler { - server app:9000; - } - server { listen 80; + set $php_handler app:9000; # HSTS settings # WARNING: Only add the preload option once you read about @@ -158,7 +156,7 @@ http { fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls - fastcgi_pass php-handler; + fastcgi_pass $php_handler; fastcgi_intercept_errors on; fastcgi_request_buffering off;