Search code examples
proxyreverse-proxycaddycaddyfile

Caddy server:multiple proxies for same site


I'm using Caddy to revers proxy some sites on a DigitalOcean Ubuntu droplet.

This is my Caddy file, pretty simple :upside_down:

my-site.com {
  # projects
  proxy /projects/some-project localhost:8998

  # main site
  proxy / localhost:9000
}

other-site.com {
  proxy / localhost:8999 # main site
}

my-site.com and other-site.com are working just fine.

But I'm getting a 404 when trying to access my-site.com/projects/some-project. I've double checked and localhost:8998 works properly on DO.

my-site.com is a Harp.js app, it is catching all the 404 how it is expected, but /projects/some-project is showing the Caddy default 404 message.

Should I work like I expect? Am I missing something?

The question is also posted on the Caddy forum.


Solution

  • Question was answered in the Caddy forum.

    My localhost:8998 expects that path to be its root so the solution was:

    without /projects/some-project