diff --git a/confs/site/reverse-proxy-headers.conf b/confs/site/reverse-proxy-headers.conf index 9fbfe7a3..3f2a219f 100644 --- a/confs/site/reverse-proxy-headers.conf +++ b/confs/site/reverse-proxy-headers.conf @@ -1,3 +1,5 @@ proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-Proto $scheme; +proxy_set_header X-Forwarded-Protocol $scheme; diff --git a/confs/site/reverse-proxy.conf b/confs/site/reverse-proxy.conf index ed4b4a50..89cbc6eb 100644 --- a/confs/site/reverse-proxy.conf +++ b/confs/site/reverse-proxy.conf @@ -1,4 +1,5 @@ location %REVERSE_PROXY_URL% { proxy_pass %REVERSE_PROXY_HOST%; + %REVERSE_PROXY_HEADERS% %REVERSE_PROXY_WS% } diff --git a/entrypoint/site-config.sh b/entrypoint/site-config.sh index ec70b525..cf9b9ba7 100644 --- a/entrypoint/site-config.sh +++ b/entrypoint/site-config.sh @@ -73,6 +73,7 @@ if [ "$USE_REVERSE_PROXY" = "yes" ] ; then cp "${NGINX_PREFIX}reverse-proxy.conf" "${NGINX_PREFIX}reverse-proxy-${i}.conf" replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_URL%" "$value" replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_HOST%" "$host_value" + replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_HEADERS%" "include ${NGINX_PREFIX}reverse-proxy-headers.conf" if [ "$ws_value" = "yes" ] ; then replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_WS%" "proxy_http_version 1.1;\nproxy_set_header Upgrade \$http_upgrade;\nproxy_set_header Connection \"Upgrade\";\n" else