# NginX RewriteMap : How to?

**URL:** <https://www.ruby-forum.com/t/nginx-rewritemap-how-to/215565>\
**Category:** NGINX\
**Created:** [January 8, 2012, 7:17pm UTC](https://www.ruby-forum.com/t/nginx-rewritemap-how-to/215565 "2012-01-08T19:17:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 8, 2012, 7:17pm UTC](https://www.ruby-forum.com/t/nginx-rewritemap-how-to/215565/1 "2012-01-08T19:17:37Z")

</div>

Hi,

I’m wondering how can I emulate the popular Apache’s RewriteMap  
feature.

I tried several things, without success :

> **[NginX RewriteMap : How to ?](https://forum.nginx.org/read.php?11,220713,220936#msg-220936)**
>
> Hi, I've seen that a map keyword exists in NginX, but I'm wondering how to use it to realize multiple calls, with matched expressions, on the same map, in order to emulate the Apache RewriteMap feature. According to the following Apache files :

Posted at Nginx Forum:

> **[NginX RewriteMap : How to ?](https://forum.nginx.org/read.php?2,220939,220939#msg-220939)**
>
> Hi, I'm wondering how can I emulate the popular Apache's RewriteMap feature. I tried several things, without success : http://forum.nginx.org/read.php?11,220713,220936#msg-220936

---

<div class="post-metadata">

**Author:** ![DenisTRUFFAUT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85f322/32.png) [@DenisTRUFFAUT](https://www.ruby-forum.com/u/DenisTRUFFAUT)\
**Post date:** [January 8, 2012, 10:15pm UTC](https://www.ruby-forum.com/t/nginx-rewritemap-how-to/215565/2 "2012-01-08T22:15:45Z")

</div>

Look at [Module ngx\_http\_map\_module](http://wiki.nginx.org/HttpMapModule) and  
[Module ngx\_http\_rewrite\_module](http://wiki.nginx.org/HttpRewriteModule)

Regards

M

[http://wiki.nginx.org/HttpMapModule](http://wiki.nginx.org/HttpMapModule)
