Configure XWiki to Use a Proxy Server
Last modified by Eleni Cojocariu-testing account on 2026/08/21 17:09
Steps
This procedure adds the proxy properties XWiki needs to the process that runs it; XWiki Behind a Proxy Server describes what fails without them.
- Open the startup file in which your installation sets the Java options:
Installation File Variable On a servlet container such as Tomcat bin/setenv.sh on Linux or bin/setenv.bat on Windows, in the container's directory CATALINA_OPTS As a standalone (demo) distribution start_xwiki.sh on Linux or start_xwiki.bat on Windows XWIKI_OPTS - Add the four proxy properties to that variable, with the host name and the port of your own proxy server:
CATALINA_OPTS="$CATALINA_OPTS -Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=7777 -Dhttps.proxyHost=proxy.mycompany.com -Dhttps.proxyPort=7777"
On Windows the same line reads:set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=7777 -Dhttps.proxyHost=proxy.mycompany.com -Dhttps.proxyPort=7777 - Add -Dhttp.nonProxyHosts to the same variable when some hosts must be reached directly, with the exceptions separated by vertical bars.
- Restart XWiki, and confirm that the properties reached its Java process, whose command line now carries them:
$ ps -ww -C java -o args= java ... -Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=7777 -Dhttps.proxyHost=proxy.mycompany.com -Dhttps.proxyPort=7777 ...
FAQ
Do the proxy properties belong in xwiki.properties?
No. The Java runtime reads them, not XWiki, so they belong on the command line of the process that runs XWiki.
What if the proxy server requires authentication?
Add -Dhttps.proxyUser and -Dhttps.proxyPassword to the same variable, and their http equivalents when the proxy also handles plain HTTP.