nginx搭建的网站,遇到一些图片404的,打算用默认的404图片,规则怎么写呢?看如下示例:

location /img {
location ~ ^/img/([_-a-zA-Z0-9]*) {
error_page 404 /img/404.jpg;
}
}

规则整理自:http://serverfault.com/questions/630840/nginx-use-rewrite-as-dynamic-404-image

Related Posts: Nginx-404图片设置 :