Update README.md with SSL configuration

This commit is contained in:
Javier J. Salmerón-García 2016-11-11 17:28:19 +01:00 committed by GitHub
parent 68127b06bb
commit 1e927ff8f5
1 changed files with 40 additions and 0 deletions

View File

@ -119,6 +119,46 @@ services:
volumes:
- /path/to/nginx-persistence/vhosts:/bitnami/nginx/conf/vhosts
```
## Using custom SSL certificates
*NOTE:* The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your server.
This container comes with SSL support already pre-configured and with a dummy certificate in place (`server.crt` and `server.key` files in `/bitnami/nginx/conf/bitnami/certs`). If you want to use your own certificate (`.crt`) and certificate key (`.key`) files, follow the steps below:
### Step 1: Prepare your certificate files
In your local computer, create a folder called `certs` and put your certificates files. Make sure you rename both files to `server.crt` and `server.key` respectively:
```
mkdir /path/to/nginx-persistence/conf/bitnami/certs -p
cp /path/to/certfile.crt /path/to/nginx-persistence/conf/bitnami/certs/server.crt
cp /path/to/keyfile.key /path/to/nginx-persistence/conf/bitnami/certs/server.key
```
### Step 2: Run the Nginx image
Run the Nginx image, mounting the certificates directory from your host.
```
docker run --name nginx \
-v /path/to/nginx-persistence/conf/bitnami/certs:/bitnami/nginx/conf/bitnami/certs \
bitnami/nginx:latest
```
or using Docker Compose:
```
version: '2'
services:
nginx:
image: 'bitnami/nginx:latest'
ports:
- '80:80'
- '443:443'
volumes:
- /path/to/nginx-persistence/conf/bitnami/certs:/bitnami/nginx/conf/bitnami/certs
```
## Full configuration