小编Nyi*_*cip的帖子

Nginx 404 上的 Laravel

我的 centos 7 VPS 中有两个站点。一个是 laravel 5.6(比如 def.com),另一个是静态 html 站点(比如 abc.com)。

使用此配置,html 站点运行顺利: sites-available/abc.com.conf

    server {
        listen   80;
        server_name  server_name abc.com www.abc.com;

        # note that these lines are originally from the "location /" block
        #root   /var/www/abc.com/html;
        #index index.php index.html index.htm;

        location / {
            root   /var/www/abc.com/html;
            index index.php index.html index.htm;
            try_files $uri $uri/ =404;
        }
        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
            root /usr/share/nginx/html;
        }

        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index …
Run Code Online (Sandbox Code Playgroud)

php nginx laravel lemp

1
推荐指数
1
解决办法
5583
查看次数

标签 统计

laravel ×1

lemp ×1

nginx ×1

php ×1