nginx / nginx/nginx

Adding variable support to `slice` module

Open
#571 5 comments 0 reactions 1 assignee View on GitHub

@ac000 is already working on this.

Since Sep 1, 2026.

feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.