Copy and deliver a request to another nginx server for real traffic testing
Solution 1:
I found the solution myself. So I share my finding here.
I used post_action directive for this.
location / {
uwsgi_pass unix:app.sock;
post_action @post_action;
}
location @post_action {
proxy_pass http://dst_host:dst_port;
}
The request first delivered to unix:app.sock and when it completed, post_action directive pass the request to named location, @post_action.
It works like a charm!