nginx 調(diào)用docker php-fpm 502 Bad Gateway 問題排查

nginx是在服務(wù)器上運(yùn)行,php-fpm是在docker上運(yùn)行,nginx 調(diào)用php-fpm 出現(xiàn) 502 Bad Gateway

1.排查是否運(yùn)行php-fpm 后導(dǎo)致php-fpm后臺(tái)運(yùn)行,docker container 停止了,然后無法訪問

docker ps

如果有php-fpm鏡像在,說明沒有停止

2.排查php-fpm.d/www.conf 配置文件

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;                            a specific port;
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses
;                            (IPv6 and IPv4-mapped) on a specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

其中l(wèi)isten = 127.0.0.1:9000 是不對(duì)的,監(jiān)聽的是docker 本地127.0.0.1,改成
listen = 0.0.0.0:9000 即可

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容