我在sites-available中有以下配置(并有一个符号链接进行启用):
#subdomain site
server {
listen 443 ssl http2;
server_name dokuwiki.[censored].org;
root /var/www/html/dokuwiki;
index index.php index.html;
include /etc/nginx/templates/ssl.tmpl;
location / {
try_files $uri $uri/ @dokuwiki;
}
location @dokuwiki {
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;
}
location ~ \.php$ {
# Caution: be sure the php7.2-fpm.sock matches your version
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /(data|conf|bin|inc|vendor)/ {
deny all;
}
}
我希望将不同的站点放置在网站根目录下:
#root site
server {
listen 80;
server_name [censored].org;
root /var/www/html/site;
index index.html;
}
当前根站点只是一个虚拟的站点。当我尝试加载它时,浏览器会尝试加载子域站点,但会发出警告,因为SSL证书(已设置为子域)不匹配。
显然我做错了什么,但是是什么呢?