I made this Rewrite URL for Magento.
Could someone using Nginx test and tell me if it is safe, and if it is necessary to add/remove/change something?
index index.php;
charset off;
autoindex off;
location /
{
try_files $uri $uri/ /index.php?$args;
}
location ~ /^(.*)$ { }
location ~ /(media|skin|js)/ {
}
location ~ /(app|backup|includes|lib|shell|var)/ {
deny all;
}
location /api {
rewrite ^/api/rest /api.php?type=rest break;
}
location /RELEASE_NOTES.txt {
deny all;
}
location /cron.(php|sh) {
deny all;
}
location ~ \.(xml|phtml|cfg|ini|sh|json|txt)$ {
deny all;
}
location /media {
if (!-e $request_filename){
rewrite ^(.*)$ /../get.php break;
}
}