> 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. 

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.

Server A:
        Specific Domain Name
        any IPs

Server B
        any domain names


Francis-

Thank you for this bit -- 

>          server {
>            server_name example.com;
>            server_name ~^[0-9.]*$;
>            return 200 "site A\n";
>          }


i didn't think of a regex-based server name.  that works perfectly.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to