From e3a7efc1a3a240756d998f1a93eb0cc2e0592877 Mon Sep 17 00:00:00 2001 From: 1sonhador <1sonhador@gmail.com> Date: Mon, 23 Mar 2026 21:26:10 +0000 Subject: [PATCH] docs(NPM): domain without :3040 needs no path rewrite; forward + headers Co-Authored-By: Paperclip --- .../bitreport-error-reporting.site.conf.example | 2 ++ .../bitreport-error-reporting-lxc-proxmox.md | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/deploy/lxc/nginx/bitreport-error-reporting.site.conf.example b/deploy/lxc/nginx/bitreport-error-reporting.site.conf.example index d646670..f964544 100644 --- a/deploy/lxc/nginx/bitreport-error-reporting.site.conf.example +++ b/deploy/lxc/nginx/bitreport-error-reporting.site.conf.example @@ -31,7 +31,9 @@ server { proxy_pass http://127.0.0.1:3040; proxy_http_version 1.1; proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + # WebSockets: usar map $http_upgrade no bloco http{} ou seguir guia NPM §14.2.1 } } diff --git a/docs/deployment/bitreport-error-reporting-lxc-proxmox.md b/docs/deployment/bitreport-error-reporting-lxc-proxmox.md index 676ffd1..d45e53e 100644 --- a/docs/deployment/bitreport-error-reporting-lxc-proxmox.md +++ b/docs/deployment/bitreport-error-reporting-lxc-proxmox.md @@ -188,6 +188,20 @@ Colocar **nginx** (no host Proxmox, CT de proxy, ou o mesmo CT se política o pe 4. **SSL:** separar **SSL** → *Request a new SSL Certificate* (Let’s Encrypt); **Force SSL** após emissão. 5. Confirmar cabeçalhos de proxy (`X-Forwarded-For`, `X-Forwarded-Proto`, `Host`) — o NPM costuma pré-definir; ajustar no *Advanced* se o upstream falhar em URLs absolutas. +#### 14.2.1 Domínio sem `:3040` — *rewrite*? + +**Não é obrigatório nenhum `rewrite` de path** no Nginx/NPM para “tirar a porta” do URL: o browser fala sempre em **443** com o NPM; o NPM faz **proxy interno** para `http://:3040`. O utilizador nunca vê `:3040` na barra de endereços. + +1. Activar **Websockets Support** no *Proxy Host* da admin UI (Next.js / HMR em dev não aplica; em produção ajuda em alguns fluxos). +2. Se faltarem cabeçalhos, no *Advanced* → **Custom Nginx Configuration** (o NPM já define `proxy_pass`; só acrescentar linhas compatíveis com o bloco `location`): + +```nginx +proxy_set_header X-Forwarded-Host $host; +proxy_set_header X-Forwarded-Port $server_port; +``` + +**Evitar** colar directivas `map` ou segundo `location /` completos no *Custom* — o NPM valida o snippet no contexto do `server{}`; blocos inválidos impedem o reload. + **Collector-worker no LXC:** manter `INGEST_BASE_URL` para `http://127.0.0.1:3041` (ou hostname interno do próprio guest). Clientes e colectores externos usam o FQDN público da ingest. ### 14.3 Cloudflare