···11+---
22+title: "Site Update: The Big Domain Move To xeiaso.net"
33+date: 2022-05-28
44+tags:
55+ - dns
66+---
77+88+Hello all!
99+1010+If you take a look in the URL bar of your browser (or on the article URL section
1111+of your feed reader), you should see that there is a new domain name! Welcome to
1212+[xeiaso.net](https://xeiaso.net)!
1313+1414+Hopefully nothing broke in the process of moving things over, I tried to make
1515+sure that everything would forward over and today I'm going to explain how I did
1616+that.
1717+1818+I have really good SEO on my NixOS articles, and for my blog in general. I did
1919+not want to risk tanking that SEO when I moved domain names, so I have been
2020+putting this off for the better part of a year. As for why now? I got tired of
2121+internets complaning that the URL was "christine dot website" when I wanted to
2222+be called "Xe". Now you have no excuse.
2323+2424+So the first step was to be sure that everything got forwarded over to the new
2525+domain. After buying the domain name and setting everything up in Cloudflare
2626+(including moving my paid plan over), I pointed the new domain at my server and
2727+then set up a new NixOS configuration block to have that domain name point to my
2828+site binary:
2929+3030+```nix
3131+services.nginx.virtualHosts."xeiaso.net" = {
3232+ locations."/" = {
3333+ proxyPass = "http://unix:${toString cfg.sockPath}";
3434+ proxyWebsockets = true;
3535+ };
3636+ forceSSL = cfg.useACME;
3737+ useACMEHost = "xeiaso.net";
3838+ extraConfig = ''
3939+ access_log /var/log/nginx/xesite.access.log;
4040+ '';
4141+};
4242+```
4343+4444+After that was working, I then got a list of all the things that probably
4545+shouldn't be redirected from. In most cases, most HTTP clients should do the
4646+right thing when getting a permanent redirect to a new URL. However, we live in
4747+a fallen world where we cannot expect clients to do the right thing. Especially
4848+RSS feed readers.
4949+5050+So I made a list of all the things that I was afraid to make permanent redirects
5151+for and here it is:
5252+5353+* `/jsonfeed` - a JSONFeed package for Go
5454+ ([docs](https://pkg.go.dev/christine.website/jsonfeed)), I didn't want to
5555+ break builds by issuing a permanent redirect that would not match the
5656+ [go.mod](https://tulpa.dev/Xe/jsonfeed/src/branch/master/go.mod) file.
5757+* `/.within/health` - the healthcheck route used by monitoring. I didn't want to
5858+ find out if NodePing blew up on a 301.
5959+* `/.within/website.within.xesite/new_post` - the URL used by the [Android
6060+ app](https://play.google.com/store/apps/details?id=website.christine.xesite)
6161+ widget to let you know when a new post is published. I didn't want to find out
6262+ if Android's HTTP library handles redirects properly or not.
6363+* `/blog.rss` - RSS feed readers are badly implemented. I didn't want to find
6464+ out if it would break people's feeds entirely. I actually care about people
6565+ that read this blog over RSS and I'm sad that poorly written feed readers
6666+ punish this server so much.
6767+* `/blog.atom` - See above.
6868+* `/blog.json` - See above.
6969+7070+Now that I have the list of URLs to not forward, I can finally write the small
7171+bit of Nginx config that will set up permanent forwards (HTTP status code 301)
7272+for every link pointing to the old domain. It will look something like this:
7373+7474+```nginx
7575+location / {
7676+ return 301 https://xeiaso.net$request_uri;
7777+}
7878+```
7979+8080+<xeblog-conv name="Mara" mood="hacker">Note that it's using `$request_uri` and
8181+not just `$uri`. If you use `$uri` you run the risk of [CRLF
8282+injection](https://reversebrain.github.io/2021/03/29/The-story-of-Nginx-and-uri-variable/),
8383+which will allow any random attacker to inject HTTP headers into incoming
8484+requests. This is not a good thing to have happen, to say the
8585+least.</xeblog-conv>
8686+8787+So I wrote a little bit of NixOS config that automatically bridges the gap:
8888+8989+```nix
9090+services.nginx.virtualHosts."christine.website" = let proxyOld = {
9191+ proxyPass = "http://unix:${toString cfg.sockPath}";
9292+ proxyWebsockets = true;
9393+ }; in {
9494+ locations."/jsonfeed" = proxyOld;
9595+ locations."/.within/health" = proxyOld;
9696+ locations."/.within/website.within.xesite/new_post" = proxyOld;
9797+ locations."/blog.rss" = proxyOld;
9898+ locations."/blog.atom" = proxyOld;
9999+ locations."/blog.json" = proxyOld;
100100+ locations."/".extraConfig = ''
101101+ return 301 https://xeiaso.net$request_uri;
102102+ '';
103103+ forceSSL = cfg.useACME;
104104+ useACMEHost = "christine.website";
105105+ extraConfig = ''
106106+ access_log /var/log/nginx/xesite_old.access.log;
107107+ '';
108108+};
109109+```
110110+111111+This will point all the scary paths to the site itself and have
112112+`https://christine.website/whatever` get forwarded to
113113+`https://xeiaso.net/whatever`, this makes sure that every single link that
114114+anyone has ever posted will get properly forwarded. This makes link rot
115115+literally impossible, and helps ensure that I keep my hard-earned SEO.
116116+117117+I also renamed my email address to `me@xeiaso.net`. Please update your address
118118+books and spam filters accordingly. Also update my name to `Xe Iaso` if you
119119+haven't already.
120120+121121+I've got some projects in the back burner that will make this blog even better!
122122+Stay tuned and stay frosty.
123123+124124+What was formerly known as the "christine dot website cinematic universe" is now
125125+known as the "xeiaso dot net cinematic universe".