Problem
Several application services needed dependable deployment, proxying, SSL, and environment separation.
Case study
Several application services needed dependable deployment, proxying, SSL, and environment separation.
Anonymized production environment using Next.js, NestJS, PM2, Apache, SSL, CI/CD. Client names, domains, and private infrastructure details are intentionally omitted.
Existing server conventions had to be respected Deployment needed clear rollback notes Environment values required careful handling
Deployed and managed multiple Next.js and NestJS services using PM2, Apache reverse proxy, SSL automation, and environment-specific CI/CD pipelines.
Reviewed runtime requirements Checked process management Mapped proxy and SSL routing
Application routes verified SSL and proxy behavior checked Deployment notes prepared
Documented deployment path, SSL and proxy configuration, and safer release operations.
Next.js, NestJS, PM2, Apache, SSL, CI/CD
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.
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.
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.
Production deployment is strongest when process management, proxying, and handover are treated together.
Consultation
Share your stack, risk level, and delivery goal. You will get a practical scope conversation instead of a generic sales pitch.