WordPress/nginx
Appearance
This page will explain how I configured nginx for my WordPress sites.
My configuration prior to migrating to nginx was built on two servers as following:
Before | After |
---|---|
Installing needed components[edit | edit source]
yum -y install nginx php-fpm
php-fpm[edit | edit source]
We will be using socket to connect to php-fpm, so you will need to change the default configuration to create a socket opposed to TCP.
vim /etc/php-fpm.d/www.conf
Around line 12, change listen from 127.0.0.1:9000 to /var/run/php-fpm.socket so it looks like:
listen = /var/run/php-fpm.socket
Then around line 39, change the user and group to nginx
user = nginx group = nginx
Then start it:
chkconfig php-fpm on service php-fpm start