Nginx-Configurations/http.d/auth.shad.moe
2024-11-04 17:09:00 +00:00

65 lines
1.9 KiB
Text

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream authentik {
server 192.168.1.205:9443;
keepalive 10;
}
server {
listen 80;
listen [::]:80;
server_name auth.shad.moe www.auth.shad.moe;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name auth.shad.moe www.auth.shad.moe;
ssl_certificate /etc/letsencrypt/live/auth.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.shad.moe/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt;
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:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
location / {
proxy_pass https://authentik;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
ssl_stapling on;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/graph.shad.moe/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
}