The context path is the prefix of a URL path.
The Jenkins controller and the reverse proxy must use the same context path.
For example, if the Jenkins controller URL is https://www.example.com/jenkins/ then the --prefix=/jenkins
argument must be included in the Jenkins controller command line arguments.
Set the context path when using the Linux packages by running systemctl edit jenkins
and adding the following:
[Service]
Environment="JENKINS_PREFIX=/jenkins"
Set the context path on Windows controllers by including the --prefix
command line argument in the jenkins.xml
file in the installation directory.
Ensure that Jenkins is running at the context path where your reverse proxy is serving Jenkins.
You will have the least pain if you keep to this principle.
The --prefix
command line argument is not needed if the context path is empty.
For example, the URL https://jenkins.example.com/ has an empty context path.