Welcome! Log In Create A New Profile

Advanced

Re: passing header information on to backend Apache/PHP

Gena Makhomed
April 05, 2009 11:26AM
On Sunday, April 5, 2009 at 16:02:34, Peter Langhans wrote:

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

PL> When using nginx as webfrontend proxy, it accepts all the ssl
PL> connections and it's working fine, but when I proxy through to
PL> apache, the knowledge about SSL is 'lost'. If possible, I don't
PL> want to be using different ports for proxying through to apache.
...
PL> Does anyone have an idea how I can get any custom set header,
PL> set in the nginx.conf through to the php scripts?

nginx config:
=============

proxy_set_header X-Nginx-Scheme $scheme;

# nginx variable $scheme will be 'http' or 'https'.

apache config:
==============

SetEnvIf X-Nginx-Scheme "^https$" HTTPS=on

# Apache environment variable HTTPS will be 'on' or not defined.

PHP code:
=========

$scheme = getenv('HTTPS') && strtolower(getenv('HTTPS')) != 'off'
? 'https'
: 'http';

# PHP variable $scheme will be 'http' or 'https'.

--
Best regards,
Gena
Subject Author Posted

passing header information on to backend Apache/PHP

Peter Langhans April 05, 2009 09:02AM

RE: passing header information on to backend Apache/PHP

lbates35406 April 05, 2009 09:37AM

Re: passing header information on to backend Apache/PHP

Peter Langhans April 05, 2009 09:57AM

RE: passing header information on to backend Apache/PHP

lbates35406 April 05, 2009 09:40AM

Re: passing header information on to backend Apache/PHP

Peter Langhans April 05, 2009 10:25AM

Re: passing header information on to backend Apache/PHP

anomalizer April 05, 2009 10:32AM

Re: passing header information on to backend Apache/PHP

Gena Makhomed April 05, 2009 11:26AM

Re: passing header information on to backend Apache/PHP

Peter Langhans April 05, 2009 11:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 310
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready