AScript is an easy-to-use programmable scripting feature that provides more complex forwarding rule configuration capabilities than the settings available in the Application Load Balancer (ALB) console. This topic describes AScript built-in variables and the corresponding NGINX variables.
Built-in variables
The following table describes the AScript built-in variables.
Built-in variable | Description | NGINX variable |
$arg_{name} | The value of the | ngx.var.arg_{name} Note Hyphens (-) in the |
$http_{name} | The value of the | ngx.var.http_{name} Note Hyphens (-) in the |
$cookie_{name} | The value of the | ngx.var.cookie_{name} Note Hyphens (-) in the |
$scheme | The protocol type. | ngx.var.scheme |
$server_protocol | The version of the protocol. | ngx.var.server_protocol |
$host | The original host. | ngx.var.host |
$uri | The original URI. | ngx.var.raw_uri |
$args |
| ngx.var.args |
$request_method | Indicates the request method. | ngx.var.request_method |
$request_uri | The content of | ngx.var.request_uri |
$remote_addr | The IP address of the client that sends the request. | ngx.var.remote_addr |
The dollar sign (
$) before a variable is used to specify that the variable is a built-in variable. You can remove the dollar sign based on your business requirements.Do not assign values to built-in variables in the same way as parameters.
You can specify at most 200 global variables and an unlimited number of local variables in a script. To specify more than 200 global variables in a script, create a custom function and use the global variables as local variables in the function.