nginx / nginx/njs

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.

feature njs
Dominant language
C
Stars
1.6k
Forks
239
Avg merge
2d 9h
Merged PRs (30d)
10

Description

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.

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.