[TriZPUG] Who is using Apache httpd in front of Python, webapps?

Joseph S. Tate dragonstrider at gmail.com
Thu Apr 17 01:45:02 CEST 2014


Nearly all proxied deployment scenarios use some combination of headers to
tell the backend that the front end has proxied a request. Apache likes
X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port. Flask should have
configuration to tell it to pay attention to those headers and generate
URLs appropriately.




On Wed, Apr 16, 2014 at 5:24 PM, Jim White <jbw2003 at earthlink.net> wrote:

>  Hi,
>
> I have just started using my first python webapp. I am using mod_proxy to
> reverse proxy like this:
>
> ProxyPass /wps http://localhost:5000
>
> This is a tornado server run by supervisord. My app is written in Flask.
> This all works except that apache is not setting the correct headers and I
> have to hack my own middleware with something like this:
>
> environ['SCRIPT_NAME'] = script_name
>
> http://flask.pocoo.org/snippets/35/
> http://flask.pocoo.org/docs/deploying/wsgi-standalone/#proxy-setups
>
> As I am the sole developer where I work I'm not sure if this approach is
> all best practices, etc.
>
> Jim
>
>
> --
> James B. White
> Cary, NC
> H: 919-380-9615
> M: 919-698-1765
> White Coding and Maps <http://whitecodingandmaps.com/>
>
> _______________________________________________
> TriZPUG mailing list
> TriZPUG at python.org
> https://mail.python.org/mailman/listinfo/trizpug
> http://trizpug.org is the Triangle Zope and Python Users Group
>



-- 
Joseph Tate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/trizpug/attachments/20140416/3e43117e/attachment.html>


More information about the TriZPUG mailing list