Skip to content

Commit

Permalink
doc(var) load default var indexes (#35)
Browse files Browse the repository at this point in the history
* add desc for lua_kong_load_default_var_indexes

* fix doc link

* update desc for lua_kong_load_var_index

* Update README.md

Co-authored-by: Wangchong Zhou <fffonion@gmail.com>

Co-authored-by: Wangchong Zhou <fffonion@gmail.com>
  • Loading branch information
chronolaw and fffonion authored Feb 22, 2022
1 parent 1ba4f42 commit 4ccf6e0
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Directives

lua_kong_load_var_index
-------------------------------------------
**syntax:** *lua_kong_load_var_index $variable;*
**syntax:** *lua_kong_load_var_index $variable | default;*

**context:** *http*

Expand All @@ -73,6 +73,49 @@ Common variables defined by other modules that are already indexed:
- `$http_user_agent`
- `$host`

Specially, use `lua_kong_load_var_index default` to
index *commonly used variables* as follows:

- `$args`
- `$is_args`
- `$bytes_sent`
- `$content_type`
- `$http_authorization`
- `$http_connection`
- `$http_host`
- `$http_kong_debug`
- `$http_proxy`
- `$http_proxy_connection`
- `$http_te`
- `$http_upgrade`
- `$http_x_forwarded_for`
- `$http_x_forwarded_host`
- `$http_x_forwarded_path`
- `$http_x_forwarded_port`
- `$http_x_forwarded_prefix`
- `$http_x_forwarded_proto`
- `$https`
- `$http2`
- `$realip_remote_addr`
- `$realip_remote_port`
- `$remote_port`
- `$request_length`
- `$request_method`
- `$request_time`
- `$request_uri`
- `$scheme`
- `$server_addr`
- `$server_port`
- `$ssl_cipher`
- `$ssl_client_raw_cert`
- `$ssl_client_verify`
- `$ssl_protocol`
- `$ssl_server_name`
- `$upstream_http_connection`
- `$upstream_http_trailer`
- `$upstream_http_upgrade`
- `$upstream_status`

See [resty.kong.var.patch\_metatable](#restykongvarpatch_metatable) on how to enable
indexed variable access.

Expand Down

0 comments on commit 4ccf6e0

Please sign in to comment.