Issue hosting Single Page React app with proxy

Im trying to host a single page react app with caddy but it isn’t forwarding the requests for the api.

When you connect to example.com/api, it should forward it to django:8000/api, but it just shows the react app instead.

example.com {
    gzip
    log stdout
    errors stdout

    root /app/frontend

    proxy /staticfiles django:8000 {
        transparent
    }
    proxy /api django:8000 {
        transparent
    }
}

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