If you are using a Linux server, make sure your IPTABLES configuration is correct.
Run sudo iptables -L -n , you will get a list of open ports. If the Iptables rule does not exist, to open the port serving the fcgi script, you will receive error 502. The Iptables rule that opens the correct port must be specified before any rule that categorically rejects all packets (i.e., the "REJECT ALL -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable form rule "REJECT ALL -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable or similar)
In my configuration, in order to open the port correctly, I had to run this command (suppose my fcgi server is running on port 4567):
sudo iptables -I INPUT 1 -p tcp --dport 4567 -j ACCEPT
WARNING: This will open port 4567 to the world.
So itβs better to do something like this:
sudo iptables-save >> backup.iptables sudo iptables -D INPUT 1
Having done this, delete error 502 for me.
tjb Mar 08 2018-12-12T00: 00Z
source share