IIS反向代理-2个子域到2个Node.js [英] IIS reverse proxy - 2 subdomain to 2 Node.js

查看:85
本文介绍了IIS反向代理-2个子域到2个Node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

我在两个站点的配置中的错误,物理路径相同(相同的文件夹),导致站点共享两个反向代理.

假设使用反向代理将指向另一个项目(Node.js),共享同一个物理文件夹不会有任何冲突,但这实际上是我的问题,现在每个站点都指向不同的文件夹,因此每个站点该站点只有一个反向代理,可以正常工作.

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.

解决方案

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.

这篇关于IIS反向代理-2个子域到2个Node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆