Skip to content

add edgeone ip range fetch#5634

Open
tianq02 wants to merge 1 commit into
NginxProxyManager:developfrom
tianq02:edgeone
Open

add edgeone ip range fetch#5634
tianq02 wants to merge 1 commit into
NginxProxyManager:developfrom
tianq02:edgeone

Conversation

@tianq02
Copy link
Copy Markdown

@tianq02 tianq02 commented Jun 5, 2026

Why

I am using EdgeOne as CDN service for my server, and NPM is not correctly handling its IP header out of the box, giving downstream hosts CDN node's IP as X-Real-IP, which is a security hazard.

Digging into the code, It seems like Cloudflare and CloudFront are already supported, so I built ip_ranges_eo.js mimicing existing design. We built its core api call imitating tencent cloud's nodejs demo code here(http request, nodejs), this doesn't bring any additional dependencies. I used gemini to refactor these demo code into a reuseable function.

Previously, IP_RANGES_FETCH_ENABLED='false' only skips initial fetch, timer is always running and npm is still periodically fetching IP ranges, which seems to be a logic bug. I refactored index.js to fix these logic, now we have a second env IP_RANGES_TIMER_ENABLED to control its behaviour. Unset defaults to 'auto', which means enable the timer only if the initial fetch succeeds. Beware this is likely a breaking change, now setting IP_RANGES_FETCH_ENABLED='false' also disables the timer.

EdgeOne doesn't include X-Real-IP header by default, so I edited nginx.conf to use XFF header instead, this shouldn't break anything.

This module is by default disabled, since EdgeOne IP range fetch is paywalled and it requires a quite involving credential setup. So I made a detailed documentation for it, which is also included in this pr, you can read it here

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • API changes
  • Performance improvement
  • Test addition or update

AI Usage

  • AI was used to write this
  • AI was used to review this

@nginxproxymanagerci
Copy link
Copy Markdown

Docker Image for build 1 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5634

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant