2022-10-17 10:22:01 -03:00
# HTTPS
2022-11-05 16:03:29 -03:00
🎉 HTTPS is automatic provided by `nginxproxy/acme-companion` .
## Toggle HTTPS use
Pass option `PROTOCOL=https` to use HTTPS:
```sh
make up-d PROTOCOL=https HOSTNAME=<hostname>
```
## Manual HTTPS
2022-10-28 15:31:32 -03:00
The certificate and private key will be taken from:
2022-10-17 10:22:01 -03:00
2022-10-28 15:31:32 -03:00
| Type | File |
| ----------- | ---------------- |
| Certificate | `https/cert.pem` |
| Private key | `https/key.pem` |
2022-10-17 10:22:01 -03:00
2022-11-05 16:03:29 -03:00
### Create certificate
2022-10-17 10:22:01 -03:00
2022-10-28 15:31:32 -03:00
To create HTTPS certificate:
* Spawn HTTP website (needed for Certbot validation)
* Run Certbot:
2022-10-17 10:22:01 -03:00
```sh
2022-10-17 16:16:44 -03:00
make certbot HOSTNAME=<hostname>
2022-10-17 10:22:01 -03:00
```
2022-10-28 15:31:32 -03:00
The above command uses `certbot/certbot` for providing the files required, it will place generated files at `https/` . Once done, re-spawn website with `PROTOCOL=https` .