Skip to content

proxy_pass works differently when put in eval #16

Description

@zongzw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions