5c38b0631a
- nginx:alpine replaces nginx-proxy-manager - certbot on host with standalone issuance and auto-renewal - per-site nginx configs in conf.d/ (HTTP->HTTPS, bare->www) - container names use underscores (timothykim_net) - setup.sh: automated cert issuance, dynamic app startup - deploy.sh: nginx -t guard, graceful image-not-found - new-app.sh: Gitea API repo creation, nginx conf generation - add ARCHITECTURE.md, USECASES.md, CLAUDE.md - remove old NPM data/certs from tracking
49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
# Redirect HTTP to HTTPS, bare domain to www
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name timothykim.net www.timothykim.net;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://www.timothykim.net$request_uri;
|
|
}
|
|
}
|
|
|
|
# Redirect bare HTTPS domain to www
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name timothykim.net;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/timothykim.net/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/timothykim.net/privkey.pem;
|
|
|
|
return 301 https://www.timothykim.net$request_uri;
|
|
}
|
|
|
|
# Main site
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name www.timothykim.net;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/timothykim.net/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/timothykim.net/privkey.pem;
|
|
|
|
add_header Strict-Transport-Security "max-age=63072000; preload" always;
|
|
|
|
location / {
|
|
proxy_pass http://timothykim_net:80;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|