- Forgejo + Redis Docker stack (wetgit-forgejo role) - FastAPI + Celery systemd services (wetgit-app role) - Nginx vhosts voor git.wetgit.nl en api.wetgit.nl (wetgit-nginx role) - SSL via Let's Encrypt (certbot webroot) - Backup script (forgejo dump, geen downtime) - Codeberg mirror script - Cron jobs voor backup/mirror/log cleanup - Ansible vault voor secrets (encrypted) Geïsoleerd van dt-platform: eigen poorten, users, directories.
51 lines
1.5 KiB
Django/Jinja
51 lines
1.5 KiB
Django/Jinja
# WetGIT API — managed by WetGIT Ansible (not dt-platform)
|
|
# Do NOT edit manually
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name {{ server_name }};
|
|
|
|
# ACME challenge (reuse existing certbot webroot)
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name {{ server_name }};
|
|
|
|
ssl_certificate /etc/letsencrypt/live/{{ server_name }}/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/{{ server_name }}/privkey.pem;
|
|
|
|
# Security headers
|
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "DENY" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
|
|
# API proxy
|
|
location / {
|
|
proxy_pass http://{{ backend_host }}:{{ backend_port }};
|
|
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;
|
|
|
|
# Timeouts for long-running legislation processing
|
|
proxy_read_timeout 120s;
|
|
proxy_connect_timeout 10s;
|
|
}
|
|
|
|
# Health check (no rate limit)
|
|
location = /health {
|
|
proxy_pass http://{{ backend_host }}:{{ backend_port }}/health;
|
|
access_log off;
|
|
}
|
|
}
|