How to setup redirect from http to https port in Bamboo

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

目的

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.

ソリューション

With two connectors defined in ${BAMBOO_INSTALLATION_DIR}/conf/server.xml:

        <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):

<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.

Last modified on Mar 23, 2021

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.