一聚教程网:一个值得你收藏的教程网站

热门教程

nginx的pathinfo配置方法详解

时间:2022-06-30 18:53:49 编辑:袖梨 来源:一聚教程网

 代码如下 复制代码


server
    {
        listen       80;
        server_name www.111com.net;
        index index.html index.htm index.php;
        root  /home/wwwroot/ci_blog;

        location ~ .*.(php|php5)($|/)
        #location ~ .php
             {
                   #fastcgi_pass 127.0.0.1:9000;
                    fastcgi_pass unix:/tmp/php-cgi.sock;
                    fastcgi_index index.php;
                    set $path_info "";
                    set $real_script_name $fastcgi_script_name;
                    if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$")
                    {
                         set $real_script_name $1;
                         set $path_info $2;
                     }
                     include fcgi.conf;
                     fastcgi_param SCRIPT_FILENAME /home/wwwroot/ci_blog/$real_script_name;
                     fastcgi_param SCRIPT_NAME $real_script_name;
                     fastcgi_param PATH_INFO $path_info;
               }


        location /status {
            stub_status on;
            access_log   off;
        }

        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
             expires      30d;
        }

        location ~ .*.(js|css)?$
        {
            expires      12h;
        }

        access_log  /home/wwwlogs/access.log  access;
    }

热门栏目