How to add expiry header in NGINX?

Posted November 26, 2013 10.7k 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?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers
Are there any errors in the error log file?
sudo tail /var/log/nginx/error.log