Documentation request
Hello, if I have loaded some search providers within a arrayvar in the context of server {}
server {
listen 127.0.1.5:80;
server_name endpoint;
set $hosts "http://bing.com;http://blah.com;http://www.yahoo.com";
array_split ';' $hosts to=$array;
charset en;
return 307 $array[0];
}
When I visit that server it redirects me to a random uri escaped place, well not properly firefox complains the server is not redirecting properly.
How do I access individual elements of the array, is push/pull possible or random?
@PaulGWebster Nope, the array variable does not support such notation. Please only use this module according to the documentation of it: https://github.com/openresty/array-var-nginx-module
For more complicated usage, please use the ngx_lua module instead. This module was written before ngx_lua module was born and the latter is always preferred.
@PaulGWebster With array_split, you get an array-typed variable. Before you use the value of this variable, you should use array_join to obtain a string value. I've added detailed documentation to README. Please check it out. Let me know if you have any further questions.
Oh, BTW, use directives can only run after locations are matched. They cannot run in the server rewrite phase.