美文网首页
Nginx 配置

Nginx 配置

作者: 洞房花猪 | 来源:发表于2016-04-15 17:59 被阅读33次
    server
    {
        listen      80;
        server_name  192.168.1.33;
        index               index.html index.htm index.php;
        
        root                /www;
    
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
        location ~* \.(js|css|jpg|jpeg|gif|png|bmp|ico)$
        {
            expires 10d;
            access_log off;
        }
    
    
        location / {
                    if (!-e $request_filename) {
                            rewrite ^(.*)$ /index.php/$1 last;
                            break;
                    }
                    #try_files $uri $uri/ /index.php;
            }
    
        location ~ .*\.(php|php5)($|/)
        {
                            include         fastcgi_params;
                            include         fastcgi.conf;
                            set                     $script                         $fastcgi_script_name;
                            set                     $path_info                      "";
                            if ($fastcgi_script_name ~ "^(.+\.php)/(.+)") {
                                    set     $script         $1;
                                    set     $path_info      $2;
                            }
                            fastcgi_pass    127.0.0.1:9000;
                            fastcgi_param   SCRIPT_FILENAME $document_root$script;
                            fastcgi_param   PATH_INFO $path_info;
                            fastcgi_param   SCRIPT_NAME $script;
        }
        access_log  /www/logs/192.168.1.210.access.log  combined;
        }
    

    相关文章

      网友评论

          本文标题:Nginx 配置

          本文链接:https://www.haomeiwen.com/subject/mdunlttx.html