Closed peracchi closed 5 months ago
Appears to be a misconfiguration and/or bug in Caddy.
The issue you linked to seems to have no relevance to the problem you're having.
@peracchi Can you explain how the Server header is affecting CSS/scripts?
Dear @francislavoie and @mholt , if you can, please take a look at
There is a lot of information there.
I'm still trying to understand what is happening. I even got a behavior on Firefox and another in Edge/Chrome.
I don't think it is a bug. Probably a misconfiguration I have done unintentionally.
Can the behavior of the server be reproduced with curl? If not, it's likely a browser bug.
The bug was a misplaced header Content-Type text/html
in the Caddy configuration, which resulted in duplicate Content-Type
headers in the response.
It's because the header
directive applies immediately, then the reverse proxy copies down the header from the backend, resulting in two.
Aside from what sounds like the proper fix already discovered, if the header
directive were deferred:
header Content-Type text/html {
defer
}
there would be no duplicate. Alternatively, utilizing the proxy's header manipulation config to apply changes to headers coming down from the backend without ambiguity:
reverse_proxy host:port {
header_down Content-Type text/html
}
would also not result in a duplicate header.
On some browsers (Brave/Edge/Chrome) I got:
Refused to execute script from '' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
On Firefox, I got pages without CSS and missing scripts functionalities. But after do a CTRL-F5, CSS/scripts load.
Bellow my
docker-compose.yml
for Zulip:On Caddy side, my
Caddyfile
needs only:Some reference links: