Welcome! Log In Create A New Profile


Echo sub request not working

March 12, 2015 06:44AM

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 passing 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 guess)

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 --add-module=/Users/amchauhan/project/echo-nginx-module-0.57 --with-cc-opt=-Wno-deprecated-declarations

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

Subject Author Posted

Echo sub request not working

AmitChauhan March 12, 2015 06:44AM

Re: Echo sub request not working

AmitChauhan March 12, 2015 06:52AM

Re: Echo sub request not working

AmitChauhan March 13, 2015 04:56AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 193
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready