nginx redirect 썸네일형 리스트형 [draft] NGINX 특정 파일이나 디렉터리만 허용하고 나머지 요청 제한하기 NGINX 특정 파일이나 디렉터리만 허용하고 나머지 요청 제한하기NGINX에서는 location 블록과 접근 제어 지시어(allow, deny, return)를 활용해 특정 파일 또는 디렉터리만 허용하고 나머지 모든 요청을 제한할 수 있다.기본 개념 정리location 매칭 우선순위location = /exact (정확 매칭)location ^~ /prefixlocation ~ regexlocation / (기본)허용할 경로를 먼저 정의하고, 차단 규칙은 가장 마지막에 둔다가 핵심 원칙특정 파일만 허용하고 나머지는 리다이렉트health_check.html만 허용, 나머지는 301 리다이렉트server { listen 80; server_name _; root /usr/share/nginx.. 더보기 [draft] 웹 서버에서 리다이렉션 설정하는 방법 Apache와 Nginx 웹 서버에서 리다이렉션(redirect) 설정하는 방법Apache 웹 서버에서 리다이렉션 설정rewrite 모듈 활성화 httpd.conf 편집vim httpd.confLoadModule rewrite_module modules/mod_rewrite.somod_rewrite.so 모듈 확인httpd -M | egrep -i rewrite$ httpd -M | egrep -i rewrite rewrite_module (shared)http에서 https로 리다이렉트 설정...RewriteEngine OnRewriteCond %{HTTPS} offRewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]#RewriteRule (.*) https://.. 더보기 이전 1 다음