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

How would someone go about setting up wildcard sub-domains with the suggested Tornado deployment? Specifically for SaaS apps that would allow users to have As well as letting them point their own domain to that URL.

share|improve this question
What suggested Tornado deployment? – womble Oct 21 '09 at 2:41

nginx would just sit in front of Tornado so assuming the standard proxy config (the Tornado pages should list a basic nginx config).

Wildcard config would be as follows (cribbed from here):

server {
    # Replace this port with the right one for your requirements
    listen       80;  

    # Multiple hostnames separated by spaces.  Replace these as well.
    server_name * www.*;  
    root /PATH/TO/$host;
    error_page  404    ;
    access_log  logs/access.log;
    location / {
        root   /PATH/TO/$host/;
        index  index.php;

    # serve static files directly
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html)$ {
        access_log        off;
        expires           30d;

    location / {

      # insert the various proxy pass directives


share|improve this answer
This works but add root in location block is not good – gagarine Feb 19 '12 at 0:12

Some relevant info here:

share|improve this answer
On ServerFault, we greatly prefer content over links to content since things disappear on the web all the time. Please provide a summary of what a link covers in more detail. – sysadmin1138 Jan 4 '12 at 1:47

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.