NGINX is a high-performance Web server, mostly used to serve HTTP requests.

Configuration

Optimization

Access Control

Code Walkthrough

Quick Notes

  1. NGINX reserves a large amount of RAM if worker_connections is set to an unreasonable value.
  2. server_tokens is best turned off to reduce metadata leak and save bandwidth.
  3. Nested locations are a trap where proxy_pass does not get inherited. Avoid them if possible.
  4. Increase proxy_buffers and client_body_buffer_size to save a temporary file read and write, but note that it also increases memory pressure.