Top Nav

Archive | Nginx

CentOS / Nginx / PHP-FPM / WordPress

Some quick notes on building a CentOS server with Nginx, PHP-FPM and WordPress.

First here’s great tutorial that covers the different Fedura / CentOS / RedHat versions:

To support WordPress I added the following line  into /etc/nginx/sites-enabled/



ServerAlias On Nginx

On Apache web servers, each virtual host has a “ServerName” directive and zero or more “ServerAlias” directives. When converting to Nginx there is only one directive – “server_name” which takes the place of both of the Apache directives. The “server_name” directive takes a set of space delimited arguments listing domains that should match the virtual host. So for example if you have this Apache config:

Then for Nginx use:

This is a simple example for full details see this page in the Nginx documentation:


Canonical Rewrite Rule For Nginx

Need to redirect from to with nginx? No problem … just add a virtual host declaration for the non-www that redirects like this:

or if you want to add to an existing vhost: