Skip to content

Commit

Permalink
Remove outdated docs and fix repo structure
Browse files Browse the repository at this point in the history
Trying to make maintenance as easier as we can
  • Loading branch information
LeoColomb committed Feb 4, 2019
1 parent 76be960 commit 8919496
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 292 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/logs/
/sites-enabled/*
!/sites-enabled/.gitkeep
/conf.d/*.conf
!/conf.d/.default.conf
!/conf.d/no-ssl.default.conf
123 changes: 119 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,126 @@ ensuring that resources are served with the correct content-type and are
accessible, if needed, even cross-domain.


## Documentation
## Getting Started

The [documentation](doc/TOC.md) is bundled with
the project, which makes it readily available for offline reading and provides a
useful starting point for any documentation you want to write about your project.
* [Nginx Beginners Guide](https://nginx.org/en/docs/beginners_guide.html)
* [Nginx Request Processing](https://nginx.org/en/docs/http/request_processing.html)
* [How Nginx works](docs/getting-started.md) — Understanding nginx, and how it differs from other webservers.

### Basic structure

This repository has the following structure:

```
./
├── conf.d/
│ ├── default.conf
│ └── templates/
├── h5bp/
│ ├── basic.conf
│ ├── location/
│ └── .../
├── mime.types
└── nginx.conf
```

* **`conf.d/`**

This directory should contain all of the server definitions.

Except if they are dot prefixed or non .conf extension, all files in this
folder **are** loaded automatically.

* **`templates` folder**

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.

* **`h5bp/`**

This directory contains config snippets (mixins) to be included as desired.

There are two types of config files provided, individual config snippets and
combined config files which provide convenient defaults.

* **`basic.conf`**

This file loads a small subset of the rules provided by this repository to add
expires headers, allow cross domain fonts and protect system files from web
access.

* **`location/`**

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


* **`mime.types`**

The mime.types file is responsible for mapping file extensions to mime types.

* **`nginx.conf`**

The main nginx config file.

### Other resources

* [Troubleshooting](docs/troubleshooting.md) — Dealing with commonly-encountered errors.
* [Hotlink protection](docs/hotlink-protection.md)


## Usage

### As a reference

To use as reference requires no special installation steps, download/checkout the
repository to a convenient location and adapt your existing nginx configuration
incorporating the desired functionality from this repository.

### Directly

To use directly, replace the nginx config directory with this repository. for example:

```shell
nginx stop
cd /etc
mv nginx nginx-previous
git clone https://github.com/h5bp/server-configs-nginx.git nginx
# install-specific edits
nginx start
```

### Manage sites

```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
$ nginx reload
```


## Support

* Nginx v**1.6.0**+


## Contributing
Expand Down
22 changes: 0 additions & 22 deletions doc/TOC.md

This file was deleted.

66 changes: 0 additions & 66 deletions doc/how-nginx-works.md

This file was deleted.

55 changes: 0 additions & 55 deletions doc/nginx-conf.md

This file was deleted.

Loading

0 comments on commit 8919496

Please sign in to comment.