How to escape the value of nginx fastcgi_param

I need to configure the password of the database through fastcgi_param

fastcgi_param DB_PASS "afdas$madads"

here $m is part of the password, but nginx always treats it as a variable, and adding a backslash doesn"t work either. What to do with it, guys

Jan.25,2022

change password


this has not been done. The project has tried to put it in the env in php-fpm.conf, for example, Env [DB _ PASS] = XXX


searched the Internet again and found the answer. It turns out that nginx does not support the escape of this $, but there is a way to get around this problem. You only need to define it as follows before the server block:

geo $m {
    default "$m";
}
For more information, please see https://www.jianshu.com/p/446.

.
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-1b3bfb5-4d976.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-1b3bfb5-4d976.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?