You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
mycontrol * {
# optional using the original ngx_http_rewrite_module
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 ?
Update: This is about module development for nginx source code
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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:
}
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 ?
Update: This is about module development for nginx source code
Thanks for reading
Note repost in: stackoverflow.com/questions/79503527/use-directive-code-from-other-module-inside-my-module-nginx
Beta Was this translation helpful? Give feedback.
All reactions