Updated readme to remove references to repo

This commit is contained in:
Ashley Rich 2020-05-01 12:10:56 +01:00
parent 104cad1c6a
commit 3482ef759d

View File

@ -1,6 +1,6 @@
# WordPress Nginx # WordPress Nginx
This repository contains the Nginx configurations used within the series [Hosting WordPress Yourself](https://deliciousbrains.com/hosting-wordpress-setup-secure-virtual-server/). It contains best practices from various sources, including the [WordPress Codex](https://codex.wordpress.org/Nginx) and [H5BP](https://github.com/h5bp/server-configs-nginx). The following example sites are included: This config kit contains the Nginx configurations used within the series [Install WordPress on Ubuntu 18.04](https://spinupwp.com/hosting-wordpress-yourself-ssl-spdy/). It contains best practices from various sources, including the [WordPress Codex](https://codex.wordpress.org/Nginx) and [H5BP](https://github.com/h5bp/server-configs-nginx). The following example sites are included:
* [multisite-subdirectory.com](sites-available/multisite-subdirectory.com) - WordPress multisite install using subdirectories * [multisite-subdirectory.com](sites-available/multisite-subdirectory.com) - WordPress multisite install using subdirectories
* [multisite-subdomain.com](sites-available/multisite-subdomain.com) - WordPress multisite install using subdomains * [multisite-subdomain.com](sites-available/multisite-subdomain.com) - WordPress multisite install using subdomains
@ -10,24 +10,6 @@ This repository contains the Nginx configurations used within the series [Hostin
## Usage ## Usage
### PHP configuration
The php-fpm pool configuration is located in `global/php-pool.conf` and defaults to PHP 7.4. It will need modifying if you want the default php-fpm pool service to be a different PHP version. Additional PHP version upstream definitions can be added to the `/upstreams` folder (a PHP 7.3 sample is provided there). You can either use the default pool using `$upstream` in your nginx configurations or the specific upstream definition (i.e. php73, php72) setup by your custom upstream definitions.
For example, currently the nginx configuration for `single-site.com` has the following set for php requests:
```
fastcgi_pass $upstream
```
You could change that to the following to use the php 7.3 PHP service instead (assuming that php7.3-fpm service is running).
```
fastcgi_pass php73
```
This effectively allows you to have different server blocks execute different versions of PHP if needed.
### Site configuration ### Site configuration
You can use these sample configurations as reference or directly by replacing your existing nginx directory. Follow the steps below to replace your existing nginx configuration. You can use these sample configurations as reference or directly by replacing your existing nginx directory. Follow the steps below to replace your existing nginx configuration.
@ -36,9 +18,7 @@ Backup any existing config:
`sudo mv /etc/nginx /etc/nginx.backup` `sudo mv /etc/nginx /etc/nginx.backup`
Clone the repo: Copy these configs to `/etc/nginx`.
`sudo git clone https://github.com/A5hleyRich/wordpress-nginx.git /etc/nginx`
Symlink the default file from _sites-available_ to _sites-enabled_, which will setup a catch-all server block. This will ensure unrecognised domains return a 444 response. Symlink the default file from _sites-available_ to _sites-enabled_, which will setup a catch-all server block. This will ensure unrecognised domains return a 444 response.
@ -60,11 +40,30 @@ Test the configuration:
If the configuration passes, restart Nginx: If the configuration passes, restart Nginx:
`sudo /etc/init.d/nginx reload` `sudo service nginx reload`
### PHP configuration
The php-fpm pool configuration is located in `global/php-pool.conf` and defaults to PHP 7.4. It will need modifying if you want the default php-fpm pool service to be a different PHP version. Additional PHP version upstream definitions can be added to the `/upstreams` folder (a PHP 7.3 sample is provided there). You can either use the default pool using `$upstream` in your nginx configurations or the specific upstream definition (i.e. php73, php72) setup by your custom upstream definitions.
For example, currently the nginx configuration for `single-site.com` has the following set for php requests:
```
fastcgi_pass $upstream
```
You could change that to the following to use the php 7.3 PHP service instead (assuming that php7.3-fpm service is running).
```
fastcgi_pass php73
```
This effectively allows you to have different server blocks execute different versions of PHP if needed.
## Directory Structure ## Directory Structure
This repository has the following structure, which is based on the conventions used by a default Nginx install on Debian: This config kit has the following structure, which is based on the conventions used by a default Nginx install on Debian:
``` ```
. .
@ -87,7 +86,7 @@ __sites-enabled__ - symlinks to configurations within the `sites-available` dire
### Recommended Site Structure ### Recommended Site Structure
The following site structure is used throughout this repository: The following site structure is used throughout these configs:
``` ```
. .