Welcome! Log In Create A New Profile

Advanced

Newbie, rewriting problem

Posted by MarvinLeRouge 
Newbie, rewriting problem
October 21, 2013 09:01AM
Hi,

Newbie with nginx, playing around with my vps.
My problem : i have an apache htaccess, and transforming it into nginx conf.
My goal : serve images at the appropriate size, depending on a cookie value, with 4 possible sizes.
I've got a problem on this part of the process :
- if the file is /img/size(320|480|768|1024)/foo, and if it's not present, then rewrite to a php sctip to generate the appropriate image (which would be served on next similar request)

I pasted my code here, Apache orignial file http://pastebin.com/bSAwiJm3 and nginx new file http://pastebin.com/wJPZcTWJ
nginx file :
lines 02 to 17 : redirect to cookie size
lines 18 to 21 : no cookie means redirect to max size
lines 22 to 27 : restrict to 4 authorized sizes
This works. My remaining problem, rewriting request to authorized sizes to the php script, if file not found.

Thanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready