0

I am getting a 403 error in

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"

My /etc/nginx/sites-available/attendanceplus.com looks like this:

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;
}

Any idea how I could fix this? I might not be giving all the relevant information. I'm not too experienced in server configs like this.

FabricioG
  • 167
  • 1
  • 7
  • 1. The configuration doesn't seem to match what you say it's for. 2. What user does nginx run as, and what are the `root` directory (from the configuration) permissions. 3. Do you have an `index.html` or `index.nginx-debian.html` in the `root` folder? – Ginnungagap Jun 14 '20 at 21:11
  • This configuration has an obvious syntax error, repeated in two places: `index.nginx-debian.html;` Fix this first, and then reload your configuration. You should use `nginx -t` to test your configuration and find any errors. – Michael Hampton Jun 14 '20 at 21:19

0 Answers0