mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
feat(v2): add support for key,cert in https (#3594)
* fix: add support for key,cert in https * docs: add steps for using https with docusaurus * improve https certs docs * typo * local https: add mkcert -install step Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
c91027f2fa
commit
92884431d1
3 changed files with 80 additions and 2 deletions
|
@ -57,6 +57,22 @@ Please note that some functionality (for example, anchor links) will not work in
|
|||
|
||||
:::
|
||||
|
||||
#### Enabling HTTPS`
|
||||
|
||||
There are multiple ways to obtain a certificate. We will use [mkcert](https://github.com/FiloSottile/mkcert) as an example.
|
||||
|
||||
1. Run `mkcert localhost` to generate `localhost.pem` + `localhost-key.pem`
|
||||
|
||||
2. Run `mkcert -install` to install the cert in your trust store, and restart your browser
|
||||
|
||||
3. Start the app with Docusaurus HTTPS env variables:
|
||||
|
||||
```shell
|
||||
HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem yarn start
|
||||
```
|
||||
|
||||
4. Open `https://localhost:3000/`
|
||||
|
||||
### `docusaurus build`
|
||||
|
||||
Compiles your site for production.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue