๐ŸŸฉ Nginx Dictionary

Every keyword, operator, and symbol โ€” with plain-English explanations.

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