Skip to content

Instantly share code, notes, and snippets.

@spikeheap
Created November 20, 2013 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikeheap/7565560 to your computer and use it in GitHub Desktop.
Save spikeheap/7565560 to your computer and use it in GitHub Desktop.
Sample nginx conf for Jenkins
upstream jenkins {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
access_log /opt/boxen/log/jenkins/sonar.access.log;
error_log /opt/boxen/log/jenkins/sonar.error.log;
listen 80;
server_name jenkins.dev;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
if ($host ~* "www") {
rewrite ^(.*)$ http://jenkins.dev$1 permanent;
break;
}
location / {
proxy_buffering off;
proxy_max_temp_file_size 0;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://jenkins.dev;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment