This guide will cover how to completely uninstall 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.
The Nginx installed from 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 bleeding edge is never the goal of Debian/Ubuntu release schedule, there is still some ways to obtain the latest version of Ngnix.
Nginx's server_name directive indicates the domain name it's listening on. But if non of the server blocks match the incoming request, it will still fall back to the last HTTP/HTTPS server block. So a direct access by IP address will probably caught by some route instead of being dropped, which is often not ideal.
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 reached 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.
According to Google's IPv6 adoption statistics, more than 30% of the Internet users are using IPv6 in 2021. In some countries like France and Germany even have adoption rate over 50%, which made it essential to adopt IPv6 on your website for the international users.
I recently had a very weird issue with Nginx serving static content. A Latin-script letter  keeps showing up in one of my CSS file, and the letters are not in the actual file. It turns out that Nginx doesn't set chartset by default, that's why the characters not in the ISO basic alphabet got decoded to something else.
Nginx came with a rate limit module called ngx_http_limit_req_module, which is quite handy for throttling harmful requests like DoS attack. And the module uses the leaky bucket algorithm to handle the connections, it could allow certain amount of burst requests in a short period of time to suit the use cases.
This guide will help you set up a fully functional Nginx HTTPS server on a Linux machine (Debian/Ubuntu/RHEL/CentOS). Covering automatic renew Let's Encrypt certificates obtained by Certbot and basic settings to enhance security.