How to serve a reverse proxy as a path on an existing domain like

1. My Caddy version (caddy -version):

Caddy v1.0.4 (h1:wwuGSkUHo6RZ3oMpeTt7J09WBB87X5o+IZN4dKehcQE=)

2. How I run Caddy:

As of now bare cmd run

caddy.exe --conf Caddyfile

a. System environment:

Windows 8

d. My complete Caddyfile:

As of now it is

root PATH_TO_MY_INDEX file

proxy /api localhost:8081

3. The problem I’m having:

From the internet the application will be server on and I want to allow the Vue application to make API calls to while the API is actually served at localhost:8081

The real question, after how to accomplish this is to preserve the requested uri, as should be mapped to localhost:8081/myresource bringing with it all the path and query parameters

5. What I already tried:

I am fiddling with proxy and rewrite mods without wrapping my head around how to accomplish this

Hi @Maxiride,

Have you tried something like this? {
  root /path/to/index.html
  proxy /api localhost:8081 {
    without /api

without is a URL prefix to trim before proxying the request upstream. A request to /api/foo without /api, for example, will result in a proxy request to /foo.

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