# More\_set\_headers with content-type "text/html" does not send header

**URL:** <https://www.ruby-forum.com/t/more-set-headers-with-content-type-text-html-does-not-send-header/222901>\
**Category:** NGINX\
**Created:** [September 14, 2012, 10:56am UTC](https://www.ruby-forum.com/t/more-set-headers-with-content-type-text-html-does-not-send-header/222901 "2012-09-14T10:56:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 14, 2012, 10:56am UTC](https://www.ruby-forum.com/t/more-set-headers-with-content-type-text-html-does-not-send-header/222901/1 "2012-09-14T10:56:32Z")

</div>

Hi,

I’m using nginx (1.3.6 +spdy52) with agentzh/headers-more-nginx-module  
(current master branch from git). There’s a Content-Type header sent  
which does contain the following: text/html; charset=utf-8

However when I add `more_set_headers -t "text/html" "X-UA-Compatible:IE=Edge,chrome=1"` to my `server` block this header  
isn’t sent. In case I remove that `-t "text/html"` it’s all fine  
(read: header is sent). Tried with `-t "text/html; charset=utf-8"` too  
without any effect.

Any ideas what might be wrong here?

Regards,  
Christian

---

<div class="post-metadata">

**Author:** ![SSChristian\_BSSnnin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@SSChristian\_BSSnnin](https://www.ruby-forum.com/u/SSChristian_BSSnnin)\
**Post date:** [September 14, 2012, 11:24am UTC](https://www.ruby-forum.com/t/more-set-headers-with-content-type-text-html-does-not-send-header/222901/2 "2012-09-14T11:24:36Z")

</div>

Hello

I have a map to match my clients but somehow i can not limit the chars  
within the regular expression.

What i want to archive is the following map with a general regular  
expression:  
map $uri $myclient {  
default noclient;  
~/de/? de;  
~/es/? es;  
~/nl/? nl;  
# 1…n (always 2 chars long)  
}

But when i try it this way:

map $uri $myclient {  
default noclient;  
~/(?[a-z]{2})/ $suffix;  
}

i get the following error:  
nginx: [emerg] invalid number of the map parameters www.vm:17

This one works but i get even hits if i have more then 2 chars what is  
not desired behaviour.

map $uri $myclient {  
default noclient;  
~/(?[a-z])/ $suffix;  
}

Any ideas? Thank you!

Regards Frank

---

<div class="post-metadata">

**Author:** ![SSChristian\_BSSnnin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@SSChristian\_BSSnnin](https://www.ruby-forum.com/u/SSChristian_BSSnnin)\
**Post date:** [September 14, 2012, 12:59pm UTC](https://www.ruby-forum.com/t/more-set-headers-with-content-type-text-html-does-not-send-header/222901/3 "2012-09-14T12:59:18Z")

</div>

On Friday 14 September 2012 13:21:06 Frank Ruske wrote:  
[…]

> But when i try it this way:
> 
> map $uri $myclient {  
> default noclient;  
> ~/(?[a-z]{2})/ $suffix;  
> }
> 
> i get the following error:  
> nginx: [emerg] invalid number of the map parameters www.vm:17

[…]

> Any ideas? Thank you!

If a regular expression includes the characters “}” or “;”, the whole  
expressions should be enclosed in single or double quotes.

wbr, Valentin V. Bartenev

–  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

> **[Technical Support for NGINX and NGINX Plus Software](https://www.nginx.com/support/)**
>
> Get the help you need with support directly from the authors and maintainers of NGINX Open Source and NGINX Plus.

---

<div class="post-metadata">

**Author:** ![SSChristian\_BSSnnin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@SSChristian\_BSSnnin](https://www.ruby-forum.com/u/SSChristian_BSSnnin)\
**Post date:** [September 15, 2012, 4:45pm UTC](https://www.ruby-forum.com/t/more-set-headers-with-content-type-text-html-does-not-send-header/222901/4 "2012-09-15T16:45:07Z")

</div>

Thank you. Did not saw that in the docs. My fault

Regards Frank

* * *

Von: removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid] im Auftrag von  
Valentin V. Bartenev [removed\_email\_address@domain.invalid]  
Gesendet: Freitag, 14. September 2012 12:58  
An: removed\_email\_address@domain.invalid  
Betreff: Re: Map using regular expresion limited to {2} chars

On Friday 14 September 2012 13:21:06 Frank Ruske wrote:  
[…]

> But when i try it this way:
> 
> map $uri $myclient {  
> default noclient;  
> ~/(?[a-z]{2})/ $suffix;  
> }
> 
> i get the following error:  
> nginx: [emerg] invalid number of the map parameters www.vm:17

[…]

> Any ideas? Thank you!

If a regular expression includes the characters } or ;, the whole  
expressions should be enclosed in single or double quotes.

wbr, Valentin V. Bartenev

–  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

> **[Technical Support for NGINX and NGINX Plus Software](https://www.nginx.com/support/)**
>
> Get the help you need with support directly from the authors and maintainers of NGINX Open Source and NGINX Plus.

* * *

nginx mailing list  
removed\_email\_address@domain.invalid  
[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)
