8 messages in ru.sysoev.nginxRe: passing header information on to ...
FromSent OnAttachments
Peter LanghansApr 5, 2009 6:02 am 
Larry BatesApr 5, 2009 6:37 am 
Larry BatesApr 5, 2009 6:40 am 
Peter LanghansApr 5, 2009 6:57 am 
Peter LanghansApr 5, 2009 7:24 am 
Arvind JayaprakashApr 5, 2009 7:31 am 
Gena MakhomedApr 5, 2009 8:26 am 
Peter LanghansApr 5, 2009 8:57 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: passing header information on to backend Apache/PHPActions...
From:Peter Langhans (pete@incipience.co.uk)
Date:Apr 5, 2009 6:57:24 am
List:ru.sysoev.nginx

Hi Larry,

thx for that. I considered that as well, but I find the solution somewhat "unelegant". It should either be identified by the port (which is hard due to architecture setup in my case) or a header (which I would prefer).

Thx for hinting this solution out again. Maybe I really should consider it and put my desire for 'compliable'/'elegant' solutions into the bin... :( (which would hurt my heart).

Bests, Pete

On Sun, Apr 5, 2009 at 2:37 PM, Larry Bates <larr@vitalesafe.com>wrote:

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

------------------------------ *From:* owne@sysoev.ru [mailto:owne@sysoev.ru] *On Behalf Of *Peter Langhans *Sent:* Sunday, April 05, 2009 8:03 AM *To:* ngi@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?