1、在nginx配置文件中加入这个:
2、重启nginx服务
二、apache禁止IP地址访问
1、更改vhosts.conf文件:
NameVirtualHost 192.168.1.191 <VirtualHost 192.168.1.191:99> #DocumentRoot "/usr/local/kk-mail/data/www" ServerName 192.168.1.191 <Location /> Order Allow,Deny Deny from all </Location> ErrorLog "logs/mail_error_log_ip" CustomLog "logs/mail_access_log_ip" common </VirtualHost> <VirtualHost 192.168.1.191:99> DocumentRoot "/usr/local/kk-mail/data/www" ServerName mail.domain.com ErrorLog "logs/mail_error_log" CustomLog "logs/mail_access_log" common </VirtualHost>
2、重启apache服务
原文地址:http://blog.51cto.com/net881004/2086116