404 Nginx error

Posted February 7, 2018 15.7k views

I am trying to make a CS:GO site. Well when i try to goto the website i get the dreaded 404 error. I cannot figure this out. I am fairly new to digital ocean. This is a paste of my Nginx errors. please let me know how to fix this.


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.

Submit an Answer
1 answer


The directory index error you’re seeing is most likely the result of a missing index ...; directive in your server block or the nginx.conf file. The index directive needs to match the language that you’re serving.

For example, if I were serving a WordPress site, I’d want to have something such as:

server {
    listen 80;

    root /path/to/public_html;

    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;

    location ~ \.php$ {

While the above is not a complete example, it shows where the index directive may be placed to help prevent that error. You can also modify the index directive in /etc/nginx/nginx.conf under the http block and add it there.

Under http it’s global, thus affects all server blocks and will help redundancies.