Hi, beginer here. Im currently trying to make a static website using Nginx and Hugo https://mydomain.com works but when I open https://mydomain.com/posts/ or https://zesfca.com/about/ Nginx gives me a 404 not found. Thank you very much! Mydomain.com is not my real domain, I replaced it for privacy reasons
Nginx.conf is default
Config in /etc/nginx/sites-available here.
You missed replacing your domain in this post, so I could try your site. It looks like your rewrite works fine, but getting the 404 here as well.
What happens when you run it locally? (
hugo serve
) Does it work?Also, run:
ls /var/www/mydomain.com/public/
if possible and share the results here. It should contain folders matching your site setup.I put my actual domain on my server but canged it to myromain on this post for privacy reasons
Post your nginx config
Mydomain.com is not my real domain, I replaced it for privacy reasons
Nginx.conf is default
Config in /etc/nginx/sites-available here.
Have you already created any posts or an about page?
yeah, without the config, it’ll be hard to say anything meaningful. if you are open to alternatives, caddy does this well and is super easy to configure.
Mydomain.com is not my real domain, I replaced it for privacy reasons
Nginx.conf is default
Config in /etc/nginx/sites-available here.
I think it’s the try file. It might be trying to find those subfolders as files and since they are directories and not files it’s failing. Or permissions. Could always be permissions.
You can look at access logs and error logs. Those might provide more clues.