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

Fix VRMS redirect link without subdomain #70

Open
3 tasks
trillium opened this issue Aug 30, 2023 · 5 comments
Open
3 tasks

Fix VRMS redirect link without subdomain #70

trillium opened this issue Aug 30, 2023 · 5 comments
Assignees
Labels
bug Something isn't working complexity: medium feature: project terraform setup role: Dev Ops Engineer Engineer who maintains and deploys software s: vrms size: 2pt Can be done in 7-12 hours updated

Comments

@trillium
Copy link
Member

trillium commented Aug 30, 2023

Overview

When a user types "https://vrms.io" or "http://vrms.io/" the browser doesn't connect to the website (i.e., if user is missing "www").

Action Items

  • Follow instructions in the devops contributing guide & create a feature branch from main
  • Add resource for A record configuration as shown here
  • partner w/ Chelsey to manually delete the previous A record in AWS
See potential recommended steps below from ChatGPT

The potential problem you're describing is related to DNS (Domain Name System) configuration. `[www.example.com](http://www.example.com/)` and `[example.com](http://example.com/)` are technically different domains from a DNS perspective. When `https://www.example.com/` works but `https://example.com/` doesn't, it usually means that the DNS records for `[example.com](http://example.com/)` (often referred to as the "root domain" or "naked domain") are not correctly set up.

Here are a few things you could check:

  1. Check your DNS records: Ensure that you have an A record or CNAME record set up for [example.com](http://example.com/). If you're using an A record, it should point to the IP address of your server. If you're using a CNAME record, it should point to the correct domain (but note that CNAME records are not allowed on root domains according to the DNS specification, although some DNS providers allow this as an extension).

  2. Check your web server configuration: Your web server (e.g., Nginx, Apache) needs to be configured to respond to requests for both [www.example.com](http://www.example.com/) and [example.com](http://example.com/). This might involve setting up server blocks (in Nginx) or virtual hosts (in Apache) for both domains.

Screenshots "https://vrms.io" Screenshot 2024-04-29 at 9 52 20 PM

"http://vrms.io" Screenshot 2024-05-06 at 7 55 47 PM

Desired Behavior

Navigating to http://vrms.io or https://vrms.io will redirect to: https://www.vrms.io

Resources/Instructions

In order to do this we will need access to the AWS DNS.

@trillium trillium added bug Something isn't working size: 2pt Can be done in 7-12 hours labels Aug 30, 2023
@ExperimentsInHonesty ExperimentsInHonesty changed the title http:/ Fix http:/ not redirecting to https Sep 29, 2023
@JackHaeg JackHaeg changed the title Fix http:/ not redirecting to https Fix VRMS redirect link without subdomain Apr 30, 2024
@chelseybeck chelseybeck transferred this issue from hackforla/VRMS May 16, 2024
@chelseybeck chelseybeck transferred this issue from hackforla/ops May 17, 2024
@tylerthome
Copy link
Member

tylerthome commented Jun 1, 2024

Analysis


The current hosted zone in Route 53 for vrms.io is configured to route traffic differently:

www.vrms.io resolves to the IPv4 address of the incubator-prod load balancer configured in ECS

image

vrms.io has multiple records which is likely causing the behavior:

  • an A record which points to the two IPv4 addresses for the same load balancer endpoint as the www subdomain (highlighted in green)

  • an AAAA record which points to a set of four IPv6 addresses that were unfamiliar (highlighted in red);

image

(these are apparently registered hosts of a subdomain of 1e100.net:)

image


This means clients, like browsers, will hit this other location if they default to using IPv6. Confirmed this locally with curl - notice that using IPv4 returns a 'minified' html/js bundle (i.e. the VRMS app) which is what we want, whereas using IPv6 fails to connect at all:

image

(SSL handshake happens to be where curl breaks, but that's because there is no HTTP application serving at that host at all)


Recommended solution

  1. Remove the AAAA record in AWS. Since our load balancer doesn't provide an IPv6 address, there is no need to replace it with a new record.

  2. Update the existing A record to point to the same hostname that the www subdomain points to, i.e. incubator-prod-lb-569274394.us-west-2.elb.amazonaws.com (or prepend the dualstack subdomain, which is what currently works via IPv4). This can be done one of two ways:

  3. Add the resource to the incubator terraform configuration. This will look similar to the existing CNAME resource for the www subdomain, with the following distinctions:
    * the record must be of type A (as root-level hostnames like vrms.io cannot have CNAME records)

  4. Make the resource terraform-managed. Easiest way to do this is just delete the existing A record in AWS and let the terraform recreate it. Alternatively, you can run a terraform import command to import the existing resource into the state, then terraform will destroy it on its own.

Let me know if I can follow up on any of these, happy to help advise where I can!

@chelseybeck chelseybeck added role: Dev Ops Engineer Engineer who maintains and deploys software s: vrms complexity: medium labels Jun 1, 2024
@github-project-automation github-project-automation bot moved this to New Issue Review in CoP: DevOps: Project Board Jun 27, 2024
@ExperimentsInHonesty ExperimentsInHonesty moved this from New Issue Review to In progress (actively working) in CoP: DevOps: Project Board Jun 27, 2024
@ExperimentsInHonesty

This comment was marked as outdated.

@JackHaeg
Copy link
Member

JackHaeg commented Sep 6, 2024

@trillium I believe this issue may already be fixed, and the desired behavior has been met (Navigating to http://vrms.io/ or https://vrms.io/ will redirect to: https://www.vrms.io/). Please confirm and we can close this issue.

@ExperimentsInHonesty
Copy link
Member

@JackHaeg
Copy link
Member

JackHaeg commented Oct 8, 2024

When a user types "https://vrms.io/" or "http://vrms.io/" the browser connects to the website.

@ExperimentsInHonesty Please close this issue as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working complexity: medium feature: project terraform setup role: Dev Ops Engineer Engineer who maintains and deploys software s: vrms size: 2pt Can be done in 7-12 hours updated
Projects
Status: In progress (actively working)
Development

No branches or pull requests

7 participants