I’ve done this before. I have serveral sites set up with Let’s Encrypt and nginx. But for some reason Let’s Encrypt cannot get to my .well-known/acme-challenge. I think it’s because this time there is no front end, it’s a web api only (server side only).
I have the following in my nginx file (my server is running on port 8080):
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream app_admin {
server 127.0.0.1:8080;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name test.com;
# for Let's Encrypt to work properly
location ^~ /.well-knownn {
allow all;
root /var/www/;
default_type "text/plain";
}
Do you have an understanding of why your nginx configuration file doesn’t cause nginx to accept incoming connections on port 80? I’m not sure I know nginx well enough to understand this.
Thank you @sahsanu, I acually just updated the config with that change and restarted nginx. Reran let’s encrypt:
/opt/letsencrypt# ./letsencrypt-auto certonly -a webroot --webroot-path=/var/www -d test.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for test.com
Using the webroot path /var/www for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. test.com (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://test.com/.well-known/acme-challenge/qyIolngTdgUfHP5F7AcvMUbTTt4v345345tdSZdIlA: Timeout
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: test.com
Type: connection
Detail: Fetching
http://test.com/.well-known/acme-challenge/qyIolngTdgUfHP5F7AcvMU5345341-IlWutdSZdIlA:
Timeout
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.