Now if you look you'll see I wasn't able to achieve this with my Github. The reason is actually pretty similar to the above, Github Pages ask you to add a CNAME record your custom domain to username.github.io, when the traffic arrive it checks the domain of the request and presents that page. This means I was able to use a reverse proxy to pull my central development page using the URL https://cmdshell.uk/dev Unfortunately I have a documentation page for each of my repositories that can be found at username.github.io/repo . The sub-folder repo is not a part of the domain so you cannot point a CNAME at it, it must be requested from within the page, a proxy attempt to point you at the sub-folder will still use the same domain and so will be mistaken for the main page. Additionally the domain the CNAME points to automatically redirects to the custom domain you set in the main repo, ultimately rendering this problem more hassle than it is worth.
Now I've wrestled with this beast before, which brings us nicely to the explanation on leased domains I promised you. So if you've ever set up a website before, maybe you went to someone like Squarespace, paid a fee and received a skeleton of a website to work form, that's how most people do it. I am not like most people, I've spent much of my life very poor, and as such have become quite the stingy miser, so that's not how I would set about building a website. The first job I got in IT was building LAMP stacks for development projects, it was a simple, and backwards task, but one I could do and became very good at. With a history like that and working in cloud infrastructure you can imagine I know a lot about how a web server actually works, and you'd be right. To build a website cheaply you mostly need to be willing to do the work yourself, first you need a computer, then most of the software is free on the open market, you just have to configure it. Where the "free" philosophy falls down is when you put it on the internet, you can put the website up on an IP which you will already have, but if you want people to visit it you need a name, preferably a memorable one, and that requires a domain provider.
Providing domains requires two things, reputation, and hardware, the latter is optional. This means domains usually cost money, otherwise nobody would risk their reputation vouching for you, which is essentially what domains are all about. In steps Freenom, who give out domains for free. Let me start by explaining how that is possible. Assume you are a small island nation, population of only a few thousand, and they're mostly farmers. You don't really have much need for the internet as your IT infrastructure is poor at best, but one of your advisors approaches you and tells you the rest of the world is leaving you behind, what little trade you have is leaving and how are you ever to invite tourism if you can't get big business interests? We need a domain he says, so you speak to ICANN and they assign you the top level country code .you, nice, now what?
There's only like 2 IT based companies on the island, its just one man fix-it shops, what are they going to do with a country code? The following day you're at the convention for small islands and Tokelau approaches you telling you they know how to market that domain so they put you in touch with Freenom. They explain, you don't need the domain, but its a valuable part of your identity and there are countless people that do need domains, individuals, charitable organizations, small businesses, they all need domains but having one is an annoying expense they may not be able to afford. So the solution is let them have a domain under your TLD for free, while it might seem like you're giving it away it will raise the profile of your domain and country with increasing traffic to and from it, eventually it will develop your IT and business infrastructure as people realize there is fertile green land out here interested in developing its tech sector.
So that's basically how it works, they provide domains, in return for raising their profile, in fact the .tk domain benefitted hugely from this by being careful to choose regulations that benefited their needs. So previously I have used Freenom domains to run websites at minimal cost, only mid-July I finally had a good idea for a domain for this website, I went to Freenom to register only to find registry was closed. It took a good deal of searching to find out why. Eventually I found this, it took me a little while to validate the claims given there has been zero communication from Freenom on this, but it looks to be true. In fact it seems to me given how long it has gone on already that they intend to cease trading on the free domains permanently, possibly due to financial issues, given they are a charitable organization.
Now I don't think Meta is entirely wrong, I've seen for myself the huge amount of malicious and nefarious botnets and the like operating within these free domains. They are undoubtedly a scourge, but what concerns me is at what cost do we pursue them like this? I was able to buy a domain out of my own pocket, but I doubt that is true for most of the legitimate users of Freenom. I could go into much more detail on it than this, but I'm no expert and to attempt a blow for blow deconstruction would be disingenuous given I can't respond to the claims of suspect practices within Freenom. I do however want to highlight and draw attention to the fact that Meta a huge company making large amounts of revenue that has proven it has many cases of malpractice at its core and sees itself as "owning" the internet is essentially burying a smaller charitable organization and denying countless individuals from building their own website. If nothing else I feel it flies in the face of the ideals the internet was built upon, it is not a corporate controlled market as they treat it, but an open forum for everyone to communicate with each other, I'll leave it to you to decide if you feel our rights as citizens of the internet have been impugned.
Anyway, evangelism aside, Freenom give domains for free. Normally when you buy a domain it becomes yours, you can move it wherever you like and the provider cannot stop you. With Freenom free domains, you lease the domain, it is still theirs, but they hold it for you. This means I couldn't move my old domains to another provider, and Freenom prevented me setting up a wildcard for the domain. This meant I couldn't essentially pass the entire domain to my server to use making it immensely difficult to set up any sort of proxying. Sometimes when you're trying to set up a thing, it seems like everything is out to get you. Through all the above issues and more I've learned it's important to know when to give up, it really is like opening a can of worms. Though that's all the problems that come to my mind right now, don't set up you own web server kids, it's bad for your health!