HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Apache reverse proxy forwarding https header (http://www.howtoforge.com/forums/showthread.php?t=60621)

volf 20th February 2013 11:35

Apache reverse proxy forwarding https header
 
I have successfully installed reverse proxy on Apache. It works like a charm. I'm using it to proxy https request to http. My problem is that I need to forward variable SERVER_HTTPS to my end server, to indicate if person is using ssl connection or just http. I have found one way to do: Each time I can forward HTTP_X_FORWARDED_PROTO variable and check on end server:

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';

But this variant is not good for me, because I can't edit the end servers scripts. Lets say that I don't even have access to it. But I know how to check if it is forwarded. So, Generally my question is: Is there any way that I can forward this variable? I have seen one more variant, with Rewrite engine , but it didn't work for me and there is no detailed information. Maybe If I will set my server on Nginx + apache this will send this header variable?

falko 22nd February 2013 13:33

On an nginx reverse proxy, you would also set

Code:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
so I guess this makes no difference.


All times are GMT +2. The time now is 22:14.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.