laravel5.6的nginx配置

代码如下:

server {
    listen           80;
    server_name      127.0.0.3;
    root             "H:/phpstudy/PHPTutorial/WWW/blog/public";
    index            index.php index.html index.htm;
    try_files        $uri $uri/ @rewrite;

    location @rewrite {
        rewrite ^/(.*)$ /index.php?_url=/$1;
    }

    location ~ \.php {
        fastcgi_pass                  127.0.0.1:9000;
        fastcgi_index                 /index.php;
        fastcgi_split_path_info       ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO       $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include                       fastcgi_params;
    }

    location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
    }

    location ~ /\.ht {
         deny all;
    }

    }
转载自: https://blog.csdn.net/maxsky/article/details/54017572

猜你喜欢

转载自blog.csdn.net/qq_21885337/article/details/81053007