IIS reverse proxy - 2 subdomain to 2 Node.js

依然范特西╮ 提交于 2020-04-30 06:32:13

问题


As in this blog is well explained how to point a domain or subdomain in IIS to a Node.js project. In this case its needed to have two subdomains each point to a Node.js project (localhost:port) in the example works well for one project but not for two.

So in this case its needed for subdomain1 point to localhost:80 and subdomain2 point to localhost:82 for example.

In the reverse proxy have:

in the pattern had (.*) but that would match any and my subdomains would point to same Node.js project. So tried to make the reverse proxy pattern match its subdomain as in here and in the printscrean and also tried as in this post in iis forum as @PascalN answer:

RequestedURL: Matches the pattern

Using: Wildcard

Pattern: http://www.iisserver.mycompany.com/internal1/*

In the Action section you should have something like this

Action Type: Rewrite

Rewrite URL: http://internal1.mycompany.com/{R:0}

And finally you can add another rule for your internal2 server

but still not working and doesn't even redirects/point to that port internaly.


回答1:


My mistake in the configuration of both sites the phisical path was the same (same folder) what originated that the sites shared the two reverse proxys.

Assumed that with the use of reverse proxy would point to another project (Node.js) would't have any conflict sharing the same phisical folder but that was in fact my probleam, now each site points to different folders, so each site only haves one reverse proxy as expected and works.



来源:https://stackoverflow.com/questions/61326944/iis-reverse-proxy-2-subdomain-to-2-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!