I have an nginx.conf file currently that looks like this (with brackets replacing sensitive data):
worker_processes 3;
events {
worker_connections 1024;
}
http {
access_log [/...];
error_log [/...] crit;
include mime.types;
sendfile on;
server {
server_name [...] [...];
return 301 [...] $request_uri;
}
server {
listen 127.0.0.1:[...];
root [/...];
location / {
include uwsgi_params;
uwsgi_pass [.../uwsgi.sock];
}
}
}
If I add the following line after the existing location {...} clause, as suggested here, loading the website will produce "404 not found" errors for image, CSS, and js assets:
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 1d;
}
How can I implement browser caching, without causing the "404" issue?