Being new to nginx and wordpress, I'm trying to install them on an ubuntu 17.10 (on a virtual machine). I've followed this step-by-step guide
Then, if I type localhost I can see nginx working. I then type localhost/wordpress I get a 502 bad gateway, and if I type localhost/wordpress/index.php then it tries to download the php file (instead of executing it).
What's failing here?
UPDATE: I've been able to install wordpress by following this guide https://www.linuxbabe.com/ubuntu/install-lemp-nginx-mariadb-php7-1-ubuntu-17-10