diff options
author | Martin Ashby <martin@ashbysoft.com> | 2022-10-14 23:22:45 +0100 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2022-10-14 23:22:45 +0100 |
commit | b55462fdcc57a5890108521749c467d23dabff12 (patch) | |
tree | d22792b1426359abce3072c224987ac8e5a16cbd /content | |
parent | 734300b259f9d10c8ea685b8e02b2dd062c3d75a (diff) | |
download | mfashby.net-b55462fdcc57a5890108521749c467d23dabff12.tar.gz mfashby.net-b55462fdcc57a5890108521749c467d23dabff12.tar.bz2 mfashby.net-b55462fdcc57a5890108521749c467d23dabff12.tar.xz mfashby.net-b55462fdcc57a5890108521749c467d23dabff12.zip |
New posts on caddy web server and SPA blogsite
Diffstat (limited to 'content')
-rw-r--r-- | content/posts/2022-10-14-blogsite.md | 10 | ||||
-rw-r--r-- | content/posts/2022-10-14-caddy.md | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/content/posts/2022-10-14-blogsite.md b/content/posts/2022-10-14-blogsite.md new file mode 100644 index 0000000..29a7520 --- /dev/null +++ b/content/posts/2022-10-14-blogsite.md @@ -0,0 +1,10 @@ +--- +title: "Blogsite" +date: 2022-10-14T22:59:01+01:00 +draft: false +--- + +I was thinking about this blog and how it's set up. I [covered](posts/2021-10-01-blog/) the setup in a previous post, but it's quite simple: the site is generated from markdown files with [hugo](https://gohugo.io/) and published to git. The server pulls from git on a schedule, rebuilds it and copies it to the web server directory. + +I made a [little experiment](https://blogsite.mfashby.net/1-hello-new-blog) with a different approach [source](https://code.mfashby.net/martin/blogsite). Instead of statically generating the site, it's a Single Page Application which does the templating and routing on the client side. In theory this has a couple of upsides: if you visit multiple pages fewer bytes are transferred overall, and it totally removes the static site generation step; the folder is all just static content provided to the web server. This approach likely has some downsides too, like; requires javascript enabled client, no RSS feed or sitemap generation, and my implementation at least is relying on some fairly modern JS features like async/await and fetch API. + diff --git a/content/posts/2022-10-14-caddy.md b/content/posts/2022-10-14-caddy.md new file mode 100644 index 0000000..0074a04 --- /dev/null +++ b/content/posts/2022-10-14-caddy.md @@ -0,0 +1,11 @@ +--- +title: "Caddy" +date: 2022-10-14T22:58:22+01:00 +draft: false +--- + +I switched to [caddy](https://caddywebserver.com) from nginx. Caddy has a 'simpler' configuration syntax, and offers built-in automatic TLS support with letsencrypt. I've also enabled automatic TLS support in [maddy](https://maddy.email) mail server, and I have been able to remove certbot entirely from my home server and disable the cron job that refreshed certs! + +The switch wasn't as painful as I thought it might be. It took about 45 minutes to read the caddy docs and port my existing nginx configuration over. Most of my sites are either simple static sites, or reverse proxies to other apps running their own web servers. + +This switch was prompted by a problem I've caused on my blog; I have put some large resources at my webserver root (e.g. /fooimage.jpg) instead of in a subfolder. In order to maintain external links, I wanted to move the images, and setup a permanent redirect to their new location. This is relatively difficult in nginx, and should be simpler in caddy. |