Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary nginx redirect rule from reverse proxy documentation #38953

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

scottlimmer
Copy link
Contributor

Remove redirect rule for flower config as per https://airflow.apache.org/docs/apache-airflow/stable/security/flower.html#flower-url-prefix


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Copy link

boring-cyborg bot commented Apr 12, 2024

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

* Removed comment about flower uri redirect
* Merged nginx server blocks into one
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label May 31, 2024
@scottlimmer
Copy link
Contributor Author

@dirrao @potiuk Can we get a re-review on this so it doesn't get squashed by the bot? I believe comments have been addressed.

@potiuk
Copy link
Member

potiuk commented Jun 1, 2024

But - is it correct ? I thought it was supposed to be differently for flower. Did you test it?

@scottlimmer
Copy link
Contributor Author

But - is it correct ? I thought it was supposed to be differently for flower. Did you test it?

This change is reflective of the current configuration I have in production.

When the rewrite ^/myorg/flower/(.*)$ /$1 break; # remove prefix from http header line is present in the config, any requests to /myorg/flower/ result in a 404.

Also, that line was introduced 7 years ago with no more info than the line comment, so it is difficult to determine exactly what issue it was resolving.

For reference below is my full nginx.conf for a NGINX proxy / SSL offload in an Airflow docker deployment where flower is operating from a subdirectory on an airflow subdomain.

server {
    listen                      80;
    server_name                 _;
    return 301 https://$host$request_uri;
}

server {
    listen                      443 ssl;
    server_name                 airflow.example.org;

    ssl_certificate             /etc/ssl/certs/airflow.crt;
    ssl_certificate_key         /etc/ssl/private/airflow.key;

    location / {
        proxy_pass              http://airflow-webserver:8080;
        proxy_set_header        Host $http_host;
        proxy_redirect          off;
        proxy_http_version      1.1;
        proxy_set_header        Upgrade $http_upgrade;
        proxy_set_header        Connection "upgrade";
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_set_header        X-Real-IP $remote_addr;
    }

    location /flower/ {
        auth_basic              "Airflow Flower";
        auth_basic_user_file    "/etc/nginx/.htpasswd";
        proxy_pass              http://flower:5555;
        proxy_set_header        Host $http_host;
        proxy_redirect          off;
        proxy_http_version      1.1;
        proxy_set_header        Upgrade $http_upgrade;
        proxy_set_header        Connection "upgrade";
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_set_header        X-Real-IP $remote_addr;
    }
}

@potiuk potiuk merged commit 7c3dc5d into apache:main Jun 11, 2024
38 checks passed
Copy link

boring-cyborg bot commented Jun 11, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:documentation stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants