We have the standard Debian installation of Jenkins (winstone only, no tomcat or apache involved), which we are running with --prefix=/jenkins
and on port 80.
Now when I access http://my.server/
I get a 404 page. Can I convince Winstone somehow to redirect that to the correct address http://my.server/jenkins/
?
EDIT: I know I could install Apache, and use the following Rewrite Rule to get what I want:
RewriteEngine On
RewriteRule ^/*$ https://jenkins.corp.mobile.de/jenkins/ [R]
My question is how to do this in Winstone.
The typical way to do what you want is to run Jenkins in some high port, like 8080 with --prefix=/jenkins
and then run something like Apache or Nginx in port 80 configured to reverse proxy /jenkins
to http://localhost:8080/jenkins
For Apache, you could add something like this to Apache's config file:
ProxyPass /jenkins http://localhost:8080/jenkins
ProxyPassReverse /jenkins http://localhost:8080/jenkins
ProxyRequests Off
# Allow direct access to Jenkins only from localhost i.e. Apache
<Proxy http://localhost:8080/jenkins*>
Order deny,allow
Allow from 127.0.0.1
</Proxy>
You should tune the access controls in the directive according to where you want to accept connections to Jenkins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With