
브라우저를 사용할 때 다음으로 전화를 겁니다.http://myhost/tiles/yellow/1/2/3.png, 나는 다음에서 콘텐츠를 얻을 것으로 예상합니다.http://myhost/cache/yellow.png 내 구성은 다음과 같습니다
location /cache/ {
alias /my/path/cache/;
}
location /tiles/ {
try_files $uri $uri/ @rulestiles;
}
location @rulestiles {
rewrite "^/tiles/([a-zA-Z1-9]*)/[0-9]{2}/[0-9]{6}/[0-9]{6}\.png$" /cache/$1\.png permanent;
}
나는 무엇을 그리워합니까? 모든 매개변수가 필요하지 않기 때문에 어디에서나 캡처를 사용하지 않기 때문인가요?
또한 수백 개의 실제 파일에만 수억 개의 심볼릭 링크가 필요하므로 심볼릭 링크를 사용하고 싶지 않습니다.
어떤 안내/도움을 주셔서 감사합니다
답변1
제 질문에 댓글을 달아 주신 덕분에 Alexey Ten
여러 가지 오류를 바로잡을 수 있었습니다.
첫째, 내 정규식이 잘못되어 테스트할 때 매개변수를 캡처하지 않았습니다.
그런 다음 URL을 동일하게 유지하기 위해 rewrite
로 변경했습니다.proxy_pass
location /cache/ {
alias /my/path/cache/;
}
location ~ "/tiles/(?<section>[a-zA-Z1-9]*)/[0-9]{1,2}/[0-9]{1,6}/[0-9]{1,6}.png$" {
proxy_pass http://my.tested.ip.code/cache/$section.png;
proxy_set_header Host $host;
}
my.tested.ip.code
서버 IP는 어디에 있습니까?