I ‘ve setup Jenkins server which is running as a docker container behind Nginx reverse proxy, it is served at example.com/jenkins/, everything is working fine except getting "It appears that your reverse proxy set up is broken" error on "manage Jenkins page". I would be grateful if anyone can help.
Docker compose file
version: "3.4"
services:
jenkins:
image: jenkins/jenkins:lts
container_name: jenkins
environment:
JENKINS_OPTS: "--prefix=/jenkins"
ports:
- 9292:8080
- 50000:50000
volumes:
- ./data:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
Nginx conf file
location /jenkins/ {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:9292;
proxy_redirect http://localhost:9292/ /jenkins/;
}
2
Answers
Your proxy redirect seems off here as you don’t have to remap /jenkins context. Here is a simple config that worked for me in the past.
You can simply change the url that is in Manage jenkins > Configure system to the new url you are using , for your case it is example.com/jenkins/, that should make the error go away.