gpt4 book ai didi

NGINX/ Jenkins : It appears that your reverse proxy set up is broken

转载 作者:行者123 更新时间:2023-12-03 15:36:38 25 4
gpt4 key购买 nike

我已经尝试了至少半个关于如何让 NGINX 与 Jenkins 合作的例子。我最近的 NGINX 配置基于以下示例:

https://wiki.jenkins.io/display/JENKINS/Running+Jenkins+behind+Nginx

无论我尝试什么, Jenkins 一直说 It appears that your reverse proxy set up is broken.我希望有人能发现问题所在,因为我花了几个小时试图解决这个问题却无济于事。

谢谢!

upstream cicd {
keepalive 32;
server 127.0.0.1:8080;
}

server {
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;

server_name cicd.domain.com;

root /var/run/jenkins/war/;

access_log /var/log/nginx/jenkins/access.log;
error_log /var/log/nginx/jenkins/error.log;

ssl_certificate /etc/letsencrypt/live/cicd.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cicd.domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

#static files
location ~ "^/static/[0-9a-fA-F]{8}\/(.*)$" {
rewrite "^/static/[0-9a-fA-F]{8}\/(.*)" /$1 last;
}

#user content
location /userContent {
root /var/lib/jenkins/;

if (!-f $request_filename){
rewrite (.*) /$1 last;
break;
}
sendfile on;
}

#cicd
location @cicd {
sendfile off;
proxy_pass http://cicd;
proxy_redirect http://localhost:8080 https://cicd.domain.com;
proxy_http_version 1.1;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_max_temp_file_size 0;

client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffering off;
proxy_request_buffering off;
proxy_set_header Connection "";
}

#optional
location / {
if ($http_user_agent ~* '(iPhone|iPod)') {
rewrite ^/$ /view/iphone/ redirect;
}

try_files $uri @cicd;
}

}

最佳答案

这不是 NGINX 的问题。

在 Jenkins 中,您需要配置 Jenkins URL。如果设置不正确,您将收到您观察到的错误。
检查 Jenkins -> 管理 Jenkins -> 配置系统 => Jenkins URL。

关于NGINX/ Jenkins : It appears that your reverse proxy set up is broken,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51006973/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com