在my /etc/nginx/nginx.conf中
第一个例子:
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/web$2;
index index.html index.htm;
}这意味着如果我访问httpwebsite/~user1 1/它将把web文件夹重定向到/home/user1 1/web
如果我访问httpwebsite/~nextuser/它将重定向到/home/nextuser/web
第二个例子:现在我想对scgi挂载做同样的操作:
location ~ ^/RPC-user1$ {
include scgi_params;
scgi_pass /home/user1/scgi.socket;
}
location ~ ^/RPC-nextuser$ {
include scgi_params;
scgi_pass /home/nextuser/scgi.socket;
}如何像第一个示例一样将这2行代码转换为通配符1行?基本上,向scgi_pass /home/$USERNAME/scgi.socket传递/RPC-$用户名之类的内容。
发布于 2014-01-27 14:38:38
试试这个:
location ~ ^/RPC-(.+)$ {
include scgi_params;
scgi_pass /home/$1/scgi.socket;
}https://stackoverflow.com/questions/21380059
复制相似问题