replace-filter-nginx-module
replace-filter-nginx-module copied to clipboard
replace letter to $ issue
Hello: I am new guy use replace-filter-nginx-module, I want insert some javascript to html body. And my javascript code contain $. When try $$ like this: replace_filter '
' '' g;
I need it to be ''.
But I still get two $$ as result
Thank you for your help.
I also came across this issue and after inspecting the source code I couldn't find why it didn't work. I then started looking for a work-around and found that this works:
Place the following in the http block of your nginx config:
geo $dollar {
default "$";
}
Then, you can use ${dollar} in your replace_filter rules to get a single $.