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;
}