Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Opened 8 years ago

Closed 8 years ago

#466 closed defect (fixed)

Jenkins has some trouble with https

Reported by: landauf Owned by: landauf
Priority: minor Milestone: IT: Server Setup
Component: IT Version:
Keywords: Cc:
Referenced By: References:

Description (last modified by landauf)

Often jenkins switches from https to http when clicking an url. Examples:

  • Go to this URL → click on "Document" (next to the big (?) sign) → you are redirected to http instead of https
  • Go to this URL → click login (upper right corner) → enter invalid account → you are redirected to http instead of https

Also login doesn't always work (or only after closing and opening the website again).

I see that jenkins is started with these command-line arguments:

--httpPort=8080
--httpListenAddress=127.0.0.1

According to https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins it may be possible to use these arguments instead:

--httpPort=-1 (disable http)
--httpsPort=8443
--httpsListenAddress=127.0.0.1

After that, the apache configuration to redirect /jenkins to localhost:8080 should be changed to redirect to localhost:8443.

Maybe this solves the issue.

Change History (4)

comment:1 Changed 8 years ago by landauf

  • Description modified (diff)

comment:2 Changed 8 years ago by landauf

  • Description modified (diff)

comment:3 Changed 8 years ago by landauf

  • Owner set to landauf
  • Status changed from new to assigned

comment:4 Changed 8 years ago by landauf

  • Resolution set to fixed
  • Status changed from assigned to closed

In /etc/apache2/sites-available/jenkins.conf add this:

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

Then install the missing plugin:

a2enmod proxy
a2enmod proxy_http
sudo a2enmod headers

Restart apache:

sudo service apache2 restart

For further information, refer to https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache

Note: See TracTickets for help on using tickets.