This is what I ended up with for pydio:
location /conf/ { deny all; }
location /data/ { internal; }
location /data/public/ {
try_files $uri $uri/ $uri.php?$args;
rewrite ^/data/public/([a-z0-9]+)-([a-z]+)$ /data/public/$1.php?lang=$2 last;
}
location ^~ /share/ {
rewrite ^/share/(.*)$ /data/public/$1 last;
}
PHP-files in /data/public
are now served through /share
without the need of the .php-ending.
Files in the format of e.g. /data/share/XYZ123-en
are being rewritten to/data/share/XYZ-123.php?lang=en
.