Select Page
Welcome to our Support Center
< All Topics

How to Set Up a Reverse Proxy on IIS with URL Rewrite?

Complete Guide: How to Set Up a Reverse Proxy on IIS with URL Rewrite?

 

Introduction

A reverse proxy is a server that sits between client devices and a web server, forwarding client requests to the web server. Using Internet Information Services (IIS) with the URL Rewrite module, you can easily configure a powerful reverse proxy on your Windows server. This setup is particularly useful for load balancing, providing SSL termination, caching content, and obscuring backend server architectures.

This tutorial will guide you through the process of setting up a reverse proxy using IIS and the URL Rewrite module, allowing you to seamlessly direct traffic from your IIS server to backend applications and services.

Prerequisites

Before beginning, ensure you have:

 

  • Windows Server with IIS installed (Windows Server 2012 R2, 2016, 2019, or 2022)
  • Administrator access to the server
  • URL Rewrite Module (Install via Web Platform Installer if missing)
  • Administrator access

Step 1: Install URL Rewrite Module (If Not Installed)

 

 

  • Verify installation
      • Open IIS Manager → Check if “URL Rewrite” appears under Site Features.

Step 2: Install the Application Request Routing (If Not Installed)

 

  • Download URL Application Request Routing from Microsoft:
  • Run the installer and follow the setup wizard.

 

Step 3: Configure Reverse Proxy in IIS

We will forward requests from http://yourdomain.com to http://backend-server:port

 

Option 1: Using GUI (IIS Manager)

  1. Open IIS Manager → Select your website (or Default Website).
  2. Double-click “URL Rewrite” → Click “Add Rule(s)” → Select “Reverse Proxy“.
    Enter Backend Server Details:

    • Server name or IP: backend-server-IP or domain-name to (e.g., 192.168.1.100)
    • Port: backend-port to (e.g., 8080)
    • Check “Enable SSL Offloading” if backend uses HTTPS.
    • Click OK → The rule will be created automatically.

    Option 2: Manually Edit web.config

     

    1. Open C:\inetpub\wwwroot\web.config (or your site’s root folder).
    2. Add the following inside <system.webServer>

     

    <rewrite>
      <rules>
        <rule name=“ReverseProxy” stopProcessing=“true”>
          <match url=“(.*)” />
          <action type=“Rewrite” url=“http://backend-server:port/{R:1}” />
        </rule>
      </rules>
    </rewrite>

     

    Restart IIS to apply changes:

    Open Command Prompt (Admin) and run:

     

    iisreset /restart

     

    Step 4: Test the Reverse Proxy

    • Access your IIS domain (e.g., https://yourdomain.com).
    • Verify whether the content is being served by the backend server.
    • Check IIS logs (C:\inetpub\logs\LogFiles) for proxy activity.

    Conclusion

    Setting up a reverse proxy on IIS with URL Rewrite allows you to efficiently manage traffic to your backend servers, providing benefits like load balancing, simplified security management, and centralized SSL termination. By following this tutorial, you’ve successfully configured a reverse proxy that can handle various routing scenarios and enhance your web infrastructure.

    HostingHome Tip: For high-traffic sites, enable caching and compression in IIS for better performance.

    Need help? Contact HostingHome Support for expert server security assistance! 🚀