Welcome! Log In Create A New Profile

Advanced

Re: Modify request body before sending to upstream

January 27, 2015 02:06AM
Still no luck. Here's my config:

upstream wservers {
server localhost:8001 max_fails=3 fail_timeout=2s weight=100;
server localhost:8002 max_fails=3 fail_timeout=2s weight=100;
}

server {
location /foo {
rewrite_by_lua '
ngx.print("yay")
';
proxy_pass http://wservers;
}

location /bar {
proxy_pass http://wservers;
}
}


Here are the curl commands:


[vm ~]$ curl localhost:8080/bar -X POST --data 'hello'
UPSTREAM: hello :UPSTREAM
[vm ~]$ curl localhost:8080/foo -X POST --data 'hello'
yay


What I need is for the second curl command to output:
UPSTREAM: yay :UPSTREAM
Subject Author Posted

Modify request body before sending to upstream

abhinanda January 21, 2015 05:47AM

Re: Modify request body before sending to upstream

abhinanda January 26, 2015 10:08PM

Re: Modify request body before sending to upstream

mex January 27, 2015 01:10AM

Re: Modify request body before sending to upstream

abhinanda January 27, 2015 01:20AM

Re: Modify request body before sending to upstream

mex January 27, 2015 01:29AM

Re: Modify request body before sending to upstream

abhinanda January 27, 2015 02:06AM

Re: Modify request body before sending to upstream

abhinanda January 27, 2015 02:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 254
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready