1. Caddy version (caddy version
):
Devel
2. How I run Caddy:
I use a caddyfile in my project’s directory. I want to reverse proxy my frontend dev server to example.com and my backend dev server to api.example.com, so I can keep credentials.
a. System environment:
macOS (Darwin) Monterry
installed caddy with homebrew
populated mime files (so locate mime works fully)
b. Command:
sudo caddy run
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
localhost {
reverse_proxy / localhost:3000
}
3. The problem I’m having:
I do not get a Content-Type header on any of the responses:
GET /
> GET / HTTP/2
> Host: localhost
> user-agent: curl/7.77.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 200
< access-control-allow-origin: *
< content-type: text/html
< date: Wed, 10 Nov 2021 23:58:42 GMT
< etag: "uhl6ls"
< permissions-policy: interest-cohort=()
< server: Caddy
<
{ [5926 bytes data]
100 69622 0 69622 0 0 1573k 0 --:--:-- --:--:-- --:--:-- 1942k
* Connection #0 to host localhost left intact
and my html is sent back fine.
If I try GET /.svelte-kit/dev/runtime/internal/start.js
> GET /.svelte-kit/dev/runtime/internal/start.js HTTP/2
> Host: localhost
> user-agent: curl/7.77.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 200
< server: Caddy
< content-length: 0
< date: Thu, 11 Nov 2021 00:01:44 GMT
<
{ [0 bytes data]
and on the original port:
> GET /.svelte-kit/dev/runtime/internal/start.js HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Content-Type: application/javascript
< Cache-Control: no-cache
< Etag: W/"7317-UkQK1ywFABk5Fa3QUizL7LYMeA8"
< Date: Thu, 11 Nov 2021 00:01:59 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Content-Length: 29463
<
{ [29463 bytes data]
The latter has the Content-Type header, which I need.
4. Error messages and/or full log output:
5. What I already tried:
I’ve populated my MIME entries.
I’ve built caddy from source
I’ve installed caddy from home-brew and the GitHub