我有一个带有 nginx 的 VPS。gitlab,phpmyadmin 已经在运行 certbots https。现在我想添加詹金斯。我将其端口更改为 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.
我做错了什么??