Echo sub request not working


I am new to Nginx, so know very little about it.

My requirement is I need to make a service call but along with proxy
that request, I need to make call to another service/servlet. For this I
decided to use Echo module to use the echo_subrequest_async option.

However the subrequest is not working and even simple echo print is not
working. Where does echo “hello” supposed to go? to the client side (my

Below is my configuration (some notes):

  1. Both the servers are java servers which are running on my local box
  2. my os is mac osx version 10.9.5
    3, I compile nginx 1.6.2 from source and with modules pcre and http echo

sudo /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.6.2
built by clang 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
configure arguments: --with-pcre=/Users/amchauhan/project/pcre-8.35

nginx config

events {
worker_connections 1024;

http {

server {
listen 80;
server_name localhost;

 location /mywebapp {
    default_type "text/plain";
    echo "in webapp call, should not happen";
    proxy_pass http://localhost:8080/mywebapp/;

 location /messaging-service {
    default_type "text/plain";
    echo "in the messaging service call";
    echo_subrequest_async  GET '/mywebapp/second';
    proxy_pass http://localhost:8090/messaging-service/;

 location /mywebapp/second {
    echo "Going to keep sesson alive !!";
    proxy_pass http://localhost:8080/mywebapp/second/;



Posted at Nginx Forum:

When I say both the servers running on my local machine it means servers
running on localhost:8080 and localhost:8090. Both are java tomcat

Posted at Nginx Forum:

Can anyone help me with this?

Posted at Nginx Forum: