openresty / openresty/array-var-nginx-module

Documentation request

Open
#3 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
68
Forks
20
Avg merge
47m
Merged PRs (30d)
2

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the nginx configuration shown in the issue, especially the array_split directive and the return directive using $array[0]. Review the module's existing documentation or examples to determine supported indexing and push/pull behavior, then document individual-element access and the expected redirect value.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx
Domain
backend, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.