Setting up IIS as Reverse Proxy for QPR UI
Jump to navigation
Jump to search
Follow these instructions to route QPR MobileDashboard HTTP traffic though IIS. It allows to use QPR MobileDashboard in IIS port (usually 80) instead of QPR MobileDashboard port (usually 8080). In addition, HTTPS can be configured in IIS, instead of GlassFish.
- Install Microsoft Web Platform Installer from http://www.microsoft.com/web/downloads/platform.aspx.
- Use it to install URL Rewrite and Application Request Routing modules.
- Create file C:\inetpub\wwwroot\m\web.config with following contents:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Reverse Proxy to mobiledash" stopProcessing="true"> <match url="(.*)" /> <action type="Rewrite" url="http://localhost:8080/mobiledash/{R:1}" /> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> </rule> </rules> <outboundRules> <rule name="Change port"> <match filterByTags="A, Form, Img" pattern="^http://localhost:8080/(.*)" /> <action type="Rewrite" value="http://localhost/{R:1}" /> </rule> </outboundRules> </rewrite> </system.webServer> </configuration>
- Create file C:\inetpub\wwwroot\EnticeServices\web.config with following contents:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Reverse Proxy to EnticeServices" stopProcessing="true"> <match url="(.*)" /> <action type="Rewrite" url="http://localhost:8080/EnticeServices/{R:1}" /> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> </rule> </rules> <outboundRules> <rule name="Change port"> <match filterByTags="A, Form, Img" pattern="^http://localhost:8080/(.*)" /> <action type="Rewrite" value="http://localhost/{R:1}" /> </rule> </outboundRules> </rewrite> </system.webServer> </configuration>
- Open IIS Management Console, click Application Requests Routing Cache in server level, click Server Proxy settins, click Enable Proxy.
- In IIS Management Console, click m and URL Rewrite, View server variables, and add HTTP_X_ORIGINAL_ACCEPT_ENCODING and HTTP_ACCEPT_ENCODING using Add button
- Do the same for EnticeServices folder.
- To harden security, in GlassFish allow incoming requests only from localhost.