Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle CF Page build errors #63

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

Carlgo11
Copy link
Member

When the 2fa.directory build failed last week, the redirect script sent users in an infinite loop.
To stop this from happening again, I reworked the redirect script so that the logic now is the following:

  1. If the user's origin region exists on the 2fa.directory, redirect to that region.
  2. If 2fa.directory/int/ returns 200, redirect to /int/.
  3. If all else fails, return the static page /503/. (HTTP 503 - Service Unavailable)
  4. If the redirect script fails, return the static page /502/. (HTTP 502 - Bad Gateway)

I also created a 404 page and increased the caching ttl for existing regions.

@Carlgo11 Carlgo11 added the Code enhancement Enchancements to the website code label Jul 28, 2024
@hkamran80 hkamran80 merged commit b96ff62 into 2factorauth:master Jul 29, 2024
2 checks passed
@Carlgo11 Carlgo11 deleted the rework-redirect-function branch August 2, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code enhancement Enchancements to the website code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants