LEMP on CentOS 6 - 404 on first test page

June 20, 2015 1.3k views
LEMP Nginx PHP Getting Started DigitalOcean

I followed multiple tutorials to set up my LEMP stack on CentOS 6.X (mostly this: http://xmodulo.com/install-lemp-stack-centos.html and https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-6). When I first installed NGINX and viewed test page - worked. When i installed PHP and tested - worked. Have since set up SSH, edited iptables to allow specific SSH port, and added a 2nd user and disallowed login by root. Now when i test my indx.php page,i get 404'd. I MUST'VE made a mistake somewhere in my config or conf.d files but i can not find it. I have been over both tutorials (above) several times and no edits can bring back my test page - can't view a test page with text content, nor a simple phpinfo() page/file. Very frustrating and i dont want to respin the droplet only to get to the same point and not know how to fix. Can anyone help?

At the moment, this is my default.conf file:

server {
listen 80;
servername IPADDRESS;

location / {
    root   /var/www/html;
    index index.php  index.html index.htm;

error_page  404              /404.html;
location = /404.html {
    root   /var/www/html;

error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /var/www/html;

# pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
    root   /var/www/html;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    include        fastcgi_params;


Be the first one to answer this question.