# Problems with rewrite

**URL:** <https://www.ruby-forum.com/t/problems-with-rewrite/191985>\
**Category:** NGINX\
**Created:** [July 21, 2010, 9:11pm UTC](https://www.ruby-forum.com/t/problems-with-rewrite/191985 "2010-07-21T21:11:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jefersonph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@jefersonph](https://www.ruby-forum.com/u/jefersonph)\
**Post date:** [July 21, 2010, 9:11pm UTC](https://www.ruby-forum.com/t/problems-with-rewrite/191985/1 "2010-07-21T21:11:57Z")

</div>

I’m having problems with rewrite, I have to download the Apache server  
for a current ngix but I’m finding some errors with rewrite

#nginx  
rewrite ^/http-bind/ [http://www.xxx.com:1010/http-bind/](http://www.xxx.com:1010/http-bind/) break;  
rewrite ^/ws-chat/(.\*)$ [http://yyy.xxx.com/$1](http://yyy.xxx.com/$1) break;

[Website Domain Names, Online Stores & Hosting | Domain.com](http://www.dominio.com/http-bind/) → [http://www.xxx.com:1010/http-bind/](http://www.xxx.com:1010/http-bind/)  
[Website Domain Names, Online Stores & Hosting | Domain.com](http://www.dominio.com/ws-chat/) → [http://yyy.xxx.com/$1](http://yyy.xxx.com/$1)

Upon request it changes the field, he must not change as it is done in  
the apache example below.

#APACHE  
RewriteRule ^/http-bind/ [http://www.xxx.com:1010/http-bind/](http://www.xxx.com:1010/http-bind/) [P]  
RewriteRule ^/ws-chat/(.\*)$ [http://yyy.xxx.com/$1](http://yyy.xxx.com/$1) [P,QSA]

[Website Domain Names, Online Stores & Hosting | Domain.com](http://www.dominio.com/http-bind/) → [Website Domain Names, Online Stores & Hosting | Domain.com](http://www.dominio.com/http-bind/)  
[Website Domain Names, Online Stores & Hosting | Domain.com](http://www.dominio.com/ws-chat/) → [Website Domain Names, Online Stores & Hosting | Domain.com](http://www.dominio.com/ws-chat/)

thanks

Posted at Nginx Forum:

> **[Problems with rewrite](https://forum.nginx.org/read.php?2,111397,111397#msg-111397)**
>
> I'm having problems with rewrite, I have to download the Apache server for a current ngix but I'm finding some errors with rewrite #NGINX rewrite ^/http-bind/ http://www.xxx.com:1010/http-bind/ break; rewrite ^/ws-chat/(.\*)$ http://yyy.xxx.com/$1...

---

<div class="post-metadata">

**Author:** ![jefersonph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@jefersonph](https://www.ruby-forum.com/u/jefersonph)\
**Post date:** [July 22, 2010, 7:13pm UTC](https://www.ruby-forum.com/t/problems-with-rewrite/191985/2 "2010-07-22T19:13:57Z")

</div>

Need to rewrite but that does not change the url, would you do that?

Posted at Nginx Forum:

> **[Re: Problems with rewrite](https://forum.nginx.org/read.php?2,111397,111704#msg-111704)**
>
> I'm having problems with rewrite, I have to download the Apache server for a current ngix but I'm finding some errors with rewrite #NGINX rewrite ^/http-bind/ http://www.xxx.com:1010/http-bind/ break; rewrite ^/ws-chat/(.\*)$ http://yyy.xxx.com/$1...

---

<div class="post-metadata">

**Author:** ![jefersonph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@jefersonph](https://www.ruby-forum.com/u/jefersonph)\
**Post date:** [July 22, 2010, 7:40pm UTC](https://www.ruby-forum.com/t/problems-with-rewrite/191985/3 "2010-07-22T19:40:53Z")

</div>

On Fri, Jul 23, 2010 at 12:12 AM, jefersonph [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Need to rewrite but that does not change the url, would you do that?

proxy\_pass

–  
O\< ascii ribbon campaign - stop html mail - [www.asciiribbon.org](http://www.asciiribbon.org)

---

<div class="post-metadata">

**Author:** ![jefersonph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@jefersonph](https://www.ruby-forum.com/u/jefersonph)\
**Post date:** [July 22, 2010, 9:40pm UTC](https://www.ruby-forum.com/t/problems-with-rewrite/191985/4 "2010-07-22T21:40:21Z")

</div>

with proxy\_pass i can send paramet ex: [http://sss.aaaa.com/$1](http://sss.aaaa.com/$1) ?

thanks for the help

Posted at Nginx Forum:

> **[Re: Problems with rewrite](https://forum.nginx.org/read.php?2,111397,111770#msg-111770)**
>
> I'm having problems with rewrite, I have to download the Apache server for a current ngix but I'm finding some errors with rewrite #NGINX rewrite ^/http-bind/ http://www.xxx.com:1010/http-bind/ break; rewrite ^/ws-chat/(.\*)$ http://yyy.xxx.com/$1...
