How to, uh, update your blog
- Remember the domain name you picked 10 months ago.
- Type the domain name into the nav bar of preferred browser.
- Get a 404 that looks familiar. Okay, nginx is working, server is still up. Great, so what gives.
- Maybe let’s try logging in to the server that’s supposed to be running this page. What was that server again?
- Log into the web portal where you have a handful of boxes running things that you can’t remember. Which one of these is running the website?
- Check the DNS section of the web portal, note down the IP address corresponding to the A/AAAA records.
- Go back to look at that handful of boxes again. Find the box of interest. Try logging in to the box.
- Login works, we even have an ssh alias set up, thanks previous self.
- Poke around a bit, directories look right, nginx conf looks solid.
- Think a bit.
- Try remembered domain name prepended with https i.e. https://{domain}
- Success, things look right. What happens if we try https://www.{domain}?.
Huh. Looks wrong. Whats up with that? It’s like I’ve got no, style, or something.
- Open up the inspector to see if it has anything to say.
- Well that’s a suspicious looking exclamation point.
- Looks like the stylesheet won’t load because of CORS. Hmmm…
- Recall that there’s something in the static site generator conf about a base url or something.
- Change the base_url to https://www.{domain}. That works, but now without the www doesn’t, same deal,no CORS allowed.
- Try something off the internet with .htaccess file
- Learn that nginx doesn’t support .htaccess. Great….
- Mess with the nginx config trying to get CORS to work, no luck.
- Move some redirects around in the nginx config. End up with a circular redirect loop.
- Experiment, eventually get the redirects right after understanding a bit better how the nginx config works with multiple ‘servers’ handling http and https separately; redirecting www or http -> https. Ended up needing to add a redirect in the https server to redirect https://www -> https://{domain}