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

Jeff Trawick trawick at gmail.com
Thu Apr 17 13:34:38 CEST 2014


On Thu, Apr 17, 2014 at 12:08 AM, Jim White <jbw2003 at earthlink.net> wrote:

>  I had this configuration when I started. When I started using templates
> though this led to problems with the app finding the static directory.
> Possibly could have fixed it with some of the app static directory
> configurations, but have it working now with my middleware hack.
>
> Do you have an example of setting Reverse Proxy Request Headers as in
> mod_proxy documentation?
>

  ProxyPass /wps http://localhost:5000

  <Location /wps>
    RequestHeader set X-Jeff /x/y/z
  </Location>

(The <Location> container is just in case you want to prevent adding the
custom header except when it is being forwarded.)

I just added a hint about RequestHeader to the end of this section:

http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers


> Thanks,
> Jim
>
> On 04/16/2014 10:47 PM, trizpug-request at python.org wrote:
>
> The web server can't naturally know SCRIPT_NAME for a reverse proxy setup
> like that, but if the backend can get hints from the URI path, you could use
>
> ProxyPass /wps http://localhost:5000/some/path/that/helps/application
>
> Or if for some reason it is easier to configure in the web server than on
> the app side then you can set whatever header are needed to "hard code" the
> information (X-SCRIPT-NAME or whatever the backend is looking at).
>
>
>
> --
> James B. White
> Cary, NC
> H: 919-380-9615
> M: 919-698-1765
> White Coding and Maps <http://whitecodingandmaps.com/>
>



-- 
Born in Roswell... married an alien...
http://emptyhammock.com/
http://edjective.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/trizpug/attachments/20140417/36963d31/attachment.html>


More information about the TriZPUG mailing list