How does nginx determine that the variable is empty?

problem description

because the request is to be rewritten, the old version uses an action parameter in body to execute different code. My plan is to use openResty .
to minimize the problem and restore it, using location

location ~ ^/oldpath/interface.php {
    set $target "";
    access_by_lua_file /var/www/script.lua;

    if ($target != "") { -sharp $target
        proxy_pass https://$target;
    }
}

tested that the $targe variable has indeed been set (verified with the echo output), but there is something wrong with the if judgment, which clearly has a value, but does not execute the fragment in if.

Sep.16,2021

then try the following?

  

if ($target ~ *'^ $') {
}

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3fd5e-34876.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3fd5e-34876.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?