English

IPv4 / IPv6 Dual-Stack Deployment Architecture

One domain serving both IPv4 and IPv6 users, securely exposing services that have no public IP.

Get a free proposal and quote

Background

Client servers sit behind NAT with no fixed public IPv4 address, yet the same domain must serve both IPv4 and IPv6 users without changing application code. The solution combines DNS, FRP tunnels, Nginx and Docker into a dual-entry architecture: IPv6 connects directly to the origin, while IPv4 is relayed through a gateway.

Solution

  • Dual A/AAAA resolution: one domain returns both IPv4 and IPv6 addresses; IPv6 users reach the origin directly, IPv4 users enter the FRP gateway.
  • Unified ingress: Nginx runs on both the gateway and the origin, handling SSL termination, host-based routing, WebSocket upgrades and static uploads; backends listen on loopback only.
  • FRP port plan: fixed ports per service, so adding a service means one new tunnel and one Nginx server block.
  • Containerised and portable: Docker runs the applications, port mappings stay independent of the host, and IPv6 address changes are handled by DDNS.
  • Certificates and security: certificates are stored centrally and synced on a schedule; only 80/443 and required tunnel ports are exposed, while MySQL, Redis and SSH stay off the public internet.

Deliverables

  • DNS A/AAAA record plan and domain inventory
  • FRP server/client configuration and port allocation
  • Nginx site configs, SSL deployment and renewal scripts
  • IPv4/IPv6/SSH/certificate verification checklist
  • Risk register and rollback procedure

Technology stack

NginxFRPDockerIPv6DNS

Outcome

The architecture is running across multiple production projects, including corporate sites, admin systems and AI applications. Adding a service requires only a port mapping and an Nginx block — zero application changes.

Services