我無法讓nginx返回我在/var/www/letsencrypt
中輸入的文件。配置Nginx回覆http://my-domain.com/.well-known/acme-challenge/XXXX
的nginx /網站可用/ mydomain.conf
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name my-real-domain.com;
include /etc/nginx/snippets/letsencrypt.conf;
root /var/www/mydomain;
index index.html;
location/{
try_files $uri $uri/ =404;
}
}
的nginx /段/ letsencrypt.conf
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}
我運行此命令: certbot certonly --webroot -w/var/www/letsencrypt/-d my-real-domain.com
但是certbot試圖訪問的頁面始終是一個404
調試
$ echo hi > /var/www/letsencrypt/hi
$ chmod 644 /var/www/letsencrypt/hi
現在我應該能夠curl localhost/.well-known/acme-challenge/hi
,但不起作用。仍然404.任何想法我失蹤?