Requesting a certificate for mjr-stock.xyz
Performing the following challenges:
http-01 challenge for mjr-stock.xyz
Waiting for verification...
Challenge failed for domain mjr-stock.xyz
http-01 challenge for mjr-stock.xyz
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.
Cleaning up challenges
Some challenges have failed.
My web server is (include version):
nginx/1.14.2
The operating system my web server runs on is (include version):
Debian 10
My hosting provider, if applicable, is:
Linode
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):
no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot 1.22.0
Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: mjr-stock.xyz
Type: connection
Detail: Fetching http://mjr-stock.xyz/.well-known/acme-challenge/Z_x2hpRYjyDQaxVwdom8UD63-IMwyXlOMkAksS6RQpI: Timeout during connect (likely firewall problem)
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.
Cleaning up challenges
Some challenges have failed.
after troubleshooting and allowing http via UFW and creating a service file for my application I got the error described in the Main post.
I think im either missing a step - Should my app be running and working on http before doing this step?
else i think the issue might be the proxy_pass value in /etc/nginx/nginx.conf
I wasnt 100% sure what to put here, i tried just my domain at first and got an error, then changed it to the server name i set for the server using hostnamectl set-hostname example-hostname
It doesn't need to be up, but nginx needs to be running and listening on port 80 if you want to use --nginx -- also, don't use certonly if you want certbot to also install the certificate as opposed to just obtaining it.
Your Namecheap DNS records look to be pointing at the Namecheap landing page and using their URL redirect. You need to have an A record pointing to your server for each of the names you use (mjr-stock.xyz, www.mjr-stock.xyz, for example).
The guide you reference looks wrong. It does not show any server for port 80 which is required for Let's Encrypt. And, it shows a port 443 server setup without any SSL certs which cannot work.
It looks like nginx is only running on port 443, i think this is because i replaced the /etc/nginx/nginx.conf file as per the instructions on An ASP.NET Core on Linux Tutorial | Linode
so it now contains:
yes i backed it up sounds like the guide I am following is not very good.
I also haven't pointed my A records to my server as @MikeMcQ pointed out so I will replace the conf file and update the A records and see where I'm at then
Amazing ran without error now and looks like the https url is working When you said before after i can add the proxy stuff to the https block what would this be required for now https is working?
If what you have is enough, you don't have to do anything else.
If you need to use nginx as a reverse proxy, there is a lot of documentation, depending on what you are
proxying.
Also, I assumed you'd redirect http to https (you should, certbot enhance --redirect), if you don't want to do that then you should add that stuff to both blocks.
Thanks, redirect is now working for www.mjr-stock.xyz, doesnt redirect from just mjr-stock.xyz though, to fix this should I edit /etc/nginx/sites-available/mjr-stock.conf again to add mjr-stock.xyz to server_name field then run certbot enhance --redirect again? I see its added a section to that file from the first run:
if ($host = www.mjr-stock.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
would manually adding another block like this with mjr-stock.xyz work?