Nginx is an HTTP and reverse proxy server which can also play as a mail proxy server or as a generic TCP/UDP proxy server. Basic HTTP server features include serving static and index files. Nginx also supports keep-alive and pipelined connections. TCP/UDP proxy server features include generic proxying of TCP and UDP as well as load balancing and fault tolerance. Go to https://nginx.org for more information.
How to install and start using Nginx
How to set up Nginx as an HTTP reverse proxy
How to set up Nginx as a TCP reverse proxy
Install Nginx
In this section, you will download, install, and configure Nginx and test the installation. Nginx is available for download at https://nginx.org/en/download.html .
Start Using Nginx
Stop: Forceful shutdown
Quit: Graceful shutdown
Reload: Reload the configuration file
Reopen: Reopen the log files
Start Using Nginx as Reverse Proxy
Nginx is frequently used for setting up as a reverse proxy server. When set as a reverse proxy server, Nginx receives requests, passes them to the proxied servers, retrieves responses from the proxied servers, and sends them back to the clients.
Configurations in Nginx are effected in the nginx.conf file located in the conf path.
Configure HTTP Reverse Proxy
Nginx HTTP Reverse Proxy Configuration
Configure TCP Reverse Proxy
Nginx TCP Reverse Proxy Configuration
Summary
The reverse proxy setup of Nginx can be really useful in load balancing external requests to microservices. Hence I use Nginx to demonstrate many scenarios in this book.