Skip to content

Instantly share code, notes, and snippets.

@nikkanetiya
Last active September 1, 2017 14:55
Show Gist options
  • Save nikkanetiya/fffa68ea0b7d2ea9f08410b3057c71e3 to your computer and use it in GitHub Desktop.
Save nikkanetiya/fffa68ea0b7d2ea9f08410b3057c71e3 to your computer and use it in GitHub Desktop.
Enable Gzip in Nginx Server
cat > /etc/nginx/conf.d/gzip.conf << EOF
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component;
EOF
service nginx restart
service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment