Getting a 404 on site.com/cache~

I migrated my server and ditched the control panel, went with https://vpssim.com to install the latest and greatest nginx + php-fpm + mariadb. Everything works except for the javascript part. Also some blog icons aren't working. I'm assuming it's an nginx rewrite issue? Data and root folder are set to nginx:nginx. Data is writable, new system_cache folder is created when I delete it. Added the rules from nginx.dist:

location ~ (^\.|/\.) {
    return 403;
}

location /cache {
    rewrite ^/cache\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$query_string;
}

location /export {
    rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/?$ /engine/handlers/export_handler.php?view=$1&guid=$2;
    rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ /engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4;
}

location = /rewrite.php {
    rewrite ^(.*)$ /install.php;
}

location / {
    try_files $uri $uri/ /index.php?__elgg_uri=$uri&$query_string;
}

Rewrite.php says success but still nothing. Any help would be appreciated, thanks!

  • Sorry bumping this, I still need help. 

  • Ok so got the javascript and cache working but now blog and group icons don't work, this really is some kind of nginx rule issue. I fixed the JS and cache issue by adding ^~ to the cache rule:

    location ^~ /cache {
        rewrite ^/cache\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$query_string;
    }

    How do you fix the rewrite issue?

  • 1.12.1, running on nginx with cloud flare on centos 6.7 with php 5.6. I checked the data folder and it properly uploads the blog and group icons along with the small, medium, large versions but getting a 404. This really is an nginx rewrite issue.

    I'm on maria db but I doubt that's the issue.

  • Back here again, my website works fine with apache so it's definitely an nginx rewrite rule issue. Any help is appreciated, thanks.