57 lines
2.5 KiB
Plaintext
57 lines
2.5 KiB
Plaintext
# pgAdmin 4 — nginx reverse proxy config
|
|
# Domein: postgres.el-kadi.nl → backend op localhost:5434
|
|
#
|
|
# Plaats in /etc/nginx/sites-available/ en symlink naar sites-enabled/
|
|
# Of in /etc/nginx/conf.d/
|
|
#
|
|
# Vereist SSL certificaat van Let's Encrypt / certbot.
|
|
|
|
server {
|
|
listen 80;
|
|
server_name postgres.el-kadi.nl;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name postgres.el-kadi.nl;
|
|
|
|
# ── SSL certificaten ─────────────────────────────────────────────────
|
|
ssl_certificate /etc/letsencrypt/live/postgres.el-kadi.nl/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/postgres.el-kadi.nl/privkey.pem;
|
|
|
|
# ── SSL beveiliging ──────────────────────────────────────────────────
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
|
ssl_prefer_server_ciphers off;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 1d;
|
|
|
|
# ── security headers ─────────────────────────────────────────────────
|
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
|
|
# ── logging ──────────────────────────────────────────────────────────
|
|
access_log /var/log/nginx/pgadmin-access.log;
|
|
error_log /var/log/nginx/pgadmin-error.log;
|
|
|
|
# ── proxy naar pgAdmin ───────────────────────────────────────────────
|
|
location / {
|
|
proxy_pass http://127.0.0.1:5434;
|
|
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;
|
|
|
|
# pgAdmin vereist lange sessies
|
|
proxy_read_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
proxy_buffering off;
|
|
client_max_body_size 10M;
|
|
}
|
|
}
|