Created
May 11, 2018 09:20
-
-
Save rhuanbarreto/a06965cbc4fcd05752da22f6b3792506 to your computer and use it in GitHub Desktop.
Jenkins configuration for Nginx reverse proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
# SSL Settings | |
ssl_session_cache shared:SSL:20m; | |
ssl_session_timeout 180m; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_session_tickets off; | |
ssl_certificate /certs/cert.crt; | |
ssl_certificate_key /certs/cert.key; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DHE+AES128:!ADH:!AECDH:!MD5; | |
# Proxy settings | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_ssl_session_reuse on; | |
server { | |
server_name external.address.tld; | |
listen 443 ssl; | |
ignore_invalid_headers off; | |
location / { | |
proxy_set_header Host $host:$server_port; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_http_version 1.1; | |
proxy_pass http://jenkins.internal.address:8080; | |
# The following address CANNOT HAVE SLASH AT THE END! | |
# If it has the slash you will see the error | |
# "It appears that your reverse proxy set up is broken" | |
proxy_redirect http://jenkins.internal.address:8080 https://external.address.tld; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment