I use nginx in my new project. I have a problem with nginx cache. Thant when I change static files, nginx load old files from cache. I use some command in nginx setting, but not work good.
nginx setup:
server { # frontend
listen 80;
server_name salary.iais.co;
access_log /var/log/nginx/salary.access.log;
root /home/mgh/salary/salary-client;
index /home/mgh/salary/salary-client/index.html;
sendfile off;
open_file_cache off;
# serve static files
location ~ ^/(assets)/ {
root /home/mgh/salary/salary-client;
expires off;
sendfile off;
open_file_cache off;
}
location / {
#proxy_pass http://127.0.0.1:3000/;
try_files $uri /index.html
expires off;
sendfile off;
open_file_cache off;
}
}
I use below command,
sendfile off;
open_file_cache off;
but not work well. I have too clear browser history to load new static files (like html, javascript and ...).