server { listen 80; server_name _; root /var/www/html; index index.php; charset utf-8; client_max_body_size 64M; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param HTTP_PROXY ""; fastcgi_read_timeout 120s; } # Les classes, modèles et fichiers SQL ne doivent jamais être servis directement. location ^~ /app/ { deny all; return 404; } location ^~ /database/ { deny all; return 404; } location ~* ^/(config\.php|db\.php|page_bootstrap\.php|README[^/]*)$ { deny all; return 404; } location ~ /\. { deny all; return 404; } location ~* \.(?:css|js|png|jpg|jpeg|gif|svg|ico|webp)$ { expires 7d; add_header Cache-Control "public, max-age=604800"; try_files $uri =404; } }