'What is the reason that nginx throws a 403 error, with all permissions allowed?
OS: macOS Monterey
Chip: Apple M1
When starting a project in docker, nginx gives a 403 error when accessed in a browser, but at the same time, a colleague's project starts without any problems
Nginx configuration
Logs when opening a project in a browser
Permissions for _default
Rights for www and others
resolver 127.0.0.11;
server
{
listen 80 default_server;
server_name _;
root /var/www/_default/www/;
pagespeed off;
set $php_sock php:9000;
# раскомментируйте одну из строчек ниже в зависимости от используемой cms
# include common_fpm_ceteracms.conf;
# include common_fpm_bitrix.conf;
include common_fpm_<% PROJECT_CMS_TYPE %>.conf;
error_log /var/log/nginx/error.log;
location /nginx_status
{
stub_status on;
allow ::;
deny all;
}
# заментие off на on если надо включить pagespeed
}
root@c312a39869da:/var/www/_default# ls -l
total 16
-rw-r--r-- 1 root root 67 Mar 15 08:12 Makefile
-rw-r--r-- 1 root root 410 Mar 15 08:12 README.md
drwxr-xr-x 2 root root 4096 Mar 15 14:52 boilerplate
drwxr-xr-x 4 root root 128 Mar 15 08:12 tmp
drwxr-xr-x 2 root root 4096 Mar 15 14:52 working
drwxrwxrwx 4 root root 128 Mar 15 08:12 www
root@c312a39869da:/var/www# ls -lna
total 16
drwxr-xr-x 1 0 0 4096 Mar 15 14:52 .
drwxr-xr-x 1 0 0 4096 Nov 22 2019 ..
drwxr-xr-x 15 0 0 480 Mar 15 08:12 _default
drwxrwxrwx 1 33 33 4096 Dec 15 2019 html
grd_nginx | 2022/03/15 11:59:16 [error] 32#32: *2 directory index of "/var/www/_default/www/" is forbidden, client: 172.19.0.1, server: _, request: "GET / HTTP/1.1", host: "127.0.0.1:8080"
grd_nginx | 172.19.0.1 - - [15/Mar/2022:11:59:16 +0000] "GET / HTTP/1.1" 403 117 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0" "-"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
