LEMP, NGINX stack - Only home page works fine, all others give 404 error

If you have a problem where you have LEMP Stack (Nginx instead of apache) and you get 404 on all pages but front you probably need to change one line in your "/sites-enabled/your-iste" file. So lets open this nginx file that defines virtual block and change the part under "location" directive from
 

try_files $uri $uri/ /index.html;

to this line

try_files $uri $uri/ /index.php?q=$uri&$args;

This should help and all of your alised urls should now work.