Nginx 服务器阻止 PDF 索引

Nginx 服务器阻止 PDF 索引

我已经设置了以下服务器块

server
 {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name  rm.madsfi.pw;
    root           /var/www/rm.madsfi.pw;
    index          port.pdf;

    ssl_certificate /etc/letsencrypt/live/rm.madsfi.pw/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/rm.madsfi.pw/privkey.pem; # managed by Certbot
}

server {
    if ($host = rm.madsfi.pw) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    listen [::]:80;
    server_name  rm.madsfi.pw;
    return 404; # managed by Certbot
}

为什么我会收到禁止错误?

文件夹权限:

drwxr-sr-x nginx nginx rm.madsfi.pw

相关内容