'$arg_{queryParameterName}'
is used to access the value associated with given query parameter
events {
}
http {
server {
listen 9090;
server_name localhost;
location = /welcome {
return 200 "name: $arg_name, \nage: $arg_age";
}
}
}
Validate
and reload the configuration.
$sudo nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
$
$sudo nginx -s reload
Open the
url ‘http://localhost:9090/welcome?name=krishna&age=30’ in browser, you can
see below screen.
No comments:
Post a Comment