I’m hosting a mirror of a service called BreezeWiki (which is an alternative front-end for fandom.com).
There are many mirrors for BreezeWiki hosted, but only 2 of them are running on Caddy, as far as I can tell (bw.projectsegfau.lt and bw.artemislena.eu). I’ve actually communicated with the administrators of one already to compare setups and there’s nothing that really sticks out.
Anyway.
You can observe the problem by going to all three of these links:
Can you see the problem? Even though a request to fandom.com’s static server (static.wikia.nocookie.net) is being made on all three websites, you only get a 404 from the first one, mine. The only difference I can see is that images have the wrong mime type (I get image/jpeg on something that should be image/webp, for example).
If I access my hosted version via ip:port on my LAN, then there’s no issues, so I can only assume Caddy is somehow doing…something.
While communicating with some admins above, I threw together a gist of my config stuff, just in case anything stands out: BreezeWiki - Opengist
Whoa, damn, that’s amazing, thanks for mentioning this exists I just set up a redirect rule with a browser extension I was already using to redirect *.fandom.com to *.breezewiki.com
Comparing the non-working and working sites, it looks like requests from yours are using “Referrer Policy strict-origin-when-cross-origin” whereas the working one is using “Referrer Policy: same-origin”.
The request headers when non-working include the Referer header with your own domain name. I think the wikia CDN rejects those requests when it has a Referer it doesn’t recognize.
You have this header set in your Caddyfile: Referrer-Policy "strict-origin-when-cross-origin", you should remove this, I think. In fact, you should probably remove the entire (headers) snippet, it’s not helping you. You should only ever set headers like this if you know what they mean and do.
Whoa, damn, that’s amazing, thanks for mentioning this exists I just set up a redirect rule with a browser extension I was already using to redirect *.fandom.com to *.breezewiki.com
I’m glad we can all unite in our hatred dislike of Fandom.
Comparing the non-working and working sites, it looks like requests from yours are using “Referrer Policy strict-origin-when-cross-origin” whereas the working one is using “Referrer Policy: same-origin”.
The request headers when non-working include the Referer header with your own domain name. I think the wikia CDN rejects those requests when it has a Referer it doesn’t recognize.
You have this header set in your Caddyfile: Referrer-Policy "strict-origin-when-cross-origin", you should remove this, I think.
Aha! Good catch. That seems to be it. Thanks!
In fact, you should probably remove the entire (headers) snippet, it’s not helping you. You should only ever set headers like this if you know what they mean and do.
I’ve read the entire MDN page for each thing and been using them for years (including on nginx prior to this). This is the first time this has ever come up. Lesson learned to investigate headers a little more closely next time.
Edit: If anything I’ve set is just doing the same thing Caddy already does by default, then I’m happy to remove a line or two. But I don’t really want to lose, say, XSS protection, as that’s rather important.