Jenkins: It appears that your reverse proxy set up is broken / Есть подозрение, что настройки вашего обратного прокси некорректны.

Автор: | 06/07/2018
 

Перед Jenkins запущен NGINX + SSL.

После запуска – Jenkins сообщает, что “Есть подозрение, что настройки вашего обратного прокси некорректны.“:

Описание ошибки есть на Jenkins Wiki.

Настройки виртуалхоста сейчас выглядят так:

upstream jenkins {
    server 127.0.0.1:8080;
}
...
server {

    listen       443 ssl;
    server_name  ci.domain.world;
    ...
    location / {

        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_pass http://jenkins$request_uri;
    }
}

Добавляем заголовок X-Forwarded-Proto:

...
    location / {

        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;
        proxy_set_header        Authorization       "";
        proxy_pass http://jenkins$request_uri;
    }
...

Перечитываем конфиги NGINX:

[simterm]

root@jenkins-production:/home/admin# nginx -t && service nginx reload
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successfu

[/simterm]

Проверяем:

Готово.