Back to case studies
Didactic case

Docker deployment on a VPS with port and proxy conflicts

A didactic case study about Docker, Nginx, DNS, SSL and containers when more than one system shares the same VPS.

Context

A company hosts more than one system on the same VPS. Locally, projects may use similar ports; in production, containers and Nginx decide what each domain really serves.

Observed symptoms

  • The container starts, but the domain points to the wrong system.
  • The backend works by IP and port, but fails through the domain.
  • The frontend home opens, but internal SPA routes break on refresh.
  • SSL works on one domain and fails on another.
  • Nginx and Docker logs are not checked after deployment.

Investigation path

01

Draw the network map

List containers, Docker networks, internal ports, exposed ports and the domain expected for each service.

02

Separate DNS, proxy and application responsibilities

DNS points the name, Nginx routes traffic and Docker isolates services.

03

Validate SPA routes and API paths

React routes should return index.html and API routes should preserve headers and reach the right backend.

04

Create a post-publish checklist

Deployment ends after testing home, internal routes, API, forms, sitemap, robots, ads.txt and logs.

Technical decisions

  • Avoid exposing unnecessary host ports.
  • Use Nginx as the public boundary for domains.
  • Separate Docker networks and project names clearly.
  • Document rollback and validation steps.

Expected outcome

Deployment stops depending on memory. The team knows where each request enters, where it goes and how to validate the new version.

FAQ

How to compare this case with your reality.

What should be tested right after deployment?

Home, internal SPA routes, API, forms, sitemap, robots, ads.txt, logs and the domains that share the VPS.

Does this affect Cloudflare configuration?

Cloudflare DNS points traffic to the VPS, while Nginx and Docker decide which system handles each domain.

WhatsApp(12) 98855-9188