Skip to content

Commit

Permalink
* Added the $https_if_not_empty variable with a fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
António P. P. Almeida committed Jan 9, 2012
1 parent e8c5abb commit c4ecf05
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fastcgi_params
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

## PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
## HTTPS 'on' parameter.
fastcgi_param HTTPS $https_if_not_empty;
7 changes: 7 additions & 0 deletions map_https_fcgi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: conf; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
### Implement the $https_if_not_empty variable for Nginx versions below 1.1.11.

map $scheme $https_if_not_empty {
default '';
https on;
}
8 changes: 8 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ http {
## upstream.
#include upstream_phpcgi_unix.conf;

## ## If using Nginx version >= 1.1.11 then there's a $https variable
## that has the value 'on' if the used scheme is https and '' if not.
## See: http://trac.nginx.org/nginx/changeset/4380/nginx
## http://trac.nginx.org/nginx/changeset/4333/nginx and
## http://trac.nginx.org/nginx/changeset/4334/nginx. If using a
## previous version then uncomment out the line below.
#include map_https_fcgi.conf;

## Include the upstream servers for Apache handling the PHP
## processes. In this case Nginx functions as a reverse proxy.
#include reverse_proxy.conf;
Expand Down

0 comments on commit c4ecf05

Please sign in to comment.