Chinaunix首页 | 论坛 | 博客
  • 博客访问: 66768
  • 博文数量: 42
  • 博客积分: 1720
  • 博客等级: 上尉
  • 技术积分: 415
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-03 22:26
文章分类

全部博文(42)

文章存档

2011年(1)

2010年(2)

2009年(39)

我的朋友

分类: LINUX

2009-08-25 22:25:20

#在虚拟主机最前面加上如下即可,记住一定要以它开头(不然不生效)。如下,返回值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;

}
阅读(554) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~