Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NGinX cannot connect to Jenkins on CentOS 7

I have installed Jenkins CI on Cent OS 7 machine as well as NGinX and configured reverse proxy as outlined in the document. I can connect to Jenkins via port 8080, but cannot via port 80. I see the following error in /var/log/nginx/error.log:

2014/09/22 22:12:35 [crit] 1639#0: *4 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 10.10.81.212, server: 10.10.81.82, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "10.10.81.82"

Does anyone has any idea what causes the problem?

P.S. I used the similar setup on CentOS 6.4 and everything was fine.

like image 361
vharavy Avatar asked Sep 23 '14 12:09

vharavy


People also ask

How do I install Jenkins on CentOS?

To install Jenkins on your CentOS system, follow the steps below: Jenkins is a Java application, so the first step is to install Java. Run the following command to install the OpenJDK 8 package: The current version of Jenkins does not support Java 10 (and Java 11) yet.

Can't Run nginx on CentOS 7?

Re: Nginx can't running on CentOS 7. avij wrote: 172.30.9.0 is a private network address. Where are you testing from? From within 172.30.9.x or outside of that? If the latter, you may need to change the settings of whatever NAT router you have to forward connections to the public IP's port 80 to your server's IP 172.30.9.x port 80.

What ports do I need to open to install Jenkins?

If you are installing Jenkins on a remote CentOS server that is protected by a firewall you need to port 8080. Use the following commands to open the necessary port: To set up your new Jenkins installation, open your browser and type your domain or IP address followed by port 8080:

How to check the status of Jenkins service in Linux?

Executing the below command , The status of jenkins service can be checked. Jenkins listens on port 8080. The same can be checked by executing the following command. The port 8080 should be whitelisted the firewall inorder to access the jenkins console. You will see the following page.


1 Answers

It seemed to be a SELinux related problem. As suggested in this question I have tried using

setsebool -P httpd_can_network_connect 1

and everything works fine after that.

like image 162
vharavy Avatar answered Oct 06 '22 01:10

vharavy