replace-filter-nginx-module
replace-filter-nginx-module copied to clipboard
Streaming regular expression replacement in response bodies
I'm using nginx for many projects, there is a possibility to add the use of nginx variables in the query, for example: replace_filter /$project/ /, - or: replace_filter "/`$project`/" /
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 '' '$$(document).ready(function(){$$(".panel-container").eq(-1).hide();});' g;...
``` replace-filter-nginx-module-0.0.1/src/ngx_http_replace_script.c: In function 'ngx_http_replace_script_add_var_code': replace-filter-nginx-module-0.0.1/src/ngx_http_replace_script.c:612:18: error: cast between incompatible function types from 'size_t (*)(ngx_http_replace_script_engine_t *)' {aka 'long unsigned int (*)(struct *)'} to 'void (*)(ngx_http_replace_script_engine_t *)' {aka 'void (*)(struct *)'}...
The Text: The Regex Expression: .* The Conf: location / { #proxy_ssl_server_name on; proxy_connect_timeout 60s; proxy_read_timeout 5400s; proxy_send_timeout 5400s; proxy_pass http://xxx.net/; proxy_ssl_verify off; #proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host "xxx.net"; proxy_set_header...
is there a directive or regex expression to accomplish this? such as replace {account_no:12345678} to {account_no:1234***8} if there is a config list contains account_no. thx
Hi there, I add this in my config, but when the response is text/html, it will also replace. Any comments? > replace_filter_types application/x-javascript javascript text/javascript application/javascript; Thanks.
Hi, is possible to replace a string only when proxy_pass return a 404 stutus? I mean something like ``` sh proxy_pass http://foo.bar/nonexistent/ if ($status = "404") { replace_filter 'Hello' 'Ciao';...
can we replace '$home/git/' with '$root/../' here https://github.com/openresty/replace-filter-nginx-module/blob/master/util/build.sh#L24 ?
We have quite a huge RegExp (1-2k of symbols, 30-100 groups). And on large bodies (300-500kb) it slows nginx down (1-5 seconds x 2 GHz x 1 core) with huge...
Hi There, Is it possible to implement dynamic variables after matching a string. I'll explain: I need to replace a know regex but the value that I need to change...