Skip to content

Relax proxy nginx limits for trusted internal network - #70

Merged
3alpha merged 1 commit into
mainfrom
relax-proxy-nginx-limits
Sep 16, 2026
Merged

3alpha merged 1 commit into
mainfrom
relax-proxy-nginx-limits

Conversation

@3alpha

@3alpha 3alpha commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Opens up the beacon-validator proxy nginx config. It only ever serves the other containers on the internal DAppNode Docker network, so the stock nginx defaults provide no protection — they just cap legitimate traffic.

Also hoists the shared proxy directives into the http block. nginx inherits them into both servers/locations, which removes the duplicated 4-line proxy_set_header block from each of the three locations.

Why

Problems the old defaults could cause:

  • client_max_body_size 1m — rejects larger request bodies.
  • large_client_header_buffers 4 8k — /eth/v1/beacon/states/head/validators/<many-pubkeys> URLs overflow the default buffers.
  • proxy_read_timeout 60s — cuts off long reads.
  • proxy_buffering on — spools responses instead of streaming, which is wrong for the SSE endpoint /eth/v1/events.

Changes

Directive Value Rationale
client_max_body_size 0 unlimited request bodies
client_body_buffer_size 1m avoid spilling to disk
client_header_buffer_size 32k long validator query paths
large_client_header_buffers 8 64k multi-pubkey queries
client_body_timeout / client_header_timeout / send_timeout 1h slow local clients
keepalive_timeout / keepalive_requests 1h / 100000 long-lived validator connections
proxy_connect_timeout 60s upstream warm-up tolerance
proxy_send_timeout / proxy_read_timeout 1h long stream reads
proxy_buffering / proxy_request_buffering off keeps /eth/v1/events SSE open, streams large responses
proxy_max_temp_file_size 0 never spool to temp files
proxy_buffer_size / proxy_buffers / proxy_busy_buffers_size 32k / 8 64k / 128k large response header sets
proxy_ignore_client_abort on validator timeout on publish no longer kills the upstream request
proxy_http_version + proxy_set_header Connection 1.1 / "" upstream keepalive instead of HTTP/1.0 default
proxy_socket_keepalive on keep upstream sockets alive
tcp_nodelay / tcp_nopush on / off low latency for a JSON API
reset_timedout_connection / lingering_time on / 30s free sockets promptly
server_tokens off don't advertise the nginx version
worker_processes / worker_connections / multi_accept auto / 8192 / on many validators fanning out
proxy_set_header X-Forwarded-Host / X-Forwarded-Port $host / $server_port full original request info to the backend

Testing

  • nginx -t against the rendered config
  • Validator client reaches the beacon chain through port 3500 as before
  • Beacon API reachable on port 4500
  • /eth/v1/events stream stays open past 60s
  • Multi-pubkey validators query with a long requester URL succeeds

Note: not yet validated locally with nginx -t — no Docker daemon was running on the authoring machine. All directives are valid in http context for the pinned nginx:1.27.0-alpine.

The proxy sits on the internal DAppNode Docker network with no untrusted
clients, so the stock nginx defaults only get in the way: 1m body limit,
4k/8k header buffers, 60s timeouts and response buffering can truncate
large validator queries, slow block publishes and the /eth/v1/events
stream.

Open everything up and hoist the shared directives into the http block,
which also removes the duplicated proxy_set_header block in both servers.

- client_max_body_size 0 (unlimited)
- larger client/proxy header and body buffers
- 1h client/proxy/send/keepalive timeouts
- proxy_buffering and proxy_request_buffering off (SSE stays open)
- proxy_ignore_client_abort on, proxy_socket_keepalive on
- HTTP/1.1 with Connection "" for upstream keepalive
- tcp_nodelay on, server_tokens off, worker tuning
@tropibot

tropibot Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

✅ TropiBot report: SYNC TEST REPORT - PASSED

This CI runs on a real DAppNode using the same RPC calls a user would make to configure a staker setup: execution client, consensus client, web3signer, MEV-boost, and relays.

📦 Package Under Test

📦 Clients Used

Component DNP Name
Execution hoodi-reth.dnp.dappnode.eth
Consensus nimbus-hoodi.dnp.dappnode.eth
Web3Signer web3signer-hoodi.dnp.dappnode.eth
MEV Boost mev-boost-hoodi.dnp.dappnode.eth
Network hoodi

🔖 Version Tracking

Client Before After
Execution reth/v2.5.1-6dec1b9/x86_64-unknown-linux-gnu reth/v2.5.1-6dec1b9/x86_64-unknown-linux-gnu
Consensus n/a Nimbus/v26.7.0-4110bc-stateofus

⏱️ Timing

Operation Duration Status
SetStakerConfig 2m 4s ✅
PackageInstall 24.5s ✅
WaitForSync 30.1s ✅

Total Duration: 3m 34s


📋 View full CI logs

@3alpha
3alpha merged commit e03f714 into main Sep 16, 2026
4 checks passed
@3alpha
3alpha deleted the relax-proxy-nginx-limits branch October 4, 2026 12:43
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.

2 participants