[0:00]Hey, welcome back. Today, we're talking about the best practices to deploy an NGINX reverse proxy. So, there are a lot of good reasons to have an NGINX reverse proxy on your server, especially if you have multiple web servers that are sharing resources. You could have one public IP address and share it amongst multiple web servers. Also, you could have caching built in, and you could also have load balancing and security, like SSL termination. So, an NGINX reverse proxy is a server that sits in front of your web servers and it directs client requests to the appropriate web server. So, in this diagram, you can see that the clients are going to connect to the NGINX reverse proxy. And the NGINX reverse proxy is going to decide which web server to send those requests to. So, the client will never directly connect to the web servers. They will always go through the NGINX reverse proxy. So, one of the first best practices for NGINX is to have proper security. So, one of the ways to do that is to disable any unnecessary modules. So, if you compile NGINX from source, it gives you the flexibility to remove modules that you don't need, thus reducing the attack surface. Also, you're going to want to make sure that NGINX is always up to date. This is very important. If you're using an older version, there could be vulnerabilities that have been discovered that you haven't patched yet. So, make sure you're always checking for updates and updating NGINX as soon as you can. And lastly, you're going to want to make sure that you're using SSL or TLS to encrypt traffic between the client and the NGINX reverse proxy. This helps to protect against man-in-the-middle attacks and other forms of eavesdropping. Another best practice is to configure NGINX for performance. One of the ways to do that is to enable caching. So, NGINX can cache frequently accessed content, such as images, CSS files, and JavaScript files. And this can significantly reduce the load on your backend servers, and it can also improve the response time for clients. Another way to improve performance is to enable compression. So, NGINX can compress responses using GZIP or Brotli. And this helps to reduce the amount of data that needs to be sent over the network, which improves performance. And lastly, you're going to want to enable HTTP/2. So, HTTP/2 is a newer version of the HTTP protocol, and it offers several performance improvements over HTTP/1.1. So, NGINX can be configured to support HTTP/2, which can help to improve the performance of your website. Another best practice is to set up proper logging and monitoring. So, NGINX can be configured to log all requests, and this log data can be used to troubleshoot problems and to monitor the performance of your web servers. And you can also use tools like Prometheus and Grafana to collect and visualize NGINX metrics. And this helps you identify potential bottlenecks and to optimize the performance of your web server. You can also set up alerts to notify you of any critical events, such as high error rates or server downtime. And this helps you to quickly respond to any problems that may occur. So, let's take a quick look at an NGINX configuration file. So, in this example, we're going to open the NGINX configuration file in the sites enabled directory. And you can see here, we have a server block. And the server block is listening on port 80. And we have a server name set to example.com. So, this is the domain name that the NGINX server will respond to. We have the location set to forward slash, which is the root directory. And we're going to proxy pass to an upstream server. And the upstream server is defined above. So, the upstream block is defining a group of backend servers. So, we have the web server set to example.com:8080. So, this is just a single web server that we're proxying to. And you can see that the NGINX reverse proxy is listening on port 80, and it's sending requests to the backend server on port 8080. So, you can see how this setup can be used to hide the backend server from the client. And this is useful for security purposes because the client will never know the IP address or the port number of the backend server. And also, we can add multiple backend servers to this upstream block. So, we can have multiple web servers. And we can also add load balancing to this upstream block. So, we can use the round robin algorithm, or we can use the least connected algorithm. So, if we use the round robin algorithm, NGINX will distribute requests to the backend servers in a round robin fashion. And if we use the least connected algorithm, NGINX will send requests to the backend server with the fewest active connections. So, there are a lot of good options for load balancing in NGINX. So, to summarize, we went over some best practices to deploy NGINX reverse proxies. So, we went over security, performance, and logging and monitoring. And we also took a quick look at an NGINX configuration file. If you found this video helpful, please give it a like and subscribe to the channel. And I'll see you in the next one.

College Basketball Saturday February 21 LIVE Show - Top DFS Plays, Strategy, Props, Picks
Mike’s Money Picks - Fantasy Sports, DFS
4m 50s906 words~5 min read
YouTube auto captions
Transcript source
YouTube auto captions
This transcript was extracted from YouTube's auto-generated caption track. The transcript below is server-rendered so it can be read, searched, cited, and shared without opening the original YouTube player.
Pull quotes
[0:00]So, there are a lot of good reasons to have an NGINX reverse proxy on your server, especially if you have multiple web servers that are sharing resources.
[0:00]Also, you could have caching built in, and you could also have load balancing and security, like SSL termination.
[0:00]So, an NGINX reverse proxy is a server that sits in front of your web servers and it directs client requests to the appropriate web server.
[0:00]So, in this diagram, you can see that the clients are going to connect to the NGINX reverse proxy.
Use this transcript
Related transcript hubs
Watch on YouTube
Share
MORE TRANSCRIPTS


