.png)
지금까지 확인한 내용은 다음과 같습니다.
로그 - 비어 있으며 새 VM을 부팅했습니다.
권한:
$ namei -l /var/www/awesome/
f: /var/www/awesome/
dr-xr-xr-x root root /
drwxr-xr-x root root var
drwxrwxr-x www-data www-data www
drwxrwxr-x www-data www-data awesome
vagrant 파일이 있는 호스트 OS 폴더에 777이 지정됩니다.
SELinux를 활성화했습니다.
그래도 컬 로컬호스트가 있는 VM 내부에서도 403이 발생합니다.
awesome.dev의 nginx 구성은 다음과 같습니다.
server {
listen *:80;
server_name awesome.dev www.awesome.dev;
index index.html index.htm index.php;
access_log /var/log/nginx/awesome.dev.access.log;
error_log /var/log/nginx/awesome.dev.error.log;
location / {
root /var/www/awesome;
try_files $uri $uri/ index.php /index.php$is_args$args;
}
location ~ \.php$ {
root /var/www/awesome;
index index.html index.htm index.php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param APP_ENV dev;
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
}
sendfile off;
}
이 문제를 해결하는 방법은 무엇입니까?
답변1
CentOS 7에서도 동일한 문제가 발생했습니다. 해결 방법:
Check getenforce
여기에는 '시행 중'이 표시되어야 합니다.
chcon
그런 다음 액세스를 허용하도록 httpd 보안 컨텍스트를 변경 했습니다 .
chcon -Rt httpd_sys_content_t /path/to/web/content
Nginx 다시 로드
systemctl restart nginx
이제 내 페이지가 로드됩니다.
답변2
의 내용 /var/www/awesome/
과 권한은 무엇입니까?
index.html
, index.htm
또는 파일이 없으면 index.php
nginx는 기본적으로 금지된 디렉터리 내용을 나열하려고 시도합니다(cf.autoindex
선적 서류 비치).