$https with SSL proxy

Dear all,

starting with version 1.1.11 the $https variable is activated by
default. This is good as many applications rely on them because apache
is using this header.
However, now i cannot set or map this variable (nginx: [emerg] the
duplicate “https” variable). We have a load balancer in front of the web
servers which does all SSL traffic. The nginx servers can only differ
between http and https via a header sent by the load balancer, the nginx
port is the same. That hasn’t been a problem in < 1.1.11. Many plugins,
codings in applications use this $https header so it would be nice if i
could assign it manually.

Any ideas?

Thanks.

Posted at Nginx Forum:

codings in applications use this $https header so it would be nice if i
could assign it manually.

Have you tried explicitly setting the fastcgi_param, like in:

fastcgi_param HTTPS $my_https;

where $my_https is a variable that you set as you want it?

–appa

Antonio P.P. Almeida Wrote:

balancer in front of the web
Have you tried explicitly setting the
nginx mailing list
[email protected]
nginx Info Page

The problem is that all applications rely on this “https” header,
changing the code of all applications makes no sense to me.

Posted at Nginx Forum:

The problem is that all applications rely on this “https” header,
changing the code of all applications makes no sense to me.

AFAIK it’s not a header but rather a parameter that is passed through
CGI
and in PHP, for example, you recover via $_SERVER[‘HTTPS’]. This has
nothing to do with headers. Of course you can set a header based on it.

X-Forwarded-Proto $https;

or

X-Forwarded-Proto $my_https;

—appa

X-Forwarded-Proto $my_https;

Oops. My bad. I meant:

X-Forwarded-Proto $scheme;

–appa

Your right, setting it for fastcgi as param works fine. I had a problem
in the past setting variables in the fastcgi_params, they’ve just been
ignored. This seems to be gone.
Then i have to rewrite the nginx internal logic of my
substitions/mappings based on this variable.

I still think allowing a manual override of this variable should be
allowed. If any other plugin relies on this header users with SSL
Accelerators will definately have a problem.

Posted at Nginx Forum: