nginx下的laravel的配置

阅读更多
本文是转载文章

来源:
https://laravelacademy.org/post/7514.html

以下是nginx下的 laravel 5.7 的nginx配置文件


配置如下:
server {
    listen 80;
    server_name example.com;
    index index.php
    client_max_body_size 50M;
    error_log /home/deploy/apps/logs/example.error.log;
    access_log /home/deploy/apps/logs/example.access.log;
    root /home/deploy/apps/example.com/current/public;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php {
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
    }
}

你可能感兴趣的:(nginx,laravel)