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

Windows support? #100

Open
JasonKleban opened this issue Dec 10, 2024 · 1 comment
Open

Windows support? #100

JasonKleban opened this issue Dec 10, 2024 · 1 comment
Assignees

Comments

@JasonKleban
Copy link

For local workstation simulations, I'm interested in an Nginx plugin for handling authentication responsibilities within the reverse proxy. Many workstations I aim to support are Windows though - how far away is Windows support for nginx plugins, please?

@bavshin-f5 bavshin-f5 self-assigned this Dec 23, 2024
@bavshin-f5
Copy link
Member

I've been looking into that, and there are several complications. Some of these should be easy to address, some are not.

  • The official builds target MSVC x32, and we don't support dynamic modules for this target.
    A static module support was introduced in Use prebuilt nginx tree if $NGX_OBJS is specified #67, but the scripts are not compatible with Windows and NMAKE.
  • There's a disagreement in alignment requirements between Rust and our code. Windows x64 build detects NGX_ALIGNMENT as 4, but Rust enforces 8 byte alignment for pointers to composite objects.
    This could possibly be worked around by using i686-pc-windows-msvc or MinGW family of targets.
  • Static builds require providing all the static dependencies of the module, e.g. output of rustc --print=native-static-libs. The command does a full build of the Rust code, making it unexpectedly hard to integrate with the NGINX buildsystem.
  • Microsoft C compiler does not support Microsoft's UNC path format produced by std::fs::canonicalize(). That's the most unexpected kind of problem and it requires small changes in the bindings generation.

Even after addressing all of the above, one of the example modules causes immediate crash that I'm still trying to debug. If I manage to figure out and fix that, I'll publish the changes and the build instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants