[object Object]

← back to Abramsagency

add golive2.sh: place vhost in conf.d (box doesn't include sites-enabled) + re-verify

776b054a6f9507867702e07fe3eab20f555d3a11 · 2026-08-13 11:35:25 -0700 · Steve Abrams

Files touched

Diff

commit 776b054a6f9507867702e07fe3eab20f555d3a11
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 13 11:35:25 2026 -0700

    add golive2.sh: place vhost in conf.d (box doesn't include sites-enabled) + re-verify
---
 golive2.sh | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/golive2.sh b/golive2.sh
new file mode 100644
index 0000000..16e6ce9
--- /dev/null
+++ b/golive2.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# Fix: place the abramsagency.com vhost where THIS box actually includes configs
+# (fleet uses conf.d, not sites-enabled), then re-verify. Run from Mac2:
+#   bash ~/Projects/abramsagency/golive2.sh
+set -euo pipefail
+SRV=root@45.61.58.125
+
+ssh -o StrictHostKeyChecking=accept-new "$SRV" 'bash -s' <<'EOS'
+set -e
+PORT=9788
+echo "== include dirs nginx actually loads =="
+nginx -T 2>/dev/null | grep -Eo 'include [^;]*(sites-enabled|conf\.d)[^;]*' | sort -u || true
+
+echo "== writing vhost to /etc/nginx/conf.d/abramsagency.com.conf =="
+cat > /etc/nginx/conf.d/abramsagency.com.conf <<NG
+server {
+  listen 80;
+  server_name abramsagency.com www.abramsagency.com;
+  location / {
+    proxy_pass http://127.0.0.1:$PORT;
+    proxy_set_header Host \$host;
+    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
+    proxy_set_header X-Forwarded-Proto \$scheme;
+  }
+}
+NG
+
+# drop the inert sites-enabled copy so there's no ambiguity
+rm -f /etc/nginx/sites-enabled/abramsagency.com
+
+nginx -t && systemctl reload nginx
+
+echo "== verify: request the vhost locally by Host header (should now be 200, not 301) =="
+curl -s -o /dev/null -w "  :80 Host=abramsagency.com -> %{http_code}\n" -H 'Host: abramsagency.com' http://127.0.0.1/
+curl -s -H 'Host: abramsagency.com' http://127.0.0.1/healthz; echo
+EOS
+
+echo
+echo "✅ vhost placed. NEXT:"
+echo "  1) GoDaddy DNS:  A @ -> 45.61.58.125   |   CNAME www -> abramsagency.com"
+echo "  2) then SSL:     ssh $SRV 'certbot --nginx -d abramsagency.com -d www.abramsagency.com --non-interactive --agree-tos -m steve@designerwallcoverings.com'"

← 1ff63c8 add one-shot golive.sh (deploy+pm2+nginx) — Steve runs it; c  ·  back to Abramsagency  ·  repoint agency site to agency.agentabrams.com (owned CF zone b0ab28a →