Month: June 2017

Serve static content from a cookieless domain in NGINX

1st June 2017

Very simple one to help anyone out there fix the issue regarding serving static content from a cookieless domain in NGINX. This does not require a CDN or sub domain, etc like most tutorials.

It’s simply a few lines of code to add to your host file:

location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js|scss|map|less|woff|woff2|otf|eot|ttf)$ {
   expires     max;
   fastcgi_hide_header "Set-Cookie";
}

(more…)