Microsoft Internet Information Services (IIS) does not support Reverse Proxy by default; to do this, you need to use Web Platform Installer to install the Application Request Routing (ARR) extension and use the URL Rewrite module to implement a reverse proxy server for back-end applications.
This article explains how to do this by setting up a scenario first; if you already have the web server installed and your application deployed, click here to skip the example scenario setup.
Scenario Preparation
Installing Internet Information Services (IIS)
To install the web server, use Server Manager to add the role:
You can find more information about installing and configuring IIS in the following article: Domain Configuration in IIS with Windows Server.
Installing a Sample Werkzeug Application for the Proxy
The example scenario will use Werkzeug, and a sample application will be created to set up a reverse proxy. Therefore, download the Python installer executable for Windows from the official website:
https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe
Run it with administrator privileges and remember to select the checkbox to add Python to PATH:
Once the installation is complete, open CMD or Powershell with administrator privileges and install Werkzeug:
# pip install WerkzeugThen create a file named app.py with the following content:
from werkzeug.wrappers import Request, Response
@Request.application
def application(request):
return Response('Hello, World!')
if __name__ == '__main__':
from werkzeug.serving import run_simple
run_simple('localhost', 4000, application)
Next, run it from the Windows console (add the path if necessary):
# py app.pyThe following should appear:
* Running on http://localhost:4000/ (Press CTRL+C to quit)The application for the reverse proxy will now be ready.
Installing and Configuring the Proxy Extension
With an IIS web server already installed, download the Application Request Routing extension required to set up a reverse proxy:
https://www.iis.net/downloads/microsoft/application-request-routing
When the installation is complete, restart the server and log in again. Open IIS Manager to add a site or use an existing one, and URL Rewrite will appear among the site's menu options. Click this module:
In the URL Rewrite menu, add a rule; a new window will appear, where you should click Reverse Proxy:
In the new window for adding a reverse proxy rule, configure it for your application. In this article, we configure the Werkzeug installed during the scenario preparation step:
Add your application under Regla de entrada, select the destination site (the hostname in this example), and then use a web browser to check that the reverse proxy works correctly:
Remember that you can obtain a free SSL certificate with Let's Encrypt to configure HTTPS with IIS. You can follow this article to do so: Install a Let’s Encrypt Certificate on Windows Server.
We hope this tutorial has helped you. Have you tried it? Leave us your comments! 🙂
Remember, if you have questions about this or any other issue related to your servers on Clouding, feel free to write to soporte@clouding.io We're here for whatever you need!