Welcome! Log In Create A New Profile

Advanced

Re: WildCard domains : how to treat IP Address and Specific Domains differently from Failover/Wildcard Domains ?

March 02, 2013 01:36AM
On Mar 2, 2013, at 0:20 , Jonathan Vanasco wrote:

> forgive me if this has been asked before -- I couldn't find this exact question in my mailing list archives back to 2007
>
> I am trying to deal with wildcard domains in a setup.
>
> The intended result is to do this :
>
> Requests for example.com
> Serve Site A
>
> All IP Address Requests :
> Serve Site A
>
> 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.


--
Igor Sysoev
http://nginx.com/support.html

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

WildCard domains : how to treat IP Address and Specific Domains differently from Failover/Wildcard Domains ?

Jonathan Vanasco March 01, 2013 03:22PM

Re: WildCard domains : how to treat IP Address and Specific Domains differently from Failover/Wildcard Domains ?

Francis Daly March 01, 2013 07:46PM

Re: WildCard domains : how to treat IP Address and Specific Domains differently from Failover/Wildcard Domains ?

Igor Sysoev March 02, 2013 01:36AM

Re: WildCard domains : how to treat IP Address and Specific Domains differently from Failover/Wildcard Domains ?

Jonathan Vanasco March 03, 2013 03:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 142
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready