Skip to content

Airflow shows "Log Url" localhost:8080, although I am using airflow behind nginx proxy on hostname:443 port #10569

@raulk89

Description

@raulk89

Apache Airflow version: 1.10.11, 1.10.12

Environment: Virtual machine

  • OS (e.g. from /etc/os-release): CentOS Linux release 7.8.2003 (Core)
  • Kernel (e.g. uname -a): 3.10.0-1127.18.2.el7.x86_64
  • Install tools: yum, pip3
  • Others:

What happened: After executing DAG, I clicked on "running tasks", then opens up this page, where there is "Log Url" link. But this one does not open, since I am using it behind nginx proxy.

image

What you expected to happen: The "Log Url" should be "https://hostname:443/..."

How to reproduce it:

Just make sure that your ariflow webserver runs on http://localhost:8080, then
# yum install nginx

Add virtualhost conf and add the following:
You can probably get by with just using port 80 also, then you do not need ssl and certs
And then your application opens up http://hostname:80

vi /etc/nginx/conf.d/airflow_webserver_proxy.conf

server {
 listen 80;
 server_name hostname.domain.com;
 return 301 https://$host$request_uri;
}

server {
 listen 443 ssl http2;
 server_name hostname.domain.com;

 location / {
  proxy_pass http://localhost:8080;
  proxy_set_header Host $host;
 }

 ssl_certificate /etc/pki/tls/certs/<<location to .cer file>>;
 ssl_certificate_key /etc/pki/tls/private/<<location to .key file>>;

 ssl_session_timeout 60m;
 ssl_dhparam /etc/ssl/certs/<<self signed cert>>;

 ssl_protocols TLSv1.2;
 add_header Strict-Transport-Security "max-age=31536000;" always;

}

# systemctl start nginx

And then open up web browser, start a random DAG, click on "running task" and then there should be this "Log Url"

Anything else we need to know: It happens always.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions