Usage added to readme
This commit is contained in:
parent
d3b9abedc3
commit
586a40fe32
36
README.md
36
README.md
@ -6,4 +6,38 @@ Nginx configuration geared towards hosting WordPress sites. Contains best practi
|
|||||||
* ssl.com - WordPress on HTTPS
|
* ssl.com - WordPress on HTTPS
|
||||||
* fastcgi-cache.com - WordPress with [FastCGI caching](https://deliciousbrains.com/hosting-wordpress-yourself-server-monitoring-caching/#page-cache)
|
* fastcgi-cache.com - WordPress with [FastCGI caching](https://deliciousbrains.com/hosting-wordpress-yourself-server-monitoring-caching/#page-cache)
|
||||||
* multisite-subdomain.com - WordPress Multisite install using subdomains
|
* multisite-subdomain.com - WordPress Multisite install using subdomains
|
||||||
* multisite-subdirectory.com - WordPress Multisite install using subdirectories
|
* multisite-subdirectory.com - WordPress Multisite install using subdirectories
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Backup any existing config:
|
||||||
|
|
||||||
|
`sudo mv /etc/nginx /etc/nginx.backup`
|
||||||
|
|
||||||
|
Clone the repo:
|
||||||
|
|
||||||
|
`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.
|
||||||
|
|
||||||
|
`sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default`
|
||||||
|
|
||||||
|
Copy one of the example configurations from _sites-available_ to _sites-available/yourdomain.com_:
|
||||||
|
|
||||||
|
sudo cp /etc/nginx/sites-available/singlesite.com /etc/nginx/sites-available/yourdomain.com`
|
||||||
|
|
||||||
|
Edit the site accordingly, paying close attention to the server name and paths.
|
||||||
|
|
||||||
|
To enable the site, symlink the configuration into the _sites-enabled_ directory:
|
||||||
|
|
||||||
|
`sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/yourdomain.com`
|
||||||
|
|
||||||
|
Test the configuration:
|
||||||
|
|
||||||
|
`sudo nginx -t`
|
||||||
|
|
||||||
|
If the configuration passes, restart Nginx:
|
||||||
|
|
||||||
|
`sudo /etc/init.d/nginx reload`
|
||||||
Loading…
x
Reference in New Issue
Block a user