欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

nginx下的laravel的配置 博客分类: PHPnginx nginxlaravel 

程序员文章站 2024-03-14 23:35:53
...
本文是转载文章

来源:
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