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

tmanolat nginx-forum at
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)
        location ~ "^(/optionalwebappname)?/ProcessImageServlet.*$" {
			set $th '';
			if ($request_uri ~ "^(.*)[\\?|&]type=th(&.*)?$") {
				set $th 'th_';
			rewrite ^(.+)$$arg_hotel_id/$th$arg_filename break;
			expires           1d;

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:,104357,133963#msg-133963

More information about the nginx mailing list