mirror of
https://github.com/netfun2000/docker-php-nginx.git
synced 2026-04-22 00:29:10 +08:00
Add mimetypes to be gzipped based on CloudFlare
This commit is contained in:
@@ -8,6 +8,7 @@ events {
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
# Threat files with a unknown filetype as binary
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Define custom log format to include reponse times
|
||||
@@ -28,7 +29,7 @@ http {
|
||||
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||
scgi_temp_path /tmp/scgi_temp;
|
||||
|
||||
# Hardening
|
||||
# Hide headers that identify the server to prevent information leakage
|
||||
proxy_hide_header X-Powered-By;
|
||||
fastcgi_hide_header X-Powered-By;
|
||||
server_tokens off;
|
||||
@@ -36,7 +37,8 @@ http {
|
||||
# Enable gzip compression by default
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
|
||||
# Based on CloudFlare's recommended settings
|
||||
gzip_types text/richtext text/plain text/css text/x-script text/x-component text/x-java-source text/x-markdown application/javascript application/x-javascript text/javascript text/js image/x-icon image/vnd.microsoft.icon application/x-perl application/x-httpd-cgi text/xml application/xml application/rss+xml application/vnd.api+json application/x-protobuf application/json multipart/bag multipart/mixed application/xhtml+xml font/ttf font/otf font/x-woff image/svg+xml application/vnd.ms-fontobject application/ttf application/x-ttf application/otf application/x-otf application/truetype application/opentype application/x-opentype application/font-woff application/eot application/font application/font-sfnt application/wasm application/javascript-binast application/manifest+json application/ld+json application/graphql+json application/geo+json;
|
||||
gzip_vary on;
|
||||
gzip_disable "msie6";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user