question

33810499 avatar image
0 Votes"
33810499 asked Bruce-SqlWork answered

Can Static IIS php server and nodeJS(Express) server share same domain(ip,port)?

I was tring to make the IIS server runs nodeJS(Express) to make dynamic website with legacy PHP APIs.
So i have googled how to run nodeJS server on IIS and followed
https://stackoverflow.com/questions/46266609/host-node-js-on-windows-server-iis
this solution.

But i found that static IIS server runs well so if i write "https://domain.com:port/main.js"
the site shows js file very well. Eventhough it shouldn't.

Meaning while i started thinking abount nodeJS server i've run over IIS.
And i thougnt it only runs when client approach root of website and just remain on ram or just off.

So is there a way to IIS and nodeJS server share same domain?

And how can i approach?

windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

When iis hosts nodejs, it doing a reverse proxy to nodejs site. While node express may be running on port 5000, iis can exposes the site as port 80 and use any domain desired.

You should not expose you node code as as a static iis site.

php runs on iis by installing the FastCgi which runs the php code.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.