Nginx Configuration Cheat Sheet

A quick reference for common Nginx configuration directives.

DirectiveDescription
serverDefines a virtual server.
listenSpecifies the port number.
server_nameSets the server name.
rootSets the root directory for requests.
locationDefines how to process requests for specific files and URIs.

DirectiveDescription
proxy_passForwards requests to another server.
proxy_set_headerSets headers for the proxied request.