nodejs / release-cloudflare-worker

Infra for serving Node.js downloads and documentation.
https://nodejs.org/dist
MIT License
22 stars 5 forks source link

need to redirect to trailing slash when serving index.html #25

Closed MoLow closed 1 year ago

MoLow commented 1 year ago

see https://dist-worker-prod.nodejs.workers.dev/api is broken, it should add a redirect to https://dist-worker-prod.nodejs.workers.dev/api/

ovflowd commented 1 year ago

Same for /metrics; We need to have a rule that if the URL is a directory, it should redirect to the same URL with trailing slash.

ovflowd commented 1 year ago

For example, if you do curl https://nodejs.org/dist it'l give you a moved permanently one to /dist/

targos commented 1 year ago

As a reference, most of the exsting rules are defined here: https://github.com/nodejs/build/blob/main/ansible/www-standalone/resources/config/nodejs.org?plain=1

ovflowd commented 1 year ago

As a reference, most of the exsting rules are defined here: nodejs/build@main/ansible/www-standalone/resources/config/nodejs.org?plain=1

Yeah, we're aware of that. Some of these rules are now incorporated directly on Cloudflare, others on Vercel (the ones that are website redirects)

So, what is left now is just the / directory slash termination. Since we already configured on the worker the current location rules from NGINX. (the ones for entry points, such as /metrics, /dist, /download, /api, /docs)

Everything else by as right now is already properly configured either on Cloudflare with Redirect Rules or Origin Rules or on Vercel via https://github.com/nodejs/nodejs.org/blob/main/redirects.json