Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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've set up my config like this:

$HTTP["host"] =~ "(^|\.)domain1\.com$" {
  fastcgi.server = ( "/domain1.py" =>
    ((
      "socket" => "/tmp/fastcgi.socket",
      "bin-path" => "/home/domain1/serveV03.py",
      "max-procs" => 1,
      "bin-environment" => (
        "REAL_SCRIPT_NAME" => ""
      ),
      "check-local" => "disable"
    ))
  )
  server.document-root = "/home/domain1"
  url.rewrite-once = (
    "^/favicon.ico$" => "/static/favicon.ico",
    "^/static/(.*)$" => "/static/$1",
    "^/(.*)$" => "/domain1.py/$1"
  )
}


$HTTP["host"] =~ "(^|\.)domain2\.com$" {
  fastcgi.server = ( "/domain2.py" =>
    ((
      "socket" => "/tmp/fastcgi.socket",
      "bin-path" => "/home/domain2/serveV01.py",
      "max-procs" => 1,
      "bin-environment" => (
        "REAL_SCRIPT_NAME" => ""
      ),
      "check-local" => "disable"
    ))
  )
  server.document-root = "/home/domain2"
  url.rewrite-once = (
    "^/favicon.ico$" => "/static/favicon.ico",
    "^/static/(.*)$" => "/static/$1",
    "^/(.*)$" => "/domain2.py/$1"
  )
}

But somehow, when I access domain2.com domain1.py gets launched - Strangely the contents in /static/ are correctly pulled from /home/domain2/static.

When I enter domain1.com everything works as expected. Why does the domain-matching fail like this?

share|improve this question
up vote 2 down vote accepted

You've set both fastCGI servers to use the same socket file. It's likely that only the first is being created successfully, and all transactions are going into that socket and out to the same Python script.

share|improve this answer
    
That's it! Thanks a lot - I'll be upvoting this as soon as the site lets me! – saibotd Apr 2 '12 at 19:45

Your Answer

 
discard

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.