Friday, July 10, 2015

Dealing with "HTTP 502 Bad Gateway"

Recently, while configuring WSO2 products with NginX, we were struggling to connect to the management console of the product since it was returning "HTTP 502 Bad Gateway" error. After doing some research, found out that it was a problem with SELinux.

There are two SELinux boolean settings available by default. One of them is httpd_can_network_connect which allows httpd to connect to anything on the network.

So to enable this, I executed the below command and everything worked well.

sudo setsebool -P httpd_can_network_connect 1
However, there are other similar variables that can be enabled other than this and they are explained in detail in [1].

[1] - https://www.axivo.com/resources/selinux-booleans-explained.22/

No comments: