Running on nginx
On Apache and LiteSpeed, the supplied .htaccess files take care of protecting sensitive folders, clean URLs and caching of static files. Nginx does not read them. Without rules of your own, files that must not be public could be downloaded from the site – config.php with the database password, the storage/ folder with backups.
What the configuration must ensure
- Deny access to
config.php, the folderssystem/,storage/,tools/,docs/, hidden files (.git,.htaccess) and.phpfiles insidelayout/. - Nothing is executed in the
media/folder. The files.php,.html,.svgand.jsare not served from there at all; documents are offered for download. - Clean URLs: whatever is not a file is handled by
index.php(try_files $uri $uri/ /index.php?$query_string;). - PHP runs from three files only:
index.php,admin.php,install.php. Other.phpfiles return 404. - The
Authorizationheader is passed to PHP – the Claude connection (MCP) and the API need it. - WebP: a browser that supports it is served
foto.jpg.webpinstead offoto.jpg, if it exists. This requires the$webp_priponamap in thehttpblock. - The upload limit
client_max_body_sizealigned withupload_max_filesizein PHP.
Check after deployment
These addresses must return 403 or 404, never the contents of the file:
https://www.example.com/config.php
https://www.example.com/system/sql/schema.sql
https://www.example.com/storage/log/chyby.log
https://www.example.com/.htaccess
Then go through Settings → System status and try uploading an image, opening an article with a clean URL and signing in to the administration.