This commit is contained in:
Seyed Mansour Mirbehbahani
2025-02-08 23:59:14 +08:00
committed by GitHub
4 changed files with 13 additions and 5 deletions

View File

@@ -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;

View File

@@ -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;
}