1

I want to serve Jenkins CI with Caddy.

Reading about Caddy "How to proxy from port to path" I have this Caddyfile:

jenkins.example.com {
    proxy / http://localhost:8080
}

Now I access Jenkins on port 8080 and set the Jenkins URL in Jenkins settings. Then Jenkins complains that the reverse proxy setup is broken, see "Jenkins says my reverse proxy setup is broken".

When I access it via https and port 80 some pages work but on lots of pages I get redirected to localhost:80.

Has someone successfully used Jenkins with Caddy?

StephenKing
  • 36,187
  • 11
  • 83
  • 112
Lars Bilke
  • 4,940
  • 6
  • 45
  • 63

2 Answers2

2

It seems that using the transparent preset fixes this:

jenkins.example.com {
    proxy / http://localhost:8080 {
        transparent
        max_fails 0
    }
}

max_fails 0 for me was required because sometimes I got a 502 Bad Gateway response. See this caddy issue.

Lars Bilke
  • 4,940
  • 6
  • 45
  • 63
0

With the caddy v2.1.1 the following Caddyfile works seamlessly

jenkins.example.com

reverse_proxy localhost:8080