Reverse path order
You can place filters at the end of the path rather than before the image key.
-
Use the
REWRITE_MATCH_PATTERNwith a regular expression that parses the path into two groups. The solution then usesREWRITE_SUBSTITUTIONto switch the order of the groups. -
Use a regular expression specified by
REWRITE_MATCH_PATTERNto parse the path into groups for a request likehttps://abcd.cloudfront.net/imagekey.png/fit-in/200x200, where the image key appears before the filters. For example:REWRITE_MATCH_PATTERN = /^\/(.*?\..*?)\/(.+)$/gm -
Reverse the order of the fields with
REWRITE_SUBSTITUTIONto convert the request into a Thumbor style request likehttps://abcd.cloudfront.net/fit-in/200x200/imagekey.png, where the image key is moved to the end of the request. For example:REWRITE_SUBSTITUTION = /$2/$1