Hello everyone, first I want to say I already searched mailman.nginx.org
for a topic relating to my question but I cannot find it.

ngx_http_rewrite_module has directives rewrite, return, etc. I want to use
directives code from other module inside my module so can do code reuse
"DRY", for example create my own directive like:

    server {  # important to work in this Context

     mycontrol * {
        myrewrite ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 last;
# using the core ngx_http_rewrite_module.c

     }
     mycontrol * {
        # optional  using the original ngx_http_rewrite_module.c
        rewrite  ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 last;

     }
}

So can avoid replicate the already functionality (I want to extend the
ngx_http_rewrite_module, and others modules in my module mycontrol with
more features). Any ideas ?

I just want to be sure for what route to go, maybe instead I should used
the PCRE library directly in ngx_http_mycontrol_module like does other
modules ?

Thanks for reading

Note repost in:
stackoverflow.com/questions/79503527/use-directive-code-from-other-module-inside-my-module-nginx
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to