Skip to content

v2.48.0

Choose a tag to compare

@github-actions github-actions released this 23 Aug 07:00
· 499 commits to main since this release

☁️ Cloudflare Tunnel — 서비스마다 Public Hostname을 등록하지 않아도 됩니다

터널로 서비스를 하나 늘릴 때마다 Cloudflare 대시보드에 Public Hostname을 등록해야 했습니다. *.example.com 와일드카드를 하나 등록해 두면 피할 수 있었지만, 같은 도메인의 와일드카드를 다른 서버나 다른 터널이 이미 쓰고 있으면 그 방법을 못 씁니다.

그런 환경에서 n8n.example.com 을 터널용 도메인으로 CNAME 걸어 두면, DNS는 터널을 잘 찾아가는데 Cloudflare가 404를 돌려줍니다. 요청의 Host가 등록된 ingress 규칙과 맞지 않아서, 요청이 NginxProxyGuard까지 오지도 못하는 상태였습니다.

Managed 모드

Cloudflare Tunnel 설정에 운영 모드 선택이 생겼습니다.

  • Token 전용 — 지금까지와 동일합니다. NPG는 커넥터만 실행하고, ingress는 Cloudflare 대시보드에서 관리합니다.
  • Managed — NPG가 터널의 catch-all 규칙(hostname 없는 마지막 ingress 규칙)까지 관리합니다. 앞쪽 규칙에 걸리지 않은 요청이 전부 NPG로 들어와 Host 헤더로 라우팅되므로, 어떤 호스트네임이든 프록시 호스트만 만들면 동작합니다.

서비스 추가 절차가 이렇게 줄어듭니다.

기존 Managed
새 서비스 프록시 호스트 + Cloudflare에 호스트네임 등록 + CNAME 프록시 호스트 + CNAME
와일드카드를 못 쓰는 환경 방법 없음 사용 가능
Cloudflare 대시보드 방문 서비스마다 최초 1회

설정 방법

Managed 모드에는 Cloudflare API 토큰이 하나 필요합니다. 권한은 딱 하나, Account / Cloudflare Tunnel / Edit 입니다. (지금 쓰고 계신 커넥터 토큰과는 다른 것입니다.)

계정 ID나 터널 ID는 입력하지 않으셔도 됩니다. 이미 저장된 커넥터 토큰에서 NPG가 직접 읽어냅니다. API 토큰을 넣고 "Catch-all: 매칭되지 않은 호스트네임을 NginxProxyGuard로 전달" 을 체크하면 끝입니다.

기존 설정을 건드리지 않습니다

대시보드에 직접 만들어 두신 Public Hostname 규칙들은 그대로 보존됩니다. NPG가 바꾸는 것은 마지막 catch-all 규칙 하나뿐이고, 그마저도 아래 두 경우에만 손댑니다.

  • Cloudflare 기본값인 http_status:404 인 경우
  • NPG가 직접 써 넣었던 규칙인 경우

다른 곳에서 관리 중인 catch-all이 이미 있으면 건드리지 않고 화면에 "충돌"로 표시합니다. Catch-all을 끄면 NPG가 넣었던 규칙만 http_status:404 로 되돌립니다.

Cloudflare가 일시적으로 응답하지 않을 때 저장하셨거나, 충돌을 대시보드에서 정리하신 경우에는 다시 저장하실 필요가 없습니다. 상태를 갱신할 때 NPG가 알아서 반영합니다. NPG의 HTTPS 포트를 바꾸신 경우에도 재시작 시 자동으로 맞춰집니다.

상세한 배경과 설계를 제안해 주신 @VoltIcaRus 님 감사합니다. (#267)


api·ui 이미지를 모두 받아 다시 올려 주세요.

docker compose pull && docker compose up -d

☁️ Cloudflare Tunnel — stop registering a Public Hostname per service

Every service added behind the tunnel needed its hostname registered as a Public Hostname in the Cloudflare dashboard. A single *.example.com wildcard avoids that — but not when another server or another tunnel already owns the zone's wildcard.

In that situation, pointing n8n.example.com at your tunnel domain by CNAME resolves fine and then Cloudflare answers 404: the request's Host matches no ingress rule, so it never reaches NginxProxyGuard at all.

Managed mode

The Cloudflare Tunnel settings now offer an operating mode.

  • Token only — unchanged behavior. NPG runs the connector; ingress lives in the Cloudflare dashboard.
  • Managed — NPG additionally maintains the tunnel's catch-all rule (the trailing ingress rule with no hostname). Anything the earlier rules do not claim arrives at NPG and is routed by Host header, so any hostname works as soon as a proxy host exists for it.

Adding a service becomes shorter:

Before Managed
New service Proxy host + register hostname in Cloudflare + CNAME Proxy host + CNAME
Wildcard unavailable Not possible Works
Dashboard visits Per service Once

Setting it up

Managed mode needs one Cloudflare API token, with exactly one permission: Account / Cloudflare Tunnel / Edit. (This is not the connector token you already use.)

You do not enter an account ID or tunnel ID — NPG reads both from the connector token it already stores. Paste the API token, tick "Catch-all: route unmatched hostnames to NginxProxyGuard", and you are done.

Your existing configuration is left alone

Public Hostname rules you created in the dashboard are preserved as-is. NPG only ever changes the trailing catch-all rule, and only when it is one of:

  • Cloudflare's default http_status:404
  • a rule NPG wrote itself

A catch-all managed by anything else is left untouched and reported as a conflict in the UI. Turning the catch-all off restores http_status:404, and only over NPG's own rule.

If you saved while the Cloudflare API was briefly unreachable, or you resolved a conflict in the dashboard, you do not need to save again — NPG reconciles on the next status refresh. Changing NPG's HTTPS port is picked up automatically on restart.

Thanks to @VoltIcaRus for the detailed report and design proposal. (#267)


Pull both the api and ui images and restart.

docker compose pull && docker compose up -d

Docker Images

docker pull svrforum/nginxproxyguard-api:2.48.0
docker pull svrforum/nginxproxyguard-ui:2.48.0
docker pull svrforum/nginxproxyguard-nginx:2.48.0

Architectures: linux/amd64, linux/arm64

Component Status
API Built
UI Built
Nginx Skipped (no changes)