Topic: nginx regex

Greetings. There are links:


I need to write a redirect, substituting instead of  in 2 GET parameter (bar, foo) digit. We admit, if it bar, id 9, if foo - id 50 etc.
Such links should turn out:

http://site.com/workers/c.php?ru&bar&123-> http://workers.site.com/page.xml?id=9&val=123
http://site.com/workers/c.php?ru&foo&888-> http://workers.site.com/page.xml?id=50&val=888

Help, to whom it is not difficult smile Very much it would not be desirable to climb in the documentation, and so affairs full.