$https variable?

Michael Shadle mike503 at gmail.com
Sat Sep 24 07:25:55 UTC 2011


Igor proposed this a while ago:

on the global level (in http{} block)
map $scheme $php_https { https on; http off; }

then in fastcgi_params
fastcgi_param HTTPS $php_https;



On Sat, Sep 24, 2011 at 12:12 AM, Luke Scott <luke at visionlaunchers.com> wrote:
> 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
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list