hi! (sorry for my bad english)
i have a URL like this:
http://www.domain.com/resize.php?pic=images/elements/imagename.jpg&type=300crop
that php checks if that image exists and serves, if not, creates image on disk with the size specified in the type parameter and returns it.
what I wanted is to check if the image exists on disk at that size, with nginx, so run only resize.php when necessary to create the image.
I tried this, but i think that location directive doesn't operate on query parameters ($args) using regex, then loncation does not match with sample URL :(
any help please?
I need to rewrite the parameters ($args) and use them in the try_files directive... is this possible?
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> 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://127.0.0.1:8080;
> }
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Edited 3 time(s). Last edit at 05/08/2013 11:20AM by pepejose.