# Mongrel/webrick redirect\_to discrepancy

**URL:** <https://www.ruby-forum.com/t/mongrel-webrick-redirect-to-discrepancy/68036>\
**Category:** Ruby\
**Created:** [February 14, 2006, 4:41pm UTC](https://www.ruby-forum.com/t/mongrel-webrick-redirect-to-discrepancy/68036 "2006-02-14T16:41:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_blackdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@S\_blackdog](https://www.ruby-forum.com/u/S_blackdog)\
**Post date:** [February 14, 2006, 4:41pm UTC](https://www.ruby-forum.com/t/mongrel-webrick-redirect-to-discrepancy/68036/1 "2006-02-14T16:41:11Z")

</div>

hi,

i’m running mongrel behind lighttpd proxy server, i redirect /xyz URLs  
to port 8081so i can get dynamic content. sometimes this content  
redirects e.g lighttpd config.

“/content/” =\>  
((  
“host” =\>“my IP address here”,  
“port” =\> 8081  
)) ,

when I use rails redirect\_to and webrick as the server i get the  
desired transation of the URLS with no sign of 8081 in the redirected  
URL

[http://myserver/content/redirected\_url](http://myserver/content/redirected_url)

when I use mongrel, the redirected URL contains the 8081 port,

[http://myserver:8081/content/redirected\_url](http://myserver:8081/content/redirected_url)

thanks

BD.

---

<div class="post-metadata">

**Author:** ![S\_blackdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@S\_blackdog](https://www.ruby-forum.com/u/S_blackdog)\
**Post date:** [February 15, 2006, 2:13am UTC](https://www.ruby-forum.com/t/mongrel-webrick-redirect-to-discrepancy/68036/2 "2006-02-15T02:13:24Z")

</div>

Let me look at this. I believe the whole way the redirects are done via  
the  
CGI library is not correct. It looks like WEBrick may be doing some  
form of  
correction. For example, CGI apparently uses a header of “location:” on  
the  
302 response, but WEBrick uses “Location:” and changes the response.

I’ve got a test case for this now so I’ll sort it out. Thanks for the  
specific details on your setup.

Zed A. Shaw

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.
