5 ms·
For static websites, is there any reason not to host them on GitHub? Since GitHub Pages lets you attach a custom domain, it seems like the perfect choice. I w
by mg 5y ago
For static websites, is there any reason not to host them on GitHub?
Since GitHub Pages lets you attach a custom domain, it seems like the perfect choice.
I would expect their CDN to be pretty awesome. And updating the website with a simple git push seems convenient.
- tekromancr 5y agoCan you do SSL?
- dewey 5y agoYes, since 2018.
- qbasic_forever 5y agoI don't think you can set a page or URL on github to return a 301 moved permanently response or similar 3xx codes. This can really mess up your SEO if you have a popular page and try to move off github, you'll basically lose all the clout on the URL and have to start fresh. It might not matter for stuff you're just tossing out there but is definitely something to consider if you're putting a blog, public facing site, etc. there.
- nobodywasishere 5y agoI have a few 301 redirects setup on github pages $ curl https://nobodywasishere.github.io # moved to https://blog.eowyn.net <html> <head><title>301 Moved Permanently</title></head> <body> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx</center> </body> </html> $ curl https://blog.eowyn.net/vhdlref-jtd # moved to https://blog.eowyn.net/vhdlref <html> <head><title>301 Moved Permanently</title></head> <body> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx</center> </body> </html>
- qbasic_forever 5y agoIs that coming back with a HTTP 200 response though and the made up HTML page? That doesn't seem right... at least, I dunno if google and such would actually index your page at the new URL vs. just thinking "huh weird looks like blog.eowyn.net is now called '301 Moved Permanently', better trash that down in the rankings".
- cptskippy 5y agoIt shows up as a proper 301 when I load up the URL in Firefox. The question is, how?
- qbasic_forever 5y agoWow, nice yeah I'd love to know how github supports configuring a URL to 301 redirect!
- MD87 5y agoOne of the Jekyll plugins that GH Pages supports[0] is jekyll-redirect-from, which lets you put a `redirect_to` entry in a page's front matter. [0]: https://pages.github.com/versions/ https://pages.github.com/versions/
- simonw 5y agoI found this example of another repo that is using the same trick: https://github.com/kotokaze/kotokaze.github.io https://github.com/kotokaze/kotokaze.github.io ~ % curl -i 'https://kotokaze.github.io/' HTTP/2 301 server: GitHub.com content-type: text/html permissions-policy: interest-cohort=() location: http://github.kotokaze.net/
- nobodywasishere 5y agoFor the latter, `<meta http-equiv="refresh" content="0; URL=https://blog.eowyn.net/vhdlref https://blog.eowyn.net/vhdlref" />` in the `<head>`
- 5y ago
- throwaway894345 5y agoI'm sure their CDN is great, and I've used it in the past; however, I like to self-host as a hobby.
- coding123 5y agoWell, not everything is open source.
- marban 5y agoNetlify FTW — For the rewrite rules alone.
- _-david-_ 5y ago>For static websites, is there any reason not to host them on GitHub? One reason would be if your site violates the TOS or acceptable use policy. GitHub bans "excessive bandwidth" without defining what that is for example. For a small blog about technology you are probably fine.
- jason0597 5y ago> is there any reason not to host them on GitHub? Because some people may not want to depend even more on Big Tech (i.e. Microsoft) than they already do
- marginalia_nu 5y agoWanting to own your own web presence is reason not to host them on GitHub. For static websites, CDNs are largely unnecessary. My potato of a website hosted from a computer in my living room has been on the front page of HN several times without as much as increasing its fan speed. It took Elon Musk tweeting a link to one of my blog posts before it started struggling to serve pages. I think it ran out of file descriptors, but I've increased that limit now.
- lostlogin 5y agoAre you able to describe how you run yours? I scummed your blog but didn’t see anything about it.
- marginalia_nu 5y agoThe static content is just nginx loading files straight off a filesystem. The dynamic content (e.g. the search engine) is nginx forwarding requests to my Java-based backend.
- Dma54rhs 5y agoYou can serve massive amount of static requests from any potato really, it's a solved problem.
- flatiron 5y agoWas it through a VPN? I feel like revealing my home IP to random people on the internet is a bad move.
- marginalia_nu 5y agoNo VPN. I have the ports fairly well tightened down, though. I'm exposed to a zero-day in iptables itself or something, but whatever. Even if someone got in it would be an inconvenience at worst. It's not like I'm making money off this stuff.
- enriquto 5y ago> For static websites, is there any reason not to host them on GitHub? I don't like github pages because it's quite slow to deploy. Sometimes it takes more than a couple of minutes just to update a small file after the git push.
- naet 5y agoOnce you've used a couple more static hosts you'll find that gh pages is a second tier host at best. Lacks some basic configuration options and toolings, can be very slow to update or deploy, the cdn actually isn't as good as others, etc. Github pages is great for hobby projects and if you're happy with it by all means keep using it... but I wouldn't ever set up a client's production site on it. If you're curious, Netlify is one popular alternative that is easy to get in to even without much experience. I would say even at the free tiers Netlify is easily a cut above Github for static hosting, and it hooks into github near perfect straight out of the box if that is something you value.