ingress #1

Merged
TheThomaas merged 157 commits from ingress into main 2026-09-08 13:20:49 +00:00
Showing only changes of commit 8f68c25177 - Show all commits

View file

@ -24,49 +24,15 @@ http {
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-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Désactiver le buffering
proxy_buffering off;
# Proxy vers CookCLI
# Proxy simple vers CookCLI
location / {
proxy_pass http://127.0.0.1:9081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# --- RÉÉCRITURE DES URLs POUR L'INGRESS ---
# Capture le chemin Ingress depuis les headers
set $ingress_path $http_x_forwarded_prefix;
if ($ingress_path = "") {
set $ingress_path "";
}
# Sub_filter pour réécrire les URLs absolues
sub_filter_once off;
sub_filter_types text/html text/css application/javascript;
# Réécriture des URLs de base
sub_filter 'href="/' 'href="$ingress_path/';
sub_filter 'src="/' 'src="$ingress_path/';
sub_filter 'action="/' 'action="$ingress_path/';
# Réécriture spécifique pour les chemins courants
sub_filter '"/static/' '"$ingress_path/static/';
sub_filter '"/assets/' '"$ingress_path/assets/';
sub_filter '"/css/' '"$ingress_path/css/';
sub_filter '"/js/' '"$ingress_path/js/';
# Si l'application utilise des chemins relatifs, les forcer
sub_filter '<base href="/"' '<base href="$ingress_path/"';
# Gérer les redirections
proxy_redirect http://127.0.0.1:9081/ $scheme://$host$ingress_path/;
proxy_redirect http://127.0.0.1:9081 $scheme://$host$ingress_path;
proxy_buffering off;
}
}
}