NginX Server Key Configurations
Last modified by Eleni Cojocariu on 2026/05/20 16:51
Reference
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 line | Description / Official Nginx documentation meaning |
|---|---|
| listen 80 | Specifies the port Nginx listens on. Port 80 is the default for HTTP traffic. |
| server_name localhost | Defines the domain name(s) this server block responds to (e.g., localhost or example.com). |
| client_max_body_size 0 | Defines 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.log | Path to the file where all successful client requests are logged. |
| error_log /var/log/nginx/xwiki-error.log | Path 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 $host | Passes the original Host header from the client request to the backend server. |
| proxy_set_header X-Real-IP $remote_addr | Sends the real client IP address to the backend. |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for | Adds the client IP to the X-Forwarded-For chain (used when multiple proxies exist). |
| proxy_set_header X-Forwarded-Proto http | Indicates whether the original request was HTTP or HTTPS. |
| proxy_http_version 1.1 | Forces HTTP/1.1, required for WebSocket connections. |
| proxy_set_header Upgrade $http_upgrade | Allows protocol upgrade (needed for WebSockets). |
| proxy_set_header Connection "upgrade" | Ensures connection header allows upgrade to WebSocket. |
| proxy_redirect off | Disables 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.