Articles about Nginx

Nginx is a powerful web server that can serve as a reverse proxy server.

In this page, you will find articles relating to Nginx. Topics include installing and configuring Nginx on different computing platforms (including Raspberry Pi).

Configuring Nginx for PHP web applications

Nginx and PHP FastCGI Process Manager (FPM) are often used side by side for PHP applications. In such a setting, Nginx will be the first point of contact for incoming HTTP requests, acting as a reverse proxy server for the PHP FastCGI Process Manager.

The PHP FastCGI Process Manager then interprets the HTTP requests that it receives from Nginx and runs the PHP scripts for generating the corresponding HTTP responses for Nginx to return back to the HTTP client.

This post discusses a set of configurations that you can use for configuring Nginx for your PHP web applications.

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.

Building a reverse proxy server with Nginx, Certbot, Raspbian Stretch Lite and Raspberry Pi 3

The Nginx reverse proxy server runs well on Raspberry Pi 3 and you can use it behind a router to route HTTP traffic to upstream web applications.

A Raspberry Pi 3 reverse proxy server is a very useful appliance to help us host multiple websites from home.

Some examples of web applications that you may want to host at home includes:

This post discusses how you can build a reverse proxy server with nginx, Certbot, Raspbian Stretch Lite and Raspberry Pi 3 to proxy HTTP traffic directed at applications on your home network.

Understanding the difference between the root and alias directives in Nginx

Nginx is a web server that is good for serving as a reverse proxy server, load balancer or HTTP cache.

One of the most important task in configuring Nginx to proxy HTTP / HTTPS traffic is telling Nginx where to look for files that it needs for serving HTTP / HTTPS requests.

This posts discusses the root and alias directives that we can use in Nginx configuration files for mapping a url from a HTTP request to a file on the server file system.

How I setup a Raspberry Pi Zero W CCTV camera with motionEye and Raspbian Stretch Lite

I had previously built a Raspberry Pi Zero W CCTV camera with motionEyeOS which was connected to the Wifi network of my old DLink router.

After I started using Linksys AC1900 Dual Band Wireless Router as my home router, I could no longer connect to that Raspberry Pi Zero W CCTV camera.

After reinstalling motionEyeOS a couple of times on my Raspberry Pi Zero W, I determined that motionEyeOS is not suitable for this new Wifi network.

On the other hand, my setup of WordPress on Raspberry Pi Zero W with Raspbian Stretch Lite, nginx, mariadb and PHP was able to connect to my new Wifi network, even after multiple system reboots.

Hence, I figured that if I wanted to build a Raspberry Pi Zero W CCTV camera that can connect to my new Wifi network, I could use Raspbian Stretch Lite as the base operating system and install motionEye for the web frontend to view the camera footage.

This post documents how I setup a Raspberry Pi Zero W CCTV with motionEye and Raspbian Stretch Lite.

Setting up WordPress on Raspberry Pi Zero W with Raspbian Stretch Lite, Nginx, MariaDB and PHP as the LEMP stack

A Raspberry Pi Zero W is a small and capable computer that included a Wi-Fi chip for projects that requires an Internet connection.

Apart from running client programs on the Raspberry Pi Zero W, it is equally capable of being a web server. Since I had a spare Raspberry Pi Zero W lying around the house and there are good reasons to blog as a programmer, I decided to use it as a WordPress server to collect content for a new blog project.

This post documents how I setup WordPress on a Raspberry Pi Zero W with Raspbian Stretch Lite, nginx, MariaDB and PHP as the LEMP stack.

Setting up WordPress on Raspberry Pi 3 with Raspbian Stretch Lite, Nginx, MariaDB and PHP 7 as the LEMP stack

Raspbian Stretch was released on 17th August 2017 and this will mean that we will be able to get a variant of Debian 9 on our Raspberry Pi. With Raspbian Stretch, we will be able to run WordPress or any PHP framework with PHP 7.0 which Zend had indicated a performance boost of up to two folds as compared to PHP 5.6.

Just like the benefits that blogging brings to a programmer, the performance boost that PHP 7 brings about is a good reason for me to port my blog over to PHP 7.

Before porting my blog over to PHP 7, it will make sense for me to perform a little proof of concept on my Raspberry Pi 3 first. With Raspbian Stretch Lite, I can see for myself that my blog runs well with PHP 7.0 before spawning a new Digital Ocean instance for Techcoil.

This post documents how I setup an instance of WordPress on Raspberry Pi 3 with Raspbian Stretch Lite, nginx, MariaDB and PHP 7 as the LEMP stack.

Setting up ProjectSend on your Raspberry Pi 3 for sharing files – the LEMP way

Do you have large files that you want to share with your friends or clients? Do you keep your Internet connection on 24-7?

Compared to using Google Drive, Dropbox or other on-the-cloud file sharing software, hosting your own file sharing software when you never switch off your Internet has a few advantages.

Provided that your friends don’t share your files with others, your files stay at home and on your friends’ machines. Furthermore, you are only limited by the amount of storage that you have on your machine.

If you have a Raspberry Pi 3 in your house, you may want to consider setting up ProjectSend on your Raspberry Pi 3 for sharing files with others. This post shows how to do it with a LEMP stack.

How to enable secured remote management of D-Link DIR series router with Certbot, nginx, Raspbian Jessie Lite and Raspberry Pi 3

If you have a Internet subscription at home, chances are you will have a router that helps to enable computers, big and small, to access the Internet concurrently. To enable my computers to access the Internet concurrently, my Internet service provider gave me a D-Link DIR-868L router which had been serving me well over 2 years.

One way for me to access the router when I was not at home is to enable remote management by checking the Enable Remote Management in the ADMINISTRATION section of the TOOLS tab.

However, this feature activate remote management through HTTP through a designated port. Since HTTP communication is not encrypted, it is not safe for me to use this remote management feature from an unfamiliar network.

Since I had created a reverse proxy server with nginx, Raspbian Jessie Lite and Raspberry Pi 3 and installed Certbot on it, I reckoned that I can enable remote management of my D-Link DIR series router to be performed in a secured manner.

This post documents how to enable secured remote management of D-Link DIR series router with Certbot, nginx, Raspbian Jessie Lite and Raspberry Pi 3.