php HTTPS $_SERVER variable?

Ilan Berkner iberkner at gmail.com
Sun Aug 16 07:05:19 MSD 2009


Thanks, I am currently using a shared block for both.

What would be the exact syntax?  I tried different variations with no
success :-(.

something like:

if ($server_port = 443)
{
fastcgi_param HTTPS on;
}

looking for confirmation that the above is correct nginx syntax...

Thanks

On Sat, Aug 15, 2009 at 1:30 PM, Michael Shadle <mike503 at gmail.com> wrote:

> You only set it in your server block that is for SSL.
>
> If you use a shared block for both, I'm not sure; perhaps there could
> be if ($request_port = 80) { } type deal put in?
>
> On Fri, Aug 14, 2009 at 11:36 PM, Ilan Berkner<iberkner at gmail.com> wrote:
> > Some of our software relies on the $_SERVER['HTTPS'] PHP variable to be
> set
> > to "on" when accessing pages via https://.  So far  I've found:
> >
> > fastcgi_params HTTPS on;
> >
> > but this turns it on for all pages, regardless of HTTP or HTTPS request
> > setting.
> >
> > What am I missing?
> >
> > When I add the HTTPS on parameter, our code works (i.e. detects HTTPS in
> > $_SERVER) but for every page, HTTP or HTTPs
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090815/7b7ee2b9/attachment.html>


More information about the nginx mailing list