Skip to content

Commit 50224fb

Browse files
author
Pierre Buyle
committed
Support the X-Forwarded-Proto header for FastCGI.
1 parent f84ec70 commit 50224fb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

templates/nginx.j2

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,12 @@ http {
190190
## previous version then uncomment out the line below.
191191
#include map_https_fcgi.conf;
192192

193-
## Include this line, if used in a loadbalanced environment
194-
## and comment the line which includes map_https_fcgi.conf.
195-
## If the loadbalancer always sends the request in http protocol,
196-
## and adds the server variable $http_x_forwarded_proto
197-
#include map_https_forwarded_proto.conf;
193+
## Support the X-Forwarded-Proto header for FastCGI.
194+
map $http_x_forwarded_proto $fastcgi_https {
195+
default $https;
196+
http '';
197+
https on;
198+
}
198199

199200
## Include the upstream servers for Apache handling the PHP
200201
## processes. In this case Nginx functions as a reverse proxy.

0 commit comments

Comments
 (0)