---
# System prepended metadata

title: Nginx
tags: [certbot, tools, nginx]

---

# Nginx
###### tags: `tools` `nginx` `certbot`
[TOC]

停止 nginx
```
nginx -s stop
```

重啟 nginx
```
nginx -s reload
```

## docker volume
```
docker volume ls 
docker volume rm
```

## cerbot 註冊 domain
```gherkin=
sudo certbot --nginx certonly -d harbor.chlin.ml
```
## cerbot renew domain
```gherkin=
sudo certbot renew

certbot certonly --force-renew -d example.com

sudo certbot renew --dry-run
```
## nginx 增加以下設定
```gherkin=
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name harbor.chlin.ml;
    ssl_certificate /etc/letsencrypt/live/harbor.chlin.ml/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/harbor.chlin.ml/privkey.pem;

    location / {
        include snippets/wp-reverse-proxy.conf;
        proxy_pass http://localhost:8331;
    }
}
```