Laravel在nginx中提供502错误的网关

时间:2019-04-20 10:19:24

标签: php linux laravel nginx ubuntu-16.04

我已重新加载服务器配置以匹配Laravel上提供的配置。当我做php --ini时,可以看到我的PHP版本是7.0,所以我进行了更改以使用7.0。

我的服务器配置如下:

server {

  server_name exoscape.co.uk;

  root /var/www/html/exoscape/public;
  index  index.php index.html index.htm;

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

  location ~ \.php$ {
     include fastcgi_params;
     fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  }

  location ~ /\.ht {
      deny all;
  }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/exoscape.co.uk/fullchain.pem; # manag$
    ssl_certificate_key /etc/letsencrypt/live/exoscape.co.uk/privkey.pem; # man$
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = exoscape.co.uk) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  listen [::]:80;

  server_name exoscape.co.uk;
    return 404; # managed by Certbot


}

我已尝试通过执行以下操作来确保该目录正确为chmod:

sudo chown -R www-data:www-data /var/www/html/exoscape/
sudo chmod -R 755 /var/www/html/exoscape/

但是,当我访问我的域时,我仍然收到502 Bad Gateway。我正在使用nginx/1.15.12。任何帮助将不胜感激。

0 个答案:

没有答案