diff --git a/templates/seafile.nginx.conf.template b/templates/seafile.nginx.conf.template index 5a7cad72..1b82b88a 100644 --- a/templates/seafile.nginx.conf.template +++ b/templates/seafile.nginx.conf.template @@ -45,7 +45,9 @@ server { proxy_set_header Host $http_host; proxy_set_header Forwarded "for=$remote_addr;proto=$scheme"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + if ($http_x_forwarded_proto = "") { + proxy_set_header X-Forwarded-Proto $scheme; + } proxy_set_header X-Real-IP $remote_addr; proxy_set_header Connection ""; proxy_http_version 1.1; @@ -88,7 +90,9 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; - proxy_set_header X-Forwarded-Proto $scheme; + if ($http_x_forwarded_proto = "") { + proxy_set_header X-Forwarded-Proto $scheme; + } proxy_read_timeout 1200s; client_max_body_size 0;