dongtuojuan8998 2010-03-09 00:31
浏览 55
已采纳

将文件夹重定向到其他服务器

I know you can redirect subdomains to a different server, but can you do the same with folders?

Say I have example.com. I can redirect mysubdomain.example.com to a different server, but can I redirect example.com/mysubdomain to a different server? I'd like to host a rails app in that folder on a site that runs php while still maintaining good search engines ratings (by not creating a sub domain which in my experience in recognized as a different site).

Any help?

Thanks!

  • 写回答

2条回答 默认 最新

  • dsh1956 2010-03-09 00:58
    关注

    As brock Batsell suggested, a solution can be proxying the requests. you'll usually find this behavior in web apps that use long polling services, like chats, and need to proxy out those services to a second web server to reduce the load on the main one (usually, apache + lighhtpd)

    Here is the basic usage (assuming youre using apache, and the other web-server is listening on the 81 port):

    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    
    ProxyRequests Off
    ProxyPreserveHost On
    proxypass /folder-to-proxy http://localhost:81/folder
    proxypassReverse /folder-to-proxy http://localhost:81/folder
    
    <Proxy http://localhost:81/>
        Order Allow,Deny
        Allow from all
    </Proxy>
    

    Just replace the localhost and port number with your second server host and port.

    Please note that even if you dont need to proxy the ftp traffic, in apache the proxy_ftp_module must be enabled as well.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问