Nginx does not cache static for subdomains. The pagespeed service shows that the cache is enabled, but when the file changes, the updated code is taken from the server, and not from the browser cache.
Response Headers
Cache-Control: public
Cache-Control: max-age = 2592000
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text / css
Date: Mon, 23 May 2016 12:00:31 GMT
Expires: Wed, 22 Jun 2016 12:00:31 GMT
Last-Modified: Mon, 23 May 2016 11:59:30 GMT
Server: nginx / 1.4.6 (Ubuntu)
Transfer-Encoding: chunked
Vary: Accept-Encoding
Nginx settings
server { listen *:80; listen [::]:80; server_name site.ru; root /home/site/public; index index.php index.html; access_log /var/log/nginx/site.access.log; error_log /var/log/nginx/site.error.log; client_max_body_size 10m; client_body_buffer_size 128k; location / { try_files $uri $uri/ /index.php?$query_string; } if (!-d $request_filename) { rewrite ^/(.+)/$ /$1 permanent; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_read_timeout 30; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } location ~* \.(css)$ { if ($request_uri ~ ^/css(/.+)$) { set $modify_request_uri $1; return 301 $scheme://css.site.ru$modify_request_uri; } } } server { listen *:80; server_name css.site.ru; root /home/site/public/css; access_log /var/log/nginx/css.site.access.log; error_log /var/log/nginx/css.site.error.log; location ~* { add_header Cache-Control public; expires 30d; } } Reply to comment from norbornen
if_modified_since off and hide the Last-Modified header
Response Headers
Cache-Control: max-age = 2592000
Cache-Control: public
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text / css
Date: Mon, 23 May 2016 13:26:54 GMT
Expires: Wed, 22 Jun 2016 13:26:54 GMT
Server: nginx / 1.4.6 (Ubuntu)
Transfer-Encoding: chunked Vary: Accept-Encoding
Still not working.
if_modified_since offand hide the header Last-Modified - nörbörnën