Tag archive for: static files

How to host a static website on your Raspberry Pi Zero W with Raspbian Stretch Lite and Nginx web server

After you capture the Northern Lights with an entry level DSLR, you may want include them in your personal portfolio. Until you find the time to setup a content management system for your personal portfolio, you want to keep it as a static website.

At this point in time, you saw that Raspberry Pi Zero W and cover lying on the table. In addition to that, you have a spare micro USB charger that you used for charging your old Android phone.

Since you do not have any other use for these items, you decided to host your personal portfolio on that Raspberry Pi Zero W.

With this intention, this is how you can host a static website on your Raspberry Pi Zero W with Raspbian Stretch Lite and Nginx web server.

Configuring Nginx to serve files for a static website

In the world of HTTP, static files are content hosted on a web server that does not change. Some examples of static files include images, CSS files, JavaScript files and HTML files.

Although it is not too hard to implement a dynamic website through a content management framework like WordPress on your own server, there are cases where it makes more sense to just host a couple of static files to realise your website.

Nginx is an excellent web server for serving static websites. If you already have Nginx running on a Raspberry Pi 3 or any other kinds of server, you may want to configure it to serve files for your static website.