nginx的配置文件,谁能帮助解释下,谢谢

烂泥行天下 发布于 2014/04/01 17:47
阅读 81
收藏 0
server
  {
    listen       80; ---监听80端口
    server_name  www.ilanni.com ilanni.com;  --配置网站主机名
    index index.html index.htm index.php index.shtml;  ---配置默认主页
    root  /home/data/vhost/www.ilanni.com;  --配置网站根目录
      location /{
               index index.html index.htm index.php;
    if ($request_filename !~* /(api|file|index\.php|resource|upload|robots\.txt|client\.php)) { 
        rewrite ^/(.*)$ /index.php/$1 last;  
        break;  
    }
       }  
  
   
  
  
  
  
    location ~ /index.php/admin/ {
         if ( $conty_ip ~* "0" ) {  
            return 404; 
          }
           root           /home/data/vhost/www.ilanni.com;
           fastcgi_index index.php;
           fastcgi_split_path_info ^(.+\.php)(.*)$;
           fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_param   PATH_INFO               $fastcgi_path_info;
           fastcgi_param   PATH_TRANSLATED $document_root$fastcgi_path_info;
           fastcgi_pass   127.0.0.1:9000;
           include        fcgi.conf;
   } 
  
  
   
location ~ /index.php/ {
           root           /home/data/vhost/www.ilanni.com;
           fastcgi_index index.php;
           fastcgi_split_path_info ^(.+\.php)(.*)$;
           fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_param   PATH_INFO               $fastcgi_path_info;
           fastcgi_param   PATH_TRANSLATED $document_root$fastcgi_path_info;
           fastcgi_pass   127.0.0.1:9000;  
           include        fcgi.conf;
}    


 


   location ~ .*\.(php|php5)?$
    {   
      if ($request_filename ~* (.*)\.php) {
            set $php_url $1;
      }
      if (!-e $php_url.php) {
            return 403;
      }                                     
      #fastcgi_pass  unix:/tmp/php-cgi.sock;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      include fcgi.conf;
     
    }


 


   location ~ .*\.(gz|zip|sql)?$
    {
    return 404;      
    }
include css_pic.conf;












access_log  /home/admin/logs/nginx/www.ilanni.com.log  wwwlog;  ---配置网站访问日志
#access_log  off;
  }


加载中
返回顶部
顶部