If you have a vanilla NGINX setup, and all pages except the home page of your website is returning a 404, it might be that you don’t have the proper redirect in your NGINX configuration file.
Check the NGINX configuration file for the existence of the following clause:
location / { try_files $uri $uri/ /index.php?$args; }