[FRP + Vite Pitfalls] localhost works but the public address returns 502? Debugging IPv6, service reloads and duplicate proxy names
Pitfall DiaryAI summary: This is a troubleshooting diary of pitfalls encountered while using FRP (Fast Reverse Proxy) for intranet penetration, summarized by AI. Pit 1: The local Vite service on port 3200 works via localhost (IPv6 ::1) but fails via 127.0.0.1 (IPv4), causing a public 502 error because Vite only binds to IPv6 and FRP forwards to IPv4. Solution: set host: '0.0.0.0' in vite.config.ts. Pit 2: Modifying frps.toml and running 'systemctl start frps' didn't take effect because the service was already running; 'start' doesn't reload config. Solution: use 'restart'. Pit 3: Duplicate 'name' fields in [[proxies]] cause 'proxy already exists' errors; names must be unique. A standard troubleshooting chain is provided: check server listening, local service, public port, and logs. Key lessons: localhost ≠ 127.0.0.1; always restart after config changes; proxy names must be unique.