我希望这会起作用,但是即使其中一个位置块已匹配,最后一行也会起作用。
server {
listen 80;
server_name a.mydomain.com;
location /f/ {
alias /var/www/sites/mydomain/photos/;
expires 1y;
}
location /img/ {
alias /var/www/sites/mydomain/http/img/;
expires 1y;
}
location /css/ {
alias /var/www/sites/mydomain/http/css/;
expires 1y;
}
location /fonts/ {
alias /var/www/sites/mydomain/http/fonts/;
expires 1y;
}
return 301 http://www.mydomain.com$request_uri;
}
我怎么能重写它来做我想做的事?