Add Support for js_balancer like balancer_by_lua_block

Open
#696 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, nginx

Research direction

The issue names no source files, tests, or entry points. Start by reading the njs documentation and the linked Lua balancer_by_lua_block reference, then determine the scope and acceptance criteria for an equivalent JavaScript balancer hook.

Written by the indexing model from the issue text.

Description

feature njs

Are there any plans to introduce a js_balancer function akin to balancer_by_lua_block found in the Lua Nginx Module (https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#balancer_by_lua_block)? We rely on balancer_by_lua for dynamically selecting servers. For instance, we utilize server tagging across multiple upstreams and use variables as a switch to avoid selecting servers with specific tags during proxying. This balancer hook is highly beneficial. However, it seems that NJS lacks a comparable hook.

Dominant language
C
Stars
1.6k
Forks
245
Avg merge
2d 5h
Merged PRs (30d)
6

Getting set up

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.

More from nginx/njs

All issues in nginx/njs

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.