NGINX

Serve static content from a cookieless domain in NGINX

1st June 2017

Very simple one to help anyone out there fix the issue regarding serving static content from a cookieless domain in NGINX. This does not require a CDN or sub domain, etc like most tutorials.

It’s simply a few lines of code to add to your host file:

location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js|scss|map|less|woff|woff2|otf|eot|ttf)$ {
   expires     max;
   fastcgi_hide_header "Set-Cookie";
}

(more…)

Redirect HTTP to HTTPS in VestaCP with NGINX

14th March 2017

Very simple trick here, but has a few people at a road block. If you’re running NGINX on VestaCP then the following will redirect all HTTP traffic to HTTPS traffic. Just make sure you’ve got a SSL certificate set-up and working. (more…)

VestaCP Server Installer – The Perfect Server

5th October 2016

NOW WORKS WITH THE NEW VERSION 0.9.8-20! 🙂

Please upgrade to VestaCP release 20. A security flaw currently affecting servers is present in release < 20. If upgrade is not yet available, please patch

I decided to create the perfect VestaCP server installer script (in my opinion) for CentOS 7 (I have only tried it on CentOS 7). Basically, you run it, it asks a few questions and then it sets up a perfect server including CSF, Monit and PHP 7 (if you want it). Amazing, right?

(more…)

Stronger Security SSL/HTTPS in NGINX VestaCP

12th May 2016

Security is paramount these days and visitors to your website want to know their browsing and transmission of data is 100% safe. How do you test this? At Quality SSL Labs of course! It’s time to secure your NGINX install once-and-for-all.

As of today, my blog is running Let’s Encrypt – the absolutely free SSL Certificate authority and my rating is A+ (I’m OK with that!) at Quality SSL Labs. Before with a default install of NGINX and VestaCP my rating was B.
(more…)

Remove trailing slashes in NGINX & WordPress

12th May 2016

If you hate those trailing slashes or perhaps you’re just a fan of good SEO practices then you’ll probably want to remove the trailing slashes from your WordPress installation and edit your NGINX configuration to make sure anything WITH a trailing slash is sent permanently (301 redirect) to the page without a slash. (more…)

How to install ngx_pagespeed with NGINX in VestaCP

12th May 2016

This tutorial for ngx_pagespeed has only been tested with Debian 7. I will provide the alternate commands for RedHat, CentOS, or Fedora but I have not tested this.

I first installed and compired NGINX from source BEFORE removing the packages incase I hit any problems, then issued the commands AGAIN to confirm it was all working. As usual – take backups! (more…)

Redirect in NGINX: 301 & 302

12th May 2016

NGINX Logo for RedirectNGINX is becoming more popular every second – and it’s because it’s super fast. In this tutorial I’m going to show you the difference between a 301 and 302 redirect in NGINX and how to implement them. But first, let’s know the difference.

301 redirects are what is known as permanent redirects. This tells search engines that the old page has been moved permanently. (more…)