From b51c22c318b017b1a271b307823852b7542dc943 Mon Sep 17 00:00:00 2001 From: seven Date: Sat, 27 Jun 2026 23:15:31 +0800 Subject: [PATCH] Add nginx deploy config and deploy script --- deploy/deploy.sh | 20 ++++++++++++++++ deploy/nginx_abigail.conf | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100755 deploy/deploy.sh create mode 100644 deploy/nginx_abigail.conf diff --git a/deploy/deploy.sh b/deploy/deploy.sh new file mode 100755 index 0000000..dc60d41 --- /dev/null +++ b/deploy/deploy.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Deploy static site to the VPS at 82.156.24.101 over rsync+ssh. +# Run from the project root: ./deploy/deploy.sh +set -euo pipefail + +SERVER="ubuntu@82.156.24.101" +REMOTE_ROOT="/var/www/abigail" +PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)" + +echo "→ Syncing files to $SERVER:$REMOTE_ROOT" +rsync -avz --delete \ + --include='index.html' \ + --include='abigail_*.html' \ + --exclude='*' \ + "$PROJECT_ROOT/" "$SERVER:$REMOTE_ROOT/" + +echo "→ Reloading nginx" +ssh "$SERVER" "sudo nginx -t && sudo systemctl reload nginx" + +echo "✓ Live at https://82.156.24.101:8093/" diff --git a/deploy/nginx_abigail.conf b/deploy/nginx_abigail.conf new file mode 100644 index 0000000..f58bc95 --- /dev/null +++ b/deploy/nginx_abigail.conf @@ -0,0 +1,49 @@ +server { + listen 8093 ssl http2; + listen [::]:8093 ssl http2; + server_name _; + + ssl_certificate /etc/nginx/ssl/abigail.crt; + ssl_certificate_key /etc/nginx/ssl/abigail.key; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + ssl_session_cache shared:SSL:10m; + ssl_session_timeout 1d; + + root /var/www/abigail; + index index.html; + + # Security headers + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + add_header Strict-Transport-Security "max-age=63072000" always; + + # Gzip + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_types text/plain text/css text/javascript application/javascript application/json image/svg+xml; + + # Short URL routes (mirror vercel.json) + location = /pricing { try_files /abigail_pricing.html =404; } + location = /individuals { try_files /abigail_individuals.html =404; } + location = /employers { try_files /abigail_employers.html =404; } + location = /library { try_files /abigail_library.html =404; } + + # cleanUrls: serve foo.html when /foo requested + location / { + try_files $uri $uri.html $uri/ =404; + } + + # Deny access to dotfiles + location ~ /\. { + deny all; + } + + # Light caching for HTML, longer for assets if/when added + location ~* \.(html)$ { + add_header Cache-Control "public, max-age=300, must-revalidate"; + } +}