All other domains ( wildcard / failover )
Serve Site B
I’ve tried several combinations of listen + server name, but I can’t get this
right. I end up sending everything to site A or site B.
server {
listen 80;
listen IP:80;
server_name example.com;
# site A
}
server {
listen 80 default_server;
# site B
}
“listen 80/server_name example.com” route all requests to example.com
to site A.
“listen IP:80” routes all requests to IP:80 to site A.
Anything else is routed to default server of 80 port, i.e. to site B.
“listen 80/server_name example.com” route all requests to example.com to site
A.
“listen IP:80” routes all requests to IP:80 to site A.
Anything else is routed to default server of 80 port, i.e. to site B.
Thank you Igor.
Unfortunately, that’s not what I needed. I don’t necessarily know the
IP address(es) on these machines. This is part of an automated
deployment.