I'm trying to stage a certificate for a nginx server. in the nginx file I am redirecting port 80 traffic to a node app running in pm2 on port 3000. You can hit the website with an insecure connection just fine.
Letsdebug.net said no issues where found. I have used [ nc -zv IPADDRESS PORT ] to verify that ports 80, 8080, 443, and 3000 are open.
Feel like i'm going crazy.
My domain is:
brdgdev.com
I ran this command:
sudo certbot --nginx --staging -d brdgdev.com
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for brdgdev.com
Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: brdgdev.com
Type: unauthorized
Detail: 35.234.250.45: Invalid response from http://brdgdev.com/.well-known/acme-challenge/97rzjZ7470MI_GPTaP0YToQ6ErrUbky8VtyxtMhhAlM: 404
Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.
My web server is (include version):
nginx 1.22.1
The operating system my web server runs on is (include version):
Debian 12
My hosting provider, if applicable, is: google cloud platform is running the server as a vm instance, hostinger is hosting the domain name
I can login to a root shell on my machine (yes or no, or I don't know):
yes
The version of my client is 2.1.0
And here is my /etc/nginx/sites-available/default file:
server {
server_name brdgdev.com;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
}
}