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
[ADDED] Support for NGINX dynamic module #17
Conversation
Following the guideline provided by NGINX - https://www.nginx.com/resources/wiki/extending/converting
@sgoldsm I am using your branch and I cannot reproduce the issue. Here is what I did:
. Add the
. Started nginx:
and
Any pointer to what I did "wrong" in that I can't reproduce the issue? |
Thanks @kozlovic for the quick feedback. If you include this Dockerfile in the root project folder - it should help reproduce the issue we're seeing. Dockerfile
Build, Configure NGINX steps
|
@sgoldsm Thanks for the update. I can reproduce and looking more into this. |
@sgoldsm I may have found what is causing the issue. Working on a fix. Will keep you posted. |
This is related to PR #17 where there is a proposal to change the configuration to support dynamic module loading. This feature was introduced in NGINX 1.9.11. When compiling NGINX with config changes from PR #17 and running with NGINX 1.14.0, the server would segfault on startup with an issue in NATS plugin. The issue is due to the reference to the global variable ngx_modules which one should not do when running with dynamic modules. The proposed changes is to use ngx_count_modules() and replace references to ngx_modules with cycle->modules as described [here](https://www.nginx.com/blog/nginx-dynamic-modules-how-they-work/#ngx_count_modules) I have added a NGINX version check so that the plugin can still be statically compiled with versions earlier than 1.9.11. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Thanks @kozlovic. Really appreciate the quick turnaround. We can confirm we're able to reference the NGINX nats directive now. |
@sgoldsm Thanks for the confirmation. I will merge the other PR first, and will then merge yours. Thank you for your contribution! |
Removed the WIP, are you ok for us to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@sgoldsm Is it ok to merge or do you want to add more to this PR? |
Good to merge @kozlovic. Thanks again for the help. |
Updating the module config to add the new configuration syntax for dynamic modules. The refactor was based primarily on the converting guide provided by NGINX.
While this successfully generates the new dynamic module - we're seeing a segmentation fault while reading the NATS server configuration. Still digging into the cause - but including this WIP PR with the hope that someone might be able to help us troubleshoot.
Segmentation Fault
NGINX configuration