How to Disable a Manually Started Hangfire Job Server on One Server in a Load-Balanced Web API Setup?

I have a multi-server Hangfire setup behind a load balancer, where each instance of my ASP.NET Web API starts a Hangfire Job Server in-process using the manual approach.

Setup Details:

  • Two servers (Server A and Server B) are behind a load balancer.
  • Each Web API instance starts Hangfire manually inside the application:

using var server = new BackgroundJobServer();

  • Hangfire uses a shared database (Redis) for job storage.

Objective:

I need a way to remotely disable Hangfire on Server B from Server A while keeping the Web API on Server B running normally for handling other HTTP requests.

Key Requirements:

  1. Stop or Pause Hangfire on Server B without stopping the entire Web API.
  2. Trigger this action remotely from Server A

Any guidance or best practices would be greatly appreciated!