Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/templates/_location.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{{ advanced_config }}

proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Scheme $resolved_proto;
proxy_set_header X-Forwarded-Proto $resolved_proto;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;

Expand Down
2 changes: 2 additions & 0 deletions backend/templates/proxy_host.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

{% include "_hsts_map.conf" %}

include conf.d/include/resolved_proto_map.conf;

server {
set $forward_scheme {{ forward_scheme }};
set $server "{{ forward_host }}";
Expand Down
5 changes: 2 additions & 3 deletions docker/rootfs/etc/nginx/conf.d/include/proxy.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
add_header X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Scheme $resolved_proto;
proxy_set_header X-Forwarded-Proto $resolved_proto;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $forward_scheme://$server:$port$request_uri;

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Resolve the effective protocol: use X-Forwarded-Proto if set
# (e.g., from proxies like Cloudflare or AWS)
# otherwise fall back to the current scheme.
map $http_x_forwarded_proto $resolved_proto {
default $scheme;
~.+ $http_x_forwarded_proto;
}