1

Ubuntu 18.04, PHP 7.1, Nginx 1.16.1, Magento 2.2.6

I have some errors in log-file:

2019/12/05 16:58:45 [error] 865#865: *14 directory index of "/var/www/www-root/data/www/mysite.com/" is forbidden, client: ***.**.26.41, server: mysite.com, request: "GET / HTTP/1.1", host: "mysite.com"    
2019/12/05 16:58:48 [error] 865#865: *14 directory index of "/var/www/www-root/data/www/mysite.com/" is forbidden, client: ***.**.26.41, server: mysite.com, request: "GET / HTTP/1.1", host: "mysite.com"

How can I fix it? Thx.

1

In your nginx configuration file (nginx.conf) check who is the user. In your nginx.conf the user directive should at the top. Then check if the directory /var/www/www-root/data/www/mysite.com/ belong to that user.

Now lets say your user in nginx is www-data and the files in /var/www/www-root/data/www/mysite.com/ belongs to root. You should run a command to change the files ownership of your project to www-data instead of root to make sure nginx can access them.

You can do it using chown like this at the root of /var/www/www-root/data/www/mysite.com/ :

sudo chown -R www-data:www-data . 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.