Skip to content

Instantly share code, notes, and snippets.

@baylisscg
Created March 22, 2011 22:08
Show Gist options
  • Save baylisscg/882190 to your computer and use it in GitHub Desktop.
Save baylisscg/882190 to your computer and use it in GitHub Desktop.
FastCGI config snippet.
# Properly inform PHP code if HTTPS is in use.
fastcgi_param HTTPS on; # on if using HTTPS off otherwise
fastcgi_param SSL_PROTOCOL $ssl_protocol; # the SSL version in use e.g. TLSv1, SSLv3 ...
@baylisscg
Copy link
Author

Set up Nginx's FastCGI module to set $_SERVER['HTTPS'] and $_SERVER['SSL_PROTOCOL'] correctly for PHP that needs to test if its behind SSL. This seems to be a mod_apache thing. You can set these up correctly as follows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment