Nginx servers old static files after git commit

cachenginx

I'm using Nginx to serve static files (while also used as a revers proxy for my NodeJS express RestAPI).
The problem is when I push a new git commit to the server, users will still get the old (last revision) files.
The workaround for now is that the user clear his cache in browser.

What could be the reason for this? I guess this is some server side caching misconfiguration?
See below my nginx config (basic + include).

As you can see below, static files (.html, .js, .css) resides under /var/www/frontend

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

listen 80;

server_name **REMOVED_FOR_PRIVACY_REASONS**;

proxy_cache_valid 404 1m;

location / {
        root /var/www/frontend;
        index index.html
        try_files try_files $uri $uri/ =404;

        #proxy_cache backcache;
        #proxy_cache_bypass $http_cache_control;
        #add_header X-Proxy-Cache $upstream_cache_status;
    }

    location /api/ {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

Best Answer

I too think this has to do with client side caching.

I would start debugging this with firebug or something similar, load the page and check the caching headers (etag / last-modified / cache-control / expires).

While we are at this, i found really good this document about HTTP caching:

https://www.mnot.net/cache_docs/

Made from one of the guys that makes the HTTP standard nevertheless.