From 33c6219cf3674f1fa541a45daedc6bdd68ba80ab Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Sat, 5 Sep 2026 19:32:37 +0000 Subject: [PATCH] Ajouter cookcli/rootfs/etc/nginx/nginx.conf --- cookcli/rootfs/etc/nginx/nginx.conf | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 cookcli/rootfs/etc/nginx/nginx.conf diff --git a/cookcli/rootfs/etc/nginx/nginx.conf b/cookcli/rootfs/etc/nginx/nginx.conf new file mode 100644 index 0000000..b56492e --- /dev/null +++ b/cookcli/rootfs/etc/nginx/nginx.conf @@ -0,0 +1,62 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + sendfile on; + keepalive_timeout 65; + + # Logs pour debugging + access_log /proc/1/fd/1; + error_log /proc/1/fd/2; + + # Gzip compression + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss application/rss+xml; + + # Configuration du serveur + server { + listen 9080; + server_name localhost; + + # Taille maximale des fichiers + client_max_body_size 10M; + + # Headers pour l'Ingress + 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; + + # Headers spécifiques à Home Assistant Ingress + proxy_set_header X-Ingress-Path $request_uri; + proxy_set_header X-Forwarded-Prefix "/api/hassio_ingress/$(HASSIO_TOKEN)"; + + # Désactiver le buffering pour les logs en temps réel + proxy_buffering off; + + # Proxy 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 + sub_filter_once off; + sub_filter_types text/html text/css application/javascript; + sub_filter 'href="/' 'href="$scheme://$host/'; + sub_filter 'src="/' 'src="$scheme://$host/'; + sub_filter 'action="/' 'action="$scheme://$host/'; + } + } +} \ No newline at end of file