子目录到不同的服务器 [英] Sub Directory to a different server

查看:27
本文介绍了子目录到不同的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以用于域,例如www.myclient.com 在完全不同的(我们的)服务器上托管一个子目录?

Is it possible to for a domain e.g. www.myclient.com to have a sub directory hosted on a completly different (our) server?

他们不想将 subdomain.myclient.com 指向我们的服务器,因此他们希望将其作为文件夹 www.myclient/subdomain/

They don't want to point subdomain.myclient.com to our servers so they want it as folder www.myclient/subdomain/

提前致谢.

推荐答案

正如评论中所讨论的,您唯一的选择是代理.其他所有内容(如 mod_rewrite/Alias)都会进行标头重定向,并将目标地址公开给用户.

As discussed in the comments, your only option is a Proxy. Everything else (Like mod_rewrite / Alias) will do a header redirect, and expose the target address to the user.

然而,Apache 的代理似乎并没有那么复杂.最基础的例子是

However, Apache's proxying doesn't seem to be that complicated. The most basic example is

ProxyPass /mirror/foo/ http://backend.example.com/

请注意,代理当然会使您的流量加倍,因为请求的每个字节都必须从远程机器上获取.

Note that a proxy will of course double your traffic, because every byte requested will have to be fetched from the remote machine.

这篇关于子目录到不同的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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