Implemented "location" option for "return" action.

This allows to specify redirects:

  {
      "action": {
          "return": 301,
          "location": "https://www.example.com/"
      }
  }
This commit is contained in:
Valentin Bartenev
2020-03-21 01:39:00 +03:00
parent 35d6f84426
commit c63b498f94
5 changed files with 60 additions and 2 deletions

View File

@@ -1103,6 +1103,8 @@ static const nxt_str_t nxt_http_redirection[] = {
nxt_string("HTTP/1.1 302 Found\r\n"),
nxt_string("HTTP/1.1 303 See Other\r\n"),
nxt_string("HTTP/1.1 304 Not Modified\r\n"),
nxt_string("HTTP/1.1 307 Temporary Redirect\r\n"),
nxt_string("HTTP/1.1 308 Permanent Redirect\r\n"),
};