Skip to content

Commit 1bd3886

Browse files
committed
v1.0 - see changelog.txt for details
1 parent 3748d66 commit 1bd3886

36 files changed

+349
-955
lines changed

README.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
# WordPress-Nginx
22

3-
WordPress specific Nginx configurations, tweaks, compatibility routines, etc.
3+
WordPress specific Nginx configurations, tweaks, and much more!
4+
5+
## Advantages
6+
7+
There are multiplpe advantages of using this repo as your go-to nginx configuration.
8+
9+
+ Contains ready-to-use sample vhost entries to be used with WP Super Cache plugin (with SSL), WP Rocket cache plugin, etc.
10+
+ Uses best practices (ex: you can find the correct use 'if' statement here).
11+
+ Continuously updated sample configurations and best practices.
412

513
## Compatibility
614

715
Tested with
816
+ Debian Debian 9.x (upcoming version)
9-
+ Ubuntu 16.04.x
17+
+ Ubuntu 16.04 LTS
1018

11-
For Fedora, Redhat, CentOS and Amazon Linux AMI or similar distributions, please look at the [CentOS branch](https://github.com/pothi/WordPress-Nginx/tree/centos "WordPress-Nginx configuration for Amazon Linux AMI, Fedora, Redhat and CentOS based distributions").
19+
For Fedora, Redhat, CentOS and Amazon Linux AMI or similar distributions, the configuration mentioned in the repo should work. Additional steps may be needed, though. See below for some details!
1220

1321
## How to Install
1422

@@ -24,15 +32,24 @@ As __sudo or root__, please use the following guidelines...
2432
```bash
2533
git clone git://github.com/pothi/wordpress-nginx.git $HOME/git/wordpress-nginx
2634
cd $HOME/git/wordpress-nginx
27-
# git checkout centos
35+
2836
cp -a $HOME/git/wordpress-nginx/{conf.d, globals, errors, sites-available} /etc/nginx/
29-
rm /etc/nginx/sites-enabled/domainname.conf
37+
mkdir /etc/nginx/sites-enabled &> /dev/null
38+
cp /etc/nginx/nginx-sample.conf /etc/nginx/nginx.conf
39+
3040
# Other steps that depends on your particular requirement:
31-
# YOUR_DOMAIN_NAME=tinywp.com
32-
# mv /etc/nginx/sites-available/domainname.conf /etc/nginx/sites-available/$YOUR_DOMAIN_NAME.conf
41+
42+
# one-off process
43+
# edit /etc/nginx/conf.d/lb.conf and update the upstream block for 'fpm'
44+
45+
# you may do the following for each vhost
46+
# WP_DOMAIN=example.com
47+
# YOUR_USERNAME=your_linux_username
48+
# cp /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-available/$WP_DOMAIN.conf
3349
# cd /etc/nginx/sites-enabled/
34-
# ln -s ../sites-available/$YOUR_DOMAIN_NAME.conf
35-
# sed -i --follow-symlinks 's/domainname.com/'$YOUR_DOMAIN_NAME'/g' /etc/nginx/sites-enabled/$YOUR_DOMAIN_NAME.conf
50+
# ln -s ../sites-available/$WP_DOMAIN.conf
51+
# sed -i --follow-symlinks 's/example.com/'$WP_DOMAIN'/g' /etc/nginx/sites-enabled/$WP_DOMAIN.conf
52+
# sed -i --follow-symlinks 's/username/'$YOUR_USERNAME'/g' /etc/nginx/sites-enabled/$WP_DOMAIN.conf
3653
# nginx -t && service nginx restart
3754
```
3855

@@ -51,4 +68,4 @@ CentOS has a different file naming convention, yet simple directory structure, w
5168
+ Patches, improvements, and suggestions are welcomed.
5269
+ Please use contact form at https://www.tinywp.in/contact/ , if you'd like to contact Pothi Kalimuthu for other reasons.
5370
+ I'm available for hire to setup, tweak or troubleshoot your server to provide *the fastest WordPress hosting*.
54-
+ Thanks for having a look here. Have a good time!
71+
+ Thanks for checking it out. Have a good time!

blacklist.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# please use the following format...
2+
# deny ip.add.re.ss;
3+
# both ipv4 and ipv6 addresses can be blacklisted
4+
# CIDR notation is allowed too
5+
6+
7+
# deny ip.add.re.ss1;
8+
# deny ip.add.re.ss2;
9+
# deny ip.add.re.ss3;

changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
v1.0
2+
- released on April 23, 2017
3+
- uniform naming scheme for domain names
4+
- uniform naming scheme for default files
5+
- introduction of blacklist and whitelist for IP addresses
6+
- fix tab/space conflict; now we use only spaces
7+
- enable gzip by default

conf.d/gzip.conf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
### Assuming gzip is not "on" in nginx.conf
2-
31
##
42
# Gzip Settings
53
##
64

7-
# gzip_static off;
8-
95
# uncomment the following, if your nginx.conf already doesn't have it turned on
106
# gzip on;
7+
118
gzip_disable "msie6";
129

1310
gzip_vary on;

conf.nginx

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)