๐ฉ Nginx Dictionary
Every keyword, operator, and symbol โ with plain-English explanations.
server server-blocksA top-level container for the server block definition
server { ... }location location-blocksA directive that defines a URI path for the server block
location / { ... }listen server-blocksA directive to define the IP address and port for the server to listen on
listen 80;
server_name server-blocksA directive to specify the host name or IP address for the server block
server_name example.com www.example.com;
root server-blocksA directive to define the document root directory for the server block
root /var/www/html;
index coreDefines files to use as an index when a URI ends with a slash
index index.html index.htm;
include coreIncludes another file or files matching a mask into the configuration
include /etc/nginx/mime.types; include /etc/nginx/conf.d/*.conf;
proxy_pass proxyA directive to specify the backend server to which the request should be proxied
proxy_pass http://backend;
proxy_set_header proxyA directive to set headers to be passed to the backend server
proxy_set_header Host $host;
ssl_certificate sslA directive to specify the SSL certificate file for the server block
ssl_certificate /etc/nginx/ssl/example.com.crt;
proxy_cache proxyDefines a shared memory zone used for caching responses
proxy_cache my_cache; proxy_cache_valid 200 1d;
ssl_certificate_key sslA directive to specify the SSL certificate key file for the server block
ssl_certificate_key /etc/nginx/ssl/example.com.key;
upstream upstreamA directive to define a group of backend servers that can be used as a single entity
upstream backend { server 127.0.0.1:8080; }return server-blocksA directive to return a response to the client without further processing
return 200 "OK";
rewrite rewriteA directive to modify the URI path of the request
rewrite ^/old/(.*)$ /new/$1 permanent;
access_log loggingA directive to specify the location of the access log file for the server block
access_log /var/log/nginx/access.log;
ssl_protocols sslEnables the specified SSL/TLS protocols
ssl_protocols TLSv1.2 TLSv1.3;
error_log loggingA directive to specify the location of the error log file for the server block
error_log /var/log/nginx/error.log;
gzip gzipA directive to enable gzip compression for the server block
gzip on;
gzip_types gzipA directive to specify the MIME types for which gzip compression should be applied
gzip_types text/plain text/css application/json;
add_header headersA directive to add custom HTTP headers to the response
add_header Cache-Control "no-cache";
try_files coreChecks files in order and serves the first found, or redirects to the last
try_files $uri $uri/ /index.html;
error_page coreDefines the URI shown for specified HTTP error codes
error_page 404 /404.html; error_page 500 502 503 504 /50x.html;
expires headersA directive to set the cache expiration for static files
expires 1d;
limit_req rate-limitingA directive to set rate limiting for the server block
limit_req zone=one burst=5 nodelay;
limit_conn rate-limitingA directive to set the maximum number of simultaneous connections from a client
limit_conn zone one;
client_max_body_size coreSets the maximum allowed size of the client request body
client_max_body_size 10m;
keepalive_timeout coreSets a timeout during which a keep-alive client connection stays open
keepalive_timeout 65;
worker_processes mainSets the number of worker processes; auto uses the number of CPU cores
worker_processes auto;
worker_connections eventsSets the maximum simultaneous connections per worker process
events {
worker_connections 1024;
}fastcgi_pass fastcgiSets the address of a FastCGI server, used with PHP-FPM
fastcgi_pass unix:/run/php/php8.1-fpm.sock;