← 문제 목록
고급
Linux
100P
map 변수 캐싱 이슈
map을 사용한 조건부 리다이렉트에서 첫 번째 요청의 결과가 이후 다른 요청에도 적용되는 문제가 있습니다.
NGINX
map $request_uri $redirect_target {
~^/old-page /new-page;
~^/legacy /modern;
default "";
}
server {
listen 80;
if ($redirect_target) {
return 301 $redirect_target;
}
location / {
proxy_pass http://backend;
}
}
0명 풀이 · 정답률 0%