答案1
解决了,我的最后两个块是错误的:
server {
listen 80;
server_name www.example.ai example.ai;
return 301 https://example.ai$request_uri;
}
server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/example.ai/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.ai/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
server_name www.example.ai;
return 301 https://example.ai$request_uri;
}