hackforla / incubator

https://github.com/orgs/hackforla/projects/73/views/5
GNU General Public License v2.0
3 stars 14 forks source link

Fix VRMS redirect link without subdomain #70

Open trillium opened 1 year ago

trillium commented 1 year ago

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

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.

tylerthome commented 5 months ago

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:

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:

    1. 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:

    2. 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!

ExperimentsInHonesty commented 2 months ago

@brittanyms Please provide update

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on."

If you don't want to be assigned to this issue anymore, please unassign yourself and stick it in the new issue approval column (if you have access)

JackHaeg commented 2 months ago

@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 commented 1 month ago
JackHaeg commented 1 month ago

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

@ExperimentsInHonesty Please close this issue as completed.