I've successfully installed wordpress on an Amazon EC2 instance. It was working, however the apache service kept slowing down my machine and causing excess instances. Because of this, I have decided to switch to NGINX. It is already installed on my server. It is partially configured but I cannot get it fully working.
I am receiving 403 forbidden when accessing any folder directly and 502 bad gateway error when accessing and files directly.. Just so you know, I have 1 elastic IP and multiple domains that all point to that IP.
What I need is each domain to point to a different subdirectory or "root", with the first domain pointing to the highest level directory I.e:
domain1 > /var/www domain2 > /var/www/domain2.com domain3 > /var/www/domain3.com
Here is my nginx.conf file: