problem with PCRE matching, utf-8, Greek, rewrite

tmanolat nginx-forum at nginx.us
Sat Sep 25 18:46:48 MSD 2010


so, seems that the following is the most correct, (at least for me
worked well so far)
[code]
        location ~ "^(/optionalwebappname)?/ProcessImageServlet.*$" {
			set $th '';
			
			if ($request_uri ~ "^(.*)[\\?|&]type=th(&.*)?$") {
				set $th 'th_';
			}
			rewrite ^(.+)$
http://static-dev.myhost.eu/$arg_hotel_id/$th$arg_filename break;
			expires           1d;
		}
[/code]

Again, my problem was to rewrite some urls with GET vars that were
expected to contain utf8 characters.
So, the $arg_filename is passed correctly to the rewrite.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,104357,133963#msg-133963




More information about the nginx mailing list