If you are using SELinux (Security-Enhanced Linux), it has a default setting that blocks HTTP servers from making network connections. For example I’m using CentOS 8 and couldn’t figure out why my server couldn’t connect but whenever I logged in I was able to.
This will allow connections to be made:
sudo setsebool -P httpd_can_network_connect true
After this you may need to restart your service.
This might be your issue if you’re able to “curl” and “ping” without problem as a user, but your webserver (Apache, Nginx, etc) isn’t able to.
-
This reply was modified 6 years, 1 month ago by igienger. Reason: Code formatting