server.js)A minimal HTTP server built with Node's built-in http module — no frameworks, no dependencies.
127.0.0.1:3000 (localhost only — not directly exposed)Extracted from nginx-1.30.0.zip into the project folder.
0.0.0.0:80 — accessible to all network interfaceshttp://127.0.0.1:3000 (the Node app)X-Real-IP and X-Forwarded-For headersnginx-1.30.0/conf/nginx.confKey change from the default nginx config:
# Before (static file serving)
location / {
root html;
index index.html index.htm;
}
# After (reverse proxy to Node)
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Added an inbound rule to allow external traffic on port 80 (required admin privileges):
Rule name: nginx HTTP 80
Direction: Inbound
Action: Allow
Protocol: TCP
Port: 80
Without this rule, Windows blocks traffic to nginx even if nginx is listening.
Exposes the Node app to the public internet via Tailscale's infrastructure — no port forwarding or static IP required.
tailscale funnel --bg http://127.0.0.1:3000
This gives a permanent public HTTPS URL: https://nbg3pc.taileeca1e.ts.net
Tailscale handles:
The funnel config persists across reboots — you do not need to re-run this command after a restart.
Browser → https://nbg3pc.taileeca1e.ts.net
→ Tailscale's edge servers (TLS terminated)
→ Tailscale daemon on this machine
→ http://127.0.0.1:3000
→ Node.js app
→ HTML response
Device → http://100.126.33.100
→ nginx :80
→ http://127.0.0.1:3000
→ Node.js app
→ HTML response
| Decision | Reason |
|---|---|
| Node.js over Python/Flask | Node is better suited for long-running HTTP servers; Flask's dev server is not production-grade |
| nginx in front of Node | Standard practice — nginx handles connection management, keeps Node focused on app logic |
| Node bound to localhost only | Prevents direct port-3000 access; all traffic must go through nginx or Tailscale Funnel |
| Tailscale Funnel over port forwarding | No router config needed, automatic HTTPS, works behind CGNAT |