Nginx location regex is not matching
- by shtuff.it
The following has been working to cache css and js for me:
location ~ "^(.*)\.(min.)?(css|js)$" {
expires max;
}
results:
$ curl -I http://mysite.com/test.css
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 16 Jan 2014 18:55:28 GMT
Content-Type: text/css
Content-Length: 19578
Last-Modified: Mon, 13 Jan 2014 18:54:53 GMT
Connection: keep-alive…