Rename ssl dir to certs

This commit is contained in:
Cristian Ditaputratama 2024-04-26 22:32:08 +07:00 committed by mergify[bot]
parent 3f36f5a14a
commit 5c40b9fdd5
2 changed files with 10 additions and 10 deletions

View file

@ -121,25 +121,25 @@ http {
## Mempersiapkan struktur direktori Nginx ## Mempersiapkan struktur direktori Nginx
Buat direktori `sites-available`, `sites-enabled`, `ssl`, `snippets` di dalam direktori `/etc/nginx` dengan menjalankan perintah: Buat direktori `sites-available`, `sites-enabled`, `certs`, `snippets` di dalam direktori `/etc/nginx` dengan menjalankan perintah:
```shell ```shell
sudo mkdir -p /etc/nginx/{sites-available,sites-enabled,ssl,snippets} sudo mkdir -p /etc/nginx/{sites-available,sites-enabled,certs,snippets}
``` ```
Buat _self-signed certificate_ (hanya digunakan sebagai konfigurasi awal yang nantinya digantikan oleh `certbot`): Buat _self-signed certificate_ (hanya digunakan sebagai konfigurasi awal yang nantinya digantikan oleh `certbot`):
```shell ```shell
sudo openssl req -x509 -newkey rsa:4096 -days 365 -nodes \ sudo openssl req -x509 -newkey rsa:4096 -days 365 -nodes \
-keyout /etc/nginx/ssl/privkey.pem \ -keyout /etc/nginx/certs/privkey.pem \
-out /etc/nginx/ssl/fullchain.pem \ -out /etc/nginx/certs/fullchain.pem \
-subj '/CN=example.local/O=My Organization/C=US' -subj '/CN=example.local/O=My Organization/C=US'
``` ```
Buat _DH-param_ dengan menjalankan perintah: Buat _DH-param_ dengan menjalankan perintah:
```shell ```shell
sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 sudo openssl dhparam -out /etc/nginx/certs/dhparam.pem 2048
``` ```
## Cloudflare IP Trusted Proxy ## Cloudflare IP Trusted Proxy

View file

@ -121,25 +121,25 @@ http {
## Preparing the Nginx directory structure ## Preparing the Nginx directory structure
Create the `sites-available`, `sites-enabled`, `ssl`, `snippets` directories inside the `/etc/nginx` directory: Create the `sites-available`, `sites-enabled`, `certs`, `snippets` directories inside the `/etc/nginx` directory:
```shell ```shell
sudo mkdir -p /etc/nginx/{sites-available,sites-enabled,ssl,snippets} sudo mkdir -p /etc/nginx/{sites-available,sites-enabled,certs,snippets}
``` ```
Create a _self-signed_ certificate (only used as an initial configuration which will later be replaced by `certbot`): Create a _self-signed_ certificate (only used as an initial configuration which will later be replaced by `certbot`):
```shell ```shell
sudo openssl req -x509 -newkey rsa:4096 -days 365 -nodes \ sudo openssl req -x509 -newkey rsa:4096 -days 365 -nodes \
-keyout /etc/nginx/ssl/privkey.pem \ -keyout /etc/nginx/certs/privkey.pem \
-out /etc/nginx/ssl/fullchain.pem \ -out /etc/nginx/certs/fullchain.pem \
-subj '/CN=example.local/O=My Organization/C=US' -subj '/CN=example.local/O=My Organization/C=US'
``` ```
Create _DH-param_ by running: Create _DH-param_ by running:
```shell ```shell
sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 sudo openssl dhparam -out /etc/nginx/certs/dhparam.pem 2048
``` ```
## Cloudflare's IPs trusted proxy ## Cloudflare's IPs trusted proxy