502 Bad gateway error

Hi Team,
Today when i tried to access my Jenkins URL i got an error which says, “502 Bad gateway error”.

One of my colleague helped me with below commands and it fixed my issue -
chown -R jenkins. /gpcloud/jenkins
iptables -F
systemctl restart jenkins

Could someone please help me in understanding this command please.