# Http/2 rewriting headers doesn't work

**URL:** https://discourse.haproxy.org/t/http-2-rewriting-headers-doesnt-work/2785
**Category:** Help!
**Created:** [July 29, 2018, 12:32pm UTC](https://discourse.haproxy.org/t/http-2-rewriting-headers-doesnt-work/2785 "2018-07-29T12:32:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bouke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/bouke/32/552_2.png) [@bouke](https://discourse.haproxy.org/u/bouke)
#### Post date: [July 29, 2018, 12:32pm UTC](https://discourse.haproxy.org/t/http-2-rewriting-headers-doesnt-work/2785/1 "2018-07-29T12:32:50Z")

</div>

I have a backend that is setup serving requests as `http://fakehost`, whilst my haproxy is configured to serve requests for `http://realhost`. I want to enable HTTP/2, so I added `alpn h2,http/1.1` to my config. However the rule for rewriting the `Host:` header no longer works after making this change. My simplified config is listed below. Is modifying headers supported with HTTP/2, and if so, how?

```auto
frontend a
  bind ... alpn h2,http/1.1
  default_backend b
  (...)

backend b
  reqrep ^Host:\ realhost Host:\ fakehost
  (...)

```

---

<div class="post-metadata">

### Author: ![bouke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/bouke/32/552_2.png) [@bouke](https://discourse.haproxy.org/u/bouke)
#### Post date: [July 30, 2018, 7:04am UTC](https://discourse.haproxy.org/t/http-2-rewriting-headers-doesnt-work/2785/2 "2018-07-30T07:04:43Z")

</div>

I replaced `reqrep` with `reqirep` and now it works. Not sure why case-insensitive match would work here, as apart from `Host` everything else is lowercase.

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [July 30, 2018, 9:58am UTC](https://discourse.haproxy.org/t/http-2-rewriting-headers-doesnt-work/2785/3 "2018-07-30T09:58:33Z")

</div>

In H2, the header names and values are always lowercase, so the header is actually `host`.
