Microsoft Internet Information Services (IIS) を使用したアトラシアン サーバー アプリケーションのプロキシ

Atlassian applications allow the use of reverse-proxies with our products; however, Atlassian Support does not provide assistance for configuring them. Consequently, Atlassian cannot guarantee providing any support for them.

設定でサポートが必要な場合、アトラシアン コミュニティに質問を登録してください。

プラットフォームについて: 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 は除く

This page explains how to establish a network topology in which Internet Information Services (IIS) acts as a reverse proxy for Atlassian server applications. The page has been written as a recipe for success – we recommend you follow it step by step. 

 アトラシアン アプリケーションでのリバース プロキシの使用は、ユーザーに次のようなアクセス方法を提供したいときに検討します。 

  • 自身のドメインでのアクセス (例:   http://our<atlassianapp>.com/ )
  • at subdomains of another domain, such as  http://my<atlassianapp>.example.com/
  • ドメインまたはサブドメインのコンテキスト パスでのアクセス (例:   http://example.com/my<atlassianapp> )
  • 異なる HTTP ポート (例: 9800、9850 など)

For more complex scenarios, you can refer to the Microsoft IIS Documentation, consult with an Internet Information Services (IIS) specialist in your organisation, ask the Atlassian Community, or contact an Atlassian Partner.

このページの手順は、アトラシアンの次のサーバー アプリケーションに適用されます。

  • Jira Server アプリケーション (Jira Software Server、Jira Core、Jira Service Desk)
  • Confluence Server
  • Bamboo Server
  • Bitbucket Server
  • Fisheye
  • Crucible
  • Crowd

In the examples that follow on this page, <atlassianapp> refers to the name of any of the Atlassian server applications above.


Atlassian server applications bundle a web server, which allows them to run without needing a proxy server. For most Atlassian applications, the bundled web server is Apache Tomcat (Fisheye and Crucible use Jetty). Consequently, you need to configure both Tomcat (or Jetty if using Fisheye or Crucible) and IIS when proxying an Atlassian application.


Prerequisites

次の条件を満たしている必要があります。

Internet Information Services (IIS) version 7.0, 8.0 or 10.0 installed

You may find it helpful to refer to the Microsoft IIS Documentation to install IIS in your Microsoft Windows Server. (http://www.iis.net/learn/get-started/whats-new-in-iis-8/installing-iis-8-on-windows-server-2012)

ドメインの DNS エントリが配置および設定済み

セットアップするプロキシ トポロジに応じた変更が組織の現在の DNS 設定に必要かどうかを、必要に応じてシステムまたはネットワーク管理者とともに確認します。

アトラシアン アプリケーションがインストール済みで、Web ブラウザからアクセス可能

アトラシアン アプリケーションを通常の手順でインストールします。

パート A. アトラシアン アプリケーションを設定する

このセクションでは、各アトラシアン アプリケーションに同梱の Tomcat (または Jetty) Web サーバーをリバース プロキシの背後で実行するように設定する方法について説明します。

1. アトラシアン アプリケーションを停止する

アプリケーションを停止すると、Tomcat も停止します。

In Windows, Atlassian applications are typically stopped/started using scripts in the "bin" directory where you installed the product. Alternatively, you may have setup the application to run as a Windows Service.

See the documentation for your product for instructions:

2. コンテキスト パスを設定する

This step is only required if you want an application to be accessed on a context path, such as  http://ourcompany.com/<contextpath> . If this is not required, you can skip this step.

Fisheye および Crucible

FishEye または Crucible をプロキシする場合、管理領域から Jetty の Web コンテキスト パスを設定します。「Fisheye の web サーバーを設定する」を参照してください。

Once you've done that, continue with Part B below.

Bitbucket Server 5.0 以上

In Bitbucket Server 5.0+, the context path can be changed by modifying server.context-path in $BITBUCKET_HOME/shared/bitbucket.properties

bitbucket.properties
server.context-path=/bitbucket
JIRA applications, Confluence, Bitbucket Server 4.x and below, Bamboo

これらのアトラシアンのサーバー アプリケーションのいずれかをプロキシする場合、Tomcat の server.xml ファイルでコンテキスト パスを次のように設定します。

server.xml ファイルの場所は、ご利用のアプリケーション、オペレーティング システム、およびインストール先に応じて異なります。 

アトラシアン アプリケーションで共通の既定のインストール先は、次のとおりです。

  • Linux: /opt/atlassian/<application-name>
  • Windows: C:\Program Files\Atlassian\<application-name>
  • Windows: C:\Atlassian\<application-name>

アトラシアン アプリケーションのフォルダ構造内の場所:

アプリケーションserver.xml の場所
Bamboo<install-path>/conf/
Confluence<install-path>/conf/
Crowd<install-path>/apache-tomcat/conf/
CrucibleFisheye と同様
FisheyeFisheye の設定ファイルは config.xml です。「Fisheye の web サーバーを設定する」および「Fisheye / Crucible で追加ポートでの web リクエストのリッスンを有効化する方法」をご参照ください。
Jira アプリケーション<install-path>/conf/
Bitbucket Server 5.0

なし。<Bitbucket home directory>/shared/bitbucket.properties に置き換えられています。

server.xml のカスタマイズを bitbucket.properties に移行する方法」をご参照ください。

Bitbucket Server 4.0 〜 4.14<Bitbucket home directory> /shared/server.xml
Stash 3.8 〜 3.11

<Stash home directory>/shared/

このリリースを利用しているが、上述のディレクトリに server.xml が存在しない場合、<install-path>/conf/server.xml から実行しています。

インスタンスのアップグレード時の考慮事項をへらすため、<install-path>/conf/server.xml<Stash home directory>/shared/ にコピーすることをおすすめします。


Stash 3.7 and earlier<install-path>/conf/

<install-path> は、システムでのアプリケーションのインストール先です。

 


<Context path="" docBase="${catalina.home}/atlassian-<atlassianapp>" reloadable="false" useHttpOnly="true">

Tomcat の server.xml 設定ファイルには、次のような Context ディレクティブがあります (Crowd を除く)。

ディレクティブを変更して、新しいコンテキスト パスを追加します。

<Context path="/<contextpath>" docBase="${catalina.home}/atlassian-<atlassianapp>" reloadable="false" useHttpOnly="true">

<contextpath> には独自の値を使用します。一般に、各アプリケーションで異なるコンテキスト パスを使用します。

path の値の先頭では path="<contextpath>" ではなく path="/<contextpath>" のように、スラッシュ (/) が必要です。

Use these instructions to update the Crowd context path.

3. Connector ディレクティブを設定する

3.1. Configure Fisheye/Crucible web server (Jetty)

FishEye または Crucible を使用している場合、管理領域からプロキシ ホスト、プロキシ スキーム、およびプロキシ ポートを設定します。詳細については、「Fisheye web サーバーを設定する」を参照してください。

Bitbucket Server 5.0 を構成している場合

Bitbucket Server 5.0 以降では Tomcat のコネクタを直接設定することができません。このため、このセクションの設定は、Bitbucket Server 4.14 以前でのみ利用できます。

server.xml configurations have been replaced by <Bitbucket home directory> /shared/bitbucket.properties

Please read through Migrate server.xml customizations to bitbucket.properties to check the corresponding properties and and to translate the configuration below. After finishing the mapping to bitbucket.properties go to Part B. Configure SSL.

It is possible to change the configuration also directly in the config.xml by having a configuration similar to:

<web-server site-url="http://<subdomain>.<domain>.com" context="">
   <http bind=":8060" proxy-port="80" proxy-scheme="http" proxy-host="<subdomain>.<domain>.com"/> 
</web-server>


3.2. Configure other Atlassian applications web server (Tomcat)

その他のアトラシアン サーバー アプリケーションのいずれかを使用している場合、Connector ディレクティブを次のように設定します。

各アプリケーションにおいて、Tomcat の server.xml  ファイルで通常の (非 SSL) Connector ディレクティブを見つけ、次のように Connector ディレクティブに schemeproxyName、および proxyPort 属性を追加します。その他の属性には既定値を設定します。これには port も含まれ、変更する特別な理由がない場合はそのままにします。proxyName の値には独自のドメイン名を使用します。

<Connector port=<default>
	maxThreads=<default>
    minSpareThreads=<default>
    connectionTimeout=<default>
    enableLookups=<default>
    maxHttpHeaderSize=<default>
    protocol=<default>
    useBodyEncodingForURI=<default>
    redirectPort=<default>
    acceptCount=<default>
    disableUploadTimeout=<default>
	proxyName="<subdomain>.<domain>.com"
	proxyPort="80"
	scheme="http"/>

Note that the proxyName parameter should be set to the FQDN that IIS will be configured to serve. This is the address a user would type into their browser to access the application. For example:

  • use <atlassianapp>.example.com to access the application at a sub-domain like http://<atlassianapp>.example.com/
  • use example.com  to access the application at a context path like  http://example.com/<atlassianapp> . In this case, the context path should not be included in the proxyName parameter, and you would have already set the Context directive in step 2 above.
  • use proxyPort="443" and scheme="https" in case the SSL is being terminate at IIS.

For more information about configuring the Tomcat Connector, refer to the Apache Tomcat 7.0 HTTP Connector Reference.


If you previously had HTTPS redirection implemented directly in Tomcat (e.g. Running Jira over HTTPS) – you may need to update the <jira-install>/WEB-INF/web.xml file to remove Tomcat redirect rules that specify the security-constraint section since you will be using IIS redirection instead.


Part B. Configure Internet Information Services (IIS)

1. Be sure you have ARR, URL rewrite and Request Filtering installed on your IIS server

In case you do not have Application Request Routing and URL Rewrite on your IIS server install them using Application Request Routing Installer.

In case Request Filtering is not installed in your IIS instance you can install it following https://www.iis.net/configreference/system.webserver/security/requestfiltering.

2. Enable Proxying on ARR

  1. From the IIS7 Console, click on Server_Name and  open Application Request Routing Cache:
  2. From the Actions panel on the right hand side, select  "Server Proxy Settings"
     
  3. Check "Enable Proxy" and set HTTP Version to "HTTP/1.1":
  4. Deselect "Reverse rewrite host in response headers" then leave all the other options on the default value and click on Apply to apply the changes.

3. Add an Application Pool and new IIS website 

Create an Application Pool for Atlassian applications and change the the .NET CLR Version to "No Managed Code". Please see How to create a new application pool for more details. If your site is configured with Default Pool and it's being shared, and ASP.NET is registered with IIS, it may cause some unexpected behavior in Atlassian applications, especially for integration features like Smart commits etc.

Next step, create a IIS website to configure the redirect. More info on how to create a Web Site on IIS can be found at How to set up your first IIS Web site. Configure this website to use the Application Pool created in the earlier step.

 In this article the site added is jira.example.com. You can change it with the correct one for your instance/domain. When a web site is created in IIS, it needs a DocumentRoot to be specified. Since this is for a redirect purpose, the DocuementRoot path itself is not important - it can be inside IIS directory or any other path since the requests are redirected to Jira.


4. Add a new URL rewrite rule

  1. From the IIS Console, click on  jira.example.com  and open URL Rewrite:
  2. From the Actions panel on the right hand side, select "Add Rules" and choose "Blank Rule";
  3. Add a name for the rule;
  4. Set Match URL to:
    1. Requested URLMatches the Pattern
    2. UsingRegular Expressions
    3. Pattern(.*)
    4. Ignore CaseChecked
  5. Set Action to:
    1. Action TypeRewrite
    2. Rewrite URL http://<JIRA_url:Port>/{R:1}
    3. Append query stringChecked
  6. Mark Stop processing of subsequent rules;
  7. Click on Apply to apply the changes.


Rule Order - Redirect before rewrite

If redirection to HTTPS in IIS will be used (recommended), you will need to implement a redirect rule in IIS and position it above/before the URL rewriting rule specified above (this will redirect the query to HTTPS before rewriting it). For an in-depth resource on this, please check out Redirect HTTP to HTTPS with Windows IIS 10.


5. Tune Request Filtering

  1. Double-click on the site name to move in the site configuration section.

  2. Click in Request Filtering

  3. Then click in Edit Feature Settings:
  4. Check Allow double escaping and hit OK:

6. Disable Output Caching

  1. On the Site Home screen in IIS Manager double click on "Output Caching"
  2. On the right side under Actions, click on Edit Feature Settings
  3. Uncheck Enable Cache and Enable kernel cache
  4. Click OK

Enabling caching will have intermittent user session changed. User session changed or hijacked in Jira server integrated with IIS

7. Enable long URLs

Add a registry key as shown below to increase the path length that IIS can handle. This is necessary for some gadgets and buttons to work correctly.

Path: "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters"
Type: DWORD 32-bit
Name: "UrlSegmentMaxLength"
Value: "1000" Hexadezimal

You will need to restart Windows for the changes to take effect. With that, we would recommend scheduling a maintenance window accordingly.

Confluence 6.0 specific notes:

If you're using Confluence 6.0 or later with Synchrony (which is required for collaborative editing), you'll need to ensure the following prerequisites are met:

  1. You must have IIS version 8.0 or higher installed
  2. You must have Web Sockets Support for IIS installed
  3. You must have Application Request Routing 3.0 installed

Please note that at this time we have seen some issues with IIS and Synchrony when pasting text. Pasting text is not possible if it is more than a small amount of text, as indicated in this issue:

CONFSERVER-46504 - 課題詳細を取得中... ステータス

You'll also need to use the following rewrite rules in your web.config file:

Sample web.config for Synchrony
<system.webServer>
    <rewrite>
        <rules useOriginalURLEncoding="false">
        <clear />
        <rule name="Synchrony HTTP" stopProcessing="true">
            <match url="^synchrony/(.*)" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
            <action type="Rewrite" url="http://localhost:8091/synchrony/{R:1}" />
        </rule>
        <rule name="Synchrony Web Sockets Reverse Proxy" stopProcessing="true">
            <match url="ws://(.*)" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
            <action type="Rewrite" url="ws://localhost:8091/{R:1}" />
        </rule>
        <rule name="Unencoded URL for Companion" stopProcessing="true">
            <match url="^download/(.*)" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
            <action type="Rewrite" url="http://localhost:8090{UNENCODED_URL}" appendQueryString="false" />
        </rule>
        <rule name="Confluence Reverse Proxy" stopProcessing="true">
            <match url="(.*)" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
            <action type="Rewrite" url="http://localhost:8090/{R:1}" />
        </rule>
        </rules>
    </rewrite>
    <security>
        <requestFiltering allowDoubleEscaping="true" />
    </security>
    </system.webServer>
    <system.web>
        <!-- This keeps IIS from complaining about special characters in the url. Also has some controls for max upload size. Set to the equivalent of the above, but in kilobytes instead of bytes. (ex. 61440 = 60MB) -->
        <httpRuntime executionTimeout="20" maxRequestLength="xxxxx" requestPathInvalidCharacters="" requestValidationMode="2.0" />
        <pages validateRequest="false" />
    </system.web>

In the example above, Confluence is accessed without a context path and does not use Confluence's internal proxy. See Administering Collaborative Editing for other proxy configuration options.

As IIS 8.0 and above does not support the Sec-WebSockets-Extension permessage-deflate header, you will also need to add the following to your startup parameters:

  • If you start Confluence via startup script on Windows or Linux, add the following parameter to your <install-path>/bin/setenv.bat or setenv.sh 
# For Linux/Unix setenv.sh
CATALINA_OPTS=-Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true %CATALINA_OPTS%


# For Windows setenv.bat
set CATALINA_OPTS=-Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true %CATALINA_OPTS%
  • If your instance is installed as a Windows service, add the following system property via command line or registry. See Configuring System Properties guide for instructions:
-Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true

パート C. 最終設定

各アプリケーションを再起動する

各アプリケーションを再起動し、新しい URL を使用してアクセスできることを確認します。 上述の停止と開始についての手順をご確認ください。

アプリケーションのベース URL を設定する

For each Atlassian application, set the Base URL to the address you configured in the proxy, which is the URL that Internet Information Services (IIS) will be serving (such as  http://www.example.com/<atlassianapp>).

For details see the instructions for your Atlassian product:

Part D. Configure Multiple Sites on the same IIS instance

OPTIONAL: In some cases more than one site will be hosted in the same IIS installation. In case you want to have a subdomain structure (i.e. jira.example.com, confluence.example.com), you may create different sites as follow:


Multiple sites on IIS single instance
  1. Create an A Record in the DNS for your subdomain and point to the same IP
      (info) IIS Reverse proxy server IP. The IP that the users will use to access the IIS. 
  2. Create new sites (step 3 of the instructions above) for each one of your subdomains:
    1. Sites > Add Website
    2. Site Name: subdomain.example.com
    3. Physical Path: select the subdomain directory
    4. Binding: same ip as example.com
    5. Host name: subdomain.example.com

NOTE: For more information about using Host Headers and SSL, you may take a look at this blog-post.

説明 This page explains how to establish a network topology in which Internet Information Services (IIS) acts as a reverse proxy for Atlassian server applications. The page has been written as a recipe for success – we recommend you follow it step by step. 
製品Jira, Confluence, Bamboo, Bitbucket, Fisheye, Crucible, Crowd
プラットフォームServer
最終更新日: 2023 年 10 月 30 日

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

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