How to proxy from port to path

Continuing the discussion from Caddy Frequently Asked Questions (FAQ):

anyone here knows how can I proxy rombox.msfjarvis.me:8080 to rombox.msfjarvis.me/jenkins ?

@MSF-Jarvis Try:

rombox.msfjarvis.me:8080

proxy / rombox.msfjarvis.me/jenkins

2016/06/01 20:26:46 listen tcp :8080: bind: address already in use

expected, since jenkins is already hijacking that port.

That means you already have something listening on that port.

I told you, it’s jenkins. It runs it’s own Java-based webserver to make itself show up at 8080

If Jenkins has bound to the port then Caddy will not be able to. You’ll have to proxy from a different port.

He probably means the inverse… Making Jenkins appear on port 80?

Ah :smile: @MSF-Jarvis, could you please restate your problem clearly?

@DenBeke is partly correct @matt
I do want jenkins to show up at port 80, but at the /jenkins endpoint. I would prefer if I can do something to get HTTPS on there too (It’s your fault, you made me a HTTPS freak ;))

rombox.msfjarvis.me/jenkins

proxy / rombox.msfjarvis.me:8080

This looks 100% hairy, but I’ll give it a go anyways

I’m running this Caddyfile on my build server:

jenkins.oakstrong.be {
        proxy / http://localhost:8080
}

Only problem… Jenkins needs some header mechanisms to support redirection etc. Which I didn’t have time to look up for Caddy, and don’t know if Caddy is even capable of doing so.

didn’t work out for me :frowning:
even my jenkins shitted out :confused:

Elaborate please, I don’t know why this would break things… After all it’s just a reverse proxy.

My bad, not clear. you didnt break it, jenkins on its own accord just resets my password each time I set it up and then I have to do it all from scratch again. using Jenkins 2.7

While setting password using Caddy or directly to Jenkins on port 8080. If it’s the latter, it’s probably one of those redirect issues I mentioned…

My jenkins is password protected, but tends to forget the password and locks me out :stuck_out_tongue_winking_eye:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.