Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site that runs off a 'normal' web server ie at the moment Apache but looking to go for a less RAM intensive alternative in future so I don't want mod_WSGI on apache.

Shortly I will be looking to deploy a web app that runs out of a python app server. I want this answering all requests to with the web server looking after the rest.

How is such an architecture created? Am I looking to Pointers to relevant online docs are appreciated.

share|improve this question
up vote 5 down vote accepted

you would run your python server on a different port, then make use of Apache's (or any decent webserver like nginx etc) reverse proxy functionality to reverse proxy any requests for example/com/reallycoolpythonwebapp to the python app server

this will also appear transparent to the user as well

some apache config within the vhost might look like this assuming mod_proxy is installed and enabled

ProxyPass /reallycoolpythonwebapp/ http://localhost:3000/
ProxyPassReverse /reallycoolpythonwebapp/ http://localhost:3000/
<Proxy *>
allow from all
share|improve this answer
I like this idea. I guess I'd just deploy the changes you describe to the web server, change the app server to accept only connections and everything would work without change to the application? – rutherford Jan 10 '12 at 19:10
thats correct and it adds a touch of security to your web app if you use any webserver security features like mod_security or http auth – anthonysomerset Jan 12 '12 at 9:59
prefer this idea instead of use a single python application server and keep all my apps running by separate. – BlaShadow Apr 4 '13 at 19:24

I would probably setup Apache to proxy requests to localhost:xyz (or whatever host/port your python app will be listening on) when the request matches

You ought to be able to pull that off with a combination of mod_rewrite (to match the target URL) and mod_proxy.

Relevant Apache docs:

In particular, in the second, note the table entries for:

^/somepath(.*) {url1}$1 [P] {url2}

share|improve this answer

The most common answer is proxy. For starters mod_proxy (

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.