pinchflat icon indicating copy to clipboard operation
pinchflat copied to clipboard

[Triage] Reverse Proxy: 404 inside container

Open jmkgreen opened this issue 7 months ago • 0 comments

Describe the bug I've deployed inside a Docker container with Traefik as the reverse proxy. The environment variable BASE_ROUTE_PATH=/pinchflat is set and can be seen by env within the running container.

The logs on the container show web access activity on /pinchflat but the response is a 404. Traefik itself is very clearly routing the request to port :80 within the container - I'm assuming this is correct.

Curiously found this in the start-up logs (no mention of the prefix):

pinchflat-pinchflat-1  | 2025-04-24 22:13:36.054 [info] | Running PinchflatWeb.Endpoint with cowboy 2.12.0 at 0.0.0.0:8945 (http)
pinchflat-pinchflat-1  | 2025-04-24 22:13:36.055 [info] | Access PinchflatWeb.Endpoint at http://localhost:8945

I've just told Traefik to route to 8945 but I get the exact same. I'm thinking :80 and :8945 are essentially the same within the container?

Note: Traefik is routing to other backends just fine.

Logs:

pinchflat-pinchflat-1  | 2025-04-24 22:08:18.522 request_id=GDldSPWUcmf4XkAAABiH [debug] | Converted error Phoenix.Router.NoRouteError to 404 response
pinchflat-pinchflat-1  | 2025-04-24 22:08:18.523 [error] | #PID<0.2574.0> running PinchflatWeb.Endpoint (connection #PID<0.2573.0>, stream id 1) terminated
pinchflat-pinchflat-1  | Server: hl.redacted.co.uk:80 (http)
pinchflat-pinchflat-1  | Request: GET /pinchflat/
pinchflat-pinchflat-1  | ** (exit) an exception was raised:
pinchflat-pinchflat-1  |     ** (KeyError) key :flash not found in: %{
pinchflat-pinchflat-1  |   reason: %Phoenix.Router.NoRouteError{
pinchflat-pinchflat-1  |     plug_status: 404,
pinchflat-pinchflat-1  |     message: "no route found for GET /pinchflat (PinchflatWeb.Router)",
... the rest upon request ...

jmkgreen avatar Apr 24 '25 21:04 jmkgreen