Why does Nginx return a 403 even though all permissions are set properly?

前端 未结 15 2416
逝去的感伤
逝去的感伤 2020-12-12 09:54

I have Nginx setup and displaying the test page properly. If I try to change the root path, I get a 403 Forbidden error, even though all permissions are identical. Additiona

相关标签:
15条回答
  • 2020-12-12 10:26

    I ran into the same problem:

    • Checked nginx.conf to verify the user
    • Permissions were set properly
    • Made sure "x" right was set for the entire path

    Did a restart from the command line (I'd been using Webmin all this time) and noticed this error:

     aed@aed:/var/www/test.local$ sudo service nginx restart
     * Restarting nginx nginx 
    nginx: [warn] conflicting server name "test.local" on 0.0.0.0:80, ignored
    nginx: [warn] conflicting server name "test.local" on 0.0.0.0:80, ignored
    

    Apparently there was a duplicate definition and thus my attempt to access "test.local" failed.

    0 讨论(0)
  • 2020-12-12 10:30

    Remember you need to allow other users to read the entire path. Also remember Dropbox will set 700 to its root directory. So chmod 755 ~/Dropbox solved my problem.

    0 讨论(0)
  • 2020-12-12 10:33

    this solved the same problem:

    restart Nginx and try again. If it fails, check again the logs. This worked for me

    0 讨论(0)
提交回复
热议问题