How to Configure IIS Port Forwarding

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up iis port forwarding to send incoming web traffic from one port to another internal port. To do this safely, you combine web server routing rules with strict firewall limits and TLS certs. Many Windows teams run multiple web apps on a single host. Each app listens on its own local port. Clients on the internet only send traffic to standard web ports. Port forwarding bridges this gap without exposing internal app ports to the public network. How iis port forwarding works in your setu

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up iis port forwarding to send incoming web traffic from one port to another internal port. To do this safely, you combine web server routing rules with strict firewall limits and TLS certs.

Many Windows teams run multiple web apps on a single host. Each app listens on its own local port. Clients on the internet only send traffic to standard web ports. Port forwarding bridges this gap without exposing internal app ports to the public network.

How iis port forwarding works in your setup

Standard web servers listen on the configured port for clear text and the configured port for encrypted traffic. Internal apps often run on high ports like 3000 or 8080. When a request hits the main server, the routing module reads the host header and URL path. It then sends the request to the right local port on the same machine or another internal host.

On Windows Server, teams achieve this in two ways. For web traffic, you add URL rewrite and request routing extensions to the web server. These extensions inspect HTTP headers and forward requests to backend app pools or local services. For raw TCP traffic, Windows offers built-in network port mapping at the OS level.

This setup affects both public users and internal services. Public users only see the main web server and its public port. Backend apps only receive traffic from the local web server process. Safe defaults start with blocking direct public traffic to the high backend ports in the Windows firewall.

You should also bind backend apps to the loopback address when they run on the same host. Always terminate TLS on the front web server and use strong certs. Disable open forwarding so attackers cannot use your server to reach random internal hosts. Run each app pool under a dedicated service account with minimal file permissions.

Checking your setup and closing audit gaps

After you set up the routing rules, you must check that the paths work as expected. Send test requests from an external machine to the public port. Confirm that the server returns the right app response. Next, try to reach the high backend port from outside the host. The firewall must drop that direct traffic every time.

SSH Agent Forwarding Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Check your web server logs to confirm that client IP addresses pass through to the backend app. Without forwarded headers, the backend log only shows the local server address. Clear logs help your security team trace requests during an incident. You should also monitor failed requests and strange host headers to spot scanning attempts.

Static routing rules and firewall blocks only protect the network path. Once an admin logs in to manage the Windows host or query backend data, static network rules stop helping. Standard server logs do not capture every command an admin runs inside an active session.

If a service account key leaks, an attacker can still read sensitive records. Sensitive fields like emails, phone numbers, card numbers, and national IDs remain visible in plain query results unless you add controls that rewrite matched fields in results.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What is the difference between URL rewrite and OS port mapping?

URL rewrite works at the HTTP layer and inspects web headers, paths, and host names. OS port mapping works at the TCP layer and forwards raw network packets without reading web content.

Why do backend logs only show the local server IP address?

When the web server forwards a request, it opens a new local socket to the backend app. You must enable forwarded header fields so the backend app can read the original client IP.

Do I need to open the backend app port in the public firewall?

No, you should keep the backend port closed to the public network. Only open ports 80 and 443 to the public, and let the web server talk to the backend port over the local loopback interface.

The query runs. The emails stay hidden.