Reverse proxy to django app not working from external computer [SOLVED]

The trouble is that you’re using http://localhost, which tells Caddy "only match requests with the hostname localhost". So when you make a request with a different IP address, Caddy doesn’t know of any way to handle it so it just responds with an empty 200 response.

If you look at your JSON config, you see the routes, you only have one handle paired with a host matcher on localhost. Caddy will try that matcher, it won’t match, then it will fall through without the request being handled. And the default behaviour for that is to respond with an empty 200 response because Caddy “worked as configured”. It’s not actually an error on Caddy’s part, but instead a misconfiguration.

Instead, you can use :80 as your site address instead of http://localhost, which will match any request to port 80.

1 Like