Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy_pass works differently when put in eval #16

Open
zongzw opened this issue Nov 26, 2019 · 0 comments
Open

proxy_pass works differently when put in eval #16

zongzw opened this issue Nov 26, 2019 · 0 comments

Comments

@zongzw
Copy link

zongzw commented Nov 26, 2019

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;
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant