文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>nginx禁止直接以IP访问

nginx禁止直接以IP访问

时间:2009-08-25  来源:weiscott

#在虚拟主机最前面加上如下即可,记住一定要以它开头(不然不生效)。如下,返回值404,可以改403等。
server {          server_name  _;  #default          return 404;      }

 server   {     listen       80;     server_name  .test.com;  #(域名前加点,不然可能访问不了)     index main.php index.php;     root  /var/htdocs/www/test;
    location ~ .*\.(php|php5)?$     {       #fastcgi_pass  unix:/tmp/php-cgi.sock;       fastcgi_pass  127.0.0.1:9000;       fastcgi_index index.php;       include fcgi.conf;     }
    log_format  testlogs  '$remote_addr - $remote_user [$time_local] "$request" '                '$status $body_bytes_sent "$http_referer" '                '"$http_user_agent" $http_x_forwarded_for';     access_log  /var/htdocs/logs/testlogs.log  testlogs;
}
相关阅读 更多 +
排行榜 更多 +
试着飞手游下载

试着飞手游下载

休闲益智 下载
血染小镇(功能菜单)中文版下载

血染小镇(功能菜单)中文版下载

飞行射击 下载
泰坦之旅高爆版下载

泰坦之旅高爆版下载

角色扮演 下载