What do $1, $2, and $3 in nginx stand for?

王林
Release: 2020-06-29 17:43:40
forward
16762 people have browsed it

What do  src=

Nginx中,set $para $1,$1表示路径中正则表达式匹配的第一个参数。

(推荐学习:nginx教程

以下是一个示例,用以实验$1,$2。如:

location ~/abc/(.*)/(.*) {
 
    set $para1 $1
 
    set $para2 $2
 
    content_by_lua_block {
 
    ngx.say(ngx.var.para1)
 
    ngx.say(ngx.var.para2)
 
    }
 
}
Copy after login

此时,若访问路径为localhost:8080/abc/qwe/asd时,则浏览器会输出。

qwe

asd
Copy after login

The above is the detailed content of What do $1, $2, and $3 in nginx stand for?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template