Reflect conf.d change is doc

This commit is contained in:
Léo Colombaro 2019-02-01 15:49:09 +01:00
parent 306af367e9
commit 76be9604e3
3 changed files with 45 additions and 73 deletions

View File

@ -1,17 +0,0 @@
[Nginx Server Configs homepage](https://github.com/h5bp/server-configs-nginx)
| [Documentation table of contents](TOC.md)
# Sites available
Files in this folder are not referenced/loaded automatically. The intended
purpose of this folder is to contain all server config files whether they
are currently in use or not.
So, for example this folder may contain:
example.com
example.com-original
otherdomain.com
newproject.com
Where each file contains the server block(s) specific to that project.

View File

@ -1,39 +0,0 @@
[Nginx Server Configs homepage](https://github.com/h5bp/server-configs-nginx)
| [Documentation table of contents](TOC.md)
# Sites enabled
Files in this folder **are** loaded automatically. The intended purpose of
this folder is to contain symlinks to the folder `sites-available`.
## Enabling a new site
To enable a new site, link the config file to sites-enabled, and restart nginx.
For example:
$ cd /etc/nginx/sites-available
... create newproject.com ...
$ cd /etc/nginx/sites-enabled
$ ln -s ../sites-available/newproject.com .
$ /etc/init.d/nginx reload
[....] Reloading nginx configuration: nginx.
$
## Disabling a site
To disable a site, remove the symlink from the sites-enabled folder, and restart
nginx.
For example:
$ cd /etc/nginx/sites-enabled
$ rm newproject.com
$ /etc/init.d/nginx reload
[....] Reloading nginx configuration: nginx.
$

View File

@ -36,19 +36,18 @@ for a description of the required steps.
## Basic structure ## Basic structure
This repository has the following structure, which is based on the standard install for a This repository has the following structure:
webserver on debian:
``` ```
. ./
├── doc ├── doc/
├── h5bp ├── conf.d/
├── basic.conf │ ├── default.conf
├── location │ └── templates/
└── ... ├── h5bp/
├── sites-available │ ├── basic.conf
└── example.com │ ├── location/
├── sites-enabled │ └── ...
├── mime.types ├── mime.types
└── nginx.conf └── nginx.conf
``` ```
@ -73,15 +72,44 @@ access.
Files in this folder contain one or more location directives. They are intended Files in this folder contain one or more location directives. They are intended
to be loaded in the server context (or, in a nested location block). to be loaded in the server context (or, in a nested location block).
### sites-available ### conf.d
This directory should contain all of the server definitions that are available This directory should contain all of the server definitions.
for use. [About sites-available](sites-available.md).
### sites-enabled Except if they are dot prefixed or non .conf extension, all files in this
folder **are** loaded automatically.
This directory should contain only symlinks to enable a specific `sites-available` * `templates` folder
server. [About sites-enabled](sites-enabled.md).
Files in this folder contain a server{} template for secure and non-secure hosts.
They are intended to be copied in the `conf.d` folder with all `example.com`
occurrences changed to the target host.
#### Usage
```bash
$ cd /etc/nginx/conf.d
```
* Creating a new site
```bash
$ cp templates/example.com.conf actual-hostname.conf
$ sed -i 's/example.com/actual-hostname/g' actual-hostname.conf
```
* Enabling a site
```bash
$ mv .actual-hostname.conf actual-hostname.conf
```
* Disabling a site
```bash
$ mv actual-hostname.conf .actual-hostname.conf
```
```bash
$ /etc/init.d/nginx reload
```
### mime.types ### mime.types