메뉴 닫기

NGINX robot.txt 파일 설정하기

Nginx robot.txt 파일 설정하기

robots.txt 파일은 검색엔진의 봇들이 홈페이지를 크로링 할수 있는지 없는지 설정하는 파일 입니다. 모두 공통적으로 사용 됩니다.

#모든 봇 허용
 location =  /robots.txt{
                add_header Content-Type text/plain;
                return 200 "User-agent: *\nAllow:/\n";
                log_not_found off;
                access_log off;
}

#모든 봇 방지
location = /robots.txt {
                add_header Content-Type text/plain;
                return 200 "User-agent: *\nDisallow:/\n";
                log_not_found off;
                access_log off;
}
Posted in Tech

Related Posts

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다