Chevereto 服务器由 Apache 转到了 Nginx,同时启用了 CDN。规则内置限制 CDN 访问动态页面判断。
location ~ images/(.*)$ {
if ($host = "up.chevereto.com"){
rewrite ^/(.*) https://up-img.chevereto.com/$1 redirect;
}
}
location ~ content/(.*)$ {
if ($host = "up.chevereto.com"){
rewrite ^/(.*) https://up-img.chevereto.com/$1 redirect;
}
}
location ~* \.(html|htm)$ {
if ($host = "up-img.chevereto.com") {
return 403;
}
}
# CORS header (avoids font rendering issues)
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}
location ~* (jpe?g|png|gif) {
log_not_found off;
error_page 404 /content/images/system/default/404.gif;
}
# Pretty URLs
location / {
if ($host = "up-img.chevereto.com") {
return 403;
}
try_files $uri $uri/ /index.php?$query_string;
}