Nginx는 오류 403으로 인해 금지된 경우에도 파일 다운로드를 허용합니다.

Nginx는 오류 403으로 인해 금지된 경우에도 파일 다운로드를 허용합니다.

새로운 Centos 7을 설정했습니다. 나는 그것을 설치했습니다 yum install php72u-fpm yum install nginx -y

다음으로 한 일은 /etc/nginx/nginx.conf에서 구성 파일의 루트 폴더를 변경하는 것이었습니다. /var/www/html로.

server_name  _;
        root         /var/www/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

다음으로 새 폴더 /var/www/html/test를 만들고 nginx에 권한을 부여했습니다 chown -R nginx.nginx /var/www/html/test/ 그런 다음 내 http://에 도달했습니다..../test/ 403 Forbidden이 표시됩니다. 오류 로그를 확인한 결과 이것이 나왔습니다.

2018/04/11 14:43:47 [error] 24229#0: *10 directory index of "/var/www/html/test/" is forbidden, client: *.*.*.*, server: _, request: "GET /test/ HTTP/1.1", host: "*.*.*.*"

하지만 놀랍게도 http://와 같이 이 명령을 실행하면.../test/page1.php 내 로컬 컴퓨터에 다운로드되는데, 이는 확실히 보안 문제입니다. 그렇죠? 이런 일이 발생하지 않도록 하는 방법은 무엇입니까?

관련 정보