nginx-eval-module icon indicating copy to clipboard operation
nginx-eval-module copied to clipboard

proxy_pass works differently when put in eval

Open zongzw opened this issue 5 years ago • 0 comments

Hi YiChen,

When I made the configuration as below, it doesn't work for me. The proxy_pass url are different in the following 2 cases.

My server is running at port 80, and http://127.0.0.1:3000/md5sum/234 is a simple 3rd server/api to return the number's md5value.

I'm new to nginx. I wonder if I missed something. Thanks for help.

        location = /eval {  # Not Work
            eval_subrequest_in_memory off;
            eval_override_content_type text/plain;
            eval_buffer_size 1k;
            eval $var {
                proxy_pass http://127.0.0.1:3000/md5sum/234;   # {"statusCode":404,"error":"Not Found","message":"Cannot GET /md5sum/234/eval"}
            }
            return 200 "$var"; 
        }

        location /proxy { # works OK
            proxy_pass http://127.0.0.1:3000/md5sum/234;
        }

zongzw avatar Nov 26 '19 11:11 zongzw