[Web-SIG] Reverse Proxy & HTTPS

Randy Syring randy at rcs-comp.com
Sat Apr 4 22:08:27 CEST 2009


I have a Python application that I want to run with the CherryPy WSGI 
Server.  My intention is to let the CherryPy server run on a non 
standard port (say 9001) and then let IIS (yes, I know what you are 
thinking, but that is what I have to work with) reverse proxy the 
website requests to CherryPy.

However, I am wondering how I should handle HTTPS.  Currently, there are 
only a few pages in my app that need HTTPS.  When running the app 
natively in IIS, if one of those pages is requested using HTTP, I will 
issue a HTTP header redirect to the HTTPS page.  How should I handle 
this in a reverse proxy situation?  What I mean is, how do I detect in 
my Python app if the original request to IIS is using SSL?  I don't want 
to have to run SSL on the connection from IIS to CherryPy.

I am thinking I could modify the headers to the CherryPy server adding 
something like "X-is-ssl" and then use middleware on the python side to 
set wsgi.url_scheme appropriately.  I just don't know the HTTP standard 
well enough to know how this kind of thing should be handled.

Thank you for any help you can provide.

-- 
--------------------------------------
Randy Syring
RCS Computers & Web Solutions
502-644-4776
http://www.rcs-comp.com

"Whether, then, you eat or drink or 
whatever you do, do all to the glory
of God." 1 Cor 10:31



More information about the Web-SIG mailing list