---
title: "Discussion on \"Deploy Multiple Websites With Different Domain Names On The Same VPS Using Docker and Nginx\" | Hashnode"
description: "Discussion on \"Deploy Multiple Websites With Different Domain Names On The Same VPS Using Docker and Nginx\". For more than 4 years (between 2014 and 2018) I was using PHP as my main stack for developing websites for my clients, at the same time, I have multiple websites using WordPress as a content management system deployed on shared hosting and never had ..."
url: "https://hashnode.com/posts/deploy-multiple-websites-with-different-domain-names-on-the-same-vps-using-docker-and-nginx/64c4460fb3f485182d8d28b6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Deploy Multiple Websites With Different Domain Names On The Same VPS Using Docker and Nginx](https://blog.hexacker.com/deploy-multiple-websites-with-different-domain-names-on-the-same-vps-using-docker-and-nginx?utm_source=hashnode&utm_medium=feed)

For more than 4 years (between 2014 and 2018) I was using PHP as my main stack for developing websites for my clients, at the same time, I have multiple websites using WordPress as a content management system deployed on shared hosting and never had ...

Jul 28, 2023 · 4 min read · blog.hexacker.com  
Read the article

-   [#devops](https://hashnode.com/tag/devops)
-   [#docker](https://hashnode.com/tag/docker)
-   [#nginx](https://hashnode.com/tag/nginx)
-   [#reverse-proxy](https://hashnode.com/tag/reverse-proxy)

## Written by

[Abdelmadjid Cherfaoui](https://hashnode.com/@Hexacker)

@Hexacker · Ottawa, Canada

  
[View profile](https://hashnode.com/@Hexacker)

Founder @Bitsoven

Full Stack Developer l Software Engineer

## Responses 1

Markdown supported · ⌘↵ to post

[CDN Edge Ops](https://hashnode.com/@cdnedgeops)

[Nov 5](https://hashnode.com/posts/deploy-multiple-websites-with-different-domain-names-on-the-same-vps-using-docker-and-nginx/64c4460fb3f485182d8d28b6/comment/6aebe5655e601a8bb635421e)

Multi-site on one VPS stays sane when nginx is the only process publishing 80/443 and every app container sits on a private compose network. Prefer one server\_name block per public hostname over path-based sharing when the stacks disagree on base paths; point each proxy\_pass at the service DNS name on an unpublished port so a recreate never forces you to chase ephemeral container IPs on the host. Mount TLS material read-only into the proxy, keep ACME HTTP-01 on the plain listener for that same server\_name, and leave app ports unpublished so a forgotten -p never bypasses TLS or access rules.

After a reload I hit each public hostname once and confirm the leaf SAN matches, that the first plain request becomes a single HTTPS redirect to the canonical host, and that Host plus X-Forwarded-Proto reach the upstream — missing those makes WordPress or similar emit http redirects with the internal service name. From inside the nginx container, curl each backend by service name, then the same path through the matching vhost; a connect failure is network membership, while a trailing-slash join mismatch usually shows up as a 404 that only appears on the public name.
