Eddie Lee

Thoughts, stories and ideas.

A growing family

Today we welcome a new addition to the family; our daughter Aurora was born this morning at 03:17AM.

Aurora and Ethan

Ethan is very excited and sure to be a great big brother.

Strip the www with nginx

DNS is a pain. The internet is littered with people complaining about "naked domain" problems - where a site responds to "www.mysite.com" but not "mysite.com".

But I have the opposite problem. URLs should be nice to look at - and personally, I'm no fan of the "www." prefix. I want the address of this site to be eddielee.me not www.eddielee.me. However; fact is, people will type "www." and I need to handle that.

Luckily this is quite easy if you're comfortable with DNS and changing a few lines in a config file.

The first thing to do is make sure both the "naked domain" and "www" subdomain are pointing to the right server. To do this set A records for both @ and www to point to your IP address.

Naked domain A record

www A record

Once these have propagated the site should be available at both "www.mysite.com" and "mysite.com".

Now, to remove the "www." and forward the user onto the correct page on the naked domain. E.g. "www.mysite.com/section/page?param=value" to "mysite.com/section/page?param=value".

To do this we need to edit the config for the nginx site; found in the directory /etc/nginx/sites-available. Here an additional server section should be added as follows.

server {  
  server_name www.mysite.com;
  return 301 $scheme://mysite.com$request_uri;

This will 301 redirect any request prefixed with "www." to the same path on the naked domain.

Hello Ghost

I've spent the weekend migrating my blog from its old home on Tumblr to a self-hosted version of Ghost on Digital Ocean. While the $5/month for a Digital Ocean server is more than a free Tumblr account, the advantages are worth it.

Plus, it's been a great opportunity to brush up on my Linux skills.

Introducing Reaction Match 2

For version 2, Reaction Match has been completely redesigned to be more fun than ever. Featuring new game modes, new shapes, new colours, a new design, and new leaderboards - there’s a lot to enjoy.

Reaction Match 2 - Screenshot

Can you master the new mode and top the leaderboard?

Man playing Reaction Match 2

The fantastic new icon was designed by Paul Wallas.

Reaction Match 2 Icon

Reaction Match 2 is available for free on the iOS App Store for iPhone, iPad, and iPod Touch.

Download on the App Store