Last active
April 22, 2020 12:28
-
-
Save junxy/61c77cdae8729f8324d2822f0d9bfed4 to your computer and use it in GitHub Desktop.
nginx 反向代理 Jenkins 插件安装源,国内源 http://mirrors.tuna.tsinghua.edu.cn/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; | |
server_name updates.jenkins-ci.org; | |
server_name mirrors.jenkins-ci.org; | |
# https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/ | |
location /download/ { | |
proxy_redirect off; | |
proxy_pass http://mirrors.tuna.tsinghua.edu.cn/jenkins/; | |
proxy_connect_timeout 60s; | |
proxy_read_timeout 5400s; | |
proxy_send_timeout 5400s; | |
proxy_set_header Host "mirrors.tuna.tsinghua.edu.cn"; | |
proxy_set_header User-Agent $http_user_agent; | |
proxy_set_header Accept-Encoding ""; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
#proxy_set_header X-Real-IP $remote_addr; | |
#proxy_set_header X-Forwarded-Proto https; | |
#proxy_set_header Accept-Language "zh-CN"; | |
} | |
location /update-center.json { | |
proxy_redirect off; | |
proxy_pass http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/; | |
proxy_connect_timeout 60s; | |
proxy_read_timeout 5400s; | |
proxy_send_timeout 5400s; | |
proxy_set_header Host "mirrors.tuna.tsinghua.edu.cn"; | |
proxy_set_header User-Agent $http_user_agent; | |
proxy_set_header Accept-Encoding ""; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment