V
V
Van9522015-03-23 18:31:42
linux
Van952, 2015-03-23 18:31:42

nginx. How to replace spaces with "+" in the parameter string?

Good day to all!
The essence of the problem is this, there is a url:
example.com/some_text_1/some_text_2?param1=val1 param2=val2 param3=val3
But to get:
example.com/some_text_1/some_text_2?param1=val1+pa...
Or:
example.com/some_text_1 /some_text_2?param1=val1%20... I
thought to solve this issue using rewrite, but it does not process arguments, I found in the docks that there is a variable that stores a string with arguments - $args. But I can’t think of / find what to do to put down “+” or “% 20” instead of spaces.
Perhaps there is already a solution?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AVKor, 2015-03-23
@AVKor

sed 's/ /+/g'

M
metajiji, 2015-03-25
@metajiji

Try
Or 100% option:

http://nginx.org/ru/docs/http/ngx_http_perl_module.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question