Skip to content

Commit

Permalink
v1.0 - see changelog.txt for details
Browse files Browse the repository at this point in the history
  • Loading branch information
pothi committed Apr 23, 2017
1 parent 3748d66 commit 1bd3886
Show file tree
Hide file tree
Showing 36 changed files with 349 additions and 955 deletions.
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# WordPress-Nginx

WordPress specific Nginx configurations, tweaks, compatibility routines, etc.
WordPress specific Nginx configurations, tweaks, and much more!

## Advantages

There are multiplpe advantages of using this repo as your go-to nginx configuration.

+ Contains ready-to-use sample vhost entries to be used with WP Super Cache plugin (with SSL), WP Rocket cache plugin, etc.
+ Uses best practices (ex: you can find the correct use 'if' statement here).
+ Continuously updated sample configurations and best practices.

## Compatibility

Tested with
+ Debian Debian 9.x (upcoming version)
+ Ubuntu 16.04.x
+ Ubuntu 16.04 LTS

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").
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!

## How to Install

Expand All @@ -24,15 +32,24 @@ As __sudo or root__, please use the following guidelines...
```bash
git clone git://github.com/pothi/wordpress-nginx.git $HOME/git/wordpress-nginx
cd $HOME/git/wordpress-nginx
# git checkout centos

cp -a $HOME/git/wordpress-nginx/{conf.d, globals, errors, sites-available} /etc/nginx/
rm /etc/nginx/sites-enabled/domainname.conf
mkdir /etc/nginx/sites-enabled &> /dev/null
cp /etc/nginx/nginx-sample.conf /etc/nginx/nginx.conf

# Other steps that depends on your particular requirement:
# YOUR_DOMAIN_NAME=tinywp.com
# mv /etc/nginx/sites-available/domainname.conf /etc/nginx/sites-available/$YOUR_DOMAIN_NAME.conf

# one-off process
# edit /etc/nginx/conf.d/lb.conf and update the upstream block for 'fpm'

# you may do the following for each vhost
# WP_DOMAIN=example.com
# YOUR_USERNAME=your_linux_username
# cp /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-available/$WP_DOMAIN.conf
# cd /etc/nginx/sites-enabled/
# ln -s ../sites-available/$YOUR_DOMAIN_NAME.conf
# sed -i --follow-symlinks 's/domainname.com/'$YOUR_DOMAIN_NAME'/g' /etc/nginx/sites-enabled/$YOUR_DOMAIN_NAME.conf
# ln -s ../sites-available/$WP_DOMAIN.conf
# sed -i --follow-symlinks 's/example.com/'$WP_DOMAIN'/g' /etc/nginx/sites-enabled/$WP_DOMAIN.conf
# sed -i --follow-symlinks 's/username/'$YOUR_USERNAME'/g' /etc/nginx/sites-enabled/$WP_DOMAIN.conf
# nginx -t && service nginx restart
```

Expand All @@ -51,4 +68,4 @@ CentOS has a different file naming convention, yet simple directory structure, w
+ Patches, improvements, and suggestions are welcomed.
+ Please use contact form at https://www.tinywp.in/contact/ , if you'd like to contact Pothi Kalimuthu for other reasons.
+ I'm available for hire to setup, tweak or troubleshoot your server to provide *the fastest WordPress hosting*.
+ Thanks for having a look here. Have a good time!
+ Thanks for checking it out. Have a good time!
9 changes: 9 additions & 0 deletions blacklist.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# please use the following format...
# deny ip.add.re.ss;
# both ipv4 and ipv6 addresses can be blacklisted
# CIDR notation is allowed too


# deny ip.add.re.ss1;
# deny ip.add.re.ss2;
# deny ip.add.re.ss3;
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
v1.0
- released on April 23, 2017
- uniform naming scheme for domain names
- uniform naming scheme for default files
- introduction of blacklist and whitelist for IP addresses
- fix tab/space conflict; now we use only spaces
- enable gzip by default
5 changes: 1 addition & 4 deletions conf.d/gzip.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
### Assuming gzip is not "on" in nginx.conf

##
# Gzip Settings
##

# gzip_static off;

# uncomment the following, if your nginx.conf already doesn't have it turned on
# gzip on;

gzip_disable "msie6";

gzip_vary on;
Expand Down
9 changes: 0 additions & 9 deletions conf.nginx

This file was deleted.

Loading

0 comments on commit 1bd3886

Please sign in to comment.