最近在看nginx,但是不太清楚alias的用途具体有什么用?root和rewrite都可以实现它,为什么还要使用alias呢?
root /data/mydomain/main/web/;
location ~* ^/app(|/)$ {
#alias /data/mydomain/main/public/app/;
rewrite ^/app(|/)$ /public/app/ last;
expires 30s;
}
上面的配置中,rewrite生效了达到我的预期。但是alias这个就出现了问题。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
人生最曼妙的风景,竟是内心的淡定与从容!