NoCache

Preview of Uninstall Nginx Completely on Debian/Ubuntu-Based Linux

Uninstall Nginx Completely on Debian/Ubuntu-Based Linux

Cyrus Kao

This guide will cover how to completely uninstall the Nginx web server (including its dependencies, modules, configuration files and logs) on Debian/Ubuntu-based Linux distros (e.g. Linux Mint, Pop!_OS, Elementary OS). It's useful when you're trying to reinstall a clean Nginx server.

Preview of Install Latest Version of Nginx on Linux (Debian/Ubuntu)

Install Latest Version of Nginx on Linux (Debian/Ubuntu)

Cyrus Kao

The Nginx installed by the package manager (apt) is usually pretty outdated. Currently, v1.20.2 is the stable version of Nginx and Ubuntu LTS 20.04 (Focal) comes with version v1.18.0. Although to stay on the bleeding edge is never the goal of the Debian/Ubuntu release schedule, there are still some ways to obtain the latest version of Ngnix.

Preview of Disable Direct IP Address Access in Nginx on Linux

Disable Direct IP Address Access in Nginx on Linux

Cyrus Kao

Nginx's server_name directive indicates the domain name it's listening on. But if none of the server blocks match the incoming request, it will still fall back to the last HTTP/HTTPS server block. So direct access by IP address will probably be caught by some route instead of being dropped, which is often not ideal.

Preview of Restore Real IP Address From Cloudflare CDN in Nginx

Restore Real IP Address From Cloudflare CDN in Nginx

Cyrus Kao

Cloudflare CDN works just like a reverse proxy, it sits in front of your web servers and forwards client requests to them. So the requests reaching your server actually came from Cloudflare. To restore the original client's IP address, we'll be using ngx_http_realip_module in Nginx to retrieve them from headers.

Preview of Auto-Renew Let's Encrypt Free Certificates for Nginx on Linux

Auto-Renew Let's Encrypt Free Certificates for Nginx on Linux

Cyrus Kao

More than 75% of all websites use HTTPS nowadays. Serving content over HTTPS is not only good practice for search engine optimization (SEO), but essential for security reasons, especially for those requests containing sensitive information.