$https variable?

Luke Scott luke at visionlaunchers.com
Sat Sep 24 07:12:35 UTC 2011


It would be great if there was an $https variable that was "on" or "off" (or "") so you could do something like this:

fastcgi_param  HTTPS $https;

Because currently telling PHP https is enabled is much harder, especially for those that prefer to have a single server{} block for both HTTP and HTTPS.

Typically PHP uses $_SERVER['HTTPS'] === 'on' to detect whether or not HTTPS is enabled.

http://us3.php.net/manual/en/reserved.variables.server.php

Luke


More information about the nginx mailing list