server{ listen 80; server_name abc.local; index index.html index.htm index.php; root /opt/tool/web; location = /favicon.ico { log_not_found off; access_log off; } location /test {
alias /opt/tool/web/cdn/; } location = /robots.txt { allow all; log_not_found off; access_log off; } include enable-php.conf; location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; }
location ~ .*\.(js|css)?$ {
expires 12h;
}
access_log off;
}
location /test {
alias /opt/tool/web/cdn/; }
换成location ^~ /test {
alias /opt/tool/web/cdn/; }