Skip to content. | Skip to navigation

Personal tools

Sections
You are here: Home / Sonstiges / Usefull insigths / nginx map breaks positional parameters in rewrite

nginx map breaks positional parameters in rewrite

This seems to be a known problem and might be fixed in the future.

 

using $1,$2 in rewrites that take place after map has matched something fails.

so use named parameters instead

 

rewrite a(.*) yolo$1

becomes

rewrite a(?<myname>.*) yolo$myname