Suggest using $http_host instead of $host#14814
Conversation
If the reverse proxy is not running in port 80, using $host won't forward the port in the HTTP request to airflow and it won't build the correct redirect URL. E.g. I have nginx and airflow running in docker in the default ports. My mapping for nginx x is 7003:80. The request http://myserver:7003/myorg/airflow/ will redirect to http://myserver/myorg/airflow/admin/ instead of http://myserver:7003/myorg/airflow/admin/.
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
|
|
The PR is likely ready to be merged. No tests are needed as no important environment files, nor python files were modified by it. However, committers might decide that full test matrix is needed and add the 'full tests needed' label. Then you should rebase it to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
|
@ad-m Can you look at it? |
ad-m
left a comment
There was a problem hiding this comment.
nginx-proxy/nginx-proxy use $http_host, but see comment in nginx-proxy/nginx-proxy#763
|
Awesome work, congrats on your first merged pull request! |
If the reverse proxy is not running in port 80, using $host won't forward the port in the HTTP request to airflow and it won't build the correct redirect URL. E.g. I have nginx and airflow running in docker in the default ports. My mapping for nginx x is 7003:80. The request http://myserver:7003/myorg/airflow/ will redirect to http://myserver/myorg/airflow/admin/ instead of http://myserver:7003/myorg/airflow/admin/. (cherry picked from commit 9cb6553)
If the reverse proxy is not running in port 80, using $host won't forward the port in the HTTP request to airflow and it won't build the correct redirect URL. E.g. I have nginx and airflow running in docker in the default ports. My mapping for nginx x is 7003:80. The request http://myserver:7003/myorg/airflow/ will redirect to http://myserver/myorg/airflow/admin/ instead of http://myserver:7003/myorg/airflow/admin/. (cherry picked from commit 9cb6553)
If the reverse proxy is not running in port 80, using $host won't forward the port in the HTTP request to airflow and it won't build the correct redirect URL.
E.g.
I have nginx and airflow running in docker in the default ports. My mapping for nginx x is 7003:80.
The request http://myserver:7003/myorg/airflow/ will redirect to http://myserver/myorg/airflow/admin/ instead of http://myserver:7003/myorg/airflow/admin/.