Rewrite proxy flag set problem

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.

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/;
}

or

location =/user {
proxy_pass http://192.168.1.210/user;
}
or

location /user/ongoingra {
proxy_pass 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:

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;
}

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/; ===== i have add slash / at
the end of 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/; ===== i have add slash / at
the end of 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:

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;
}


Igor S.

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: