我有一台运行 ubuntu 的 Raspberry,上面有 Nginx 运行两个网站。我使用 certbot 在其中一个网站上配置了 TLS。(wordpress 和 dokuwiki)
这两个站点均运行正常,没有任何问题。
我想托管第三个网站,即 Mantis 网站,用于错误跟踪。我为网站安装了 nginx 基本配置……网站已启动并运行,一切正常。但是,当我尝试使用 certbot 配置 TLS 时,它破坏了整个系统;所有元素和 gui 都崩溃了。
以前有人遇到过这样的问题吗?如果我恢复 certbot 所做的 .conf 更改,它会恢复正常,但没有 ssl。
这是 certbot 触碰之前的原始内容:
server {
listen 80;
server_name example.eu www.example.eu;
access_log /var/log/nginx/mantis-access.log;
error_log /var/log/nginx/mantis-error.log;
error_page 404 =200 /error.html;
root /var/www/example/mantis;
index index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
include fastcgi_params;
}
}
以下是 certbot 执行完脚本后的结果:
server {
server_name example.eu www.example.eu;
access_log /var/log/nginx/mantis-access.log;
error_log /var/log/nginx/mantis-error.log;
error_page 404 =200 /error.html;
root /var/www/example.eu/mantis;
index index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
include fastcgi_params;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.eu/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = example.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name example.eu www.example.eu;
return 404; # managed by Certbot
}
如有任何想法或指点我将不胜感激。