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

마루 라온 21 Reputation points
2021-08-10T09:12:32.3+00:00

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 development | Internet Information Services
0 comments No comments
{count} votes

Answer accepted by question author
  1. Bruce (SqlWork.com) 81,971 Reputation points Volunteer Moderator
    2021-08-10T15:22:32.563+00:00

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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