homelab/roles/keycloak/templates/keycloak.conf.j2

29 lines
824 B
Plaintext
Raw Normal View History

2021-05-18 21:10:37 +00:00
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name "keycloak.{{ base_domain }}";
set $keycloak keycloak;
# Security/XSS Mitigation Headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
2021-06-20 17:39:46 +00:00
include /etc/nginx/snippets/authelia-endpoint.conf;
2021-05-18 21:10:37 +00:00
location / {
proxy_pass http://$keycloak:8080;
2021-06-20 17:39:46 +00:00
include /etc/nginx/snippets/authelia-auth.conf
2021-05-18 21:10:37 +00:00
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 X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_buffering off;
}
}