How to add expiry header in NGINX?

November 26, 2013 8.3k views
Tried to add this one- location ~* .(js|css|png|jpg|jpeg|gif|ico)$ { expires 30d; log_not_found off; } But it didn't worked,that stopped the server. Any solution?
2 Answers
Are there any errors in the error log file?
sudo tail /var/log/nginx/error.log
Check out the Nginx wiki: ngx_http_headers_module.
Have another answer? Share your knowledge.