IIS and docker jira

Mohsen Seifi October 16, 2017

Dear

I'm about to use Jira in windows server and IIS. The thing is that I installed Jira in docker via docker 7.5 Docker image .

The Jira is up and running in ip:8080.

I'm trying to use a domain with https in order to connect to the Jira. 

So I did the DNS settings and SSL certificate. Then I created a website in IIS and I bounded the URLs. After that I did the set up the reverse proxy and http tp https rule in IIS.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="HTTP to HTTPS" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                        <add input="{SERVER_PORT_SECURE}" pattern="^0$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
                </rule>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="http://IP:8080/{R:1}" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" enabled="false">
                    <match filterByTags="A, Form, Img" pattern="http://jira.mydomain.com/(.*)" />
                    <action type="Rewrite" value="https://jira.mydomain.com/{R:1}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
        <httpRedirect enabled="false" destination="https://jira.mydomain.com" exactDestination="false" childOnly="true" httpResponseStatus="Temporary" />
    </system.webServer>
</configuration>

After that I went through the Jira setting with my browser and I changed the base URL to https://jira.mydomain.com but the factt is that I see errors :/

When I'm trying to access my jira via URL, I can't get my full dashboard.

Full error here

But everything seems to work with IP:port .

 

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 17, 2017

Jira is running an internal webserver, Tomcat.  This Tomcat instance is setup to server its content on port 8080.  Since you are now looking to proxy this connection, you likely need to either create a new connector or modify your existing connector in Tomcat so that this webserver understands its traffic is being routed through a proxy.   That specific error happens because by default jira only expects the scheme to be http.  The fact that your proxy is https is confusing Jira.

 

I'd recommend walking through the steps in Proxying Atlassian server applications with Microsoft Internet Information Services (IIS)

 

This guide explains how we would expect IIS and Jira to be configured to work together.  It also explains in section "3.2. Configure other Atlassian applications web server (Tomcat)" that you need to adjust the $JIRAINSTALL/conf/server.xml file to contain certain parameters.  For example if your IIS is terminating the SSL, then the Jira tomcat connector in use should look something like this:

 

<Connector acceptCount="100" bindOnInit="false" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"

proxyName="jira.example.com" proxyPort="443" scheme="https"/>

In that setup, Tomcat is still opening port 8080 locally, but it's expecting that traffic is actually going to routed through a https://jira.example.com address first before it reaches the Jira site.  For the sake of troubleshooting SSL, I'd recommend having a connector just for the proxy, and another unproxied connector.  Should strange display issues happen in Jira, having this other connector is a helpful means to test out if the problem is with Jira or with the proxy in front of Jira.   Also anytime you make changes to the server.xml, after you save that file, you have to restart Jira for these changes to take effect.

Mohsen Seifi October 18, 2017

Note that I'm using Jira in a Docker container and as I'm new to Docker, I couldn't find a way to edit that file (But I could access to terminal and I read that file)

I'll be thankful if you help me with that :)

Suggest an answer

Log in or Sign up to answer