Configuration reference
Directives, syntax and valid contexts. Straight to the setting.
296 documented directives
This reference covers the entries below. Optional modules depend on your build. Validate with xinginx -t; use syntax & inheritance for file structure.
absolute_redirectControls absolute redirects generated by xin.access_logSelects the access-log destination and format.add_headerAdds a response header.add_trailerAdds a response trailer.aliasReplaces the matched location with a filesystem path.allowAllows requests from matching client addresses.auth_basicProtects a scope with HTTP Basic authentication.auth_basic_user_fileLoads credentials for HTTP Basic authentication.auth_delayDelays unauthorized responses.auth_requestAuthorizes requests using a subrequest.auth_request_setCaptures a value after the authorization subrequest.autoindexEnables directory listings.breakStops the current rewrite sequence.check_pending_bytesChecks for pending bytes before reusing an upstream connection.client_body_buffer_sizeSets the in-memory request-body threshold before spilling to disk.client_body_temp_pathSets the request-body spill directory.client_body_timeoutSets the maximum gap between reads of a client request body.client_header_buffer_sizeSets the initial request-header buffer size.client_header_timeoutSets the timeout for reading the request header.client_max_body_sizeLimits the size of a client request body.cloudflare_tunnelConnects xin to Cloudflare as a tunnel connector.daemonControls background operation.default_typeSets the fallback response content type.denyDenies requests from matching client addresses.disable_symlinksControls symbolic-link traversal for file access.error_logSelects the error-log destination and minimum severity.error_pageRoutes error responses to a URI or named location.etagControls ETag generation for static responses.eventsContains connection settings.expiresSets expiration and cache-control response headers.fastcgi_cacheFASTCGI: Selects the response-cache zone.fastcgi_cache_background_updateKeeps the unsupported CGI cache refresh mode disabled.fastcgi_cache_bypassFASTCGI: Skips reading the cache when any condition is nonempty and not zero.fastcgi_cache_keyFASTCGI: Defines the cache key.fastcgi_cache_lockFASTCGI: Serializes requests filling the same cache entry.fastcgi_cache_lock_ageFASTCGI: Allows another fill after the current fill exceeds this age.fastcgi_cache_lock_timeoutFASTCGI: Sets how long a request waits for a cache fill.fastcgi_cache_max_range_offsetFASTCGI: Limits the starting range offset eligible for caching.fastcgi_cache_methodsFASTCGI: Selects request methods eligible for caching.fastcgi_cache_min_usesFASTCGI: Sets the number of requests required before caching.fastcgi_cache_pathDefines a disk-cache directory and zone.fastcgi_cache_revalidateKeeps the unsupported CGI cache refresh mode disabled.fastcgi_cache_use_staleFASTCGI: Selects when stale cached responses may be served.fastcgi_cache_validFASTCGI: Sets the cache lifetime for response status codes.fastcgi_connect_timeoutSets the connect timeout for the fastcgi upstream.fastcgi_indexAppends an index filename when computing the FastCGI script name.fastcgi_no_cacheFASTCGI: Skips writing the cache when any condition is nonempty and not zero.fastcgi_paramSets a parameter sent to the application server.fastcgi_passSends a request to a FastCGI responder.fastcgi_pass_request_bodyControls forwarding of request body to the application server.fastcgi_pass_request_headersControls forwarding of request headers to the application server.fastcgi_read_timeoutSets the read timeout for the fastcgi upstream.fastcgi_send_timeoutSets the send timeout for the fastcgi upstream.fastcgi_split_path_infoSplits the script name from PATH_INFO.flvMarks a location as an FLV pseudo-streaming handler.geoSelects a variable value by client address.grpc_connect_timeoutSets the gRPC upstream connect timeout.grpc_passProxies a request to a gRPC backend.grpc_read_timeoutSets the gRPC upstream read timeout.grpc_send_timeoutSets the gRPC upstream send timeout.grpc_set_headerSets a request header sent to the gRPC upstream.grpc_ssl_certificateLoads a certificate for upstream client authentication.grpc_ssl_certificate_keyLoads the private key for upstream client authentication.grpc_ssl_nameSets the upstream TLS server name.grpc_ssl_protocolsSelects upstream TLS protocol versions.grpc_ssl_server_nameSends SNI to the upstream.grpc_ssl_trusted_certificateLoads trusted upstream CA certificates.grpc_ssl_verifyVerifies the upstream TLS certificate.grpc_ssl_verify_depthSets the upstream certificate verification depth.grpc_webTranscodes gRPC-Web requests on a grpc_pass location to and from real gRPC.gunzipDecompresses responses for clients that do not accept gzip.gzipEnables gzip response compression.gzip_comp_levelSets the gzip compression level from 1 through 9.gzip_disableDisables gzip for matching User-Agent values.gzip_http_versionSets the minimum HTTP version for gzip.gzip_min_lengthSets the minimum response length for gzip.gzip_proxiedSelects when proxied responses may be compressed.gzip_staticServes precompressed .gz files.gzip_typesSelects additional content types for gzip.gzip_varyAdds Vary: Accept-Encoding for gzip negotiation.hashSelects a backend using a configured hash key.httpContains HTTP servers and their shared settings.http2Enables HTTP/2 for a server.ifConditionally runs rewrite directives.if_modified_sinceSelects conditional modification-time comparison.ignore_invalid_headersIgnores invalid request headers.includeIncludes another configuration file or a glob of files.indexDefines files tried for a directory request.internalRestricts a location to internal requests.ip_hashSelects a backend using the client address.keepaliveSets the upstream idle-connection cache size.keepalive_disableDisables keepalive for selected browser families.keepalive_requestsLimits requests served on one client connection.keepalive_timeLimits the lifetime of a keepalive connection.keepalive_timeoutControls how long an idle client connection remains open.large_client_header_buffersSets the count and size of large request-header buffers.least_connChooses the backend with the fewest active connections.limit_connLimits simultaneous connections by zone.limit_conn_dry_runCounts stream connection-limit events without rejecting connections.limit_conn_statusSets the status used when a connection limit is exceeded.limit_conn_zoneDefines a shared connection accounting zone.limit_exceptApplies access rules to methods other than those listed.limit_rateLimits response bytes sent per second.limit_rate_afterDelays response rate limiting until this many bytes have been sent.limit_reqApplies a request-rate zone to a context.limit_req_statusSets the response status for rejected rate-limited requests.limit_req_zoneDefines a shared request-rate accounting zone.listenSelects the address, port and protocol for a server.locationSelects configuration by request URI.log_formatDefines an access-log format.mapMaps a source value to a variable.max_rangesLimits the number of ranges in a request.mcp_allow_toolAllows MCP tools matching the listed patterns.mcp_deny_toolDenies MCP tools matching the listed patterns.mcp_passRoutes MCP requests to an HTTP backend.memc_cmds_allowedRestricts which memcached commands memc_pass may run.memc_passSends a request to memcached, full read/write ASCII protocol.memcached_buffer_sizeSets the read buffer size for a memcached reply.memcached_connect_timeoutSets the connect timeout to a memcached target.memcached_gzip_flagAdds Content-Encoding: gzip when a stored item's flags bit is set.memcached_next_upstreamSelects conditions for retrying the next memcached server.memcached_next_upstream_timeoutLimits total time spent trying memcached servers on failover.memcached_next_upstream_triesLimits the number of memcached servers tried on failover.memcached_passProxies a location to a memcached get, nginx's own read-only single-key gateway.memcached_read_timeoutSets the timeout between reads of a memcached reply.memcached_send_timeoutSets the timeout for sending the get command to memcached.merge_slashesCollapses adjacent slashes while normalizing request paths.mp4Marks a location as an MP4 pseudo-streaming handler.mp4_buffer_sizeAccepted for configuration compatibility; no runtime effect.mp4_max_buffer_sizeBounds the trusted size of a parsed moov atom.mp4_start_key_frameWidens a start= crop back to the nearest key frame.open_file_cacheKeeps the unsupported open-file cache disabled.pcre_jitControls JIT compilation of regular expressions.pidSets the master PID file.port_in_redirectIncludes the listener port in generated redirects.proxy_bufferingControls buffering of upstream responses.proxy_buffersSets the response buffer count and size.proxy_cacheHTTP proxy: Selects the response-cache zone.proxy_cache_background_updateHTTP proxy: Updates stale cache entries in the background.proxy_cache_bypassHTTP proxy: Skips reading the cache when any condition is nonempty and not zero.proxy_cache_convert_headHTTP proxy: Converts HEAD to GET for cache storage.proxy_cache_keyHTTP proxy: Defines the cache key.proxy_cache_lockHTTP proxy: Serializes requests filling the same cache entry.proxy_cache_lock_ageHTTP proxy: Allows another fill after the current fill exceeds this age.proxy_cache_lock_timeoutHTTP proxy: Sets how long a request waits for a cache fill.proxy_cache_max_range_offsetHTTP proxy: Limits the starting range offset eligible for caching.proxy_cache_methodsHTTP proxy: Selects request methods eligible for caching.proxy_cache_min_usesHTTP proxy: Sets the number of requests required before caching.proxy_cache_pathDefines a disk-cache directory and zone.proxy_cache_revalidateHTTP proxy: Revalidates expired cache entries conditionally.proxy_cache_use_staleHTTP proxy: Selects when stale cached responses may be served.proxy_cache_validHTTP proxy: Sets the cache lifetime for response status codes.proxy_connect_timeoutSets the upstream connection timeout.proxy_cookie_domainRewrites Set-Cookie domain attributes.proxy_cookie_flagsChanges security flags on matching cookies.proxy_cookie_pathRewrites Set-Cookie path attributes.proxy_hide_headerSuppresses an upstream response header.proxy_http_versionSelects the HTTP version used to an upstream.proxy_ignore_headersDisables processing of selected upstream control headers.proxy_intercept_errorsRoutes eligible upstream errors through error_page.proxy_limit_rateLimits the rate of reading a buffered upstream response.proxy_max_temp_file_sizeCaps response spill files; zero disables spilling.proxy_next_upstreamSelects failures eligible for an upstream retry.proxy_next_upstream_timeoutLimits total time spent retrying upstreams.proxy_next_upstream_triesLimits the number of upstream attempts.proxy_no_cacheHTTP proxy: Skips writing the cache when any condition is nonempty and not zero.proxy_passForwards a request to an HTTP or HTTPS upstream.proxy_pass_headerAllows an otherwise hidden upstream response header.proxy_pass_request_bodyControls forwarding of the request body.proxy_read_timeoutSets the timeout between upstream reads.proxy_redirectRewrites upstream Location and Refresh headers.proxy_request_bufferingControls request-body buffering before proxying.proxy_requestsLimits datagrams in a UDP session.proxy_responsesSets the expected UDP response count.proxy_send_timeoutSets the timeout between upstream writes.proxy_set_headerAdds, replaces or suppresses a request header sent upstream.proxy_ssl_certificateLoads a certificate for upstream client authentication.proxy_ssl_certificate_keyLoads the private key for upstream client authentication.proxy_ssl_nameSets the upstream TLS server name.proxy_ssl_protocolsSelects upstream TLS protocol versions.proxy_ssl_server_nameSends SNI to the upstream.proxy_ssl_trusted_certificateLoads trusted upstream CA certificates.proxy_ssl_verifyVerifies the upstream TLS certificate.proxy_ssl_verify_depthSets the upstream certificate verification depth.proxy_temp_pathSets the proxy temporary-file directory.proxy_timeoutSets the stream proxy inactivity timeout.randomSelects backends at random, optionally comparing two.real_ip_headerSelects the trusted client-address source.real_ip_recursiveWalks trusted forwarded-address chains.recursive_error_pagesAllows error-page processing to recurse.reset_timedout_connectionResets timed-out connections.resolverConfigures DNS servers for runtime resolution.resolver_timeoutSets the DNS resolution timeout.returnStops processing and returns a status, redirect or response body.rewriteMatches and rewrites a URI using a regular expression.rootBuilds a filesystem path by appending the request URI.satisfyCombines address and authentication checks.scgi_cacheSCGI: Selects the response-cache zone.scgi_cache_background_updateKeeps the unsupported CGI cache refresh mode disabled.scgi_cache_bypassSCGI: Skips reading the cache when any condition is nonempty and not zero.scgi_cache_keySCGI: Defines the cache key.scgi_cache_lockSCGI: Serializes requests filling the same cache entry.scgi_cache_lock_ageSCGI: Allows another fill after the current fill exceeds this age.scgi_cache_lock_timeoutSCGI: Sets how long a request waits for a cache fill.scgi_cache_max_range_offsetSCGI: Limits the starting range offset eligible for caching.scgi_cache_methodsSCGI: Selects request methods eligible for caching.scgi_cache_min_usesSCGI: Sets the number of requests required before caching.scgi_cache_pathDefines a disk-cache directory and zone.scgi_cache_revalidateKeeps the unsupported CGI cache refresh mode disabled.scgi_cache_use_staleSCGI: Selects when stale cached responses may be served.scgi_cache_validSCGI: Sets the cache lifetime for response status codes.scgi_connect_timeoutSets the connect timeout for the scgi upstream.scgi_no_cacheSCGI: Skips writing the cache when any condition is nonempty and not zero.scgi_paramSets a parameter sent to the application server.scgi_passSends a request to an SCGI application.scgi_pass_request_bodyControls forwarding of request body to the application server.scgi_pass_request_headersControls forwarding of request headers to the application server.scgi_read_timeoutSets the read timeout for the scgi upstream.scgi_send_timeoutSets the send timeout for the scgi upstream.send_timeoutSets the response-write timeout.sendfileUses the operating system’s file-send path where available.sendfile_max_chunkLimits bytes transferred in one file-send operation; zero is unlimited.serverDefines an HTTP virtual server.server_nameNames the virtual hosts handled by a server block.server_name_in_redirectUses the configured server name in generated redirects.server_tokensControls the server identification policy.setAssigns a rewrite variable.set_real_ip_fromTrusts an address to supply the client IP.split_clientsDivides requests into stable percentage buckets.ssiEnables the Server Side Includes body filter.ssi_last_modifiedPreserves Last-Modified on an SSI-processed response.ssi_min_file_chunkAccepted for configuration compatibility; no runtime effect.ssi_silent_errorsSuppresses the SSI error marker in the body.ssi_typesExtends the content types the SSI filter processes.ssi_value_lengthCaps the length of a value produced while evaluating an SSI expression.ssl_certificateLoads the PEM certificate chain for a TLS server.ssl_certificate_keyLoads the private key for a server certificate.ssl_ciphersSelects supported TLS cipher suites.ssl_client_certificateLoads trusted client CA certificates.ssl_dhparamAccepts a legacy DH-parameter path with a warning.ssl_prefer_server_ciphersUses the server cipher preference order.ssl_prereadReads TLS ClientHello metadata without terminating TLS.ssl_protocolsEnables TLS protocol versions.ssl_reject_handshakeRejects TLS handshakes for this server.ssl_session_cacheConfigures the TLS session cache.ssl_session_ticketsControls TLS session tickets.ssl_session_timeoutSets the TLS session lifetime.ssl_staplingEnables OCSP stapling.ssl_stapling_verifyVerifies stapled OCSP responses.ssl_verify_clientControls client-certificate verification.streamContains TCP and UDP proxy servers.stub_statusServes basic connection and request counters.sub_filterReplaces text in response bodies.sub_filter_last_modifiedPreserves modification metadata during substitution.sub_filter_onceControls whether each substitution runs only once.sub_filter_typesSelects content types for body substitution.tcp_nodelayDisables Nagle buffering on TCP connections.tcp_nopushEnables packet coalescing for the file-send path.try_filesTests candidate files and falls back to a URI, named location or status.typesMaps filename extensions to MIME types.underscores_in_headersAccepts underscores in request-header names.upstreamDeclares a named pool of backend servers.useAffirms the runtime’s event backend.userSelects the serving user and optional group.uwsgi_cacheUWSGI: Selects the response-cache zone.uwsgi_cache_background_updateKeeps the unsupported CGI cache refresh mode disabled.uwsgi_cache_bypassUWSGI: Skips reading the cache when any condition is nonempty and not zero.uwsgi_cache_keyUWSGI: Defines the cache key.uwsgi_cache_lockUWSGI: Serializes requests filling the same cache entry.uwsgi_cache_lock_ageUWSGI: Allows another fill after the current fill exceeds this age.uwsgi_cache_lock_timeoutUWSGI: Sets how long a request waits for a cache fill.uwsgi_cache_max_range_offsetUWSGI: Limits the starting range offset eligible for caching.uwsgi_cache_methodsUWSGI: Selects request methods eligible for caching.uwsgi_cache_min_usesUWSGI: Sets the number of requests required before caching.uwsgi_cache_pathDefines a disk-cache directory and zone.uwsgi_cache_revalidateKeeps the unsupported CGI cache refresh mode disabled.uwsgi_cache_use_staleUWSGI: Selects when stale cached responses may be served.uwsgi_cache_validUWSGI: Sets the cache lifetime for response status codes.uwsgi_connect_timeoutSets the connect timeout for the uwsgi upstream.uwsgi_modifier1Sets the first uWSGI modifier byte (0–255).uwsgi_modifier2Sets the second uWSGI modifier byte (0–255).uwsgi_no_cacheUWSGI: Skips writing the cache when any condition is nonempty and not zero.uwsgi_paramSets a parameter sent to the application server.uwsgi_passSends a request to a uwsgi-protocol application.uwsgi_pass_request_bodyControls forwarding of request body to the application server.uwsgi_pass_request_headersControls forwarding of request headers to the application server.uwsgi_read_timeoutSets the read timeout for the uwsgi upstream.uwsgi_send_timeoutSets the send timeout for the uwsgi upstream.worker_connectionsSets the maximum simultaneous connections per worker.worker_cpu_affinityAssigns workers to CPU sets.worker_prioritySets the worker scheduling priority.worker_processesSets the number of serving workers.worker_rlimit_coreSets the core-dump size limit.worker_rlimit_nofileSets the requested file-descriptor limit.xin_file_io_concurrencyBounds concurrent file operations.xin_file_io_timeoutSets the timeout for blocking file operations.No matching directives. Try a shorter name or choose all contexts.