【发布时间】:2019-09-17 20:56:48
【问题描述】:
Nginx 仅适用于 http://localhost,不适用于 http://localhost/jenkins。
这是我的配置:
这工作@http://localhost,登录屏幕出现,一切正常。
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
proxy_set_header Host $http_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-Proto $scheme;
proxy_pass http://localhost:8080/;
proxy_redirect off;
proxy_read_timeout 90;
}
}
...但我想见詹金斯@http://localhost/jenkins
这就是我所说的:
server {
listen 80 default_server;
listen [::]:80 default_server;
location /jenkins/ {
proxy_set_header Host $http_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-Proto $scheme;
proxy_pass http://localhost:8080/;
proxy_redirect off;
proxy_read_timeout 90;
}
}
...它似乎将我重定向到 http://localhost/login?from=%2F 并给出错误 404。
【问题讨论】:
标签: nginx jenkins proxy centos