Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you access HTTP GET parameters in Nginx prior to version 0.7.8?

The changelog lists version 0.7.8 as the version that introduces the $arg_X notation to access the HTTP GET parameter X from within nginx.conf.

Unfortunately, the wiki is very up to date. How do you access HTTP GET parameters from within nginx.conf before this version?

like image 952
Ian Terrell Avatar asked Jan 26 '26 02:01

Ian Terrell


1 Answers

At the moment, the best I have is matching against $args.

For instance, instead of saying if ($arg_user = "jim") you can say if ($args = "user=jim"). This particular example only works for a single argument, since multiple arguments can come in any order; that case should be handled with regular expressions.

like image 53
Ian Terrell Avatar answered Jan 27 '26 16:01

Ian Terrell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!