1b7b70426c
- config: koanf-based loading (defaults → YAML → KINDEXR_ env vars) - db: embedded SQLite migrations with BEGIN/END-aware statement splitter - server: chi router, GET /health returns JSON stats - cmd/kindexr: graceful SIGTERM shutdown - cmd/kindexr-cli: stub - deploy: systemd unit, example config, nginx snippet - all packages covered by race-clean tests
74 lines
2.4 KiB
Plaintext
74 lines
2.4 KiB
Plaintext
# nginx reverse proxy configuration for nzbstr
|
|
# Place this in /etc/nginx/sites-available/nzbstr and symlink to sites-enabled/.
|
|
#
|
|
# Prerequisites:
|
|
# - nzbstr daemon listening on 127.0.0.1:9117
|
|
# - TLS certificate (e.g. from Let's Encrypt via certbot)
|
|
#
|
|
# Usage:
|
|
# cp nginx.conf.example /etc/nginx/sites-available/nzbstr
|
|
# ln -s /etc/nginx/sites-available/nzbstr /etc/nginx/sites-enabled/
|
|
# nginx -t && systemctl reload nginx
|
|
|
|
upstream nzbstr {
|
|
server 127.0.0.1:9117;
|
|
keepalive 32;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name nzbstr.example.com;
|
|
|
|
# Redirect all HTTP to HTTPS.
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name nzbstr.example.com;
|
|
|
|
# --- TLS (uncomment and adjust paths after running certbot) ---
|
|
# ssl_certificate /etc/letsencrypt/live/nzbstr.example.com/fullchain.pem;
|
|
# ssl_certificate_key /etc/letsencrypt/live/nzbstr.example.com/privkey.pem;
|
|
# include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
# --- end TLS ---
|
|
|
|
# Security headers.
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "DENY" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
|
|
# Logging.
|
|
access_log /var/log/nginx/nzbstr_access.log;
|
|
error_log /var/log/nginx/nzbstr_error.log;
|
|
|
|
# Proxy to nzbstr daemon.
|
|
location / {
|
|
proxy_pass http://nzbstr;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_set_header Connection "";
|
|
|
|
# Torznab responses can be slow if searching a large index.
|
|
proxy_read_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
}
|
|
|
|
# Health endpoint — allow from anywhere for monitoring.
|
|
location /health {
|
|
proxy_pass http://nzbstr/health;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
}
|