I have an Nginx setup that serves a couple of websites for years and I ve never had any problems. Today I finally decided to try to add some certificates, with certbot and it didn’t go as planned - the site, fully static html - became inaccessible. I manually edited the server block file and removed all the lines added by the certbot, but to no luck. All the pages of the site now work EXCEPT for the index page.
server {
listen 80;
listen [::]:80;
root /var/www/freethrow/html;
index index.html index.htm index.nginx-debian.html;
server_name freethrow.rs www.freethrow.rs;
location / {
try_files $uri $uri/ =404;
}
}
Any help is more than welcome.
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!
Yes, I tried but without the index part it doesn’t validate, it seems to be an Nginx directive…
Still no luck.
Hello, @aleksendric
What you can do is to use the following line in the nginx.conf instead of the currently added one:
index.html index.htm index.nginx-debian.html;
You can also check the nginx config for syntax errors:
nginx -t
If the commands returns Syntax OK you’re good to go and you can restart Nginx and then re-test if everything is loading okay.
Let me know how it goes, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.