User Tools

Site Tools


lesson_6_-_web_proxy_for_jenkins

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lesson_6_-_web_proxy_for_jenkins [2016/03/25 16:10] – created curry_searlelesson_6_-_web_proxy_for_jenkins [2016/03/25 16:19] (current) curry_searle
Line 3: Line 3:
 At the end of this lesson you will be able to connect to your Jenkins instance from a web browser. This web request passes through the nginx reverse web proxy we setup in a previous lesson. At the end of this lesson you will be able to connect to your Jenkins instance from a web browser. This web request passes through the nginx reverse web proxy we setup in a previous lesson.
  
-On Master+On Master, edit the existing nginx configuration file for //master//:
 <code> <code>
 sudo vi /etc/nginx/sites-available/master sudo vi /etc/nginx/sites-available/master
Line 36: Line 36:
     }     }
 </code> </code>
 +
 +The full nginx configuration file ///etc/nginx/sites-available/master// should look like this:
 +
 +<file xml master>
 +server {
 +    listen 80;
 +    server_name master;
 + 
 +    location /gogs/ {
 +        proxy_pass http://localhost:3000/;
 +    }
 +
 +    location ^~ /jenkins/ {
 +        proxy_pass http://localhost:8080/jenkins/;
 +
 +        # The following settings from https://wiki.jenkins-ci.org/display/JENKINS/Running+Hudson+behind+Nginx
 +        sendfile off;
 +
 +        proxy_set_header   Host             $host;
 +        proxy_set_header   X-Real-IP        $remote_addr;
 +        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
 +        proxy_max_temp_file_size 0;
 +
 +        #this is the maximum upload size
 +        client_max_body_size       10m;
 +        client_body_buffer_size    128k;
 +
 +        proxy_connect_timeout      90;
 +        proxy_send_timeout         90;
 +        proxy_read_timeout         90;
 +
 +        proxy_buffer_size          4k;
 +        proxy_buffers              4 32k;
 +        proxy_busy_buffers_size    64k;
 +        proxy_temp_file_write_size 64k;
 +    }
 +
 +}
 +</file>
  
 The master site configuration is already enabled so all we need to do is restart the nginx service: The master site configuration is already enabled so all we need to do is restart the nginx service:
Line 45: Line 84:
  
 === Resources === === Resources ===
 +  * [[https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy|Jenkins]] - behind nginx reverse-proxy
lesson_6_-_web_proxy_for_jenkins.1458947428.txt.gz · Last modified: 2016/03/25 16:10 by curry_searle