JIRA on multiple domains

Dragomir Denev May 15, 2012

Hi,

I have configured IIS as an ARR proxy to JIRA and I access it on jira.mydomain.com (which is proxied to localhost:8080). I need to also access JIRA on support.mydomain.com. Is there a way to setup JIRA (and IIS) to work with 2 domains?

Thank you

3 answers

1 vote
Petar Velikov November 1, 2017

I don't know about IIS, but it can be done with Apache.

1. Add to JIRA_INSTALL/conf/server.xml two new connectors (AJP and HTTP on 8081)

 <Connector port="8081"
  maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" bindOnInit="false"
  scheme="https"
  proxyName="support.mydomain.com"
  proxyPort="443" />

 <Connector port="8009" redirectPort="8443" enableLookups="false" protocol="AJP/1.3" URIEncoding="UTF-8"/>

2. Install Apache HTTP Server and create two virtual hosts. The second one will use Substitute to replace the base URL inside HTML responses:

<VirtualHost _default_:443>
    ServerName jira.mydomain.com
...
    ProxyPass    / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>
<VirtualHost *:443>
    ServerName support.mydomain.com
...
    ProxyPass        /  http://localhost:8081/
    ProxyPassReverse    /  http://localhost:8081/

    RequestHeader unset Accept-Encoding
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s/jira.mydomain.com/support.mydomain.com/i"
</VirtualHost>

3. Set the base URL to first domain https://jira.mydomain.com

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2017

This does mean users trying to access it on the second domain might run into display problems, and then end up accessing it over the first domain within a few clicks.  Seriously, not worth doing.

1 vote
Norman Abramovitz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2012

I would do this through through your DNS provider. Make both names point to the same ip address. I have //localhost:8080, //bugs.mydomain.com and //xyz:8080 all pointing to the same host.

Dragomir Denev May 15, 2012

Yes, but what is your Base URL in JIRA? I have set an ARR proxy in IIS which redirects all requests for jira.mydomain.com to localhost:8080. In JIRA I have also edited the connector to use proxying and my JIRA Base URL is jira.mydomain.com.

The above means that whenever I access JIRA via any means (IP, domain that points to it) it will automatically redirect me to jira.mydomain.com. This is done by JIRA, not IIS.

I tried what you proposed but I got errors with the gadgets on my dashboard.

I wonder if a second connector listening on port 8081 would do the trick...

Or maybe you mean that I don't use proxying at all and just make all my DNS names point to JIRA?

Thank you

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2012

You can only have one base url in Jira, so you need to decide which domain is going to be the primary place to run it and stick with that.

You could however use Apache to rewrite urls so that it looks like Jira is working on several domains, but internal links and emails will still all be based on the base url

0 votes
Mark Murawski February 2, 2017

Is this still a limitation?

 

Our group owns several companies and we need to use our JIRA service desk to handle customers from each of these companies independently with separate branding.

 

I know that you can brand the portal on a per-project basis, but it still leaves the question on having JIRA support multiple domains and reply with links back to the proper domain on a per-project basis.

 

Mark Willcox August 14, 2017

Did you make any progress with this?

I'm facing a similar issue and at the moment I think running multiple instances of JIRA is the only way to do it...

Synchronising users should be OK if there is a stand-alone user directory (e.g. Crowd or Active Directory).

Not so confident about being able to link between issues in different JIRAs but I believe one JIRA instance can be linked via application links to any number of other JIRA instances, I just haven't tried it yet...

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 14, 2017

Same answer - you can only run it on one domain because there's only one base url.

You are right in that you would need multiple servers if you want multiple url access to be done properly (rather than just a redirect to the right place)

jean-spector September 16, 2019

@Nic Brough -Adaptavist- Is it possible to add a client-side script that will rewrite the URLs on the page?

I realize it's not the best practice (and never will be), but having something is better than having nothing at all. In my case, I have to carry a second laptop just to be able to use the original URL for Jira...

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 16, 2019

Yes, you could run it through a proxy on the wrong address, but you'll need to do a lot of rewriting, including in both directions, and the urls in emails and exports are still going to be the base url.

jean-spector September 16, 2019

Thank you, @Nic Brough -Adaptavist- 

Suggest an answer

Log in or Sign up to answer