URL: https://linuxfr.org/forums/linux-general/posts/reseau-passer-du-https-a-un-conteneur-docker
Title: Réseau : Passer du HTTPS à un conteneur Docker
Authors: reynum
Date: 2018年10月10日T14:38:19+02:00
License: CC By-SA
Tags: docker, apache2, nginx, proxy, https et firefox
Score: 0
Bonjour,
Suite à mon problème que j'ai résolu grâce à [ce post](https://linuxfr.org/forums/linux-general/posts/wordpress-et-docker) j'ai voulu passer à niveau supérieur, le https.
Du coup naturellement j'ai généré des certificats avec le script [deshydrated](https://github.com/lukas2511/dehydrated) dans le conteneur Docker et ensuite j'ai appliqué la même recette qu'en http côté Nginx (proxy)
```shell
server {
listen 443;
server_name nextcloud.reynum.eu;
location / {
proxy_pass http://nextcloud.reynum.eu:6443;
#proxy_redirect http://nextcloud.reynum.eu:6443/ https://nextcloud.reynum.eu;
proxy_set_header Host $host;
}
}
```
Et du côté conteneur Docker et apache
```shell
Alias /nextcloud /var/www/nextcloud/
Alias /.well-known/acme-challenge /var/www/dehydrated
ServerName nextcloud.reynum.eu