SERVER_HOST is ignored: getServerBaseUrl() always returns http://nango-server when it is set
Author: breken-aiCreated Sep 27, 2026Updated Sep 27, 2026
packages/shared/lib/utils/utils.ts has:
function getServerHost() {
return process.env['SERVER_HOST'] || process.env['SERVER_RUN_MODE'] === 'DOCKERIZED' ? 'http://nango-server' : 'http://localhost';
}The ternary binds looser than ||, so this is (SERVER_HOST || SERVER_RUN_MODE === 'DOCKERIZED') ? 'http://nango-server' : 'http://localhost'. With SERVER_HOST=http://my-host, getServerBaseUrl() returns http://nango-server:3003, not http://my-host:3003. getApiUrl() falls back to this when SERVER_SERVICE_URL is unset, and the jobs service uses it to tell runners where the server is.
Repro: SERVER_HOST=http://my-host SERVER_PORT=3003 → getServerBaseUrl() returns 'http://nango-server:3003'.
Suggested fix (one line + 3 unit tests): https://github.com/breken-ai/nango/compare/master...fix/server-host-env-precedence
Source: NangoHQ/nango