我在nginx中使用certbot作为ssl。当我输入https://www.example.com时,它会重定向到https://example.com。但当我输入https://www.example.com/article时。它显示url没有找到。
server {
root /home/anjaan/dsjwl/backend/public;
gzip on;
gzip_types text/plain application/xml text/css application/javascr>
gzip_min_length 1000;
index index.php index.html index.htm index.nginx-debian.html;
server_name desijewel.in;
// My other configrations
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/desijewel.in/fullchain.pem; # managed>
ssl_certificate_key /etc/letsencrypt/live/desijewel.in/privkey.pem; # manag>
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = desijewel.in) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name desijewel.in;
return 404; # managed by Certbot
}发布于 2021-09-19 16:52:16
使用以下方法从certbot添加另一个证书
sudo certbot certonly --expand -d www.example.com然后将此证书自动添加到nginx conf中-
sudo certbot --nginxhttps://stackoverflow.com/questions/69244652
复制相似问题