【问题标题】:Using two different frameworks on a single domain (Oracle Weblogic / Django)在单个域上使用两个不同的框架 (Oracle Weblogic / Django)
【发布时间】:2019-08-22 19:12:06
【问题描述】:

假设我的公司在https://example.com 有一个站点,它由旧版本的Oracle Weblogic 提供支持。该公司希望最终将网站转换为 Django 框架,但希望零碎完成。

具体来说,它希望在旧框架上维护原始站点,但希望设置一个像 https://example.com/newurl/ 这样的子文件夹(或者,像 https://newurl.example.com 这样的子域),其中将包含一个具有新功能等的 Django 项目。 ,并且这个新 url 中的任何子目录同样将仅包含 Django 应用程序。

我的问题是,是否有可能以这种方式在同一个域中包含两个框架,如果可以,如何使用 Apache 来实现它?谢谢。

【问题讨论】:

    标签: python django oracle apache weblogic


    【解决方案1】:

    是的,当然可以。试试reverse proxy软件,如:

    反向代理是一种proxy server,代表client从一个或多个servers中检索资源。然后这些资源返回给客户端,看起来好像它们来自代理服务器本身。[1] 与forward proxy 不同,forward proxy 是其关联客户端联系任何服务器的中介,反向代理是其任何客户端要联系的关联服务器。换句话说,proxy 代表客户端,而 reverse-proxy 代表服务器。 ()

    Nginx 反向代理示例配置

    server {
      listen 80;
    
      server_name example.com;
    
      location ~ /newurl {
        proxy_pass http://django-server;
      }
    
      location ~ /oldurl {
        proxy_pass http://oracle-weblogic-server;
      }
    }
    

    HaProxy 反向代理示例配置

    frontend http_frontend
    bind *:80
    mode http
    option httpclose
    acl is_newurl hdr_end(host) -i newurl
    use_backend django if is_newurl
    acl is_oldurl hdr_end(host) -i oldurl
    use_backend oracle if is_oldurl
    
    backend django
    mode http
    cookie SERVERID insert indirect nocache
    server django django-server:80 check cookie django
    
    backend oracle
    mode http
    cookie SERVERID insert indirect nocache
    server oracle oracle-weblogic-server:80 check cookie oracle
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-13
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-17
      相关资源
      最近更新 更多