Hi,
Tell me please, how can I remove all spaces from $args ?
I create solution, it remove up to 5 spaces. But it not best way i
think.
if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
if ($args ~ (.*)\s(.*)$) { set $args $1; }
Posted at Nginx Forum:
Hi, Tell me please, how can I remove all spaces from $args ? I create solution, it remove up to 5 spaces. But it not best way i think. if ($args ~ (.*)\s(.*)$) { set $args $1$2; } if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
Hett
April 28, 2016, 7:17pm
2
On Thu, Apr 28, 2016 at 06:46:11AM -0400, Hett wrote:
Hi there,
Tell me please, how can I remove all spaces from $args ?
I suspect that you may need to use one of the programming language
modules available in your nginx to do that.
Why do you want to do it?
Perhaps there is an alternative acceptable way to achieve your final
desired result.
f
Francis D. [email protected]
Hett
April 29, 2016, 8:17am
3
Hi,
I using third-party software,
in some cases users create not valid url, and I want to fix it
for example:
http://xx.yy/xx/yy/?a=1&b=1 2 3.txt
need replace by:
http://xx.yy/xx/yy/?a=1&b=123.txt
Posted at Nginx Forum:
Hi, Tell me please, how can I remove all spaces from $args ? I create solution, it remove up to 5 spaces. But it not best way i think. if ($args ~ (.*)\s(.*)$) { set $args $1$2; } if ($args ~ (.*)\s(.*)$) { set $args $1$2; }