# Location header subsitution

**URL:** <https://www.ruby-forum.com/t/location-header-subsitution/221589>\
**Category:** NGINX\
**Created:** [July 20, 2012, 3:39pm UTC](https://www.ruby-forum.com/t/location-header-subsitution/221589 "2012-07-20T15:39:13Z")\
**Posts on this page:** 3\
**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:** [July 20, 2012, 3:39pm UTC](https://www.ruby-forum.com/t/location-header-subsitution/221589/1 "2012-07-20T15:39:13Z")

</div>

Hello,

i tried to build content adaption with nginx. For example requesting  
[http://example.com.reverseproxy.com](http://example.com.reverseproxy.com) will serve you content from  
[example.com](http://example.com) with substituted url from [http://example.com](http://example.com) to  
[http://example.com.reverseproxy.com](http://example.com.reverseproxy.com)  
It works great but now i have to substitute Location Header on http  
status code 301. Anybody knows how this is possible? I tried  
subs\_filter. It works great on body subsitution, but not on headers.

Sorry for my bad english.

Greetings  
Anthony

Posted at Nginx Forum:

> **[Location header subsitution](https://forum.nginx.org/read.php?2,228784,228784#msg-228784)**
>
> Hello, i tried to build content adaption with nginx. For example requesting http://example.com.reverseproxy.com will serve you content from example.com with substituted url from http://example.com to http://example.com.reverseproxy.com It works great...

---

<div class="post-metadata">

**Author:** ![anthonyvage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@anthonyvage](https://www.ruby-forum.com/u/anthonyvage)\
**Post date:** [July 20, 2012, 5:02pm UTC](https://www.ruby-forum.com/t/location-header-subsitution/221589/2 "2012-07-20T17:02:12Z")

</div>

On Friday 20 July 2012 17:38:51 anthonyvage wrote:

> Sorry for my bad english.

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![anthonyvage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@anthonyvage](https://www.ruby-forum.com/u/anthonyvage)\
**Post date:** [July 20, 2012, 5:22pm UTC](https://www.ruby-forum.com/t/location-header-subsitution/221589/3 "2012-07-20T17:22:04Z")

</div>

Thanks a lot i dit not know that i can use this with regular  
expressions.

Posted at Nginx Forum:

> **[Re: Location header subsitution](https://forum.nginx.org/read.php?2,228784,228790#msg-228790)**
>
> Hello, i tried to build content adaption with nginx. For example requesting http://example.com.reverseproxy.com will serve you content from example.com with substituted url from http://example.com to http://example.com.reverseproxy.com It works great...
