Set-OPS-Public/roles/serveur_icingaweb2/templates/nginx.conf.j2
Daniel Allaire b60c5dc963 serveur_oauth2_proxy : passerelle SSO OIDC générique + Icinga Web 2 au SSO
oauth2-proxy (v7.15.3) place Keycloak devant toute app sans OIDC natif
(auth external, utilisateur via en-tête). Rôle paramétrable, réutilisable.
Éprouvé devant icingaweb2 (backend=external, X-Forwarded-Preferred-Username).

Prouvé : testmail → oauth2-proxy → Keycloak → icingaweb2 /dashboard,
connecté. Ferme le gap LDAP-direct d'icingaweb2.

Réglages appris : insecure_oidc_allow_unverified_email (IdP interne) ;
reverse-proxy passe X-Forwarded-* pas X-Auth-Request-* ; handler nginx en
restart (pas reload) — un changement d'adresse d'écoute n'est pas pris par
un reload gracieux.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 19:05:04 -04:00

29 lines
1,009 B
Django/Jinja

# Géré par Set-OPS (rôle serveur_icingaweb2). Ne pas éditer à la main.
# nginx LOCAL : sert Icinga Web 2 (PHP-FPM). L'edge nginx proxifie par nom vers ce port.
server {
listen {{ serveur_icingaweb2_nginx_bind }}{{ serveur_icingaweb2_http_port }};
{% if not serveur_icingaweb2_nginx_bind %}
listen [::]:{{ serveur_icingaweb2_http_port }};
{% endif %}
server_name {{ serveur_icingaweb2_hostname }};
root {{ serveur_icingaweb2_docroot }};
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ ^/index\.php {
fastcgi_pass unix:{{ serveur_icingaweb2_php_fpm_socket }};
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME {{ serveur_icingaweb2_docroot }}/index.php;
fastcgi_param ICINGAWEB_CONFIGDIR {{ serveur_icingaweb2_config_dir }};
fastcgi_param REMOTE_USER {{ serveur_icingaweb2_remote_user }};
}
location ~ /\.ht {
deny all;
}
}