Score:1

Jenkins after HTTPS reverse proxy keeps on redirecting to HTTP

us flag

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>
in flag
As usual: share all text content **in text form**
Robert avatar
us flag
@NicoHaase Thanks, I have added the Apache reverse proxy configuration (in text form :-) and asked the moderators to move to serverfault.
Score:1
sx flag

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

Score:1
us flag

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.

in flag
Configure the proper URL in Jenkins. See https://serverfault.com/questions/931485/jenkins-behind-nginx-reverse-proxy-in-subdirectory/931486#931486
Alex Weitz avatar
kr flag
I wonder how can I set it up for an AWS ALB
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.