interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / infra / spark / nginx / sni-router.conf

53 lines · 2836 bytes Raw Blame History
1# SPARK EDGE copy (2026-11-08, from the hub Pi config of the same day). Differences from the Pi:
2# listens on 192.168.1.108:443 only; hs.aienos.com is passed raw to the Pi (192.168.1.192:443).
3# Undo: sudo systemctl disable --now nginx on the Spark, and point the router 443 forward back to 192.168.1.192.
4# SNI router on :443 (interplane.io lane, 2026-10-04).
5# TLS passthrough: nginx reads only the requested name from the TLS hello and forwards the raw bytes.
6# Headscale keeps its own TLS + built-in ACME (TLS-ALPN-01 passes through untouched).
7# Rollback: sudo /usr/local/sbin/interplane-web-rollback
8stream {
9 access_log off;
10 # Per-source-IP cap on concurrent :443 connections, shared across all three vhosts.
11 # Rationale: worker_connections is 768; one source could otherwise exhaust the
12 # shared router's connection slots and take the web lanes down with it. Browsers
13 # open well under 20 concurrent connections per origin, so 64 leaves headroom.
14 limit_conn_zone $binary_remote_addr zone=perip:10m;
15 map $ssl_preread_server_name $sni_backend {
16 interplane.io interplane_web;
17 www.interplane.io interplane_web;
18 www.aienos.com aienos_web;
19 aienos.com aienos_apex; # 301 to www (SiteHub, 2026-11-07)
20 hs.aienos.com headscale;
21 default 127.0.0.1:9; # L992 reject unknown or absent TLS names
22 }
23 upstream headscale { server 127.0.0.1:4453; } # via PROXY strip shim -> 4443
24 upstream interplane_web { server 127.0.0.1:4448; } # PROXY listener (forge edge); 4454 shim -> 4444 kept for rollback
25 upstream aienos_web { server 127.0.0.1:4446; } # PROXY listener (4445 kept for draining)
26 upstream aienos_apex { server 127.0.0.1:4447; } # apex redirect, PROXY listener
27 server {
28 listen 192.168.1.108:443; # Spark edge: LAN address only (tailnet :443 is vaultwarden, *:80 is apache)
29 ssl_preread on;
30 preread_timeout 10s;
31 limit_conn perip 64;
32 proxy_pass $sni_backend;
33 proxy_protocol on; # allen chat lane: real client address for www.aienos.com limits
34 proxy_connect_timeout 5s;
35 proxy_timeout 1h;
36 }
37 # PROXY-protocol strip shims (allen chat lane, 2026-10-26): headscale and
38 # interplane keep receiving plain TLS from 127.0.0.1, exactly as before.
39 server {
40 listen 127.0.0.1:4453 proxy_protocol;
41 proxy_protocol off;
42 proxy_pass 192.168.1.192:443; # Spark edge: Headscale stays on the hub Pi; its own :443 router takes it to 4443
43 proxy_connect_timeout 5s;
44 proxy_timeout 1h;
45 }
46 server {
47 listen 127.0.0.1:4454 proxy_protocol;
48 proxy_protocol off;
49 proxy_pass 127.0.0.1:4444;
50 proxy_connect_timeout 5s;
51 proxy_timeout 1h;
52 }
53}