What It Does

This web.config makes IIS act as a reverse proxy: all incoming HTTP traffic to your IIS website is silently forwarded to ASPPY, running as a service on localhost:8080. The client never sees port 8080 — to the outside world, IIS remains the web server, just as it did with Classic ASP.

This setup is the easiest (no the only) way to run ASPPY as a drop-in replacement for Classic ASP/VBScript pages, without changing any URLs or client-facing behaviour.

<configuration>
  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
    <rewrite>
      <rules>
        <rule name="ReverseProxyToASPPY" stopProcessing="true">
          <match url=".*" />
          <action type="Rewrite" url="http://localhost:8080/{R:0}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Line-by-Line Explanation

<httpErrors existingResponse="PassThrough" />

By default, IIS intercepts HTTP error responses (404, 500, etc.) and replaces them with its own error pages. PassThrough disables this — whatever ASPPY returns is sent directly to the client, errors included. This is important so that ASPPY's own error handling reaches the browser unmodified.

<match url=".*" />

A regular expression that matches every incoming request URL, without exception. All .asp pages, static assets, and any other requests are captured by this rule.

stopProcessing="true"

Once this rule matches (which it always will), IIS stops evaluating any further rewrite rules. Prevents unintended rule conflicts.

<action type="Rewrite" url="http://localhost:8080/{R:0}" />

Rewrites the request to ASPPY on localhost:8080, appending the original URL path via {R:0} (the full matched string). For example:

Incoming request Forwarded to ASPPY
/ http://localhost:8080/
/default.asp http://localhost:8080/default.asp
/shop/order.asp?id=42 http://localhost:8080/shop/order.asp?id=42

This is a rewrite, not a redirect — the URL in the browser does not change.


Requirements

1. URL Rewrite Module (required)

Provides the <rewrite> configuration section in web.config. Without it, IIS does not understand the rewrite rules and will throw a 500 error.

2. Application Request Routing — ARR (required)

Enables IIS to forward HTTP requests to ASPPY on port 8080. The URL Rewrite module alone can rewrite URLs internally, but cannot proxy requests over HTTP to another process.

Important: After installing ARR, you must explicitly enable the proxy at the server level in IIS Manager:
IIS Manager → Server node → Application Request Routing Cache → Server Proxy Settings → Enable proxy → Apply
This is a one-time step per server. Without it, rewrite rules that forward to http://localhost:port will silently fail with a 404.

3. ASPPY running on port 8080 (required)

The ASPPY service must be running and listening on localhost:8080 before any requests will be handled. IIS will return a 502 Bad Gateway if ASPPY is not running.


Scope

This web.config only affects the site it belongs to. Enabling ARR proxy at the server level is a global capability switch, but the actual forwarding behaviour is controlled entirely by per-site rewrite rules. Other IIS websites on the same server without these rules are completely unaffected.


Traffic Flow

Browser → IIS :80/:443 → ASPPY on localhost:8080
                      ← response returned to browser

IIS handles SSL termination, logging, and connection management. ASPPY receives plain HTTP requests on port 8080 and returns responses exactly as Classic ASP did — the transition is transparent to the client.