Cookie Free Domains

Updated on Mar 13, 2019

Method Type: User
(This means that the method is handled by the user)

Status: Must be applied by the user.


HTTP cookies are small pieces of information send from the web server to the user's browser while the user is browsing a website. They are later send back to the server to notify it about the user's previous activity like login authentication or items added to the shopping cart in the previous user sesson.

How cookie free domain work:

When the user requests a static images from the web server via the web browser cookies are also send but the server doesn't have any use of them. That's why in these cases cookies are considered a performance hit since they have no benefit but can make the HTTP requests take longer to complete. A workaround is to use a subdomain on which to host only the static content for your website. This way that subdomain will become cookie free since your cookies are set on the main website. All of the big content providers such as YouTube and Amazon use cookie free domains to optimize their traffic and loading times.

Using a cookie free domain provides the following Advantages:

  • Less network traffic
  • Decreased loading times on static content

If you wish to configure your own server(VPS/Dedicated) to deliver static content with the help of NGINX from a cookie free domain the first thing you will need to do is to create a cookie free domain.

After that you will have to point the domain to the same server where your main domain is.    A    A

**Where is where your website is and is where your cookie free content will be.

Now you will need to edit the NGINX configuration file (ngix.conf) and add the following code:

server {
        listen ip:80;
        root /srv/http/nginx/;
        access_log      logs/;
        location / {
        index index.html;
        charset   utf-8;



        server {
        listen  ip:80;
        root /srv/http/nginx/;
        location / {
                if ($request_filename ~ "\.(jpg|css|gif|png|swf|ico|mp3)$") {
        return 404;

The last step is to configure the images on your website to load from To do so you will need to include references to the static content.

Initial image:

<img src="/images/testimage.png" />

Referenced image:

<img src="http://" />

Now when there is a request for static content like testimage.png it will be provided by NGINX via

On this page...

    Optimized SSD Web Hosting

    • Free Domain Transfer
    • Google PageSpeed Enabled
    • 24/7 Technical Support
    • Fast SSD Storage
    • Hack-free Protection
    • Free Cloudflare CDN
    • Immediate Activation
    View More