在 nginx 上收到 403 错误,但不清楚原因

在 nginx 上收到 403 错误,但不清楚原因

我收到 403 错误

2020/06/14 06:37:13 [error] 5033#5033: *44826 directory index of "/var/www/attendanceplus.com/" is forbidden, client: 54.149.161.1, server: carestry.com, request: "GET / HTTP/1.1", host: "carestry.com"

我的/etc/nginx/sites-available/attendanceplus.com样子是这样的:

server {
 listen 80 default_server;
 listen [::]:80 default_server;
 return 301 https://$server_name$request_uri;
 root /var/www/html;
 index.nginx-debian.html;
 server_name carestry.com www.carestry.com;
 location / {
 add_header Cache-Control "private, no-store, no-cache";
 try_files $uri $uri/ /index.html;
 }
}

server {
  listen 443 ssl;
  listen [::]:443 ssl;
  root /var/www/html;
  index.nginx-debian.html;
  server_name carestry.com www.carestry.com;
  location / {
 add_header Cache-Control "private, no-store, no-cache";
 try_files $uri $uri/ /index.html;
  }
ssl_certificate /etc/letsencrypt/live/carestry.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/carestry.com/privkey.pem;
}

有没有什么办法可以解决这个问题?我可能没有提供所有相关信息。我对这类服务器配置不太有经验。

相关内容