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后臺運(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 是不對的逗扒,監(jiān)聽的是docker 本地127.0.0.1古戴,改成
listen = 0.0.0.0:9000 即可