Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
web.config

README.md

What this is for

This guide explains how to set your IIS to allow connecting Document Server using a virtual path (i.e. when Document Server address is not the root domain address, but is a virtual folder inside the address, e.g. http://docservice/documentserver-virtual-path/).

How to use it

Step 1

Edit the web.config file. Find rewrite.rules in the configuration section:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="INIT_SERVER_VARIABLE_FROM_PROXY" stopProcessing="false">
          <match url=".*" /> 
          <serverVariables>		  
		    <set name="HTTP_THE_SCHEME" value="{HTTP_X_FORWARDED_PROTO}" replace="true" />			
			<set name="HTTP_THE_HOST" value="{HTTP_X_FORWARDED_HOST}" replace="true" />
          </serverVariables>
		  <action type="None" />
        </rule>	
		<rule name="INIT_SERVER_VARIABLE_DEFAULT" stopProcessing="false">
          <match url=".*" /> 
		  <conditions trackAllCaptures="true">
			<add input="{HTTPS}s" pattern="on(s)|offs" />
          </conditions>
          <serverVariables>		  
			 <set name="HTTP_THE_SCHEME" value="http{C:1}" replace="false" />			
			 <set name="HTTP_THE_HOST" value="{HTTP_HOST}" replace="false" />						
          </serverVariables>
		  <action type="None" />
        </rule>	
        <rule name="DocumentServerRewrite" enabled="true">
          <match url="^documentserver-virtual-path(.*)" />
            <conditions trackAllCaptures="true">
              <add input="{HTTPS}s" pattern="on(s)|offs" />
            </conditions>
            <serverVariables>              
			  <set name="HTTP_X_FORWARDED_PROTO" value="{HTTP_THE_SCHEME}" replace="true" />
              <set name="HTTP_X_FORWARDED_HOST" value="{HTTP_THE_HOST}/documentserver-virtual-path" replace="true" />
            </serverVariables>
            <action type="Rewrite" url="http://docservice{R:1}" />
         </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

And replace the docservice value with Document Server real IP (when on local network) or Internet address. The documentserver-virtual-path value must be changed to Document Server virtual folder address.

Step 2

Install the additional IIS components:

Step 3

Add IIS server variables. You will need to add HTTP_X_FORWARDED_PROTO,HTTP_X_FORWARDED_HOST,HTTP_THE_SCHEME and HTTP_THE_HOST as new IIS server variables. This can be done the following way:

  • Go to the IIS Manager, select the website, then open URL Rewrite.
  • In the right-side menu locate Manage Server Variables and click View Server Variables.
  • Use the Add... action and add the HTTP_X_FORWARDED_PROTO,HTTP_X_FORWARDED_HOST,HTTP_THE_SCHEME and HTTP_THE_HOST one after another. More information on adding the variables to the IIS server can be found here.