Start the iptables website in the Centos + nginx + wordpress environment and return the 502 iptables nginx fastCGI
Website environment: Centos nginx php (wordpress)
The problem is summarized as follows:
When the iptables website is started, 502 is returned, and the iptables website is disabled.
Iptables settings are as follows:
Chain INPUT (policy DROP 1 packets, 139 bytes)
Pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- lo any anywhere
17 1460 ACCEPT all -- any anywhere state RELATED, ESTABLISHED
1 40 ACCEPT tcp -- any anywhere tcp dpt: ssh
0 0 ACCEPT tcp -- any anywhere tcp dpt: mysql
2 80 ACCEPT tcp -- any anywhere tcp dpt: http
0 0 ACCEPT all -- lo any anywhere
0 0 ACCEPT icmp -- any anywhere
0 0 ACCEPT tcp -- any anywhere tcp dpt: pptp
0 0 ACCEPT gre -- any anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
Pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 16 packets, 4024 bytes)
Pkts bytes target prot opt in out source destination
2 80 ACCEPT tcp -- any anywhere tcp spt: http
Lo enabled, 80 enabled, and 9000 started
When iptables is enabled, a static webpage can be opened. However, if you switch back to wordpress, 502 is returned.
Check whether error-log is:
01:45:37 [error] 1745 #0: * 106 recv () failed (104: Connection reset by peer) while reading response header from upstream, client:, server: xiaobuxun. me, request: "POST/wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi: // 127.0.0.1: 9000", host: "xiaobuxun. me ", referrer:" http://xiaobuxun.me/wp-admin/post-new.php"
I think it is iptables. it is because Port 9000 of fastCGI is not enabled, but I have already configured it. why do I still return port 502? please kindly advise !!!
Reply to discussion (solution)
Why don't anyone take care of me ???
Is there a php-fpm log?
Reference: http://wildlyinaccurate.com/solving-502-bad-gateway-with-nginx-php-fpm
I installed http://www.deepvps.com/lnmp-v10.html on centos
LNMP one-click installation package V1.0 released
Easy to install directly