Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx permission denied #2464

Closed
0xuhe opened this issue Jan 9, 2020 · 8 comments
Closed

nginx permission denied #2464

0xuhe opened this issue Jan 9, 2020 · 8 comments

Comments

@0xuhe
Copy link
Contributor

0xuhe commented Jan 9, 2020

Info:

  • Docker version ($ docker --version): 19.03.5
  • Laradock commit ($ git rev-parse HEAD): 0d08602
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Ubuntu

Issue:


Nginx has no permission for public/index.php,
I have tried change owner or permission in nginx container and workspace container

chmod -R 777 /var/www/app/public
# or
chmod -R 777 /var/www/app/
# or
chown -R root:root /var/www/app/
chown -R www-data:www-data /var/www/app

But still failed, and get logs in nginx error log as below

[crit] 11#11: *7 stat() "/var/www/app/public/index.php" failed (13: Permission denied)

Expected behavior:


Reproduce:


Relevant Code:

// place a code sample here
@LexSombra
Copy link

I've got the same problem!

@0xuhe
Copy link
Contributor Author

0xuhe commented Jan 28, 2020

@LexSombra I've found the solution that change user from root to normal user will fix this issue.

@0xuhe 0xuhe closed this as completed Jan 28, 2020
@praguevara
Copy link

Can you be a little more specific please? I'm having the same problem.

@0xuhe
Copy link
Contributor Author

0xuhe commented Mar 3, 2020

@praguevara Run docker-compose command in normal user account, Maybe user docker have no permission in root directory

@praguevara
Copy link

I'm already running docker-compose from a normal user account.

@0xuhe
Copy link
Contributor Author

0xuhe commented Mar 3, 2020

That's weird. It helps me that run docker-compose from a normal user account

@0xuhe
Copy link
Contributor Author

0xuhe commented Sep 18, 2020

@praguevara @LexSombra I found that user www-data has no permission on /var/www, so you should chmod to 755 in nginx container

@praguevara
Copy link

@praguevara @LexSombra I found that user www-data has no permission on /var/www, so you should chmod to 755 in nginx container

This was some time ago, but I believe my problem was I had the folder on an NTFS drive, and that was messing with the permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants