NginX Server Key Configurations

Last modified by Eleni Cojocariu on 2026/05/20 16:51

Reference

Warning

WIP

NginX is a widely used open-source web server, often utilized as a reverse proxy to forward client requests to backend applications like XWiki. The following configuration keys ensure proper communication between NginX and XWiki:

Configuration lineDescription / Official Nginx documentation meaning
listen 80Specifies the port Nginx listens on. Port 80 is the default for HTTP traffic.
server_name localhostDefines the domain name(s) this server block responds to (e.g., localhost or example.com).
client_max_body_size 0Defines the maximum allowed size of the client request body. A value of 0 disables the size limit, allowing unlimited upload size.
access_log /var/log/nginx/xwiki-access.logPath to the file where all successful client requests are logged.
error_log /var/log/nginx/xwiki-error.logPath to the file where Nginx logs errors (configuration issues, backend failures).
location /xwiki { ... }Matches requests with URI starting with /xwiki and applies the enclosed configuration.
proxy_pass http://localhost:8080/xwiki/##Forwards incoming requests to a backend server (reverse proxy). Here, to XWiki running on port 8080.
proxy_set_header Host $hostPasses the original Host header from the client request to the backend server.
proxy_set_header X-Real-IP $remote_addrSends the real client IP address to the backend.
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_forAdds the client IP to the X-Forwarded-For chain (used when multiple proxies exist).
proxy_set_header X-Forwarded-Proto httpIndicates whether the original request was HTTP or HTTPS.
proxy_http_version 1.1Forces HTTP/1.1, required for WebSocket connections.
proxy_set_header Upgrade $http_upgradeAllows protocol upgrade (needed for WebSockets).
proxy_set_header Connection "upgrade"Ensures connection header allows upgrade to WebSocket.
proxy_redirect offDisables automatic rewriting of redirect URLs from the backend.
location = / { return 301 /xwiki; }Exact match for root URL ("/"), redirects permanently to /xwiki.

More

To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.

Related

Get Connected