Files
infra/stacks/books/nginx/install.sh
T

13 lines
690 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# books.ruzzy.dev: vhost nginx + сертификат Let's Encrypt. Запуск на fr1: sudo sh ~/books/nginx/install.sh
set -e
here=$(dirname "$0")
install -m 644 "$here/books.ruzzy.dev.conf" /etc/nginx/sites-available/books.ruzzy.dev.conf
ln -sf /etc/nginx/sites-available/books.ruzzy.dev.conf /etc/nginx/sites-enabled/books.ruzzy.dev.conf
nginx -t
systemctl reload nginx
# certbot допишет 443-блок и редирект с 80 в sites-available/books.ruzzy.dev.conf (продление — его же таймером)
certbot --nginx -d books.ruzzy.dev --non-interactive --redirect
nginx -t && systemctl reload nginx
echo "готово: https://books.ruzzy.dev"