Node.js on IIS

First ,Node.js is completely new to me.
But I installed Node, IISNode and URLRewrite on IIS, and the example that came with iisNode works well.
But my Wappler testsite does not start,

Seems like Wappler app wont start because it tries to listen to the port set in config.js and it can not start when it tries to listen to the same port as the iis Website.

In the example site that came with iisNode the node server i think the listen port is set another way with “process.env.PORT”

This is the Hello.JS that came with iisNode example app

var http = require(‘http’);
http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’: ‘text/html’});
res.end('Hello from urlrewrite sample. Request path: ’ + req.url);
}).listen(process.env.PORT);

does anyone have some direction that I can try. I have tried to start the Node server via reverse proxy. But no real luck.
My Web.config file is attached
Regards Olavweb.config.zip (387 Bytes)

Why don’t you start IIS listening on another port(3001) and reverse proxy it to localhost:3000 ?

Have tried it, but no luck.
Attached Web.config with reverse proxy. Tried both with and without Outbound rules

Olav

web…config.zip (672 Bytes)

Sorry. No clue on how IIS works. I was just laying out the basics on how to reverse proxy a node server. Hopefully someone with IIS experience can chip in.

Thanks anyway:)

I will add process.env.PORT as the default port in the upcoming update.

1 Like

Great. Looking forward to testing

Hi @olavn, it is works? I have the same question to use Node.JS on IIS!

I moved everyting to docker and digital ocean

1 Like