ARTIFACTORY: Permission denied error with Nginx redirect

Venu Reddy
2022-01-11 07:13


Permission denied error with Nginx redirect



Even after configuring Nginx as outlined in Configuring Nginx when Artifactory is accessed via UI, a 502 Bad Gateway error can sometimes be seen on the browser

The Nginx log: error.log shows a message such as

connect() to <Artifactory_IP>:8082 failed (13: Permission denied) while connecting to upstream, client [...] 


If SELinux is enabled, there are many booleans that control access. You can retrieve current settings by running a command such as:

getsebool -a | grep httpd


The relevant parameter here is:  httpd_can_network_connect

When disabled, this Boolean prevents HTTP scripts and modules from initiating a connection to a network or remote port. Enable this Boolean to allow this access by running the following command:

setsebool -P httpd_can_network_connect 1