Hi Gena,<br><br>thx for the reply. Works perfectly as well!<br><br>Bests,<br>Pete<br><br><div class="gmail_quote">On Sun, Apr 5, 2009 at 4:26 PM, Gena Makhomed <span dir="ltr"><<a href="mailto:gmm@csdoc.com">gmm@csdoc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Sunday, April 5, 2009 at 16:02:34, Peter Langhans wrote:<br>
<br>
PL> My problem is, that I need my php scripts to know<br>
PL> in some way or another whether SSL is used or not<br>
PL> (to include either https or http javascript files e.g.).<br>
<br>
PL> When using nginx as webfrontend proxy, it accepts all the ssl<br>
PL> connections and it's working fine, but when I proxy through to<br>
PL> apache, the knowledge about SSL is 'lost'. If possible, I don't<br>
PL> want to be using different ports for proxying through to apache.<br>
...<br>
PL> Does anyone have an idea how I can get any custom set header,<br>
PL> set in the nginx.conf through to the php scripts?<br>
<br>
nginx config:<br>
=============<br>
<br>
proxy_set_header X-Nginx-Scheme $scheme;<br>
<br>
# nginx variable $scheme will be 'http' or 'https'.<br>
<br>
apache config:<br>
==============<br>
<br>
SetEnvIf X-Nginx-Scheme "^https$" HTTPS=on<br>
<br>
# Apache environment variable HTTPS will be 'on' or not defined.<br>
<br>
PHP code:<br>
=========<br>
<br>
$scheme = getenv('HTTPS') && strtolower(getenv('HTTPS')) != 'off'<br>
? 'https'<br>
: 'http';<br>
<br>
# PHP variable $scheme will be 'http' or 'https'.<br>
<br>
--<br>
Best regards,<br>
<font color="#888888"> Gena<br>
<br>
<br>
</font></blockquote></div><br>