0
내 URL 형식 : http://example.org/img?src=http://a.com/logo.pngnginx는 http://example.org/img?src=A에서 A로 규칙을 다시 작성합니까?
내가 http://example.org/logo.png이 요청을 다시 작성 nginx를 원하는 (하지 URL redriect)
이 어떻게 할까?
내 URL 형식 : http://example.org/img?src=http://a.com/logo.pngnginx는 http://example.org/img?src=A에서 A로 규칙을 다시 작성합니까?
내가 http://example.org/logo.png이 요청을 다시 작성 nginx를 원하는 (하지 URL redriect)
이 어떻게 할까?
src
변수는 $arg_src
변수로 사용할 수 있지만 if
블록을 사용하여 필요한 부분을 추출해야합니다. if
사용에 대해서는 this caution을 참조하십시오.
(당신이 당신의 특정 요구에 정규식을 적용해야합니다) :
location = /img {
if ($arg_src ~ \w(?<src>/\w.*)$) {
rewrite^$src last;
}
}