So, you want to use username@personaldomain.example as a Mastodon profile, but don't want to run an instance with a single user? Webfinger to the rescue! If you run your own web server, or have control over it, you can set up a webfinger implementation that should transparently work with Mastodon to let people follow you regardless of which instance you're actually on.
For a great guide to doing this for Apache, please see Erik's post. This guide is about doing the same for nginx.
First, make sure that you have the nginx javascript module (njs) installed. We need the javascript module in order to be able to easily extract a urldecoded query string parameter. On Ubuntu this is a matter of running:
# apt-get install nginx-module-njs