python - 在单个域上使用两个不同的框架 (Oracle Weblogic/Django)

标签 python django oracle apache weblogic

假设我的公司有一个网站 https://example.com ,并且它由旧版本的 Oracle Weblogic 提供支持。该公司希望最终将网站过渡到 Django 框架,但希望逐步实现。

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

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

最佳答案

是的,当然这是可能的。试试reverse proxy软件,例如:

reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client, appearing as if they originated from the proxy server itself.[1] Unlike a forward proxy, which is an intermediary for its associated clients to contact any server, a reverse proxy is an intermediary for its associated servers to be contacted by any client. In other words, a proxy acts on behalf of the client(s), while a reverse-proxy acts on behalf of the server(s). ()

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

关于python - 在单个域上使用两个不同的框架 (Oracle Weblogic/Django),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57615769/

相关文章:

python - django 中的 kwargs - 如何将 unique() 放入 kwargs

Python 找不到用于 Spotify 滚动框的 xpath

django - 如果所有字段都是只读的,则在管理员中隐藏保存按钮

sql - 在oracle中连接值

python - 在 Python 中将日期转换为日期时间

python - NumPy 日志函数抛出 int 属性错误

python - Django rest_framework 3.22 多次更新创建对象而不是更新

django - 是否有 "proper"方法将 django.db.models.query.ValuesListQuerySet 转换为纯列表?

c# - Entity Framework 将数字(1)转换为 bool 帮助?

java - 如何在 oracle 列中查找无效的 UTF-8 字符