Deploying of NodeJS Express Typescript API on IIS

ABGS Technical Support 0 Reputation points
2025-01-13T06:02:25.0633333+00:00

I'm trying to deploy my NodeJS Express Typescript API App on my IIS. While searching, I came across using the iisnode which is outdated and not maintained module these past few year. Also I came accross using reverse proxy. What is the best way or more efficient way to deploy my app in iis? Thanks a lot.

Windows development | Internet Information Services
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-01-14T06:21:19.7433333+00:00

    Hi @ABGS Technical Support,

    1.Build the project and we can find the publish files inside dist folder.

    User's image

    2.Create a site in IIS and set the physical path to E:\repos\Nodejs\typescript-express-api\dist.

    3.The publish files should like below.

    User's image

    4.The content of web.config.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
            </handlers>
            <httpPlatform stdoutLogEnabled="true" stdoutLogFile=".\node.log" startupTimeLimit="20" processPath="E:\Program Files\nodejs\node.exe" arguments=".\index.js">
                <environmentVariables>
                    <environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%" />
                    <environmentVariable name="NODE_ENV" value="Production" />
                </environmentVariables>
            </httpPlatform>
        </system.webServer>
    </configuration>
    
    1. Test Result.

    User's image

    Tip:

    We can find the nodejs installed path by command: where node


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards

    Jason


  2. Tom Tran (WICLOUD CORPORATION) 260 Reputation points Microsoft External Staff
    2025-07-18T10:35:13.67+00:00

    Hi ABGS Technical Support,

    Sorry for the late response

    You're absolutely right iisnode is no longer actively maintained and isn't recommended for modern Node.js deployments. Instead, the most efficient and reliable way to host a Node.js Express (TypeScript) API on IIS is by using IIS as a reverse proxy to forward requests to your Node.js application running on a separate port.

    Here's an overview:

    1. Run your Node.js app on a local port (e.g., http://localhost:3000).
    2. Install and configure IIS with the URL Rewrite and ARR (Application Request Routing) modules.
    3. Set up a reverse proxy rule in IIS to forward incoming HTTP requests to your Node.js app.

    This approach allows IIS to handle incoming traffic, SSL termination, and logging, while your Node.js app handles the API logic.

    Reference:

    Hope this helps!


Your answer

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