Question

404 Nginx error

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. https://pastebin.com/9ftgR002 please let me know how to fix this.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@kobefrench03

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;
    server_name domain.com www.domain.com;

    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.