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