Welcome! Log In Create A New Profile

Advanced

help on using $arg

Posted by elico 
help on using $arg
April 22, 2012 03:49PM
i am using nginx as a reverse proxy to video files using a proxy_store and $arg .
so i have this nice server that is using a arg named "Key-Pair-Id"
and when i'm settings up (partial settings)
##start qoute
location / {
root /usr/local/www/nginx_cache/files/;
try_files "/id=$arg_Key-Pair-Id.hint=$arg_hint" @proxy_v;
}

location @proxy_imdbv {
resolver 192.168.1.201;
proxy_pass http://$host$request_uri;
proxy_temp_path "/usr/local/www/nginx_cache/files/tmp";
proxy_store "/usr/local/www/nginx_cache/files/imdbcache/id=$arg_Key-Pair-Id.hint=$arg_hint";
##end quote

nginx create a file named:
id=-Pair-Id.hint=flv
instead of the id key number

so i was wondering about the limits of $args names and is there a way to use it in my case?

Thanks,
Elico
Re: help on using $arg
April 22, 2012 11:53PM
so i managed to do what i needed using prce on nginx.

i inserted in the server conf file the next lines:

server {
listen 127.0.0.1:8087;

if ($request_uri ~* "(Key-Pair-Id.*)\&") {
set $id $1;
}

and then i can use the arguments with a variable $id

Regards,
Elico
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 126
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready