name based hosting limiting

Paul paul at gtcomm.net
Tue Sep 2 23:27:44 MSD 2008


Is there a way to limit the domains that can be requested on a server 
directive?

Say I have

    server
        {
                listen 2.2.2.2:80;
                server_name x.com *.x.com;
                location /
                {
                        proxy_pass http://1.1.1.1;
                        proxy_redirect http://1.1.1.1/     
http://$http_host/;
                        proxy_redirect default;
                        proxy_set_header        Host            
$host;          ##Forwards host along
                        proxy_set_header        X-Forwarded-For 
$remote_addr;   ##Sends realip to customer svr
                }
        }



Can I say, ONLY x.com and *.x.com can use this server?  Because I can 
send any domain to it  and it passes it along to the backend server.
I would like to limit access to this.

Thanks

Paul

GloboTech Communications
Phone: 1-514-907-0050
Toll Free: 1-(888)-GTCOMM1
Fax: 1-(514)-907-0750
paul at gtcomm.net
http://www.gtcomm.net





More information about the nginx mailing list