gpt4 book ai didi

ssl - 使用 nginx 的 Jenkins 的 502 错误网关

转载 作者:太空宇宙 更新时间:2023-11-03 14:25:54 25 4
gpt4 key购买 nike

我有一个带有 nginx 的 VPS。 gitlab,phpmyadmin 已经在运行 certbots https。现在我想添加 Jenkins 。我将其端口更改为 8090,因为它不与 gitlabs 8080 端口冲突。我检查了每个状态,所有服务都在运行。

    upstream jenkins {
keepalive 32;
server localhost:8090 fail_timeout=0;
}

server {
server_name build.example.de;

listen 443 ssl; # managed by Certbot

access_log /var/log/nginx/jenkins_access.log;
error_log /var/log/nginx/jenkins_error.log;

ssl_certificate /etc/letsencrypt/live/build.example.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/build.example.de/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

location / {
proxy_set_header Host $host:$server_port;
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_redirect http:// https://;
proxy_pass http://jenkins;

# Required for new HTTP-based CLI
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off; # Required for HTTP-based CLI to work over SSL

# workaround for https://issues.jenkins-ci.org/browse/JENKINS-45651
add_header 'X-SSH-Endpoint' 'build.example.de:50022' always;
}

}

server {
if ($host = build.example.de) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;

server_name build.example.de;
return 404; # managed by Certbot
}

我总是得到错误:

[error] 8441#8441: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 88.65.0.115, server: build.example.de, request: "GET / HTTP/1.1", upstream: "https://127.0.0.1:8090/", host: "build.example.de"


Jul 26 16:32:10 v22018076557869542 systemd[1]: Starting LSB: Start Jenkins at boot time...
Jul 26 16:32:10 v22018076557869542 jenkins[24446]: Error: Unable to access jarfile jenkins-cli.jar
Jul 26 16:32:10 v22018076557869542 jenkins[24446]: Correct java version found
Jul 26 16:32:10 v22018076557869542 jenkins[24446]: * Starting Jenkins Automation Server jenkins
Jul 26 16:32:10 v22018076557869542 su[24520]: Successful su for jenkins by root
Jul 26 16:32:10 v22018076557869542 su[24520]: + ??? root:jenkins
Jul 26 16:32:10 v22018076557869542 su[24520]: pam_unix(su:session): session opened for user jenkins by (u
Jul 26 16:32:10 v22018076557869542 su[24520]: pam_unix(su:session): session closed for user jenkins
Jul 26 16:32:11 v22018076557869542 jenkins[24446]: ...done.
Jul 26 16:32:11 v22018076557869542 systemd[1]: Started LSB: Start Jenkins at boot time.

我做错了什么??

最佳答案

看起来你的请求被重定向到上游:“https://127.0.0.1:8090/”,虽然它应该是简单的 http,但尝试删除 < strong>proxy_redirect http://https://;

关于ssl - 使用 nginx 的 Jenkins 的 502 错误网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57221259/

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