Skip to content

Commit 35ee49f

Browse files
committed
Merge pull request #166 from Pheromone/D7
* Fix support of the X-Forwarded-Proto header for fastcgi.
2 parents 81aa86d + 9a248f5 commit 35ee49f

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

apps/drupal/fastcgi_drupal.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ fastcgi_param SCRIPT_FILENAME $document_root/index.php;
2727
## later. The if_not_empty flag was introduced in 1.1.11. See:
2828
## http://nginx.org/en/CHANGES. If using a version that doesn't
2929
## support this comment out the line below.
30-
fastcgi_param HTTPS $https if_not_empty;
30+
fastcgi_param HTTPS $fastcgi_https if_not_empty;
3131
## For Nginx versions below 1.1.11 uncomment the line below after commenting out the above.
32-
#fastcgi_param HTTPS $https;
32+
#fastcgi_param HTTPS $fastcgi_https;
3333

3434
## 2. Nginx FCGI specific directives.
3535
fastcgi_buffers 256 4k;

apps/drupal/fastcgi_no_args_drupal.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ fastcgi_param SCRIPT_FILENAME $document_root/index.php;
2727
## later. The if_not_empty flag was introduced in 1.1.11. See:
2828
## http://nginx.org/en/CHANGES. If using a version that doesn't
2929
## support this comment out the line below.
30-
fastcgi_param HTTPS $https if_not_empty;
30+
fastcgi_param HTTPS $fastcgi_https if_not_empty;
3131
## For Nginx versions below 1.1.11 uncomment the line below after commenting out the above.
32-
#fastcgi_param HTTPS $https;
32+
#fastcgi_param HTTPS $fastcgi_https;
3333

3434
## 2. Nginx FCGI specific directives.
3535
fastcgi_buffers 256 4k;

fastcgi_params

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fastcgi_param REDIRECT_STATUS 200;
2727
## later. The if_not_empty flag was introduced in 1.1.11. See:
2828
## http://nginx.org/en/CHANGES. If using a version that doesn't
2929
## support this comment out the line below.
30-
fastcgi_param HTTPS $https if_not_empty;
30+
fastcgi_param HTTPS $fastcgi_https if_not_empty;
3131
## For Nginx versions below 1.1.11 uncomment the line below after commenting out the above.
32-
#fastcgi_param HTTPS $https;
32+
#fastcgi_param HTTPS $fastcgi_https;

map_https_forwarded_proto.conf

-4
This file was deleted.

nginx.conf

+6-5
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,12 @@ http {
186186
## previous version then uncomment out the line below.
187187
#include map_https_fcgi.conf;
188188

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

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

0 commit comments

Comments
 (0)