In the Centos + nginx + wordpress environment, stop and start the iptables website. 502 is returned.

Source: Internet
Author: User
Tags connection reset
Start the iptables website in the Centos + nginx + wordpress environment and return the 502 website environment: Centos & nbsp; nginx & nbsp; php (wordpress). The following is a summary of the current problems: 502 is returned when the iptables website is started, close iptables website open normal I start iptables website in Centos + nginx + wordpress environment 502
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 !!! Iptables nginx fastCGI:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.