matrix-public-archive/server
Eric Eastwood 55f1867c68
Prevent Cloudflare from overriding our own 504 timeout page (#228)
Explored in https://gitlab.matrix.org/matrix-public-archive/deployment/-/issues/2 (internal deployment issue)

> Cloudflare returns an Cloudflare-branded HTTP 502 or 504 error when your origin web server responds with a standard HTTP 502 bad gateway or 504 gateway timeout error:
>
> *-- https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#502504-from-your-origin-web-server*

<img src="https://github.com/matrix-org/matrix-public-archive/assets/558581/46f6d88c-ba53-4efb-809f-3f331bf9b799" width="400">


The only way to disable this functionality is to have an Enterprise Cloudflare plan and use the `Enable Origin Error Pages` option:

> **Enable Origin Error Pages**
>
> When Origin Error Page is set to “On”, Cloudflare will proxy the 502 and 504 error pages directly from the origin.
>
> Requires Enterprise or higher

So instead of dealing with that headache, we're just working around this by responding with a 500 error when we timeout. Should be good enough I think. The user won't know any difference but may affect what Search Engines think. Not sure search engines care about the distinction since the page is slow to respond anyway which they punish.
2023-05-11 16:24:58 -05:00
..
child-process-runner Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
hydrogen-render Add image metadata for URL previews (#224) 2023-05-10 00:50:12 -05:00
lib Add image metadata for URL previews (#224) 2023-05-10 00:50:12 -05:00
middleware Prevent Cloudflare from overriding our own 504 timeout page (#228) 2023-05-11 16:24:58 -05:00
routes Better grammar in URL preview description (#225) 2023-05-10 01:12:49 -05:00
tracing We can better detect static assets to avoid tracing nowadays (#207) 2023-05-02 00:55:22 -05:00
server.js Enable tracing by config so we can enable from argv, env variable, or config file (#41) 2022-07-14 11:26:53 -05:00
start-dev.js Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00