From e01becb14370a8e72aeae74f6b5e3d954dbee4d4 Mon Sep 17 00:00:00 2001 From: Greg Poole Date: Sun, 9 Feb 2020 15:57:26 +1100 Subject: [PATCH] Pass original request protocol from proxy to NC Signed-off-by: Greg Poole --- .../mariadb/fpm/web/nginx.conf | 7 ++++++- .../with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf | 7 ++++++- .../with-nginx-proxy/mariadb/fpm/web/nginx.conf | 7 ++++++- .../with-nginx-proxy/postgres/fpm/web/nginx.conf | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf index 4d301636..89212b8d 100644 --- a/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy-self-signed-ssl/mariadb/fpm/web/nginx.conf @@ -35,6 +35,11 @@ http { server app:9000; } + map $http_x_forwarded_proto $pass_https { + default off; + https on; + } + server { listen 80; @@ -119,7 +124,7 @@ http { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; - # fastcgi_param HTTPS on; + fastcgi_param HTTPS $pass_https; # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true; diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf index 4d301636..89212b8d 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf @@ -35,6 +35,11 @@ http { server app:9000; } + map $http_x_forwarded_proto $pass_https { + default off; + https on; + } + server { listen 80; @@ -119,7 +124,7 @@ http { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; - # fastcgi_param HTTPS on; + fastcgi_param HTTPS $pass_https; # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true; 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 4d301636..89212b8d 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 @@ -35,6 +35,11 @@ http { server app:9000; } + map $http_x_forwarded_proto $pass_https { + default off; + https on; + } + server { listen 80; @@ -119,7 +124,7 @@ http { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; - # fastcgi_param HTTPS on; + fastcgi_param HTTPS $pass_https; # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true; 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 4d301636..89212b8d 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 @@ -35,6 +35,11 @@ http { server app:9000; } + map $http_x_forwarded_proto $pass_https { + default off; + https on; + } + server { listen 80; @@ -119,7 +124,7 @@ http { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; - # fastcgi_param HTTPS on; + fastcgi_param HTTPS $pass_https; # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true;