passing header information on to backend Apache/PHP

Larry Bates larry.bates at vitalesafe.com
Sun Apr 5 17:37:52 MSD 2009


How about a rewrite rule that passes a parameter to your PHP script:
 
 

  _____  

From: owner-nginx at sysoev.ru [mailto:owner-nginx at sysoev.ru] On Behalf Of Peter
Langhans
Sent: Sunday, April 05, 2009 8:03 AM
To: nginx at sysoev.ru
Subject: passing header information on to backend Apache/PHP


Hi,

I'm using nginx 0.6.35, apache 2.0.63 and php 5.2.9.

My problem is, that I need my php scripts to know in some way or another whether
SSL is used or not (to include either https or http javascript files e.g.).

When using nginx as webfrontend proxy, it accepts all the ssl connections and
it's working fine, but when I proxy through to apache, the knowledge about SSL
is 'lost'. If possible, I don't want to be using different ports for proxying
through to apache.

I thought it'd be enough to set headers like:

for 80:
proxy_set_header           X-Secure     of;

for 443:
proxy_set_header           X-Secure     on;

put I have not found a way how I could retrieve those values from within the php
script. They seem to be filtered out by Apache.

Does anyone have an idea how I can get any custom set header, set in the
nginx.conf through to the php scripts?

Thanks a lot,
Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090405/7a532928/attachment.html>


More information about the nginx mailing list