gsub request_uri paramater

40 views
Skip to first unread message

Stan Wong

unread,
Nov 24, 2016, 10:37:28 AM11/24/16
to openresty-en
Hi,

Is it possible to gsub request uri parameter before send to upstream?

original client request query string = /rpc/validation.php?token=aaaa&tokensalt=bbbbb&version=abc

new url /rpc/validation.php?token=aaaa&tokensalt=bbbbb&version=abc123

I tried below code but the URL query string parameter remain the same when forward to upstream.

local args = ngx.req.get_uri_args()
args.version = "abc123"
ngx.req.set_uri_args(args)

Kwanhur Huang

unread,
Nov 24, 2016, 8:55:46 PM11/24/16
to openre...@googlegroups.com, Kwanhur Huang
hello,

you can process it with ngx.var.args and ngx.re.split()


--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages