nginx vhost is almost the exact copy of the vhost on
https://wiki.jenkins.io/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy:
upstream jenkins {
server
127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
server_name jenkins.my-domain;
add_header X-Frame-Options SAMEORIGIN;
include /etc/nginx/release.conf;
access_log /var/log/nginx/redirects-access.log vhosts;
error_log /var/log/nginx/redirects-error.log;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name jenkins.my-domain;
ssl_certificate ssl/my-domain.crt;
ssl_certificate_key ssl/my-domain.key;
ssl_dhparam ssl/dhparam-2048.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Frame-Options SAMEORIGIN;
access_log /var/log/nginx/jenkins.my-domain.access.log;
error_log /var/log/nginx/jenkins.my-domain.error.log;
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;
# workaround for
https://issues.jenkins-ci.org/browse/JENKINS-45651 add_header 'X-SSH-Endpoint' 'jenkins.my-domain:22' always;
}
}
So either I'm blind, or the documentation is somehow wrong?
And indeed, I can see "java.io.IOException: HTTP full-duplex channel timeout" in jenkins log.
This one indeed works:
java -jar jenkins-cli.jar -s
http://localhost:8080 -auth user:pass help offline-node
But since I need to execute it from remote, I'd rather connect to
https://jenkins.my-domain