feat(ansible/templates): Simplifie et améliore la configuration Caddy.

This commit is contained in:
Serreau Jovann
2026-01-28 13:15:53 +01:00
parent 89ad16c5cb
commit eb66b60c7f

View File

@@ -6,34 +6,35 @@ intranet.ludikevent.fr, signature.ludikevent.fr, reservation.ludikevent.fr {
root * {{ path }}/public
file_server
# --- REWRITE INVISIBLE POUR LE SITE VISITEUR ---
@visitor_home {
host reservation.ludikevent.fr
path /
}
rewrite @visitor_home /reservation
# --- LOGIQUE RÉSERVATION ---
@is_reservation_host host reservation.ludikevent.fr
# --- NO-INDEX ---
@noindex_hosts host intranet.ludikevent.fr signature.ludikevent.fr
header @noindex_hosts X-Robots-Tag "noindex, nofollow"
handle @is_reservation_host {
# Si on arrive sur la racine /
# On réécrit en interne vers /reservation
rewrite / /reservation
@index_host host reservation.ludikevent.fr
header @index_host -X-Robots-Tag
# --- HEADERS & PHP ---
header {
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
Referrer-Policy "strict-origin-when-cross-origin"
CF-Connecting-IP {header.CF-Connecting-IP}
X-Real-IP {remote_host}
# On passe à PHP en s'assurant que le script index.php est utilisé
php_fastcgi unix//run/php/php8.4-fpm.sock {
# On force Symfony à utiliser le nouveau chemin réécrit
env REQUEST_URI {uri}
}
}
handle_path /assets/* {
rewrite * /build{path}
}
# --- LE RESTE DES DOMAINES (Intranet / Signature) ---
handle {
header {
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
Referrer-Policy "strict-origin-when-cross-origin"
CF-Connecting-IP {header.CF-Connecting-IP}
X-Real-IP {remote_host}
}
php_fastcgi unix//run/php/php8.4-fpm.sock {
env REMOTE_ADDR {header.CF-Connecting-IP}
handle_path /assets/* {
rewrite * /build{path}
}
php_fastcgi unix//run/php/php8.4-fpm.sock
}
}