How to use NGINX as a reverse proxy

published 25.06.2020 23:37

by Jack Wallen from
Image of article 'How to use NGINX as a reverse proxy'

With this new configuration file created, we need to activate it by creating a link with the command: sudo ln -s Restart NGINX with the command: sudo systemctl restart nginx How to test the reverse proxy With NGINX now configured as the reverse proxy, open a browser and point it to the address of the server hosting the proxy.

To do this, log in to your Ubuntu Server instance and issue the command: sudo apt-get install nginx -y Start and enable the service with the commands: sudo systemctl start nginx sudo systemctl enable nginx How to create a new NGINX config file We're going to create a brand new default NGINX configuration file.

With this in place, you can gain the following benefits: Single point of access to your servers Simplifies access control tasks Reduce risks to sensitive data Helps achieve compliance Enables transparent maintenance of backend servers Load balancing and failover I'm going to walk you through the process of setting up a very basic reverse proxy, using NGINX.

Although NGINX itself is a web server, it does an outstanding job of serving as a reverse proxy.

Image: Jack Wallen There are two types of proxies that admins typically work with: A forward proxy, or simply "proxy," is used by clients to bypass firewall restrictions, or to serve as a cache server for a LAN A reverse proxy is used to help achieve load balancing and high availability for web servers Obviously, the most important of the two for admins is the reverse proxy.