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'm close to deploying a Django project to production. I'm looking over some infrastructure decisions. Something that came up was serving static files with a different server such as lighttpd.

However, we're starting off with a single dedicated server so our only option would be to use a non-standard port for the static file webserver.

  1. Is there precedence for this? I.e. Does anyone "big" do this?

  2. Any particular port I should use or shy away from using?

  3. Can anyone thing of some downsides of going this route?

share|improve this question
Why not split it down the middle, with certain URLs being handled by the web server for static media, and all the rest being forwarded to the WSGI container/FastCGI connector? – Ignacio Vazquez-Abrams Dec 22 '10 at 7:12
up vote 3 down vote accepted

You'll get highest end-user compatibility by using a different IP address and TCP/80 than you would by using the same address and something like TCP/8080. Some really restrictive corporate firewalls will not allow connections to strange ports, even common ones like TCP/8008 or TCP/8080. If that isn't a concern for you, then binding to a common HTTP-alternate port should be good enough for what you're attempting to do.

share|improve this answer

I would just setup another virtual host on the same webserver, so serve the static content from "", making this change trivial down the line. You can do it your way, but you are probably not going to see much performance gain but try:

  1. Setup django application virtual host on localhost:8080
  2. setup proxy core to have localhost:8080 as a backend
  3. configure a virtualhost in lighttpd

Is there precedence for this? I.e. Does anyone "big" do this?

Sure people server static content from different server, I've heard youtube is big on that.

Any particular port I should use or shy away from using?

I would shy away from using ports other than 80, but that's just me.. :-)

Can anyone think of some downsides of going this route?

  1. complicated, and very little gain if you only use one application server anyways.
  2. all Django pages has to pass through a proxy.
  3. you have to ask here.. :-)
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.