美文网首页
nginx+php location写法

nginx+php location写法

作者: 带着小猪闯天下 | 来源:发表于2019-06-03 14:28 被阅读0次
    server {
            listen 80;
            server_name yanjue.com;
            access_log  /data/wwwlogs/yanjue.com/access.log access buffer=32k;
            error_log  /data/wwwlogs/yanjue.com/error.log;
    
    location / {
            root /data/wwwroot/yanjue.com/public;
            index index.php index.html index.htm;
            }
    location ~ \.php {
            root /data/wwwroot/yanjue.com/public/;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi_params;
            set $real_script_name $fastcgi_script_name;
                if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                    set $real_script_name $1;
                    set $path_info $2;
                }        
            fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
    
            }
    }
    
    WeChat92e7b001c0e0d4e7a4e8590634bcb1a1.png

    相关文章

      网友评论

          本文标题:nginx+php location写法

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