Share via

How to use IIS on Windows Server 2019 for reverse proxy?

OldNoob 40 Reputation points
2026-02-14T08:31:33.42+00:00

Subject: How to use IIS on Windows Server 2019 for reverse proxy?

Goal: I want to host my primary IIS site normally, but access an application called "OpenList" at the path https://ip/openlist.

Current Setup:

  • OS: Windows Server 2019
  • Server: IIS with SSL (Certificate installed, https://ip works).
  • Modules: URL Rewrite Module and Application Request Routing (ARR) are installed.
  • Backend App: OpenList is running on http://127.0.0.1:5244.

The Problem: When I access https://ip/openlist, I get a browser error: ERR_TOO_MANY_REDIRECTS (or "This page isn't working, redirect loop").

Configuration Details:

  1. OpenList Config (config.json): I have set the site_url to match the external address:
       "site_url": "https://ip/openlist"
    
  2. IIS Web.Config: I placed this web.config in the root of my IIS site:
       <?xml version="1.0" encoding="UTF-8"?>
       <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="OpenlistProxy" stopProcessing="true">
                        <match url="^openlist(/.*)?" ignoreCase="true" />
                        <action type="Rewrite" url="http://127.0.0.1:5244{R:1}" appendQueryString="true" />
                    </rule>
                </rewrite>
            </system.webServer>
        </configuration>
    
Windows development | Internet Information Services
{count} votes

Answer accepted by question author
  1. Tom Tran (WICLOUD CORPORATION) 4,415 Reputation points Microsoft External Staff Moderator
    2026-02-25T10:43:46.1366667+00:00

    Hi @OldNoob ,

    It’s great to hear that you were able to resolve the issue, and thank you for sharing the exact configuration change that fixed it. I really appreciate you following up with the working solution, as this will be helpful for others running into the same behavior.


    Issue:

    • When accessing OpenList through IIS at https://<server>/openlist, the site returned a redirect loop (ERR_TOO_MANY_REDIRECTS). Although IIS was successfully proxying requests to the backend service, OpenList continued redirecting because the internal request path did not match how the application expected to be accessed.

    Solution:

    • The issue was resolved by modifying the IIS rewrite rule so that requests are forwarded to /openlist on the backend service instead of the backend root. Specifically, changing the rewrite action from:
      http://127.0.0.1:5244{R:1}
      to
      http://127.0.0.1:5244/openlist{R:1}

    With this change, IIS forwards requests to the backend using the same /openlist base path that is exposed externally. Because OpenList now consistently receives requests under the expected path, it no longer attempts to redirect the request to correct the URL, and the redirect loop stops occurring.


    Thanks again for taking the time to confirm and share the solution.

    If you find this summarization helpful, please kindly consider marking this as the final answer by following this guidance.

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. OldNoob 40 Reputation points
    2026-02-24T09:13:15.8833333+00:00

    I changed

    <action type="Rewrite" url="http://127.0.0.1:5244{R:1}" appendQueryString="true" />

    to

    <action type="Rewrite" url="http://127.0.0.1:5244/openlist{R:1}" appendQueryString="true" /> and the problem was solved.

    0 comments No comments

  2. Tom Tran (WICLOUD CORPORATION) 4,415 Reputation points Microsoft External Staff Moderator
    2026-02-16T10:01:23.61+00:00

    Hi @OldNoob ,

    Thanks for sharing your info!

    From what you shared, your setup is very close. OpenList is just getting a bit confused about where it lives, so your browser keeps going in circles.

    Perhaps you could try to:


    1. Update your OpenList config.json

    Tell OpenList that it lives in the folder called /openlist:

    "sub_path": "/openlist",
    "disable_force_https": true
    

    2. Update your IIS rule

    This helps IIS tell OpenList that you're inside the /openlist folder.

    <rule name="OpenList" stopProcessing="true">
        <match url="^openlist/?(.*)$" />
        <action type="Rewrite" url="http://127.0.0.1:5244/{R:1}" />
        <serverVariables>
            <set name="HTTP_X_FORWARDED_PROTO" value="https" />
            <set name="HTTP_X_SCRIPT_NAME" value="/openlist" />
        </serverVariables>
    </rule>
    

    3. Restart IIS and OpenList, then refresh your browser.


    Hope this helps! Please let me know how it goes!


  3. Bruce (SqlWork.com) 83,581 Reputation points Volunteer Moderator
    2026-02-14T20:58:54.99+00:00

    It appears the proxies site is looping back. What happens if you hit the proxied site directly:

    http://127.0.0.1:5244

    use the browsers network trace to see it is redirecting.

    0 comments No comments

  4. Q&A Assist
    2026-02-14T08:32:15.85+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To set up a reverse proxy for your application "OpenList" using IIS on Windows Server 2019, you need to ensure that your configuration is correct and that there are no redirect loops. Here are some steps to help you troubleshoot and configure your setup:

    1. Check the Application Configuration: Ensure that the site_url in your OpenList configuration is set correctly. Since you are using a reverse proxy, the site_url should typically point to the internal address (e.g., http://127.0.0.1:5244) rather than the external URL. You might want to change it back to http://127.0.0.1:5244.
    2. IIS Web.Config: Your web.config looks mostly correct, but ensure that the rule is properly defined. The rule you provided should work, but you may want to add a condition to prevent the rule from applying to requests that are already being proxied. Here’s an updated version of your rule:
         <rule name="OpenlistProxy" stopProcessing="true">
             <match url="^openlist(/.*)?" ignoreCase="true" />
             <conditions>
                 <add input="{HTTP_HOST}" pattern="^ip$" />
             </conditions>
             <action type="Rewrite" url="http://127.0.0.1:5244{R:1}" appendQueryString="true" />
         </rule>
      
      This condition checks that the request is coming to the expected host.
    3. Enable Proxy: Ensure that you have enabled the proxy functionality in the Application Request Routing settings in IIS. You can do this by:
      • Opening IIS Manager.
      • Selecting your server node.
      • Clicking on the "Application Request Routing" feature.
      • Checking the "Enable Proxy" checkbox.
    4. Testing the Configuration: After making these changes, restart IIS and try accessing https://ip/openlist again. If you still encounter the redirect loop, check the logs for any clues about the nature of the redirects.
    5. Outbound Rules: If your application generates links that point back to itself incorrectly, you may need to set up outbound rules to rewrite those links correctly. This can help prevent the redirect loop by ensuring that links in the response point to the correct external URL.

    By following these steps, you should be able to configure your IIS to work as a reverse proxy for your OpenList application without encountering redirect issues.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.