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";
}
NGINX is becoming more popular every second – and it’s because it’s super fast. In this tutorial I’m going to show you the difference between a 301 and 302 redirect in NGINX and how to implement them. But first, let’s know the difference.