0
ARGS(對不起我的英文不好)
我有這樣一個URL:
http://www.domain.com/resize.php?pic=images/elements/imagename.jpg&type=300crop
如果圖像存在,並且成爲在PHP檢查,如果沒有,則使用type參數中指定的大小在磁盤上創建映像並將其返回。
我想要的是檢查圖像是否以nginx的大小存在於磁盤上,因此只有在需要創建圖像時才運行resize.php。
我想這一點,但我認爲該位置指令不會對使用正則表達式查詢參數($參數)進行操作,然後loncation不匹配樣品網址:(
任何幫助嗎?
我需要重寫的參數($參數),並在try_files指令使用它們......這可能嗎?
location ~ "^/resize\.php\?pic=images/(elements|gallery)/(.*)\.jpg&type=([0-9]{1,3}[a-z]{0,4})$)" {
try_files /images/$1/$2.jpg /imagenes/elements/thumbs/$3_$2.jpg @phpresize;
}
location @phpresize {
try_files $uri =404;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
proxy_pass http://www.localhost.com:8080;
}