使用Nginx反向代理在Airflow中进行错误的重定向 是应该是

问题描述

我在Nginx下使用Airflow。效果很好,但是在极少数情况下会将请求发送到不存在的URL。

我的气流在

https://aaa.bbb.com/tools-adm/airflow/admin/

我以 / tools-adm / 作为前缀。它是管理员进入点网页的一部分,列出了不同的工具。

但是当我尝试这个

enter image description here

GET请求发送到

GET https:/ /aaa.bbb.com/airflow/admin/taskinstance/?flt0_dag_id_equals=task1

应该是

GET https:/ /aaa.bbb.com/tools-adm/airflow/admin/taskinstance/?flt0_dag_id_equals=task1

(空格是为了防止SE降价创建链接,这不是错误)。 大多数GUI都可以正常工作。只是一些晦涩的部分坏掉了,或者不同的拨动开关似乎不起作用。

我的配置

/root/airflow/airflow.cfg

[webserver]
# The base url of your website as airflow cannot guess what domain or
# cname you are using. This is used in automated emails that
# airflow sends to point links to the right web server
base_url = https://edge01.aaa.bbb.com:5150/airflow

/etc/Nginx/test.conf

location /airflow {

      add_header X-debug "in airflow";

      proxy_set_header Host $host;
      proxy_redirect off;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_pass http://localhost:5150;
      proxy_redirect off;

      add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR nor ONL UNI COM NAV"';
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_ssl_trusted_certificate <redacted>;
      proxy_ssl_session_reuse on;
      proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      proxy_ssl_ciphers "EECDH+ECDSA+AES ... P !DSS";
      proxy_pass_header Authorization;
      proxy_buffering off;
}

当我尝试将端口5150传送到本地计算机时,气流正确重定向

Nginx问题还是气流问题?大多数GUI都可以正常工作。奇怪的是,某些链接已断开,而某些链接则正常工作。

感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)