alltej
alltej

Reputation: 7285

Airflow in K8s - curl the URL shows Redirecting

I have an airflow deployed in kubernetes. When I curl the base_url, it shows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
* Connection #0 to host <my_base_url> left intact
<p>You should be redirected automatically to target URL: <a href="/admin/">/admin/</a>.  If not click the link.

If I browse base_url/health shows that is healthy. If I run the kubectl port-forward command, I can see the UI.

What is causing the redirecting message?

Upvotes: 0

Views: 1226

Answers (1)

alltej
alltej

Reputation: 7285

The solution that works for me is setting the environment variable.

FORWARDED_ALLOW_IPS = *

Add this environment variable in the deployment yaml file.

          env:          
            - name: FORWARDED_ALLOW_IPS
              value: "*"

I have enable_proxy_fix = False set in airflow.cfg.

I found a related SO question here: Cannot access airflow web server via AWS load balancer HTTPS because airflow redirects me to HTTP

Upvotes: 1

Related Questions