[object Object]

← back to Parked Landers

Normalize http->https on all 8 landers; add normalize/fix2/check helpers

93126952205132a3c4f1053ac32b8febf1b4320e · 2026-09-09 13:16:58 -0700 · Steve

Files touched

Diff

commit 93126952205132a3c4f1053ac32b8febf1b4320e
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Sep 9 13:16:58 2026 -0700

    Normalize http->https on all 8 landers; add normalize/fix2/check helpers
---
 normalize-remote.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/normalize-remote.sh b/normalize-remote.sh
new file mode 100755
index 0000000..2d1ed43
--- /dev/null
+++ b/normalize-remote.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Runs ON Kamatera. Make all 8 uniform: :80 = ACME webroot + http->https redirect; :443 = lander.
+# Only rewrites a conf if its cert exists. Backup + nginx -t gate + auto-restore.
+set -u
+IP="45.61.58.125"
+TS=$(date +%s); BAK="/root/nginx-bak-norm-$TS"; mkdir -p "$BAK"
+DOMS="protectyourspec.com cannabisofthemonthclub.com hempofthemonthclub.com marijuanaofthemonthclub.com potofthemonthclub.com weedofthemonthclub.com mymemosamples.com hospitalitysalesrepresentatives.com"
+cd /etc/nginx/sites-available || exit 1
+for d in $DOMS; do
+  [ -f "/etc/letsencrypt/live/$d/fullchain.pem" ] || { echo "skip $d (no cert)"; continue; }
+  cp -a "$d.conf" "$BAK/" 2>/dev/null
+  cat > "$d.conf" <<CONF
+server {
+    listen $IP:80;
+    server_name $d www.$d;
+    location ^~ /.well-known/acme-challenge/ { root /var/www/certbot; default_type "text/plain"; }
+    location / { return 301 https://\$host\$request_uri; }
+}
+server {
+    listen $IP:443 ssl http2;
+    server_name $d www.$d;
+    root /var/www/parked-landers/$d;
+    index index.html;
+    ssl_certificate /etc/letsencrypt/live/$d/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/$d/privkey.pem;
+    location / { try_files \$uri \$uri/ /index.html; }
+}
+CONF
+  echo "normalized: $d"
+done
+if ! nginx -t 2>&1; then
+  echo "!! nginx -t FAILED — restoring"; for d in $DOMS; do [ -f "$BAK/$d.conf" ] && cp -a "$BAK/$d.conf" ./; done
+  nginx -t && systemctl reload nginx; echo "RESTORED. ABORT."; exit 1
+fi
+systemctl reload nginx
+echo "=== VERIFY (http should now be 301 -> https 200 everywhere) ==="
+for d in $DOMS; do
+  h=$(curl -s -m10 -o /dev/null -w "%{http_code}" "http://$d/" 2>/dev/null)
+  s=$(curl -s -m10 -o /dev/null -w "%{http_code}" "https://$d/" 2>/dev/null)
+  ours=$(curl -s -m10 "https://$d/" 2>/dev/null | grep -qi "curated domain portfolio" && echo "OUR-LANDER" || echo "other")
+  printf "  %-38s http=%s https=%s %s\n" "$d" "$h" "$s" "$ours"
+done
+echo "BACKUP at $BAK"
+echo "NORMALIZE DONE"

← 5283034 All 8 landers: real flux images swapped in (0 placeholders)  ·  back to Parked Landers  ·  (newest)