1

We have set up Jenkins behind an Apache reverse server with HTTPS. Although the default Jenkins URL is set to https://... in Jenkins and links on the GUI are working fine, all redirects ("302 Found") are pointing to HTTP, e.g. here: browser I could not find any existing thread on this here. Is there maybe some setting we might still be missing?

Addendum: This is the reverse proxy configuration we are using:

<VirtualHost _default_:8443>
SSLEngine On
SSLCertificateFile "C:/Portable/laragon/etc/ssl/abc-pub.pem"
SSLCertificateKeyFile "C:/Portable/laragon/etc/ssl/abc.pem"

<Directory "C:/Portable/laragon/www/"> AllowOverride All </Directory>

https://wiki.jenkins.io/display/jenkins/running+jenkins+behind+apache

ProxyPass /jenkins http://localhost:8080/jenkins nocanon ProxyPassReverse /jenkins http://localhost:8080/jenkins

ProxyRequests Off AllowEncodedSlashes NoDecode

Local reverse proxy authorization override

Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)

<Proxy *> Order deny,allow Allow from all </Proxy>

Robert
  • 161

2 Answers2

2

I was able to resolve the issue by adding the following statements to the Apache reverse proxy virtual host configuration:

RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

This does not solve the Jenkins issue but works around by rewriting HTTP requests as HTTPS.

Robert
  • 161
1

You can try setting Manage Jenkins > Configure System -> Jenkins Location - Jenkins URL to the actual url of your jenkins.

v.ng
  • 111