差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| tech:nginx_proxy_manager [2024/07/24 21:04] – 增加 goaccess 與 watchtower 自動更新 jonathan | tech:nginx_proxy_manager [2026/05/05 16:30] (目前版本) – [編輯與啟動] jonathan | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== | + | ====== Nginx Proxy Manager(NPM) 當 Revers Proxy Server(Docker) ====== |
| * 環境 : [[tech/ | * 環境 : [[tech/ | ||
| * 安裝的主機 IP : 192.168.11.231 | * 安裝的主機 IP : 192.168.11.231 | ||
| 行 42: | 行 42: | ||
| watchtower: | watchtower: | ||
| - | image: | + | image: |
| container_name: | container_name: | ||
| volumes: | volumes: | ||
| 行 83: | 行 83: | ||
| * 編輯 Proxy Host -> Advanced -> Custom Nginx Configuration 加入 < | * 編輯 Proxy Host -> Advanced -> Custom Nginx Configuration 加入 < | ||
| - | ==== 2. 解決無法下載後端 NextCloud | + | ==== 2. 解決無法下載Proxy Host 超過 1GB 大檔案的設定 ==== |
| - | * https:// | + | * Proxy Host 是 NextCloud 要提供檔案下載時發現預設下載檔案大小限制為 1GB |
| + | * 參考 - https:// | ||
| + | * 另外 NextCloud/ | ||
| * 編輯 Proxy Host -> Advanced -> Custom Nginx Configuration 加入 <cli> | * 編輯 Proxy Host -> Advanced -> Custom Nginx Configuration 加入 <cli> | ||
| - | proxy_set_header Host $host; | + | client_body_buffer_size 512k; |
| - | proxy_set_header X-Forwarded-Proto $scheme; | + | proxy_read_timeout 86400s; |
| - | proxy_set_header X-Real-IP $remote_addr; | + | |
| - | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | + | |
| - | proxy_max_temp_file_size 16384m; | + | |
| client_max_body_size 0; | client_max_body_size 0; | ||
| - | location = / | + | if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS)$) |
| - | return | + | return |
| } | } | ||
| - | location = / | + | </ |
| - | return 301 $scheme:// | + | |
| - | }</ | + | |
| ==== 3. 解決忘記登入資訊的做法 ==== | ==== 3. 解決忘記登入資訊的做法 ==== | ||
| 行 176: | 行 173: | ||
| docker compose logs -f | docker compose logs -f | ||
| </ | </ | ||
| + | |||
| + | ==== 8. 升級到 v2.12.4 後管理介面無法登入議題 ==== | ||
| + | * log 出現 - Cannot install certbot-dns-cloudflare==4.0.0 and cloudflare==4.0.* | ||
| + | * 參考 - https:// | ||
| + | * 目前 Workaround 作法 | ||
| + | - 進入 NPM 容器內執行 Exp. <cli> | ||
| + | pve-rproxy: | ||
| + | NAME IMAGE | ||
| + | nginx-proxy-manager | ||
| + | pve-rproxy: | ||
| + | | ||
| + | | \ | | __ _(_)_ __ __ _| _ \ _ __ _____ ___ | ||
| + | | \| |/ _` | | '_ \\ \/ / |_) | '__/ _ \ \/ / | | | |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__| | ||
| + | | |\ | (_| | | | | |> <| __/| | | (_) > <| |_| | | | | (_| | | | | (_| | (_| | __/ | | ||
| + | |_| \_|\__, |_|_| |_/ | ||
| + | | ||
| + | Version 2.12.4 (b84762b) 2025-07-01 01:23:38 UTC, OpenResty 1.27.1.1, debian 12 (bookworm), Certbot certbot 4.0.0 | ||
| + | Base: debian: | ||
| + | Certbot: nginxproxymanager/ | ||
| + | Node: nginxproxymanager/ | ||
| + | |||
| + | [root@docker-434df09eec04:/ | ||
| + | [root@docker-434df09eec04:/ | ||
| + | exit | ||
| + | </ | ||
| + | - 重新啟動容器 <cli> | ||
| + | pve-rproxy: | ||
| + | [+] Restarting 1/1 | ||
| + | ✔ Container nginx-proxy-manager | ||
| + | pve-rproxy: | ||
| + | </ | ||
| + | |||
| + | ==== 9. 查看 SSL Certificates 紀錄的設定內容 ==== | ||
| + | * 因為 Web UI 只能針對 SSL Certificates 新增或刪除, | ||
| + | * 進入 data 目錄應該可以看到 database.sqlite | ||
| + | * 使用 sqlite3 進入查詢< | ||
| + | ~/ | ||
| + | SQLite version 3.49.2 2025-05-07 10:39:52 | ||
| + | sqlite> select * from certificate; | ||
| + | 1|2024-01-25 12: | ||
| + | </ | ||
| + | * 如果有興趣了解整個資料庫結構可以下 **.fullschema** 查看< | ||
| + | sqlite> .fullschema | ||
| + | CREATE TABLE `knex_migrations` (`id` integer not null primary key autoincrement, | ||
| + | CREATE TABLE `knex_migrations_lock` (`index` integer not null primary key autoincrement, | ||
| + | CREATE TABLE `migrations` (`id` integer not null primary key autoincrement, | ||
| + | : | ||
| + | CREATE TABLE `access_list_client` (`id` integer not null primary key autoincrement, | ||
| + | /* No STAT tables available */ | ||
| + | </ | ||
| + | |||
| ===== 參考網址 ===== | ===== 參考網址 ===== | ||