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

nixos/nginx: add locations."name".uwsgiPass option and use it #346776

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 6, 2024

I am going to use that in another PR for searxng #346777 to reduce duplication for uwsgi.

This also allows to easily overwrite a uwsgi_pass target with an upstreams block.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I haven't checked, but I assume you can't have both proxyPass and uwsgiPass in the same location?

If so, we'll probably want an assertion checking for this?

@SuperSandro2000
Copy link
Member Author

So I haven't checked, but I assume you can't have both proxyPass and uwsgiPass in the same location?

If so, we'll probably want an assertion checking for this?

Probably, I added one.

@Ma27
Copy link
Member

Ma27 commented Oct 8, 2024

Probably, I added one.

I think you pushed that to the wrong PR.

@SuperSandro2000 SuperSandro2000 force-pushed the nginx-uwsgi-pass branch 2 times, most recently from 45dad5a to be26ca8 Compare October 8, 2024 11:37
@SuperSandro2000
Copy link
Member Author

Pushed the assertion to this PR and added the if blocks for proxyResolveWhileRunning.

@Ma27
Copy link
Member

Ma27 commented Oct 12, 2024

@ofborg eval

@Ma27
Copy link
Member

Ma27 commented Oct 12, 2024

I'm a little surprised the check-meta check just shown an actual error. Also I don't see anything obvious in the change. cc @cole-h any idea what's up? Triggering eval didn't seem to help either here.

${optionalString (config.uwsgiPass != null && !cfg.proxyResolveWhileRunning)
"uwsgi_pass ${config.uwsgiPass};"
}
${optionalString (config.uwsgiPass != null && cfg.proxyResolveWhileRunning) ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit torn on this.

On one hand I think it's surprising that the proxy* options have an effect on uwsgi. OTOH it seems tedious to add counterparts for the uwsgi case.

I'm slightly leaning towards adding uwsgi counterparts for everything we need here. What do others think of this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the ones that existed. uwsgi has no http_version or set_header commands.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also leaning towards adding uwsgi counterparts because this behavior is not intuitive. If we keep the proposed behavior in this PR we IMHO should at least mention in the proxy-related options documentation that they also apply to uwsgi.

As far as I can see this only applies to:

  • recommendedProxySettings
  • proxyResolveWhileRunning
  • proxyTimeout

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just done that :)

nixos/modules/services/web-servers/nginx/default.nix Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants