空主机头域名指向是指,比如我有个www.aaa.com的站点,别人用www.bbb.com域名指向了aaa.com的IP,这样访问www.bbb.com也能显示aaa.com的内容了。 server { limit_conn addr 10; listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } ...后面省略 }
网上还有两个样例: 返回500错误 server { listen 80 default; server_name _; return 500; }
server { listen 80 default; server_name _; rewrite ^(.*) http://www.aaa.com permanent;(责任编辑:IT) |