Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@indikatordesign
Last active December 5, 2022 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indikatordesign/25711ea32abf521ce815347871c542f6 to your computer and use it in GitHub Desktop.
Save indikatordesign/25711ea32abf521ce815347871c542f6 to your computer and use it in GitHub Desktop.
NGINX - Config for Plesk as reverse proxy for WordPress
include mime.types;
types {
application/x-font-ttf ttc ttf;
application/x-font-woff woff;
image/webp webp;
image/x-icon cur ico;
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# Expire rules for static content
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# access_log logs/static.log; # I don't usually include a static log
}
# Feed
location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control "public, no-transform";
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf|ttc|otf|eot|woff|woff2|font.css)$ {
add_header 'Access-Control-Allow-Origin' '*';
expires 365d;
access_log off;
add_header Pragma public;
add_header Cache-Control "public, no-transform";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
add_header 'Access-Control-Allow-Origin' '*';
expires 30d;
access_log off;
add_header Pragma public;
add_header Cache-Control "public, no-transform";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment