我真的以我的智慧结束了这个! 首先,似乎没有办法做LetsEncryptvalidation过程,没有使域名生活! (当你试图从一台服务器移动到另一台服务器时,这会很糟糕)
然后,我似乎无法得到极致挑战的东西工作。 这里是我的configurationnginx域主机:
server { listen xxx.xxx.xxx.xxx:80; server_name test.co.uk www.test.co.uk; root /home/rachel/web/test.co.uk/public_html; # Necessary for Let's Encrypt Domain Name ownership validation location /.well-known/acme-challenge/ { try_files $uri /dev/null =404; } location / { return 301 https://$host$request_uri; } } server { listen xxx.xxx.xxx.xxx; server_name cdn.test.co.uk ; root /home/rachel/web/cdn.test.co.uk/public_html; index index.php index.html index.htm; access_log /var/log/nginx/domains/cdn.test.co.uk.log combined; access_log /var/log/nginx/domains/cdn.test.co.uk.bytes bytes; error_log /var/log/nginx/domains/cdn.test.co.uk.error.log error; # Necessary for Let's Encrypt Domain Name ownership validation location /.well-known/acme-challenge/ { try_files $uri /dev/null =404; } location / { return 301 https://$host$request_uri; } }
我做了一个testingfoo.html文件,并把它放在/.well-known/foo.html文件夹中。 然后去浏览器:
http://test.co.uk/.well-known/foo.html
我得到一个403错误。 我究竟做错了什么? 我看不出为什么它这么复杂呢!
谢谢(希望你能保存我留下的一点点头发)
Eugh,我真的应该刚刚开始在这里张贴我的问题! 几乎每一次,我发现后发现正确的解决scheme!
Necessary for Let's Encrypt Domain Name ownership validation location '/.well-known/acme-challenge' { root /home/rachel/web/cdn.test.co.uk/public_html; } location / { if ($scheme = http) { return 301 https://cdn.test.co.uk$request_uri; } }
希望这可以帮助别人!