nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Fix the stuck at startup causing 502 bad gateway.

Open jqknono opened this issue 1 year ago • 2 comments

Some cloud vendors may have been blocked by AWS, this led to stuck at startup.

jqknono avatar Sep 26 '24 12:09 jqknono

There are some issues about 502 bad gateway, cannot login. The direct cause is the NPM getting stuck at startup, some of them related to the fetching of https://ip-ranges.amazonaws.com/ip-ranges.json

Some cloud vendors like Tencentcloud may block aws or be block by aws. Also , it may take a long time downloading this file, which blocked the port 81 backend.

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3965 https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3585 https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3574 https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3157

jqknono avatar Sep 26 '24 12:09 jqknono

Docker Image for build 2 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-4021

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@jc21 develop branch dont have your commit,Is it flushed by other commit?

yangluoning avatar Nov 13 '24 06:11 yangluoning

@jc21 develop branch dont have your commit,Is it flushed by other commit?

I'm not sure what "commit" you're talking about? This PR is not mine and is not merged either.

jc21 avatar Dec 16 '24 22:12 jc21

PR is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Jun 28 '25 02:06 github-actions[bot]

For a quick workaround, you can run the following commands:

NPM_CTR_NAME=nginxproxymanager
docker exec $NPM_CTR_NAME sed -i 's/\.then(internalIpRanges\.fetch)//g' /app/index.js
docker restart $NPM_CTR_NAME

This will patch the application to skip fetching the IP ranges on startup.

Alternatively, as of #4398, you can use the IP_RANGES_FETCH_ENABLED environment variable to control this behavior.

To disable the fetch, set:

IP_RANGES_FETCH_ENABLED=false

This will also prevent the application from hanging at startup. However, note that the default behavior is still to attempt downloading the IP ranges unless explicitly disabled.

jqknono avatar Jun 30 '25 10:06 jqknono