File: //bigscoots/wpo/nginx/staticfiles.conf
# fc63a428-6359-400b-8e93-21df2a84fbaa
# prepare for letsencrypt
# https://community.centminmod.com/posts/17774/
location ~ /.well-known {
location ~ /.well-known/acme-challenge/(.*) {
more_set_headers "Content-Type: text/plain";
}
}
location ~* \.(jpg|jpeg|png|gif|svg|webp|avif|tiff|ico)$ {
gzip_static on;
#add_header Pragma public;
#add_header X-Frame-Options SAMEORIGIN;
#add_header X-Xss-Protection "1; mode=block" always;
#add_header X-Content-Type-Options "nosniff" always;
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800";
include /root/.bigscoots/nginx/includes/staticfiles_images.conf;
if (-f $document_root/wp-content/bigscoots-cache/$host/cache_disabled) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, max-age=0";
}
break;
}
location ~* \.(3gp|wmv|avi|asf|asx|mpg|mpeg|webm|ogg|ogv|mp4|mkv|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|test|bin|xz|lz|sqlite|jar|db|sqlitedb|war|z|Z|7zip|bak|old|backup|sql|sql\.zip|sql\.tar|sql\.tar\.gz|sql\.tar\.bz2|sql\.tgz|sql\.rar|sql\.7z|tar\.bz2|tar\.bzip2|save|swp|php\.bak|php\.swp|php\.save)$ {
gzip_static off;
sendfile off;
sendfile_max_chunk 1m;
#add_header Pragma public;
#add_header X-Frame-Options SAMEORIGIN;
#add_header X-Xss-Protection "1; mode=block" always;
#add_header X-Content-Type-Options "nosniff" always;
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800";
if (-f $document_root/wp-content/bigscoots-cache/$host/cache_disabled) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, max-age=0";
}
break;
}
location ~* \.(js|json)$ {
#add_header Pragma public;
#add_header X-Frame-Options SAMEORIGIN;
#add_header X-Xss-Protection "1; mode=block" always;
#add_header X-Content-Type-Options "nosniff" always;
#add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800";
#add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, stale-while-revalidate=86400, stale-if-error=604800";
if (-f $document_root/wp-content/bigscoots-cache/$host/cache_disabled) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, max-age=0";
}
break;
}
location ~* \.(css)$ {
#add_header Pragma public;
#add_header X-Frame-Options SAMEORIGIN;
#add_header X-Xss-Protection "1; mode=block" always;
#add_header X-Content-Type-Options "nosniff" always;
#add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800";
if (-f $document_root/wp-content/bigscoots-cache/$host/cache_disabled) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, max-age=0";
}
break;
}
location ~* \.(eot|ttf|woff|woff2|otf)$ {
#add_header Pragma public;
#add_header X-Frame-Options SAMEORIGIN;
#add_header X-Xss-Protection "1; mode=block" always;
#add_header X-Content-Type-Options "nosniff" always;
#add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800";
if (-f $document_root/wp-content/bigscoots-cache/$host/cache_disabled) {
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "private, no-store, no-cache, must-revalidate, max-age=0";
}
break;
}
location ~* /ads.txt {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, max-age=0";
try_files $uri $uri/ /index.php?q=$uri&$args;
}