How to allow access to TC via HTTPs only for users

I would like to set up a TeamCity instance to redirect any http requests to https.

I have managed to successfully set up an SSL certificate and change TeamCity's server.xml file to accept https connections on port 443 but what I can't figure out is how to redirect any requests via regular HTTP to use ssl instead.

While I could just comment out the plain HTTP connector in the xml, I'm hoping that there is a more elegant way to achieve this outcome.

0
1 comment
Avatar
Permanently deleted user

Ironically despite searching google before posting here, I found the answer on this page:

http://paulstovell.com/blog/teamcity-ssl-on-windows-with-redirect-from-http

The bit I needed was editing web.xml in the TeamCity conf folder by adding the following:

<security-constraint>
    <web-resource-collection>
        <web-resource-name>HTTPSOnly</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>
0

Please sign in to leave a comment.