How can we help?

Search the knowledge base or browse by topic.

Follow

Configuring IIS as a Reverse Proxy for VT Writer

Prerequisites:

  1. You must install these two required extensions for Microsoft IIS:
    Url-Rewrite-Download
    Application-Request-Routing-Download

Creating a Server Certificate


Note: creating a certificate only needs to be done if you do not have an SSL cert for your server already.


First step is to create a SSL cert for the VisibleThread Doc server via Microsoft IIS. Open your Microsoft IIS server and navigate to the Server Certificates tab and double click it.


IIS Manager feature view with the Server Certificates icon highlighted

In the pane on the right hand side of the window you will see options for creating an SSL cert. For this example I will use a Self-Signed Certificate. 


worddavd2e55b6d0fbb183b80427f72c7f97a2c.png


Next, create a name for your certificate. Once you have entered a name. click OK.

IIS Create Self-Signed Certificate dialog with the friendly name field and OK button highlighted

 

Creating a Site


To create a site click Sites in the left pane.


IIS Manager connections tree with the Sites node highlighted


Click Add Web Site... in the right hand pane.


worddav20f006b496a329d6f7b7a84fa684529f.png


Next, fill the Add Website form with your relevant information. Ensure the IP address: is All Unassigned. Click OK once completed. 

IIS Add Website dialog with site name VTWriter, http binding on port 80 and IP address set to All Unassigned

 

Configuring the reverse proxy

To set up the reverse proxy, navigate to your new Site and click URL Rewrite.

IIS Manager home for the VT Writer site with the URL Rewrite icon highlighted


Next, click Add Rule(s)... in the right hand pane.


IIS URL Rewrite Actions pane with the Add Rule(s) link highlighted


Select Reverse Proxy and click OK

IIS Add Rule(s) dialog with the Reverse Proxy template and OK button highlighted

 

The address must be localhost:8080. Select Enable SSL Offloading. Then click OK.

Reverse proxy rule dialog forwarding to localhost:8080 with Enable SSL Offloading checked

 

Configuring SSL Encryption and Port 443

To set up SSL encryption and port 443 we need to add a new binding. Navigate to your Site in the IIS Manager and select Bindings... in the right hand pane. Then click Add....

IIS Edit Site actions pane with the Bindings link highlighted

Begin filling out the form. Ensure the Type: is set to https. Leave the IP Address as All Unassigned, and set the Port to 443. Lastly, select the SSL certificate you wish to use. Then click OK.

IIS Add Site Binding dialog set to https, All Unassigned, port 443 and the self-signed SSL certificate

Edit Preserve Host Headers Variable

On the server level, select Configuration Editor.

IIS Manager at the server level with the Configuration Editor icon highlighted

Under the system.webServer/proxy section, change the variable PerserveHostHeaders to True.

IIS Configuration Editor on system.webServer/proxy with preserveHostHeader set to True

Configure Server Proxy Settings

Go to the top level root of the server, click on ‘Application Request Routing Cache’ then in the right bar actions area in the ‘Proxy’ area go to ‘Server Proxy Settings’ and disable ‘Reverse rewrite host in response headers’

 

Increase Request Limit

Next, on the site level, open Request Filtering.

IIS Manager home for the VT Writer site with the Request Filtering icon highlighted

Click Edit Feature Settings in the left hand pane.

IIS Request Filtering Actions pane with the Edit Feature Settings link highlighted

Change the Maximum URL Length value to 8192. Change the Maximum query string value to 4096. Then click OK.

IIS Edit Request Filtering Settings dialog with Maximum URL length 8192 and Maximum query string 4096

Enable HTTP_X_FORWARDED

Select URL Rewrite on the server level. Then click View Server Variables.

IIS URL Rewrite Actions pane with the View Server Variables link highlighted

Click Add... and add the four variables below.

HTTP_X_FORWARDED_HOST
HTTP_X_FORWARDED_SCHEMA
HTTP_X_FORWARDED_PROTO
HTTP_X_FORWARDED_PORT

IIS allowed server variables list with the four HTTP_X_FORWARDED HOST, PORT, PROTO and SCHEMA entries

Next, back on the site level, open URL Rewrite and open your existing ReverseProxy rule. Under Server Variables, click Add.... The variables you just made should be available in the drop down menu. Add each one, with the values listed below:

HTTP_X_FORWARDED_HOST      {HTTP_HOST}
HTTP_X_FORWARDED_SCHEMA     https
HTTP_X_FORWARDED_PROTO      https
HTTP_X_FORWARDED_PORT 443

Reverse proxy rule Server Variables list setting the forwarded host to {HTTP_HOST}, scheme and proto to https and port to 443

Setting up HTTP - HTTPS Redirection

By default, after completing the IIS Reverse Proxy setup, VT Writer is available on Port 80 (HTTP) and Port 443 (HTTPS). In many cases it may be more desirable to redirect HTTP traffic to HTTPS to enforce encryption. The following steps will set up this redirection.

In the URL Rewrite menu on your IIS site, select Add Rule(s)... and then click Blank rule and click OK.

IIS URL Rewrite Add Rule(s) dialog with the Blank rule template and OK button highlighted

 

Choose a name for the rule, and change the pattern to (.*)

IIS Edit Inbound Rule named HTTP_REDIRECT_RULE with the match pattern (.*)

Select Conditions, then click Add. Insert {HTTPS} for the Condition Input. Insert ^OFF$ for the Pattern. Then click OK.

IIS Add Condition dialog with condition input {HTTPS} and pattern ^OFF$

Next select Action, and change the Action type to Redirect. Then insert https://{HTTP_HOST}{REQUEST_URI} in the Redirect URL field. Then click Apply in the top right corner.

IIS inbound rule Action set to Redirect with redirect URL https://{HTTP_HOST}{REQUEST_URI} and a permanent 301 redirect

Lastly, move up your new redirect rule in the URL Rewrite rule list by selecting your redirect rule and clicking Move Up.
IIS URL Rewrite rule list with the HTTP redirect rule above the reverse proxy rule and the Move Up action highlighted

Was this article helpful?
0 out of 0 found this helpful

Get Additional Help

Reach out to support@visiblethread.com to create a ticket.