Nginx - Web Server and Reverse Proxy
This guide provides a comprehensive overview of Nginx configuration and optimization.
Nginx is a powerful, high-performance web server, reverse proxy, load balancer, and HTTP cache. Its event-driven, asynchronous architecture allows it to handle thousands of concurrent connections with minimal resource usage.
default_type application/octetstream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
# Round-robin (by default)
server backend1.example.com:3000;
server backend2.example.com:3000;
Frequently asked questions
What does the directive `proxy_cache_valid 200 60m;` do?
proxy_cache_valid 200 60m;
What does the directive `proxy_cache_valid 404 1m;` do?
proxy_cache_valid 404 1m;
What does the directive `proxy_cache_use_stale error timeout updating;` do?
proxy_cache_use_stale error timeout updating;
What does the directive `proxy_cache_background_update on;` do?
proxy_cache_background_update on;
▶ Try it live
Everything above runs in your browser — open Hash Function Avalanche Visualizer and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.