Adding variable support to `slice` module
@ac000 is already working on this.
Since Sep 1, 2026.
- Dominant language
- C
- Stars
- 31.7k
- Forks
- 8.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 13
Description
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 for smallfiles.cache.com).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.