server { listen 80; server_name _; root /var/www/html; index index.php index.html; # Datenordner (SQLite-Datenbank) niemals über den Browser ausliefern. # Ersetzt die .htaccess-Regel, die unter nginx nicht greift. location ^~ /data/ { deny all; return 404; } # Interne PHP-Ordner ebenfalls sperren location ^~ /includes/ { deny all; return 404; } location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass php:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # Versteckte Dateien (z.B. .htaccess, .git) nicht ausliefern location ~ /\. { deny all; } }