Fix Set correct forward proto even when behind reverse proxy

This commit is contained in:
Mark Stapper
2025-07-01 10:34:19 +02:00
parent 0134600469
commit fa3a5c534f

View File

@@ -2,6 +2,12 @@
# by using `envsubst` to replace the environment variables in the template with
# their actual values.
# Helper to get scheme regardless if we are behind a prox or not
map $http_x_forwarded_proto $forwardscheme {
default $scheme;
https https;
}
server {
root /var/www/html;
listen ${ROMM_PORT};
@@ -10,7 +16,8 @@ server {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $forwardscheme;
location / {
try_files $uri $uri/ /index.html;