[SOLVED] Cadddy v2 reverse proxy

If the only thing you’re trying to serve is that aoo, then I think a simple reverse proxy should be enough for this site, shouldn’t it? I’m not sure what else you’re trying to serve, so it’s unclear what’s happening.

http://localhost {
    reverse_proxy 192.168.1.2:8001
}

Their docs mention some instructions if running under a subpath:

So you could run this under a subpath if you prefer, as long as you set those env vars when running it. It would look like this:

reverse_proxy /browser/* 192.168.1.2:8001

Note that for when you bring this on with HTTPS, their docs mention:

If you’re using a reverse-proxy setup with SSL termination in front of this application in combination with ENABLE_DELETE_IMAGES=true you must make sure that the application knows about this fact (by sending X-Forwarded-Proto: https in the HTTP headers).

Currently Caddy doesn’t sent that header automatically, but it will as of the next release (you can add it yourself with the header_up subdirective of reverse_proxy in the meantime):

This isn’t necessary, Caddy will fetch and manage its own certificates. Using Let’s Encrypt, it’s not necessary to reuse certificates from old installations. The rate limits are quite generous. It would be more work to try and move the certificates to the exact paths Caddy would expect and even then the contents might not be exactly correct either (wrong key types, etc).

1 Like