-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Adding variable support to slice
module
#571
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
Comments
Hi, @lucasRolff |
Should be possible to share your solution with the public then :) |
Hi,@lucasRolff
Currently, the slice directive uses ngx_conf_set_size_slot as its handler, which means it only accepts a fixed size value at configuration time, not a variable. This is the code that implements variable slice
|
Describe the feature you'd like to add to nginx
It would be really nice to be able to set a variable for the
slice
directive in the slicing module, so it can be set/loaded from e.g. Redis (if one were to load variables from Redis via Lua for example).Describe the problem this feature solves
Currently it's not possible to control the slice size via a variable, meaning if you want to change this for a given host, you'd need a completely new server block.
Instead it would be nice to be able to set the slicing size through a variable, and pass the variable to the
slice
directive.Additional context
I use nginx with the nginx lua module, and I load a lot of my server block config from Redis into variables.
However, sometimes I want to either disable or enable slicing for a given host (e.g
largefiles.cache.com
) but keep it disabled forsmallfiles.cache.com
).The text was updated successfully, but these errors were encountered: