Last modified by Vincent Massol on 2025/01/13

Hide last authors
Vincent Massol 16.2 1 Example inspired from the config for https://www.myxwiki.org (with only the important parts):
Thomas Mortagne 1.1 2
Thomas Mortagne 15.1 3 * Any acces to port ##80## redirect to port ##443##
4 * Proxy the port ##443## to the port ##8080## (where most application servers are listening by default)
5 * Redirect ##/## access to ##/xwiki/##
6 * Make sure XWiki have enough information to know what is the source URL
7 * Make sure that special characters like ##/## and ##+## are allowed by Apache
Raphaël Jakse 7.1 8 * Mind the "noncanon" keyword. Without it, URLs containing semicolons will be mangled
Thomas Mortagne 16.1 9 * Enable WebSocket
Thomas Mortagne 3.1 10
Thomas Mortagne 11.1 11 {{code}}
Thomas Mortagne 1.1 12 <VirtualHost *:80>
13 ServerName mydomain.com
14 ServerAlias *.mydomain.com
15
16 RewriteEngine On
Thomas Mortagne 4.1 17 RewriteCond %{HTTPS} off
Thomas Mortagne 1.1 18 RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
19 </VirtualHost>
20
21 <VirtualHost *:443>
22 ServerName mydomain.com
23 ServerAlias *.mydomain.com
24
25 DocumentRoot /var/www/
26
27 ErrorLog /var/log/apache2/xwiki-error.log
28 CustomLog /var/log/apache2/xwiki-access.log combined
29
30 RedirectMatch ^/$ /xwiki/
31
32 <Location /xwiki>
33 Order Deny,Allow
34 Satisfy Any
35 </Location>
36
37 AllowEncodedSlashes NoDecode
38
39 ProxyRequests Off
40 <Proxy *>
41 Order deny,allow
42 Allow from all
43 </Proxy>
44 ProxyPreserveHost On
Tom Wise 14.1 45 ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket
Thomas Mortagne 13.1 46 ProxyPassReverse /xwiki http://localhost:8080/xwiki nocanon
Thomas Mortagne 1.1 47
48 ## Workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=58001 (ProxyPreserveHost does not includes Forwarded)
49 RequestHeader set Forwarded "proto=https"
50
51 # TODO: add your SSL setup
52 </VirtualHost>
53 {{/code}}

Get Connected