0

I don't understand why nginx cannot find files when the root is under home directory, e.g. /home/ubuntu/tabs. It will give 404 error.

It works fine when the root is /var/www/tabs.


server{
        listen 80;
#root /var/www/tabs;
root /home/ubuntu/tabs;
        server_name 18.191.229.199;

index main.html ;

        location / {
               try_files $uri $uri/ =404;

        }


        location /folder {
               try_files /folder/main1.html /folder/main2.html =404;

        }
}


Rich Liu
  • 23
  • 3
  • Nginx need to have +x access on all directories leading to the site's root directory. Please check this [thread](https://stackoverflow.com/questions/25774999/nginx-stat-failed-13-permission-denied#answer-43686446). – miBra Aug 07 '22 at 08:30
  • I don't understand because all the folders have +x for everyone – Rich Liu Aug 07 '22 at 23:33

0 Answers0