【问题标题】:Laravel 5.5 and nGinx: 404 Not Found on all routes except homeLaravel 5.5 和 nGinx:404 Not Found 在除 home 之外的所有路线上
【发布时间】:2017-09-10 14:59:06
【问题描述】:

我创建了一个除default 之外的文件来配置我的laravel APP。文件名为“laravel”。

laravel 文件:

server {
  listen 80;
  listen [::]:80;

  root /home/user/var/www/laravel-blog/public;

  index index.php index.html index.htm;

  location / {
    try_files $uri $uri/ /index.php?query_string;
  }

  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    # fastcgi_pass 127.0.0.1:9000;
  }

  location ~ /\.ht {
    deny all;
  }
}

有人知道怎么解决吗?谢谢!

【问题讨论】:

    标签: laravel nginx laravel-5 laravel-5.5


    【解决方案1】:

    你检查过php7.0-fpm的日志吗?

    我在使用全新安装的 Laravel 5.5 时发现了同样的问题,并在日志中发现了这个问题:

    WARNING: [pool www] child 5319 exited on signal 11 (SIGSEGV - core dumped) after 312.990977 seconds from start
    

    您的一个 php 扩展可能有问题,禁用 newrelic 对我有用。您可以尝试在 public/index.php 上添加它以禁用单个事务的 newrelic:

    if (function_exists('newrelic_ignore_transaction')) {
        newrelic_ignore_transaction();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-14
      • 2020-08-21
      • 1970-01-01
      • 2021-12-27
      • 2018-08-20
      相关资源
      最近更新 更多