7

解决 Docker Nginx 与 Php-fpm 偶现 502 问题

 3 years ago
source link: http://i.lckiss.com/?p=7521
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

解决 Docker Nginx 与 Php-fpm 偶现 502 问题

2021-10-02

这个标题不太好取,目前环境是 Nginx + Php-fpm,其中之前提过 WordPress 容器优化,使用 php -fpm 可以极大程度的减少容器体积,但那时候遗留了一个问题,就是在后台更新插件或者更新 WordPress 时,一段时间后(猜测是更新完成后的回调)会提示502,之前的非 Docker 模式下并没遇到过,所以直接将锅甩给后台响应的 php-fpm 。

本想打开 php-fpm 的调试模式去看看日志,后来在网上看到一个简单方案,与我猜测一致,就是 php-fpm 容器的监听问题。经过测试确实如此,解决办法:

进入 php-fpm 容器 bash ,先找寻配置文件位置:

# find / -name www.conf
/usr/local/etc/php-fpm.d/www.conf

得到结果:/usr/local/etc/php-fpm.d/www.conf

直接编辑将listen = 127.0.0.1:9000  改为 listen = [::]:9000 

重启容器测试可行,其他不管了。

参考:nginx+docker+php7.4出现502 bad gateway的解决办法


Recommend

  • 19

    公司的一个项目大致是这样的:一个左侧列表,点击左侧列表的文章标题,右侧展开该文章对应的内容的。 现在的问题出现在极少部分客户有时左侧的标题,无法打开对应的右侧的内容,给人的改进就是‘卡’、点不动、点了没反应。...

  • 11
    • xushanxiang.com 4 years ago
    • Cache

    Linux改动php.ini后如何重启php-fpm

    一、改动php.ini 最近使用PhpMyAdmin导入一个1.5M的*.sql.zip文件到MySQL过程中遇到上传文件异常: 413 Request Entity Too Large 搜索了一下,原来是

  • 9
    • www.anquanke.com 3 years ago
    • Cache

    php内核分析-fpm和df的问题思考

    php内核分析-fpm和df的问题思考 阅读量    25365...

  • 4

    一、业务背景 目前移动端的使用场景中会用到大量的消息推送,push消息可以帮助运营人员更高效地实现运营目标(比如给用户推送营销活动或者提醒APP新功能)。 对于推送系统来说需要具备以下两个特性: 消息秒级送到用户,无...

  • 4
    • blogread.cn 3 years ago
    • Cache

    多nginx单php-fpm的配置方法

    多nginx单php-fpm的配置方法 浏览:3034次  出处信息     用php fastcgi和nginx搭配的形式是很常见的,在很BT的需求下...

  • 17
    • computingforgeeks.com 3 years ago
    • Cache

    Install Nginx With PHP-FPM on Ubuntu 22.04|20.04

    Install Nginx With PHP-FPM on Ubuntu 22.04|20.04Search ComputingForGeeksThis guide has been created to help...

  • 8

    1)海外设备上偶现的报错处理方式 ​2)Shader冗余则ShaderLab占用大小问题 3)URP Renderer Feature实现二次元描边,Cutout的处理问题 4)Unity中视频播放的解决方案 这是第286篇UWA技术知识分享的推送。今天我们继续为大家精...

  • 20

    <?xml encoding="utf-8" ??>OpenBSD 7, Nginx, PHP-FPM (FastCGI Process Manager), and MySQL (OEMP) work as a collection to form a web stack that makes it possible to run dynamic applications on a server. Ngi...

  • 9
    • wakzz.cn 3 years ago
    • Cache

    golang低版本http2偶现400

    golang低版本http2偶现400 祈雨的博客 2020-08-01

  • 6

    Hardening NGINX and PHP-FPM for Production Arne Blankerts |

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK