tomcat - Jenkins does not redirect to HTTPS -
the problem
i using jenkins on https/ssl (the details of setup below). can navigate https://jenkins.mydomain.com:8088 without problems. links correct https:// in front of them. can navigate through jenkins pages.
except when jenkins tries redirect (e.g after login, after clicking build, etc). whenever jenkins tries redirect page, sends me http:// page (not https://)
what i've tried
- i have tried setting setting
jenkins urlin global configuration. works fine everything, except redirectshttp://, despite url sayinghttps://
- i have tried following instructions here regarding modifying
jenkins.xmlport configuration, setup not using jenkins windows service install, don't havejenkins.xmlthere different place can specify parameters jenkins? - i have tried understanding whatever "mod_proxy https" means, don't have virtual hosts configuration. , besides, tomcat installation not 1 handles ssl. issue seems in jenkins's redirect mechanism, ignoring
jenkins urlprotocol part global configuration.
the jenkins setup
- apache tomcat running windows service
jenkins.warrenamedroot.warplaced in tomcat'swebappsfolder- executing through
bin\tomcat6.exe //rs//instance_name - configured through tomcat's windows "monitor service" tool

- there multiple instances configured way on machine, differentiated different tomcat folders , different tomcat ports under respective
conf\server.xml - i've inherited setup. don't know why didn't use native install package windows service. there multiple instances of jenkins (through multiple instances of tomcat service) on computer. trying change installation type instances incur unacceptable amount of downtime.
- jenkins' port
8088, cannot use443ssl there multiple instances running , can't have443way instances differentiated port.
the ssl setup
- we have global ssl cert (
*.mydomain.com) hosted on load balancer hardware. (i don't have access actual file) - there no ssl on actual windows server hosting jenkins.
- the dns
jenkins.mydomain.comresolves virtual ip on load-balancer, forwards traffic actual windows server hosting jenkins. - there nothing wrong setup, works fine other sites. this ssl setup works fine our jenkins instance.
i suggest peeking around server.xml , finding connector , adding secure="true" if doing http proxy scheme. redirect ports may involved.
<connector secure="true" port="8088" protocol="http/1.1" uriencoding="utf-8" connectiontimeout="20000" /> for reference, run jenkins behind 2 apache proxies, 1 external , 1 internal:
the relevant parts of our external vhost (jenkins.host.com):
requestheader unset authorization requestheader set authorization "basic (encrypted password)" proxypass / ajp://dev.internal:9101/ proxypassreverse / ajp://dev.internal:9101/ the relevant parts of tomcat's server.xml:
<connector port="9001" protocol="http/1.1" uriencoding="utf-8" connectiontimeout="20000" /> <connector port="9101" protocol="ajp/1.3" uriencoding="utf-8"/> <host name="dev.internal" appbase="webapps" unpackwars="true" autodeploy="true"> <alias>jenkins.host.com</alias> <!-- singlesignon valve, share authentication between web applications documentation at: /docs/config/valve.html --> <!-- <valve classname="org.apache.catalina.authenticator.singlesignon" /> --> <!-- access log processes example. documentation at: /docs/config/valve.html note: pattern used equivalent using pattern="common" --> <valve classname="org.apache.catalina.valves.accesslogvalve" directory="logs" prefix="dev.internal_access_log." suffix=".txt" rotatable="false" pattern="%h %l %u %t "%r" %s %b" /> </host>
Comments
Post a Comment