Last modified by Eleni Cojocariu-testing account on 2026/08/18 15:05

Show last authors
1 NginX forwards requests to the XWiki [[Servlet Container>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.WebHome]] on a Linux system, using the [[directives XWiki needs>>doc:documentation.xs.admin.installation.http-reverse-proxy.nginx-key-configurations.WebHome]]. This procedure serves the wiki over plain ##HTTP## on port ##80##; [[Configure HTTPS for the NginX HTTP Proxy Server>>doc:documentation.xs.admin.installation.http-reverse-proxy.nginx-key-configurations.configure-https.WebHome]] adds ##HTTPS## on top of it. The commands are those of a Debian-based distribution.
2
3 1. Make sure your wiki is running and reachable locally, for example at {{code language="none"}}http://localhost:8080/xwiki{{/code}}.
4 1. [[Install NginX>>https://nginx.org/en/docs/install.html]].
5 1. Create the file ##/etc/nginx/sites-available/xwiki## with the following content:(((
6 {{code language="nginx"}}
7 map $http_upgrade $connection_upgrade {
8 default upgrade;
9 "" "";
10 }
11
12 server {
13 listen 80;
14 server_name localhost;
15
16 access_log /var/log/nginx/xwiki-access.log;
17 error_log /var/log/nginx/xwiki-error.log;
18
19 client_max_body_size 0;
20
21 location = / {
22 return 301 /xwiki/;
23 }
24
25 location /xwiki {
26 proxy_pass http://localhost:8080;
27
28 proxy_set_header Host $http_host;
29 proxy_set_header X-Real-IP $remote_addr;
30 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31 proxy_set_header X-Forwarded-Proto $scheme;
32 proxy_set_header X-Forwarded-Host $http_host;
33 proxy_set_header Forwarded "";
34
35 proxy_http_version 1.1;
36 proxy_set_header Upgrade $http_upgrade;
37 proxy_set_header Connection $connection_upgrade;
38
39 proxy_redirect off;
40 }
41 }
42 {{/code}}
43 )))
44 1. Enable the site: {{code language="none"}}sudo ln -s /etc/nginx/sites-available/xwiki /etc/nginx/sites-enabled/{{/code}}.
45 1. Check the configuration: {{code language="none"}}sudo nginx -t{{/code}}.
46 1. Reload NginX: {{code language="none"}}sudo systemctl reload nginx{{/code}}.
47 1. Open {{code language="none"}}http://localhost{{/code}} in a browser. NginX redirects to {{code language="none"}}http://localhost/xwiki/{{/code}} and the wiki loads through port ##80##, with no port number in the address.

Get Connected