0

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?

saibotd
  • 103
  • 4

1 Answers1

2

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.

Kyle Smith
  • 9,563
  • 1
  • 30
  • 32