Is it possible to serve two different applications on the same origin but different paths?

1. My Caddy version (caddy -version):

v2

a. System environment:

windows server 2019, except for Caddy which is installed on the host all the other services and applications are run in docker containers.

3. The problem I’m having:

It’s not a problem (yet), I’d like to understand if and how I could serve two different services on the same origin.

I have two docker containers:

  • one running a Vue SPA + nginx
  • one running a Go application exposing a set of API for the SPA to use

On the host machine there is a caddy webserver which fundamentally reverse proxies the two containers to domain1.com and api.domain1.com.

I’d like to understand if and how I could change this setup so that the website is served via domain1.com and the API on domain1.con/api

This could save me some hassle with browsers CORS policy and some authentication settings.

5. What I already tried:

I tried to dig the documentation without grasping concepts I could make use of.

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