如何在IIS上为Linux上的域托pipe页面?

我在两台不同的服务器上托pipe一个网站有问题。 我的公司用ASP.NET MVC为一个客户端开发了几个页面,他们的网站托pipe在Linux上。 我们假设在我们的Windows主机(它有1个IP和许多其他网站托pipe在它的主机上),他们的dll,图像,CSS和JS文件,但地址应该是他们的域名…像www.ClientDomainLinux。 COM / MyMvcController /我的页面

我是一个开发人员,我不知道我应该如何设置IIS来实现这一目标…他们已经build立了代理指向我们的托pipe,但没有任何的CSS,图像或JS文件加载,它不能正常工作…

我需要一些帮助,如何设置IIS以便链接正常工作,

任何types的想法都非常感激。

谢谢

想到两个解决scheme。

首先是你的客户端的Linux网站上的一个简单的框架/ iFrame,附上你的ASP.NET http://www.yourwindowsserver.com/clients/clientXYZ/MyPage。

设置起来很简单,但是对于您的客户网站中技术精通的访问者来说,可以看到他们被redirect到了第二台服务器。

第二种方法是将Linux网站的一部分configuration为反向代理。 这样做的好处是,对于访问者来说,它只会连接到www.ClientDomainLinux.com,因此看起来是无缝的。 http://www.ClientDomainLinux.com上的Web服务器将作为HTTP代理服务器,并接收/ MyMvcController / MyPage的请求,将该传入请求转换为发送到www.yourwindowsserver.com/clients/clientXYZ/MyPage的请求,接收答复并将重新发送回复网站访问者。

Linuxnetworking服务器通常使用Apachenetworking服务器。 反向代理configuration使用mod_proxy或者mod_rewrite,这通常是pipe理员需要configuration的。

# somewhere in the main apache configuration file LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so # either in the virtual host definition for www.ClientDomainLinux.com or possibly .htaccess ProxyPass /MyMvcController/MyPage http://www.yourwindowsserver.com/clients/clientXYZ/MyPage ProxyPassReverse /MyMvcController/MyPage http://www.yourwindowsserver.com/clients/clientXYZ/MyPage 

重写规则的替代方式如下所示:

 # somewhere in the main apache configuration file LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule rewrite_module modules/mod_rewrite.so # either in the virtual host definition for www.ClientDomainLinux.com or possibly .htaccess RewriteRule ^/MyMvcController/MyPage(.*) http://otherhost/otherpath$1 [P] 

http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html http://httpd.apache.org/docs/2.4/mod/mod_proxy.html