Setting up nginx.conf - getting 404s

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:biosene.us

I ran this command:sudo nano nginx.conf

It produced this output:

My web server is (include version):nginx 1.30.4

The operating system my web server runs on is (include version): Ubuntu 20.04.5 LTS

My hosting provider, if applicable, is: EasyDNS/EasyVPS

I can login to a root shell on my machine (yes or no, or I don't know):Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):SSH

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):5.8.0

Hi all, thanks for helping maintain such an awesome project!

I'm attempting to self host a server using a static site generator called quartz (https://quartz.jzhao.xyz) (Hosting)
However, I'm getting 404s and I realized the nginx.conf changed when I installed certbot. I tried my best to merge the before into the after but I'm defininitely doing something wrong. Please help me correct this?!

Thanks,

atm84


The first pictures shows listen statements outside a server block.
The second picture shows a server block that is listening on port 80 AND 443.

This is probably not the best place to look for basic nginx configuration instruction.

Thanks for the advice, I removed the listening on port 80 line and moved listen 443 up. Still not working, so I'll go check the nginx forum as well.

The first picture looks okay to me. The indentation for the closing brackets makes it hard to read. But, the closing bracket under the ssl_dhparam closed the server block for port 443 and the next server block was just for port 80. At least how I see it.

That is, the first picture looked fine. If it didn't work right that may have just been application config. Maybe the root didn't point to the right place or the app in that location was not configured right.

The second pic is what looks active currently. And, while it is using the correct cert the mix of listen for port 80 and 443 is causing problems. Specifically HTTPS requests are stuck in a redirect loop.

I think reverting to the first pic is a good first step. And, then work on getting the app configured properly.

yeah; I do see that now. :eyes:
[the four left brackets and five right brackets threw me off]