Skip to content

nginx: [emerg] "let" directive is not allowed here #3

@root-wyj

Description

@root-wyj

let不能再if中执行。(let directive is not allowed in if body)

        location /let {

            if ($uri ~ ^/let/(\d+)$) {
                echo $uri;
                set $id $1;
                echo $id;
                let $dived ( 3 / 2 );
                echo $dived
            }
        }

检查配置文件的时候 会不通过,报题目那样的错误

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions