the domain name of the website is www.example.com
, and the static resource JS,CSS, images are listed in js.example.com
, css.example.com
, and img.example.com
. Baidu statistics is installed on the website, and it is found that the domain name of static resources also has an occasional cookie, of Baidu statistics. I would like to ask how to delete the Cookie? for static resources
this is how I set it on the nginx server:
CSS:
server {
listen 443 ssl http2;
server_name css.example.com;
access_log off;
index index.html index.htm index.php;
root /alidata1/web/css.example.com/css;
ssl on;
ssl_stapling on;
...
location ~ .*\.(js|css)?$ {
expires 360d;
add_header Set-Cookie "UM_distinctid=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Set-Cookie "Hm_lpvt_6188cc7a9315dbe7155a5b2c9ecceasdas03=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Set-Cookie "Hm_lvt_6188cc7a9315dbe7155a5b2c9ecceasdas03=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Cache-Control max-age=31104000;
access_log off;
}
JS:
server {
listen 443 ssl http2;
server_name js.example.com;
access_log off;
index index.html index.htm index.php;
root /alidata1/web/js.example.com/js;
ssl on;
ssl_stapling on;
...
location ~ .*\.(js|css)?$ {
expires 360d;
add_header Set-Cookie "UM_distinctid=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Set-Cookie "Hm_lpvt_6188cc7a9315dbe7155a5b2c9ecceasdas03=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Set-Cookie "Hm_lvt_6188cc7a9315dbe7155a5b2c9ecceasdas03=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Cache-Control max-age=31104000;
access_log off;
}
img:
server {
listen 443 ssl http2;
server_name img.example.com;
access_log off;
index index.html index.htm index.php;
root /alidata1/web/img.example.com/img;
ssl on;
ssl_stapling on;
...
location ~ .*\.(webm|webp|gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 360d;
add_header Set-Cookie "UM_distinctid=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Set-Cookie "Hm_lpvt_6188cc7a9315dbe7155a5b2c9ecceasdas03=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Set-Cookie "Hm_lvt_6188cc7a9315dbe7155a5b2c9ecceasdas03=deleted;expires=Thu, 01 Jan 1970 00:00:00 GMT";
add_header Cache-Control max-age=31104000;
access_log off;
}
found no effect