$_SERVER['HTTPS'] is empty #59

Closed
Fidelix opened this Issue Jul 23, 2012 · 7 comments

4 participants

@Fidelix

$_SERVER['HTTPS'] is empty for https sites.

Can someone reproduce this?
There is nothing special with my configuration.

Nginx version is 1.2. Compiled from source.

@perusio
Owner

That variable is set from the FCGI config. It's a fastcgi_param. Check your fcgi conf. There's a if_not_empty parameter on the conf that should take care of setting that fcgi_param to on when over HTTPS auto magically. You can force it by setting to on.

@Fidelix

I know. This is on my nginx.conf>
include /etc/nginx/fastcgi.conf;

This file includes fastcgi_params, and fastcgi_params has this>
fastcgi_param HTTPS $https if_not_empty;

So it must be something else...

@hmoen

Did this ever get resolved? I'm experiencing the same issue with your default setup with nginx version: nginx/1.2.4.

@hmoen

I got around this by adding the following to fastcgi_drupal.conf:
fastcgi_param HTTPS $https if_not_empty;
I don't understand why since fastcgi.conf called by nginx.conf includes fastcgi_params file.

@emjayess

I wound up doing the same thing @hmoen noted in the above comment, which I noted in a g.d.o/nginx thread here.

and like @hmoen I still haven't come to understand why it was necessary.

@perusio
Owner

There's a particular issue with fastcgi_param. Quoted from the docs:

Sets a parameter that should be passed to the FastCGI server. A value can contain text, variables, and their combination. These directives are inherited from the previous level if and only if there are no fastcgi_param directives defined on the current level.
@perusio
Owner

Meaning if you changed a fastcgi_param at a specific location that means that all other parameters for FCGI previously defined revert back to default. Hence the need to include the conf file again at that location.

Closing this.

@perusio perusio closed this Nov 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment