Question

How do I configure comporession with a ghost droplet

Posted December 14, 2013 3.4k views
Am I right in saying that, insetad of using htaccess, i should configure: etc/nginx/nginx.conf file in order to enable compression (gzip or deflate) and other such tweaks that I ma used to doing with htaccess. I am using a droplet pre-configured with the one click ghost blog installation. Many thanks.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer
Yes, that is correct. Nginx does not have the concept of .htaccess files as it degrades performance (see http://wiki.nginx.org/LikeApache-htaccess).

To enable gzip, add this to /etc/nginx/nginx.conf, right after http {:
        gzip  on;

gzip_disable "msie6";
gzip_min_length 1400;
gzip_types text/plain text/css text/javascript text/xml application/x-javascript application/xml application/xml+rss;


Restart nginx:
sudo service nginx restart
Submit an Answer