Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Accepted Answer
Make sure you have your WordPress site stored in /var/www/html and set correct permissions on /var/www/html and it’s content. To check, the following simple ls command will do the job:
- ls -ld /var/www/html
Also, for content:
- ls -l /var/www/html
Recommended permissions are sammy:www-data, where sammy is your non-root user. If it’s not like that, you can set them by running:
- sudo chown -R sammy:www-data /var/www/html
Also, make sure you have WordPress unpacked in /var/www/html and not in /var/www/html/wordpress or anything similar.
You can also post result of ls -l /var/www/html, so we’re sure you did it right.
If nothing helps, best bet are to check logs. Check for latest entries in /var/log/nginx/error.log and /var/log/nginx/access.log. The first one is the most relevant and will probably tell you the reason of error. If you’re not sure how to debug it, you can post it here (make sure to redact any sensible information).
As of forum and another WP site. You can’t do it like you explained.
First, you can’t have two WP sites in one directory. The best way would be to create appropriate directories in /var/www for each site. For example in /var/www/example.com store WordPress site running on main domain - example.com, and in /var/www/subdomain.example.com store site running on the subdomain.
As for forum, I wouldn’t recommend using example.com/forum as it can break WordPress permalinks. Do it with subdomains, on the same way I explained above - create directory for it, e.g. /var/www/forum.example.com and store it there.
All this would require you to create appropriate Nginx server blocks and the How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04 will show you how to do it.
Greetings!
Sounds like the redirects needed for WordPress are not present in the Nginx configuration. This would explain why changing the permalinks resulted in those nasty 404s. Generally you can find the exact coding needed at this WordPress codex page.
I had the same issue after I installed the nginx on my server. The error was caused by some bad statements in my conf file. I just had to add this to the conf file:
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_index index.php;
I used this tutorial, check maybe it will help.