Skip to content

Conversation

@arjav1528
Copy link
Contributor

@arjav1528 arjav1528 commented Jan 26, 2026

Fixes #60922

The Keycloak authentication provider generates HTTP redirect URLs even when
running behind an HTTPS reverse proxy. This occurs because the login route
uses request.url_for() to generate the callback URL, which doesn't respect
proxy headers like X-Forwarded-Proto by default.

This fix configures Airflow to respect proxy headers by adding support for:

  1. Uvicorn's --proxy-headers flag with FORWARDED_ALLOW_IPS environment variable
  2. Alternative ProxyFix middleware configuration

Both approaches enable the Keycloak provider to correctly generate HTTPS
redirect URLs when deployed behind nginx ingress or other reverse proxies.

Testing:

  • Verified redirect_uri uses HTTPS when proxy headers are configured
  • Confirmed backward compatibility with existing deployments

@vincbeck vincbeck merged commit 0708036 into apache:main Jan 27, 2026
95 checks passed
shreyas-dev pushed a commit to shreyas-dev/airflow that referenced this pull request Jan 29, 2026
…pache#61095)

* docs: Enhance Airflow API server configuration in values.yaml

* docs: Update Airflow API server args description to include reverse proxy support and provide usage example

* docs: Update API server env vars description to include reverse proxy configuration and provide example usage

* docs: Add Helm chart configuration details for running Airflow behind a reverse proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Airflow Keycloak provider redirect to HTTP instead of HTTPS

2 participants