您的位置:首页 > 编程语言 > PHP开发

php 解决:502 bad gateway

2017-01-10 19:29 169 查看
写好上线没什么想法,活动开始,网站慢慢被更多人知道,访问的越来越多,每天最高16W的访问量,突然投诉多了,说:502 bad gateway

搞了一天多时间,最后终于试出来了:网上有关502的解决方法太多了,我都去试了,帖子抄袭太多,看了很多很多,试了很多很多

最后就找到一篇帖子解决了,我这种情况的问题:http://www.digitalwhores.net/ubuntu-2/error-502-connect-to-unixvarrunphp5-fpm-sock-failed-11-resource-temporarily-unavailable-while-connecting-to-upstream/   当然它的端口和我的端口值不一样


ERROR 502 – connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

November
24, 2015HostingLinuxUbuntu502nginx

 

2015/11/24 12:01:49 [error] 48055#0: *14094117 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client:

Once again, i’m struggling with nginx + php-fpm
sudo nano /etc/php5/fpm/pool.d/www.conf

search for
listen = /var/run/php5-fpm.sock

and replace it for
listen = 127.0.0.1:7777

On the *.conf files of sites-enabled (/etc/nginx/sites-enabled/)
replace (or comment)
fastcgi_pass unix:/var/run/php5-fpm.sock;

with
fastcgi_pass 127.0.0.1:7777;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: