基本上服务器实例正在
运行somesite.com/production/folder/here?param=here&count=1
我想将someite.com/demo
指向/production/folder/here
,因此当用户输入somesite.com/production/demo?param=here
时,它无需重定向到/production/folder/here
答案 0 :(得分:59)
server {
server_name example.com;
root /path/to/root;
location / {
# bla bla
}
location /demo {
alias /path/to/root/production/folder/here;
}
}
如果您需要在try_files
内使用/demo
,则需要将alias
替换为root
,并因错误explained here而重写