Case study

Multi-Application Production Deployment

Several application services needed dependable deployment, proxying, SSL, and environment separation.

Problem

Several application services needed dependable deployment, proxying, SSL, and environment separation.

Environment

Anonymized production environment using Next.js, NestJS, PM2, Apache, SSL, CI/CD. Client names, domains, and private infrastructure details are intentionally omitted.

Constraints

Existing server conventions had to be respected Deployment needed clear rollback notes Environment values required careful handling

Approach

Deployed and managed multiple Next.js and NestJS services using PM2, Apache reverse proxy, SSL automation, and environment-specific CI/CD pipelines.

Implementation

Reviewed runtime requirements Checked process management Mapped proxy and SSL routing

Validation

Application routes verified SSL and proxy behavior checked Deployment notes prepared

Outcome

Documented deployment path, SSL and proxy configuration, and safer release operations.

Technology Stack

Next.js, NestJS, PM2, Apache, SSL, CI/CD

Running several apps on shared servers

When several Next.js and NestJS services share a server, each one needs its own port, its own PM2 process definition and its own environment file. We describe every process in a single PM2 ecosystem file so restarts, log locations and memory limits are explicit, and enable PM2's startup hook so services come back after a reboot. Each service gets a separate system user or at least a separate directory with tight permissions, so one compromised app cannot read another's secrets.

Reverse proxy and SSL

Apache (or Nginx) sits in front as the only public entry point. Each domain or subdomain maps to one upstream port through a virtual host, with HTTP redirected to HTTPS. Certificates are issued and renewed automatically with Let's Encrypt, and renewal is tested with a dry run so expiry never becomes an incident. Proxy timeouts, request size limits and forwarded headers are set deliberately rather than left at defaults that break uploads or real client IPs.

Environment separation and releases

Staging and production use separate environment files, databases and, where budget allows, separate servers. The CI/CD pipeline deploys to staging on merge and to production on an explicit release, using the same build. Every release step (pull, install, build, restart, health check) is written down so someone other than the original engineer can run or roll back a deploy.

Lesson

Production deployment is strongest when process management, proxying, and handover are treated together.

Consultation

Need a similar production issue investigated?

Share your stack, risk level, and delivery goal. You will get a practical scope conversation instead of a generic sales pitch.