virtualhosts and listen (Listen to all, handle some)

pepejose nginx-forum at nginx.us
Thu Mar 10 12:55:43 MSK 2011


thanks for answering maxim.

then it not makes sense to use *: 80 in this case??

the following is correct?

THANK YOU!

## DEFAULT SERVER FOR ALL NETWORK INTERFACES ##
server {
listen 127.0.0.1:80 default_server;
listen 192.168.1.1:80 default_server;
listen public_ip:80 default_server;

server_name _;
return 444;
}


## HANDLE ONLY LAN ##
server {
listen 192.168.1.1:80;

server_name phpmyadmin;
}

## HANDLE LOCALHOST LAN AND INTERNET##
server {
listen 127.0.0.1:80;
listen 192.168.1.1:80;
listen public_ip:80;

server_name www.site.com;
}

## HANDLE ONLY LOCALHOST##
server {
listen 127.0.0.1:80;

server_name bots;
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,181900,181911#msg-181911




More information about the nginx mailing list