我在使用ssl证书设置我的nginx服务器时遇到了一些问题,而且我有点搞砸了。当我访问我的网站时,它会重定向到/ var / wwww的无限循环。它看起来像这样:
这是我的cd / etc / nginx / sites-available / default文件
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name molle.ws www.molle.ws;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/molle.ws/fullchain.pem; # managed by Cert$
ssl_certificate_key /etc/letsencrypt/live/molle.ws/privkey.pem; # managed by Ce$
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot

请帮忙:/