← back to Abramsagency
golive-http-only.sh
24 lines
#!/usr/bin/env bash
# FALLBACK: un-break agency.agentabrams.com by serving clean HTTP (no 301->https,
# no :443) until the SSL SNI fix is applied. Single conf.d file, nginx -t gated.
# Run from Mac2: bash ~/Projects/abramsagency/golive-http-only.sh
set -euo pipefail
SRV=root@45.61.58.125
HOST=agency.agentabrams.com
PORT=9788
ssh -o StrictHostKeyChecking=accept-new "$SRV" "cat > /etc/nginx/conf.d/$HOST.conf <<NG
server {
listen 80;
server_name $HOST;
location ^~ /.well-known/acme-challenge/ { root /var/www/certbot; default_type \"text/plain\"; try_files \\\$uri =404; }
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;
}
}
NG
nginx -t && systemctl reload nginx && echo HTTP_ONLY_RESTORED"
echo "== check =="
curl -s -m 12 -H "Host: $HOST" http://45.61.58.125/ -o /dev/null -w "http via vhost=%{http_code}\n" || true