Created
June 6, 2018 09:31
-
-
Save olegbuevich/c00a8a3b3efc245c3732ba7334d76fa8 to your computer and use it in GitHub Desktop.
jenkins + nginx proxy (JENKINS_ARGS=--prefix=/jenkins)
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
server { | |
listen 80 default_server; | |
server_name dev.example.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl default_server; | |
server_name dev.example.com; | |
ssl_certificate /etc/letsencrypt/live/dev.example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/dev.example.com/privkey.pem; | |
add_header Strict-Transport-Security max-age=15768000; | |
if ($host != "dev.example.com") { | |
return 403; | |
} | |
location / { | |
return 403; | |
} | |
location ^~ /jenkins { | |
proxy_pass http://localhost:8080; | |
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_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
client_max_body_size 10m; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 90; | |
proxy_read_timeout 90; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment