sudone.com 服务器系统架构分析日志


nginx虚拟主机配置的一个注意事项

[2009-08-24 21:33:29]
nginx默认可以用ip地址的访问转向第一个虚拟主机,在中国,这样的“功能”会被电信托管商投诉。

解决办法很简单,配置nginx的第一个虚拟主机,让其出错,就可以了:

server {include port.conf;server_name null;location / {root /dev/null;log_not_found off;}}

其中的server_name可以乱写,只要不是正常的域名就可以了。

站名:sudone.com; 站长:Ayou; 服务器:ubuntu+nginx+squid+php