I have a server file like this
server {
listen 80;
server_name subdomain.example.com;
return 301 https://$server_name$request_uri;
location /.well-known/acme-challenge {
root /var/www/letsencrypt;
}
}
Now when I try sudo letsencrypt renew
. It throws up and error saying can't find .well-known/acme-challenge
. But as soon as I commented the return 301
line restarted the server and It worked.
Now I want to retest it putting the location first and not commenting the return 301 statement but it says certificate not due for renewal
.So the question is does order in which the file is read, does it matter?
and it won't automatically renew because of this reason for me, those who do renewal how do you handle this situation?