Wordpress not showing up, 404 error

So I followed the tutorials step by step for the LEMP stack and then installed wordpress. It does not show up when I access my domain tho, I keep getting the 404 page from the nginx server. I repeated the process from scratch just to make sure I didnt make any mistakes but same thing happened. I literally have no idea where the problem may be. The tutorials are of no help, the wordpress installation tutorial is like 10 steps and then it should be ready for access thru the browser. Any ideas?

2 Replies

When using a LEMP Stack for wordpress or any other php powered site you will need to make some changes to nginx as it does not have native support out of the box. I have posted a sample config file below. replace example.com with your domain and replace root with the location of wordpress. The example was taken from https://www.digitalocean.com/community/ … untu-16-04">https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04 you can also follow the guides at https://www.linode.com/docs/web-servers/lemp/ for configuring a LEMP stack, just select your linux distro or one closeest to your distro and follow. pay attention to the steps for enabling php.

# Example taken from a digital ocean guide and modified to include the domain.
server {
    listen 80 example.com www.example.com;
    listen [::]:80 example.com www.example.com;

    root /var/www/html/example.com/;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name example.com;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

You can use WordPress with Linode on Cloudways platform, I was having same issue and found this blog to fix WordPress 40 error: https://www.cloudways.com/blog/fix-404-error-on-wordpress/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct