nginx下TP3.2访问页面总是404

2019/06/03 09:53
阅读数 42

这是我测试onethink用的配置 可以参考一下

 

server {
    listen 80;
    server_name onethink.dev www.onethink.dev;
    
    root /vagrant/www/onethink;
    index index.php;
    
    location / {
        if ( -f $request_filename) {
            break;    
        }

        if ( !-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
            break;    
        }
    }    

    location ~ \.php {
        set $script $uri;
        set $path_info "";
        if ($uri ~ "^(.+\.php)(/.+)") {
            set $script $1;
            set $path_info $2;    
        }    

        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param PATH_INFO $path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$script;
        fastcgi_param SCRIPT_NAME $script;
        try_files $uri =404;
    }
}

 

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部