Confluence on IIS results in redirect loop
Asked by Asaf Sitner:

I've followed the instructions found in [the](https://confluence.atlassian.com/display/CONFKB/How+To+Setup+Confluence+with+IIS "Part 1") [documentation](https://confluence.atlassian.com/display/CONFKB/Connecting+Confluence+with+IIS+7 "Part 2") and connected Confluence to an IIS7 website (on windows server 2012).

The Confluence installtion at \<mydomain\>/confluence works properly, but the requests to the site on other paths (i.e. \<mydomain\>/\*) result in a redirect loop and the page doesn't load.

The server.xml file looks like this:

```
&lt;Server port="8000" shutdown="SHUTDOWN" debug="0"&gt;    &lt;Service name="Tomcat-Standalone"&gt;        &lt;Connector port="8090" connectionTimeout="20000" redirectPort="8443" maxThreads="200" minSpareThreads="10" enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" /&gt;        &lt;Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" URIEncoding="UTF-8" /&gt;                 &lt;Engine name="Standalone" defaultHost="localhost" debug="0"&gt;          &lt;Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false"&gt;                &lt;Context path="/confluence" docBase="../confluence" debug="0" reloadable="false"&gt;                    &lt;Manager pathname="" /&gt;                &lt;/Context&gt;            &lt;/Host&gt;        &lt;/Engine&gt;    &lt;/Service&gt;&lt;/Server&gt;
```

Am I missing something?


Answers:
author: Tiago Comasseto
body: Hi Asaf, personally I really hate AJP, I lost my temper many times with it... then my live changed when I discovered ARR, you can see how this configuration is set [here](https://confluence.atlassian.com/display/JIRAKB/Integrating+JIRA+with+IIS+using+ARR). It says JIRA there, but the steps are exactly the same for Confluence.

I hope it helps.

Cheers

comments: author: Asaf Sitner
body: So how exactly do I set this up as a non-subdomain?

The documentation only explains [confluence.mydomain.com](http://confluence.mydomain.com), but what do I need to do if I want to make it into mydomain.com/confluence?

I've tried setting a rewrite rule that with the pattern **/confluence/.\*** to keep the rest of the site intact, and with the destination of **localhost:8090/{R:0}** (the default confluence settings).

In the server.xml file I've added the proxy name to **[mydomain.com](http://mydomain.com)** and the port to **80**.

However, I'm getting a 404 error on any matching request (mydomain.com/confluence/anything). Any ideas where I messed up?


author: Tiago Comasseto
body: Hi Asaf, you can use the pattern exactly as in the KB, you can use *(.\*)* in IIS and set the contect path (*/confluence* ) in your *server.xml*

Cheers


author: Asaf Sitner
body: I tried that, so that the pattern is **.\*** in the IIS redirect rule, and the server.xml proxy name is set to **mydomain/confluence**

But now I'm getting server error 404 on the site root, and the confluence path points to **mydomain/confluence/confluence/\***

So the confluence installation works in this configuration, but not the rest of the site.

Oh, and by the way, I had to change the redirect path's arguments from {R:1} to {R:0}, otherwise I'm getting error 500.50 for invalid rewrite parameter. IIS also warns that 1 is not a legal reference.


author: Asaf Sitner
body: I've made no progress since.

I read somewhere that it's possible to do this with server farms - is it true? Should I try this approach?


Tags: confluence-administration

iis

redirect