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">&lt;<a href="mailto:gmm@csdoc.com">gmm@csdoc.com</a>&gt;</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&gt; My problem is, that I need my php scripts to know<br>
PL&gt; in some way or another whether SSL is used or not<br>
PL&gt; (to include either https or http javascript files e.g.).<br>
<br>
PL&gt; When using nginx as webfrontend proxy, it accepts all the ssl<br>
PL&gt; connections and it&#39;s working fine, but when I proxy through to<br>
PL&gt; apache, the knowledge about SSL is &#39;lost&#39;. If possible, I don&#39;t<br>
PL&gt; want to be using different ports for proxying through to apache.<br>
...<br>
PL&gt; Does anyone have an idea how I can get any custom set header,<br>
PL&gt; 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 &#39;http&#39; or &#39;https&#39;.<br>
<br>
apache config:<br>
==============<br>
<br>
SetEnvIf X-Nginx-Scheme &quot;^https$&quot; HTTPS=on<br>
<br>
# Apache environment variable HTTPS will be &#39;on&#39; or not defined.<br>
<br>
PHP code:<br>
=========<br>
<br>
$scheme = getenv(&#39;HTTPS&#39;) &amp;&amp; strtolower(getenv(&#39;HTTPS&#39;)) != &#39;off&#39;<br>
    ? &#39;https&#39;<br>
    : &#39;http&#39;;<br>
<br>
# PHP variable $scheme will be &#39;http&#39; or &#39;https&#39;.<br>
<br>
--<br>
Best regards,<br>
<font color="#888888"> Gena<br>
<br>
<br>
</font></blockquote></div><br>