How to setup redirect from http to https port in Bamboo
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When no reverse proxy is used, and Bamboo is listening on two ports, say, 8085 and 8443, it may be necessary to automatically redirect http requests to https endpoint, i.e. connector setup with a keystore.
Solution
With two connectors defined in ${BAMBOO_INSTALLATION_DIR}/conf/server.xml:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<Connector
port="8085"
protocol="HTTP/1.1"
maxThreads="150" minSpareThreads="25"
connectionTimeout="20000"
disableUploadTimeout="true"
acceptCount="100"
enableLookups="false"
maxHttpHeaderSize="8192"
useBodyEncodingForURI="true"
URIEncoding="UTF-8"
redirectPort="8443">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
</Connector>
<Connector
port="8443"
maxThreads="150" minSpareThreads="25"
connectionTimeout="20000"
disableUploadTimeout="true"
acceptCount="100"
enableLookups="false"
maxHttpHeaderSize="8192"
useBodyEncodingForURI="true"
URIEncoding="UTF-8"
keystoreFile="${user.home}/.keystore"
keystorePass="changeit"
scheme="https" secure="true" SSLEnabled="true" sslProtocol="TLS"
clientAuth="false" />
-->
add the following to ${BAMBOO_INSTALLATION_DIR}/conf/web.xml (end of the file, just before </web-app> closing tag):
1
2
3
4
5
6
7
8
9
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Restart Bamboo. Now, http:localhost:8085 is redirected to https://localhost:8443.
この内容はお役に立ちましたか?