1

How do I send all requests for www.domain.com and domain.com to the root /directoryA except for the subdomain specific.domain.com which needs to go to the root /directoryB.

www.domain.com is already redirected to domain.com and should stay that way if possible.

duckyfuzz
  • 149
  • 1
  • 7
  • Please clarify if you actually want to serve request for *.domain.com. Though (IMHO) that is not recommended. You can check out this [answer](http://serverfault.com/a/462852/138643) regarding wild card domain setting. – John Siu Jan 22 '13 at 17:25

1 Answers1

2

All you need is create different server section with different server name

server {
  server_name domain.com

  root /directoryA

  ... other options ...

}

server {
  server_name specific.domain.com

  root /directoryB

  ... other options ...

}

No section is created for www.domain.com as it is already redirected. (Or www.domain.com will have its own server section to handle the redirection).

John Siu
  • 3,667
  • 2
  • 17
  • 23