TYPO free

home

fighting for TYPO free code

Enabling cookie free domains in Nginx

11 Aug 2009

As explained in a previous article, we can save some headers by enabling cookie-free domains. Here is my configuration for Nginx. Only requests for static files should end up on this domain, so we don't put anything fancy in here. The only thing we don't want to send (even by accident) is the Set-Cookie header:

server {
  listen www.s1.typofree.org:80;
  server_name www.s1.typofree.org;

  fastcgi_hide_header Set-Cookie;

  access_log off;

  location / {
    root   /var/www/typofree.org;
    include sites-available/expires.conf;
  }

  location = /clear.gif {
    empty_gif;
    expires max;
  }
} 

For more information please read the other article.

Update19 may 2011, Here is what I would do today:

 

server {
  listen 109.74.192.51;
  server_name www.s1.typofree.org;
  root /var/www/typofree.org;
  expires max;

  try_files $uri $uri/ /clear.gif;

  location = /clear.gif {
    empty_gif;
  }
}

add comment
Commenting is closed for this item