I have a question concerning nginx redirects / try_files:
I have a website (vhost managed by ISPConfig3) at www.XXXYYY.com
In the root directory there are folders, index.php and so on.
I want certain files in www.XXXYYY.com/folder21/public/309273.php
to be accessible at www.XXXYYY.com/309273
(to have prettier links).
However, everything I tried yet did either not work at all or the .php-files got downloaded instead of being processed by PHP-FPM…
This is the nginx vhost directive I'm currently trying out in ISPConfig3:
This is being set by ISPConfig3:
location ~ \.php$ {
try_files @php;
}
location @php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9026;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
This is the part that is being added by me at the bottom of the vhost-file:
location / {
try_files $uri $uri/ /folder21/public/$uri.php /index.php =404;
}
location /folder21/ { internal; }
location /folder21/public/ {
try_files $uri $uri/ $uri.php;
}
Any help on this is appreciated!