name based hosting limiting

Scott Larson stl at wiredrive.com
Tue Sep 2 23:52:10 MSD 2008


      You could supply a catch-all (ie. _;) server configuration and  
redirect that to a local 404 page served directly by nginx.
-- 
Scott Larson
Network Administrator

Wiredrive
4216 3/4 Glencoe Ave
Marina Del Rey, CA 90292
t 310.823.8238
stl at wiredrive.com
http://www.wiredrive.com

On Sep 2, 2008, at 12:27 PM, Paul wrote:

> 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