Nginx-more :: Get HTTP/2 with ALPN, PageSpeed, ModSecurity, GeoIP2 and much more in one single package

nginx-more with HTTP/2 diagram ©

What is nginx-more?

I use at first to manually compile nginx from source every time a customer wanted to switch from Apache to Nginx (LAMP to LEMP) to get decent performance for their websites. It was time-consuming to deploy and maintain so I decided to create a package (rpm) for CentOS 6 & 7. I added more to its name as it includes third party modules. With this package, I’m able to setup a LEMP server in few minutes with easy vhosts configuration. I can also deploy a new module on all customer’s server by simply pushing a new package update to the repository.

Nginx-more was originally based on nginx release 1.6. It doesn’t have any dependencies on any packages not included by CentOS base and it won’t break anything because it will conflict if nginx is already installed on your system. It’s also fully compatible with Nginx Amplify and it’s in production on many websites since 2014. Among them, some high traffic websites such as:

The package changelog is available for CentOS 6 and CentOS 7. It’s updated frequently as you can see. A new build is created when a new nginx version is released or when a CVE is discovered and needs patching. The new package is usually in the testing repository for a week before being pushed to stable.

What is the difference between nginx and nginx-more?

This module list is updated over time. You can see the development of nginx-more package on Github.

Getting started

CentOS 6 > yum -y install https://repo.aerisnetwork.com/pub/aeris-release-6.rpmCentOS 7 > yum -y install https://repo.aerisnetwork.com/pub/aeris-release-7.rpm

Once the repository is configured, you can proceed with installing nginx-more. You can install it directly with the rpm or use Aeris repository:

#> yum install nginx-more 

All configurations will be installed in default directory which is /etc/nginx/. The package already includes a bunch of PHP-FPM configurations in conf.d/custom/ for WordPress, Laravel, Drupal, OpenCart and PrestaShop, so you can get started in few seconds with your website hosting.

Clean vhost exemple for WordPress:

server {
listen 127.0.0.1:443 ssl http2;
server_name exemple.com;
root /home/www/exemple.com/public_html;
access_log /var/log/nginx/exemple.com-access_log main;
error_log /var/log/nginx/exemple.com-access_log warn;
include conf.d/custom/restrictions.conf;
include conf.d/custom/pagespeed.conf;
include conf.d/custom/fpm-wordpress.conf;
}

All nginx-more builds are kept in the repository. If you upgrade to a newest version and it has any issues that you do not have time to troubleshoot by looking at the nginx error_log, you can downgrade to an older version with yum:

#> yum downgrade nginx-more

You can also switch to regular nginx package from EPEL or Nginx with a simple yum command (swap or yum replace plugin):

#> yum swap nginx-more nginx

How to enable HTTP/2 with ALPN and confirm that it works

listen 127.0.0.1:443 ssl spdy;
to
listen 127.0.0.1:443 ssl http2;

To convert multiple vhosts (be careful with this):

#> sed -i ‘s/ssl\ spdy/ssl\ http2/g’ /etc/nginx/conf.d/vhosts/*.conf

SPDY replacement is the main reason why nginx-more/1.10.0 will be in the testing repository longer time then usual so users can convert to HTTP/2 without any issues. New users aren’t affected as they will start right away with HTTP/2. To upgrade nginx-more while it’s still in testing repo:

#> yum --enablerepo=aeris-testing update nginx-more

A simple way to confirm that your website actually use HTTP/2 is to open the powerful Chrome inspector and verify the Network tab, see below.

Chrome inspector screenshot to confirm HTTP/2 protocol

What nginx-more looks like installed

nginx-more 1.10.0 screenshot

Package maintainer and Feedbacks

Please provides any feedbacks if you use this package. I also accept module or feature request to add more customization or enhancements to nginx-more. However, it will be accepted only if it doesn’t cause any compatibility or instability issue.

I'm an IT architect involved in the hosting business. I spend my free time doing R&D, security, packaging rpms and work on startups!

I'm an IT architect involved in the hosting business. I spend my free time doing R&D, security, packaging rpms and work on startups!