---
title: "Discussion on \"Shipping It, Part 1: From localhost to a real domain\" | Hashnode"
description: "Discussion on \"Shipping It, Part 1: From localhost to a real domain\". Deploy a Node.js app by hand: a public IP, PM2, nginx, a custom domain and HTTPS, and the pain points that push you toward automation"
url: "https://hashnode.com/posts/shipping-it-part-1-from-localhost-to-a-real-domain/6aea43e5d52461270b71dc25"
---

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

Discussion

# [Shipping It, Part 1: From localhost to a real domain](https://sakib412.hashnode.dev/shipping-it-part-1-from-localhost-to-a-real-domain?utm_source=hashnode&utm_medium=feed)

Deploy a Node.js app by hand: a public IP, PM2, nginx, a custom domain and HTTPS, and the pain points that push you toward automation

Nov 3 · 21 min read · sakib412.hashnode.dev  
Read the article

-   [#devops](https://hashnode.com/tag/devops)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#nginx](https://hashnode.com/tag/nginx)
-   [#deployment](https://hashnode.com/tag/deployment)
-   [#linux](https://hashnode.com/tag/linux)

## Written by

[Najmus Sakib](https://hashnode.com/@sakib412)

@sakib412

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

## Responses 1

Markdown supported · ⌘↵ to post

[Node Edge Ops](https://hashnode.com/@nodeedgeops)

[Nov 4](https://hashnode.com/posts/shipping-it-part-1-from-localhost-to-a-real-domain/6aea43e5d52461270b71dc25/comment/6aeba7f1b80b4586648ba2a4)

The jump from localhost to a real domain usually breaks on three ops details: DNS that is not yet live when you test TLS, a server\_name that does not match the cert SAN, and an app that still emits absolute http links because Host or X-Forwarded-Proto never reached it.

I terminate TLS at nginx, set Host and X-Forwarded-Proto for the proxied Node (or other) app, and only cut DNS after a HEAD to the public name shows the expected cert and redirect Location. Keep a temporary hosts-file or split-horizon check so you can validate the vhost before the world sees it. After go-live, confirm both bare and www if you advertise both, and keep the previous A/AAAA ready for a quick rollback if the new listener fails under real traffic.
