我设置了2个码头工人,一个是詹金斯,另一个是nginx。我希望nginx配置为将所有移动传递给localhost / jenkins /到http://jenkins:8080的我的docker镜像......
但是当我转到http://localhost/jenkins/时,它会将我重定向到http://localhost/login?from=%2F ...它会移除“/ jenkins /”部分......
这是我的nginx conf:
server {
listen 80;
listen 443 ssl default_server;
ssl_certificate /etc/nginx/certificates/${SSL_CERTIFICATE_NAME}.crt;
ssl_certificate_key /etc/nginx/certificates/${SSL_CERTIFICATE_NAME}.key;
client_max_body_size 0;
proxy_max_temp_file_size 0;
proxy_buffering off;
tcp_nodelay on;
proxy_read_timeout 600;
location /jenkins/ {
proxy_pass http://jenkins:8080;
proxy_redirect default;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
我不知道出了什么问题......看起来它正在接收默认数据,因为它重定向到“login?from =%2F”但它丢失了/ jenkins /子文件夹......
请帮忙吗?