Skip to content

Instantly share code, notes, and snippets.

@treejamie
Created November 10, 2013 12:20
Show Gist options
  • Save treejamie/7397592 to your computer and use it in GitHub Desktop.
Save treejamie/7397592 to your computer and use it in GitHub Desktop.
Nginx SSL config for proxying to jenkins
upstream jenkins {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
server_name {{ jenkins_url }};
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
server_name {{ jenkins_url }};
ssl_certificate {{ your_cert_path }};
ssl_certificate_key {{ your_key_path }};
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers HIGH:!ADH:!MD5;
ssl_prefer_server_ciphers on;
location / {
# be paranoid
allow 192.1.11.0/24; # trusted networks only
deny all;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect http:// https://;
add_header Pragma "no-cache";
proxy_pass http://jenkins;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment