NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.01k stars 2.67k forks source link

Fails to honour http/https proxy environment settings when fetching IP Ranges #2149

Open nigelm opened 2 years ago

nigelm commented 2 years ago

Checklist

Describe the bug When running on a firewalled network with internet access via a proxy, the initial startup runs a process to fetch IP ranges of external services:-

[IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[IP Ranges] › ✖  error     connect ETIMEDOUT 143.204.176.42:443

We have https_proxy/HTTP_PROXY/http_proxy/HTTP_PROXY and no_proxy/NO_PROXY environment variables set up - and this allows the Lets Encrypt services to work (with DNS solvers).

However this fetch from Amazon causes the management startup to pause for a good 2 minutes.

Could this fetch be changed to honour the proxy settings.

Nginx Proxy Manager Version

Version: 2.9.18

vcutrona commented 2 years ago

same here We're experiencing exact the same on our firewalled company server.

pf-uvonceumer commented 1 year ago

same here, I am running the container inside our company network which requires the use of the company proxy to connect to the internet.

github-actions[bot] commented 6 months ago

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

nigelm commented 6 months ago

I've just checked our installations with the latest release. I am no longer seeing this issue, however I believe this is likely due to a change in our environment (external DNS is no longer directly available) rather than the specific issue having been fixed - and the fetch is still failing, its just failing quickly.

Can @vcutrona or @pf-uvonceumer confirm that this issue still exists?

pf-uvonceumer commented 6 months ago

Issue still persist.

Proxy settings:

image

Log excerpt:

[4/29/2024] [7:38:43 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[4/29/2024] [7:40:55 AM] [IP Ranges] › ✖  error     

Using latest tag: sha256:6219c2184f19e0f50a77f4bb04066de79a3de795b6a863abaa861d52ff1fe012

vcutrona commented 3 months ago

I checked our Docker deployment and I can't find the issue within the log messages. However, we changed our server environment as well, thus I can't reproduce the issue with our previous setup.

pf-uvonceumer commented 3 months ago

Issue still persists in v2.11.3:

❯ Configuring npm user ...
useradd warning: npm's uid 0 outside of the UID_MIN 1000 and UID_MAX 60000 range.
❯ Configuring npm group ...
❯ Checking paths ...
❯ Setting ownership ...
❯ Dynamic resolvers ...
❯ IPv6 ...
Enabling IPV6 in hosts in: /etc/nginx/conf.d
- /etc/nginx/conf.d/production.conf
- /etc/nginx/conf.d/include/assets.conf
- /etc/nginx/conf.d/include/block-exploits.conf
- /etc/nginx/conf.d/include/ip_ranges.conf
- /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
- /etc/nginx/conf.d/include/log.conf
- /etc/nginx/conf.d/include/proxy.conf
- /etc/nginx/conf.d/include/ssl-ciphers.conf
- /etc/nginx/conf.d/include/force-ssl.conf
- /etc/nginx/conf.d/include/resolvers.conf
- /etc/nginx/conf.d/default.conf
Enabling IPV6 in hosts in: /data/nginx
- /data/nginx/proxy_host/1.conf
❯ Docker secrets ...
-------------------------------------
 _   _ ____  __  __
| \ | |  _ \|  \/  |
|  \| | |_) | |\/| |
| |\  |  __/| |  | |
|_| \_|_|   |_|  |_|
-------------------------------------
User:  npm PUID:0 ID:0 GROUP:0
Group: npm PGID:0 ID:0
-------------------------------------
❯ Starting nginx ...
❯ Starting backend ...
[7/16/2024] [1:02:13 PM] [Global   ] › ℹ  info      Using Sqlite: /data/database.sqlite
[7/16/2024] [1:02:15 PM] [Migrate  ] › ℹ  info      Current database version: none
[7/16/2024] [1:02:15 PM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[7/16/2024] [1:02:15 PM] [Global   ] › ⬤  debug     CMD: logrotate /etc/logrotate.d/nginx-proxy-manager
[7/16/2024] [1:02:15 PM] [Setup    ] › ℹ  info      Logrotate completed.
[7/16/2024] [1:02:15 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[7/16/2024] [1:02:15 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[7/16/2024] [1:04:26 PM] [IP Ranges] › ✖  error     
[7/16/2024] [1:04:26 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[7/16/2024] [1:04:26 PM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
[7/16/2024] [1:04:26 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[7/16/2024] [1:04:26 PM] [Global   ] › ℹ  info      Backend PID 161 listening on port 3000 ...
[7/16/2024] [1:04:26 PM] [SSL      ] › ℹ  info      Completed SSL cert renew process