setting up nginx

Since I’m on a VPS, I decided to up it and switch from Apache2 to Nginx, after all Nginx is so well regarded and fast! Always wanted to try it out.

 

Nginx

Instructions on converting a standard digital ocean wordpress installation to nginx.

https://www.digitalocean.com/community/articles/how-to-migrate-a-wordpress-installation-from-apache-to-nginx-on-an-ubuntu-vps

https://www.digitalocean.com/community/questions/nginx-config-for-enabled-sites-does-not-appear-to-be-taking-effect-any-more

Difficulty level – Simple. Make sure there are no typocs.

Remember to backup and take snapshots before and after major changes.

 

Then Google Pagespeed Insights still seemed to report the server as responding slowly ???? so I decided to enable Varnish. Varnish responds to port 80 and serves cached data unless it needs to pull from Nginx on port 8080. Cool. Was fairly easy to install.

Varnish guide

https://www.digitalocean.com/community/articles/how-to-install-wordpress-nginx-php-and-varnish-on-ubuntu-12-04

Difficulty level – rather simple

 

Google Pagespeed Insights

Analyzes website for mobile and desktop optimizations in terms of speed and usability, eg things like minify js, css, caching.

 

W3 Total Cache

WordPress Plugin that helps to do minifying of js html css, caching. etc. Even interfacing with CDNs if you’re using one. Wow. I had issues with the minify settings, esp the url rewrite.

 

Pingdom speed test

Helps to test the speed of your page load, size, and even charts it out beautifully.

 

Pagespeed

Google Pagespeed itself has a mindbogglingly awesome server level webpage optimization. It does way too many things to list here. But it’s better integrated with Apache which supports modules. Nginx is real tricky as it can’t be easily built in. I tried really long and it’s very un-beginner friendly. I think I got a test copy working but I got tired of trying to replace the default nginx with this, and I will have to manually keep nginx updated in the future. So maybe I will put this aside for now.

Nginx uses ngx_pagespeed which needs to be custom installed with nginx. offical page here:  https://github.com/pagespeed/ngx_pagespeed

Difficulty level – challenging.

 

Useful commands:

$ netstat -tutpln

 

setting up nginx

Leave a Reply

Your email address will not be published. Required fields are marked *