Enable HTTPS in jenkins?

后端 未结 4 1362
栀梦
栀梦 2020-12-15 07:20

I have a private network with a local IP. I want to Enable HTTPS for my Jenkins server which is static IP W.X.Y.Z:8080.

Jenkins version 2.9
java version \"1.         


        
4条回答
  •  感情败类
    2020-12-15 07:40

    If you have a valid certificate and you do not want to enable HTTPS for your Jenkins but still want an SSL enable traffic then here is another way.

    In my case, I put Jenkins behind my Nginx web server. So here are the steps which I follow:

    1. I have installed Nginx server. (sudo apt install nginx)
    2. Copy the cert files in that machine. (Files are: .crt and .key)
    3. Changed the nginx configuration in /etc/nginx/sites-available/default file to something like this:

      ssl_certificate /etc/nginx/.crt;
      ssl_certificate_key /etc/nginx/.key;
      
    4. Follow the steps mentioned in the Jenkins Wiki.

    5. And everything works like a charm...

    By doing these steps the request flow will be like this:

    1. Request goes to Nginx web server.
    2. The reverse proxy redirects the traffic to the localhost:8080 (or custom IP: port) where Jenkins is running.
    3. Jenkins will serve the request and give the response to Nginx
    4. Nginx will return the response.

    You can do the same with Apache, HAProxy, and squid, see

    • Running Jenkins with native SSL / HTTPS
    • Running Jenkins behind Nginx
    • Jenkins behind an NGinX reverse proxy)

提交回复
热议问题