Skip to content

Caddy responds 200 for unmatched routes #4026

@jeyemwey

Description

@jeyemwey

Hey, I'm not sure if this is a bug per se, but it's certainly surprising behavior: I have a caddy v2 server with this caddyfile:

subdomain.example.com {
  reverse_proxy /api/* http://127.0.0.1:8080
}

As expected, any request to /api/* is forwarded to my backend server on :8080. However, a request to /something_else/ is responded with a 200 OK and Content-Length: 0.

This response is very surprising to me, I would have either expected a 404 Not Found or a 503 Service Unavailable response, indicating that the route was not matched. 200 OK is almost certainly not the right move here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalid ❓This doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions