Я могу открыть свой Jenkins на http://localhost:8080 в браузере, но wget не может этого сделать.
wget http://localhost:8080
--2018-06-12 07:39:56-- http://localhost:8080/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 403 Forbidden
2018-06-12 07:39:56 ERROR 403: Forbidden.
И curl может сделать это:
curl http://localhost:8080
<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F'/><script>window.location.replace('/login?from=%2F');</script></head><body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
</body></html>
Дело в том, что мой Nginx не работает так же, как wget , я получаю Ошибка 502 Bad Gateway на Nginx при попытке перенаправить на Jenkins:
Это мой сервер Nginxблок для Дженкинса:
server {
listen 80;
server_name ...;
location / {
proxy_pass http://127.0.0.1:8080;
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 X-Forwarded-Proto $scheme;
}
}