I'm using nginx docker image to serve a simple index.html file.
As mentioned in the quick guid, I have a Dockerfile containing:
FROM nginx
COPY www-root-dir /usr/share/nginx/html
(www-root-dir
just contains an index.html
file)
But when I run this image, it returns 403 Forbidden. And in logs it says:
[error] 7#7: *2 "/usr/share/nginx/html/index.html" is forbidden (13: Permission denied),
I've searched about this and know it's about file permissions.
But what permission/owner should I set for that? I've tried chown
ing to www-data
and nginx
. Also chmod
ing +rwx
didn't help.
My question is: What exactly should I do? And whatever the solution is, why it's not mentioned in the official docs?
Edit:
I also tried without the custom html file.
This simple Dockerfile yet responds the same:
FROM nginx
# Just it!
所有评论(0)