URL with WWW before it works only on first load Elastic Beanstalk

38 views Asked by At

I ran into an interesting problem today. When accessing my site https://justbookr.com/ with a www in front of the URL in an incognito window in Chrome, the site opens correctly. But after a few refreshes, Chrome throws an error - The web page at https://www.justbookr.com/ might be temporarily down or it may have moved permanently to a new web address..

I am running on Elastic Beanstalk behind a load balancer, and have not set up anything in the deployment config of Beanstalk to handle redirections or anything with www. I have a CNAME record for www.justbookr.com with the value of justbookr.com.

I'm just curious as to why it would work on initial load, and then fail after a refresh? Accessing the site without www works fine all the time.

Why would this happen?

EDIT: I also have a Service Worker --- do I need to set www as well in the Worker?

workbox.routing.registerRoute(/https:\/\/justbookr.com/, workbox.strategies.networkFirst({ cacheName: "JustBookr-production", plugins: [] }), 'GET');

workbox.routing.registerNavigationRoute('/https:\/\/justbookr.com/');
0

There are 0 answers