A guide to hosting static websites using NGINX

Learn how to host a static website using a VM and NGINX!

Joseph Gefroh
7 min readSep 4, 2017

--

NGINX is a very powerful web server. You can do a ton of things with it, such as setting up reverse proxies or load balancing. It can also be used to host your static website.

Now, keep in mind that there are many options when it comes to hosting static websites nowdays — Github pages, any number of hosting providers, Amazon S3 or Cloudfront, Cloudflare, etc. This is just one option among many.

Like this article? Add me on LinkedIn!

This guide assumes some things:

  • You’re comfortable using Linux.
  • You’re trying to host a basic static website on a VM.
  • You don’t know how to use NGINX.

Step 1: Get a server or a VM.

You’ll need shell access to follow this guide. I recommend a $5/month droplet from DigitalOcean, but it doesn’t really matter where it is.

Step 2: Point your domain name to the new server

Your domain name needs to point to your new server. Create an A record in your hosting provider’s DNS settings, pointing your domain name (eg. jgefroh.com) to the server IP…

--

--

Joseph Gefroh

VP of Product and Engineering @ HealthSherpa. Opinions my own. Moved to Substack. https://jgefroh.substack.com/