2.8 KiB
2.8 KiB
Deploying iliadobkin.com
Architecture
Browser → Caddy (public IP, TLS) → nginx on 10.0.10.124:80 → /var/www/iliadobkin.com
- DNS for
iliadobkin.compoints to the Caddy server. - Caddy terminates TLS and reverse-proxies to
10.0.10.124:80. - nginx on
10.0.10.124(portfolio) serves static files from/var/www/iliadobkin.com.
Paths on portfolio (10.0.10.124)
| Path | Purpose |
|---|---|
/var/www/iliadobkin.com-src |
Git clone — pull, build here |
/var/www/iliadobkin.com |
Live site — nginx root, rsync dist/ here |
/var/www/html |
Default nginx docroot — not used for this site |
Full deploy (SSH into portfolio as root)
cd /var/www/iliadobkin.com-src
git fetch origin && git checkout main && git reset --hard origin/main
rm -rf node_modules dist
npm ci
npm run build
rsync -av --delete ./dist/ /var/www/iliadobkin.com/
No nginx reload needed after a normal deploy — only the static files change.
Verify deploy worked
# On the server — disk should match the build:
grep -o 'assets/index-[^"]*\.js' /var/www/iliadobkin.com/index.html
# From anywhere — public site should match disk:
curl -sS https://iliadobkin.com/index.html | grep -o 'assets/index-[^"]*\.js'
Both commands must print the same hash (e.g. assets/index-BURprqoD.js).
If the site still looks old in the browser
- Hard refresh: Ctrl+Shift+R or open in a private/incognito window.
- DevTools → Application → Storage → Clear site data, then reload.
- The app is a PWA — an old service worker can cache stale assets.
nginx vhost (one-time setup)
If /etc/nginx/sites-available/iliadobkin.com doesn't exist or nginx is serving
from /var/www/html instead, create the vhost:
cat > /etc/nginx/sites-available/iliadobkin.com << 'EOF'
server {
listen 80;
listen [::]:80;
server_name iliadobkin.com www.iliadobkin.com;
root /var/www/iliadobkin.com;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
}
EOF
ln -sf /etc/nginx/sites-available/iliadobkin.com /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
Caddy config (on the Caddy server, not portfolio)
iliadobkin.com {
reverse_proxy 10.0.10.124:80
}
www.iliadobkin.com {
redir https://iliadobkin.com{uri} permanent
}
Quick one-liner deploy
ssh root@10.0.10.124 'cd /var/www/iliadobkin.com-src && git fetch origin && git reset --hard origin/main && rm -rf node_modules dist && npm ci && npm run build && rsync -av --delete ./dist/ /var/www/iliadobkin.com/'