Created
December 29, 2015 06:56
-
-
Save 1syo/eb2bafc2d2ba76b6270c to your computer and use it in GitHub Desktop.
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; | |
listen [::]:80 default_server; | |
root /var/cache/jenkins/war; | |
index index.html; | |
server_name _; | |
server_tokens off; | |
location / { | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/.htpasswd; | |
location ~ \.class$ { deny all; } | |
location ~ \.jar$ { deny all; } | |
location /WEB-INF { deny all; } | |
location /META-INF { deny all; } | |
try_files $uri @jenkins; | |
} | |
location /css { | |
expires 1y; | |
add_header Cache-Control public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
} | |
location /images { | |
expires 1y; | |
add_header Cache-Control public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
} | |
location /scripts { | |
expires 1y; | |
add_header Cache-Control public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
} | |
location /help { | |
expires 1y; | |
add_header Cache-Control public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
} | |
location @jenkins { | |
proxy_redirect 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 Authorization ""; | |
proxy_connect_timeout 30; | |
proxy_send_timeout 60; | |
proxy_read_timeout 60; | |
proxy_pass http://127.0.0.1:8080; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment