Skip to content

Instantly share code, notes, and snippets.

@dcnl1980
Last active September 17, 2021 02:48
Show Gist options
  • Save dcnl1980/1f33a174569a425a5e92e2a4e776daba to your computer and use it in GitHub Desktop.
Save dcnl1980/1f33a174569a425a5e92e2a4e776daba to your computer and use it in GitHub Desktop.
Nginx Cookieless Domain
#
# Name: nginx-cookieless.conf
# Auth: Chris van Steenbergen <[email protected]>
# Date: 12 August 2016
# Desc: Nginx Cookieless Domain configuration for 100% performance grade with
#
# See for yourself at: https://tools.pingdom.com/#!/beJG0v/http://www.reclick.nl
#
server {
listen *:80;
listen [::]:80;
server_name static.reclick.nl;
log_not_found off;
error_log off;
fastcgi_hide_header Set-Cookie;
root /srv/www/laravel5/public;
location / {
if ($request_filename ~ "\.(css|js|jpg|jpeg|gif|ico|png|bmp|pict|csv|doc|pdf|pls|ppt|tif|tiff|eps|ejs|swf|midi|mid|ttf|eot|woff|otf|svg|svgz|webp|docx|xlsx|xls|pptx|ps|class|jar|woff2|less|scss)$") {
add_header Pragma "public";
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
add_header Access-Control-Allow-Origin *;
access_log off;
expires 1M;
break;
}
return 302 http://www.reclick.nl$request_uri;
}
@iShariefi
Copy link

Where do I upload this?

@sajumani
Copy link

sajumani commented Jan 8, 2019

fastcgi_hide_header Set-Cookie;

It's resolved in https://gtmetrix.com for my domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment