# Rewrite proxy flag set problem

**URL:** <https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184>\
**Category:** NGINX\
**Created:** [March 23, 2012, 12:17pm UTC](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184 "2012-03-23T12:17:22Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 27, 2012, 10:55am UTC](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184/21 "2012-03-27T10:55:40Z")

</div>

On Tue, Mar 27, 2012 at 04:50:59AM -0400, niraj wrote:

> nginx: [emerg] invalid number of arguments in “proxy\_pass” directive in  
> /etc/nginx/conf.d/default.conf:52  
> nginx: configuration file /etc/nginx/nginx.conf test failed

These were Apache examples.

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 27, 2012, 2:48pm UTC](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184/22 "2012-03-27T14:48:26Z")

</div>

Hi

For that auction proxy\_pass working but now

I have request like

/user/ongoingra/display\_ra\_list?from\_period=&to\_period=&type=20

I want to redirect this query for that I have added the following

location =/user/ongoingra/ {  
proxy\_pass [http://192.168.1.210/user/ongoingra/](http://192.168.1.210/user/ongoingra/);  
}

or

location =/user {  
proxy\_pass [http://192.168.1.210/user](http://192.168.1.210/user);  
}  
or

location /user/ongoingra {  
proxy\_pass [http://192.168.1.210/user/ongoingra](http://192.168.1.210/user/ongoingra);  
}

but I am not able to get the result of the following request

/user/ongoingra/display\_ra\_list?from\_period=&to\_period=&type=20  
just like the same other request also

i.e. /user/completedra/display\_ra\_list?type=20

Please suggest which rule will fulfill my request to redirect ?

Posted at Nginx Forum:

> **[Re: rewrite proxy flag set problem](https://forum.nginx.org/read.php?2,224274,224484#msg-224484)**
>
> Hi I have write a one rewrite rule as below rewrite /auction(.\*)$ http://192.168.1.210$1; This rewrite rule working fine for me. but the problem is it show the Ip address 192.168.1.210 also. I want to hide this IP , fo

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 28, 2012, 7:31am UTC](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184/23 "2012-03-28T07:31:52Z")

</div>

Hi Igor

Thnx for helping again.

My personal view for that doc is its a very brief document. I have  
read before I post the above mail.

I dont get the fully understand from that doc…

suppose

what is meaning of the following  
location /user/ { ===== I have  
add slash / at the end of /user  
proxy\_pass [http://192.168.1.210](http://192.168.1.210);  
}

what will be the effect…

If

what is meaning of the following  
location /user/ { ===== I have  
add slash / at the end of /user  
proxy\_pass [http://192.168.1.210/](http://192.168.1.210/); ===== i have add slash / at  
the end of [http://192.168.1.210](http://192.168.1.210)  
}  
what will be the effect …

If  
what is meaning of the following  
location /user {  
proxy\_pass [http://192.168.1.210/](http://192.168.1.210/); ===== i have add slash / at  
the end of [http://192.168.1.210](http://192.168.1.210)  
}

what will be the effect …

Its very difficult to understand all this above stuff with that document  
only…

Tnks for your reply. Sorry for taking too much your valuable time.

Posted at Nginx Forum:

> **[Re: rewrite proxy flag set problem](https://forum.nginx.org/read.php?2,224274,224512#msg-224512)**
>
> Hi I have write a one rewrite rule as below rewrite /auction(.\*)$ http://192.168.1.210$1; This rewrite rule working fine for me. but the problem is it show the Ip address 192.168.1.210 also. I want to hide this IP , fo

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 27, 2012, 3:01pm UTC](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184/24 "2012-03-27T15:01:40Z")

</div>

On Tue, Mar 27, 2012 at 08:47:57AM -0400, niraj wrote:

> location =/user/ongoingra/ {  
> location /user/ongoingra {
> 
> Please suggest which rule will fulfill my request to redirect ?

It seems you did not read location documentation:

```
Also, using the "=" prefix it is possible to define an exact
match of URI and location.

```

Obviously “/user/ongoingra/” and “/user” do not match exactly  
“/user/ongoingra/display\_ra\_list”.

Also “location /user/ongoingra” matches  
“/user/ongoingra/display\_ra\_list”,  
but does not match “/user/completedra/display\_ra\_list”.

Where should these URLs be proxied to ?  
Probably, you need

location /user {  
proxy\_pass [http://192.168.1.210](http://192.168.1.210);  
}

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [April 9, 2012, 10:26am UTC](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184/25 "2012-04-09T10:26:26Z")

</div>

Hi

```
   As mentioned above the different condition for Nginx, If anybody

```

know in details then please guide me.

It will help me to understand the Nginx rewrite rule in details.

Posted at Nginx Forum:

> **[Re: rewrite proxy flag set problem](https://forum.nginx.org/read.php?2,224274,225057#msg-225057)**
>
> Hi I have write a one rewrite rule as below rewrite /auction(.\*)$ http://192.168.1.210$1; This rewrite rule working fine for me. but the problem is it show the Ip address 192.168.1.210 also. I want to hide this IP , fo

[Previous page](https://www.ruby-forum.com/t/rewrite-proxy-flag-set-problem/218184.md?page=1)
