从我们的服务器在另一个域上运行网站
我们将在 Windows 服务器上开发一个 ASP.NET 应用程序,并希望在另一个公司的域名 http://notourdomain 上运行。 com。该域当前所在的服务器是 Resin,其语言是 Java(TM) SE 运行时环境
实现这一点的最佳方法是什么?
我们需要我们的应用程序在“notourdomain.com/app/”上运行,
所以如果在我们的服务器上它是“ourserver.com/app/dir1/page/”或“ourserver.com/dir1/page/”
在他们的域上将显示为“notourdomain.com/app/dir/page/”
他们建议使用负载平衡进行 URL 重定向,以便内容看起来是从“notourdomain.com”提供的
您是否有任何其他建议或具体信息这会被设置吗?正面、负面、评论等?
感谢您提供有关此问题的任何信息。
we are going to develop an asp.net application on our windows server that we want to run on another companies domain name, http://notourdomain.com. The server which the domain is currently on is Resin and their language is Java(TM) SE Runtime Environment
What is the best way to make this happen?
We would need our application to run on "notourdomain.com/app/"
so if on our server it was "ourserver.com/app/dir1/page/" or "ourserver.com/dir1/page/"
on their domain it would show as "notourdomain.com/app/dir/page/"
They suggested to do the URL redirecting using their load balancing so the content appears to be serving up from "notourdomain.com"
Do you have any other suggestions or specifics on how this would be set up? Positives, negatives, comments, etc?
Thank you for any information you can give on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议创建一个子域,这可能是两个应用程序之间发生 url 冲突的可能性很小的选项。
所以它会是这样的:
http://yourappname.notourdomain.com
I would suggest create a subdomain, this might be the option that would have minor chance of url conflicting between the two apps.
So it will be something like this:
http://yourappname.notourdomain.com
如果您愿意重定向到
http://ourserver.com/app/*
(而不是透明地使用notourdomain.com
域)并且负载均衡器支持然后一定要让他们的负载均衡器重定向到您的网站。但是,如果您不希望主机名因重定向而发生更改,请继续阅读:
首先,如果他们的负载均衡器可以代理(而不是重定向)到您的服务器的请求,那么这将是一个好方法。
他们是否在 Resin 前面运行 HTTP 服务器(例如 Apache、nginx)?如果是这样,许多流行的 HTTP 服务器都支持代理。 HTTP 服务器可以配置为将
/app/*
的所有请求代理到http://ourserver.com/app/*
。如果他们没有运行 HTTP 服务器,而 Resin 是响应每个 HTTP 请求的前线服务器,那么我对 Resin 不熟悉,所以我无法给出具体细节。但您应该研究一下 Resin 是否可以配置为代理某些请求。如果没有,那么也许您可以创建在 Resin 中运行并响应
/app/*
请求的 servlet。该 servlet 的唯一工作是充当代理,连接到ourserver.com
以检索适当的页面并将结果传递给客户端。这是最不理想的解决方案。If you're cool with a redirect to
http://ourserver.com/app/*
(rather than transparently using thenotourdomain.com
domain) and the load balancer supports it, then by all means have their load balancer redirect to your website.However, if you don't want the hostname to change at all due to a redirect, read on:
First, if their load balancer can proxy (not redirect) requests to your server, then that would be a good method.
Are they running a HTTP server in front of Resin (e.g., Apache, nginx)? If so, many popular HTTP servers support proxying. The HTTP server can be configured to proxy all requests for
/app/*
tohttp://ourserver.com/app/*
.If they're not running a HTTP server, and Resin is the front line server responding to every HTTP request, then I'm not familiar with Resin so I can't give specifics. But you should look into whether Resin can be configured to proxy certain requests. If not, then perhaps you can create servlet that runs in Resin and responds to
/app/*
requests. This servlet's only job is to act as a proxy, connecting toourserver.com
to retrieve the appropriate page and pass the result on to the client. This is the least ideal solution.