繁体   English   中英

NGinx Laravel 4-502错误的网关错误

[英]NGinx Laravel 4 - 502 Bad Gateway Error

server {
        listen  80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /home/thinkshare/public/;
        index index.php;

        server_name domain_here;

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

        location ~ \.php$ {
                try_files $uri /index.php =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

这是我当前的NGinx配置-我无法终生确定在连接,域或IP直接上发出502网关错误的确切原因。 有什么想法吗?

编辑

移除网域

我终于能够在此链接中找到答案。

实际上,需要将nginx文件中的fastcgi_pass以及fpm文件中的listen更改为127.0.0.1:9000。

套接字的权限不正确,并且更改为top的原因解决了该问题

在Ubuntu 16.04中,我也收到此错误。 我通过编辑/etc/php/7.0/fpm/pool.d/www.conf解决了

user = yourname
group = yourgroup

listen.owner = yourname
listen.group = yourgroup

并使用$sudo service php7.0-fpm restart

此错误是由于在其他目录中您的路径不在www-data拥有的默认/var/www中时,应进行设置!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM