慢慢成长
type: channel
link: https://zzzykj.cn/
description: 记录点滴;慢慢成长
items: Docker compose 部署 N8N
items: Nginx反向代理参考
items: N8N小计
items: Docker compose 部署 Mysql8.0 并开启主从复制
items: Docker-compose 部署 SpringBoot 应用
items: Docker-compose 部署 RocketMQ
items: Docker-compose 部署 Redis
items: docker compose 部署 RustDesk 全套
items: Nginx 常用配置
items: Docker 部署

Docker compose 部署 N8N
type: item
date: 2026-01-21T07:42:37+00:00
description: Docker compose 部署 N8N创建持久化目录mkdir data mkdir files创建必要文件.env# DOMAIN_NAME and SUBDOMAIN together determine where n8n will be reachable from # The top level domain to serve from DOMAIN_NAME=204.local # The subdomain to serve from SUBDOMAIN=n8n # The above example serve n8n at: https://n8n.example.com # Optional timezone to set which gets used by Cron and other scheduling nodes # New York is the default value if not set GENERIC_TIMEZONE=Europe/Berlin # The email address to use for the TLS/SSL certificate creation SSL_EMAIL=user@example.com EXECUTION_MAX_DATA_SIZE=104857600 docker-compose.ymlservices: n8n: image: n8nio/n8n restart: always ports: - "5678:5678" labels: - traefik.enable=true - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}:5678`) - traefik.http.routers.n8n.tls=true - traefik.http.routers.n8n.entrypoints=web,websecure - traefik.http.routers.n8n.tls.certresolver=mytlschallenge - traefik.http.middlewares.n8n.headers.SSLRedirect=true - traefik.http.middlewares.n8n.headers.STSSeconds=315360000 - traefik.http.middlewares.n8n.headers.browserXSSFilter=true - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true - traefik.http.middlewares.n8n.headers.forceSTSHeader=true - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME} - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true - traefik.http.middlewares.n8n.headers.STSPreload=true - traefik.http.routers.n8n.middlewares=n8n@docker environment: - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}:5678 - N8N_PORT=5678 - N8N_PROTOCOL=http - N8N_RUNNERS_ENABLED=true - N8N_SECURE_COOKIE=false - NODE_ENV=production - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/ - GENERIC_TIMEZONE=${GENERIC_TIMEZONE} - TZ=${GENERIC_TIMEZONE} - EXECUTION_MAX_DATA_SIZE=104857600 - EXECUTION_TIMEOUT=3600000 - EXECUTIONS_DATA_MAX_SIZE=104857600 volumes: - ./data:/home/node/.n8n - ./files:/files

Nginx反向代理参考
type: item
date: 2026-01-21T06:22:00+00:00
description: Nginx反向代理参考# 定义一个上游服务器组，这是实现负载均衡和高可用的基础 # 常用度：极高 upstream my_backend_servers { # 负载均衡策略 (默认为轮询) # 1. 轮询 (默认): 每个请求按时间顺序逐一分配到不同的后端服务器 # server backend1.example.com; # server backend2.example.com; # 2. weight (权重): 指定轮询几率，weight和访问比率成正比，用于后端服务器性能不均的情况 server backend1.example.com weight=3; server backend2.example.com weight=1; # 3. ip_hash: 每个请求按访问ip的hash结果分配，这样每个访客固定访问一个后端服务器，可以解决session问题 # ip_hash; # server backend1.example.com; # server backend2.example.com; # 4. least_conn (最少连接): 将请求分配给连接数最少的服务器 # least_conn; # server backend1.example.com; # server backend2.example.com; # 健康检查相关参数 server backend1.example.com max_fails=3 fail_timeout=30s; # 在30秒内，如果与该服务器通信失败3次，则认为该服务器不可用，并在接下来的30秒内不再尝试 server backend2.example.com max_fails=3 fail_timeout=30s; } server { listen 80; server_name your.domain.com; # 替换为您的域名 # ==================== 核心代理配置 (常用度: 极高) ==================== # 1. proxy_pass: 最核心的指令，指定后端服务器的协议和地址 # 可以是单个地址，也可以是上面定义的 upstream 块名称 location / { proxy_pass http://my_backend_servers; # 将请求转发到名为 my_backend_servers 的上游服务器组 # proxy_pass http://127.0.0.1:8080; # 也可以直接指定单个后端服务 } # 2. proxy_set_header: 重定义或添加发往后端服务器的请求头 # 这对于后端服务器获取客户端真实信息至关重要 location / { proxy_pass http://my_backend_servers; # 将客户端的真实 Host 头传递给后端 proxy_set_header Host $host; # 将客户端的真实 IP 地址传递给后端，后端程序通常通过这个头获取用户IP proxy_set_header X-Real-IP $remote_addr; # X-Forwarded-For 是一个事实上的标准，用于记录请求经过的每一个代理服务器IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 如果客户端和 Nginx 之间是 HTTPS 连接，而 Nginx 和后端是 HTTP，这个头可以告诉后端原始协议 proxy_set_header X-Forwarded-Proto $scheme; } # 3. proxy_connect_timeout: 定义与后端服务器建立连接的超时时间 # 通常不应超过75秒 location / { proxy_pass http://my_backend_servers; proxy_connect_timeout 60s; } # 4. proxy_send_timeout: 定义向后端服务器发送请求的超时时间 # 这个超时是指在两次成功的写操作之间的间隔时间，而不是整个传输时间 location / { proxy_pass http://my_backend_servers; proxy_send_timeout 60s; } # 5. proxy_read_timeout: 定义从后端服务器读取响应的超时时间 # 这个超时是指在两次成功的读操作之间的间隔时间 location / { proxy_pass http://my_backend_servers; proxy_read_timeout 60s; } # =======…

N8N小计
type: item
date: 2026-01-19T08:54:00+00:00
description: N8N小计常用网站社区节点 - NPM检索站(排行站) - http://n8engine.com/开源项目社区节点 Top-100 - restyler/awesome-n8n常用社区节点微信类企业微信 - n8n-nodes-wecom工具类图片转PDF n8n-nodes-pdfkit网页转PDF n8n-nodes-htmlcsstopdf基础平台功能增强类全局变量 - n8n-nodes-globals

Docker compose 部署 Mysql8.0 并开启主从复制
type: item
date: 2025-07-10T02:38:00+00:00
description: Docker compose 部署 Mysql8.0 并开启主从复制部署主机编写主机脚本vim install.sh#!/bin/bash # mysql 镜像名称 mysql_img_name="mysql" # mysql 版本 mysql_version="8.0" # 暴露端口 exposed_port="33060" # server-id server_id=1 # 服务名称 service_name="mysql" # ROOT 用户密码 root_password="123456" # ROOT 用户 host root_host="%" # 用于主从复制的用户 slave_user="slave" # 用于自从复制的用户的密码 slave_pass="123456" # 初始化SQL文件 init_sql_file="./init.sql" # 数据文件挂载目录 data_dir="./data" # 配置文件挂载目录 conf_dir="./conf" # 备份文件挂载目录 bak_dir="./bak" # 当前用户ID uid=$(id -u) # 内部端口 internal_port="3306" # 内部数据文件路径 internal_data_dir="/var/lib/mysql" # 内部配置文件路径 internal_conf_dir="/etc/mysql/conf.d" # 内部备份文件路径 internal_bak_dir="/bak" # 内部初始化SQL文件路径 internal_init_sql_file="/docker-entrypoint-initdb.d/init.sql" # ---------------------------------- # 创建文件夹 mkdir $data_dir mkdir $conf_dir mkdir $bak_dir # 创建配置文件 cat <<EOF > conf/master.cnf [mysqld] server-id=$server_id log-bin=mysql-bin gtid_mode=ON enforce-gtid-consistency=true log_slave_updates=ON binlog_format=ROW EOF # 创建 初始化sql cat <<EOF > init.sql -- 创建基于 mysql_native_password 认证的用于主从复制的用户 CREATE USER '${slave_user}'@'%' IDENTIFIED WITH mysql_native_password BY '${slave_pass}'; -- 创建基于默认认证规则的用于主从复制的用户 -- CREATE USER '${slave_user}'@'%' IDENTIFIED BY '${slave_pass}'; -- 授予完整权限 GRANT ALL PRIVILEGES ON *.* TO '${slave_user}'@'%'; -- 授予部分权限 -- GRANT REPLICATION SLAVE ON *.* TO '${slave_user}'@'%'; -- 刷新权限 FLUSH PRIVILEGES; -- 创建测试库 CREATE DATABASE IF NOT EXISTS test_db; USE test_db; CREATE TABLE IF NOT EXISTS test_table ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50) ); EOF # 创建 docker-compose.yml 文件 cat <<EOF > docker-compose.yml version: '3' services: $service_name: image: $mysql_img_name:$mysql_version ports: - "$exposed_port:$internal_port" volumes: # 将容器内的数据卷挂载到宿主机上 - $data_dir:$internal_data_dir - $conf_dir:$internal_conf_dir - $bak_dir:$internal_bak_dir - $init_sql_file:$internal_init_sql_file environment: - MYSQL_ROOT_PASSWORD=$root_password - MYSQL_ROOT_HOST=$root_host user: $uid:$uid restart: a…

Docker-compose 部署 SpringBoot 应用
type: item
date: 2025-07-05T02:20:04+00:00
description: Docker-compose 部署 SpringBoot 应用创建 docker-compose.yml 文件version: "3" services: app: image: openjdk:21 container_name: app volumes: - ./data:/data - ./app.jar:/app.jar environment: - SPRING_PROFILES_ACTIVE=prod - TZ=Asia/Shanghai command: java -jar /app.jar restart: always networks: - service networks: service: external: true

Docker-compose 部署 RocketMQ
type: item
date: 2025-07-05T02:18:00+00:00
description: Docker-compose 部署 RocketMQ创建网络docker network create rocketmq部署NameServervim docker-compose.ymlversion: '3.8' services: rmqnamesrv: image: apache/rocketmq:4.9.6 container_name: rmqnamesrv ports: - "9876:9876" networks: - rocketmq command: sh mqnamesrv networks: rocketmq: external: true部署broker创建配置文件vim broker.conf# Broker 名称 brokerName=broker-1 # Broker 所属的集群名称 brokerClusterName=default-cluster # NameServer 地址 namesrvAddr=rmqnamesrv:9876 # Broker 的监听地址（可以是容器的内部 IP 或者主机的 IP） brokerIP1=192.168.1.202 # Broker 监听端口 listenPort=10911 # 是否开启自动创建主题 autoCreateTopicEnable=true # 是否开启自动创建订阅组 autoCreateSubscriptionGroup=true diskMaxUsedSpaceRatio=98创建 docker-compose.yml 文件vim docker-compose.ymlversion: '3.8' services: rmqbroker1: image: apache/rocketmq:4.9.6 container_name: rmqbroker1 ports: - "10912:10912" - "10911:10911" - "10909:10909" #environment: # NAMESRV_ADDR: "rmqnamesrv:9876" volumes: - ./broker.conf:/home/rocketmq/rocketmq-4.9.6/conf/broker.conf networks: - rocketmq command: sh mqbroker -c /home/rocketmq/rocketmq-4.9.6/conf/broker.conf networks: rocketmq: external: true部署可视化监控vim docker-compose.ymlversion: '3.8' services: rocketmq-dashboard: image: apacherocketmq/rocketmq-dashboard:latest container_name: rocketmq-dashboard environment: - JAVA_OPTS=-Drocketmq.namesrv.addr=rmqnamesrv:9876 ports: - "8080:8080" networks: - rocketmq networks: rocketmq: external: true

Docker-compose 部署 Redis
type: item
date: 2025-06-23T01:34:12+00:00
description: Docker-compose 部署 Redis编写docker-compose.ymlvim docker-compose.ymlversion: '3.8' services: redis: image: redis:8.0 container_name: redis ports: - "6379:6379" volumes: - ./data:/data command: redis-server --requirepass 123456 restart: always创建数据目录mkdir data启动服务docker compose up -d

docker compose 部署 RustDesk 全套
type: item
date: 2025-06-06T09:26:02+00:00
description: docker compose 部署 RustDesk 全套参考链接RustDesk Server 自部署文档RustDesk 命令rustdesk-api 项目地址使用Docker-compose部署Http 反代Https 反代1. 参考链接RustDesk Server 官方文档内容摘录使用Docker-compose部署networks: rustdesk-net: external: false services: hbbs: container_name: hbbs ports: - 21115:21115 - 21116:21116 - 21116:21116/udp - 21118:21118 image: rustdesk/rustdesk-server command: hbbs -r <server[:21117]> -k <key> volumes: - /data/rustdesk/server:/root networks: - rustdesk-net depends_on: - hbbr restart: unless-stopped deploy: resources: limits: memory: 64M hbbr: container_name: hbbr ports: - 21117:21117 # 自定义 hbbr 映射端口 - 21119:21119 # web client image: rustdesk/rustdesk-server command: hbbr -k <key> volumes: - /data/rustdesk/server:/root networks: - rustdesk-net restart: unless-stopped deploy: resources: limits: memory: 64M rustdesk-api: container_name: rustdesk-api environment: - TZ=Asia/Shanghai - RUSTDESK_API_RUSTDESK_ID_SERVER=<server[:21116]> - RUSTDESK_API_RUSTDESK_RELAY_SERVER=<server[:21117]> - RUSTDESK_API_RUSTDESK_API_SERVER=http://<server[:21114]> #- RUSTDESK_API_RUSTDESK_KEY=<key> ports: - 21114:21114 image: lejianwen/rustdesk-api volumes: - /data/rustdesk/api:/app/data #将数据库挂载出来方便备份 - /data/rustdesk/server:/app/conf/data #挂载key文件到api容器，可以不用使用 RUSTDESK_API_RUSTDESK_KEY networks: - rustdesk-net restart: unless-stopped depends_on: - hbbs - hbbrHttp 反代server { server_name <server>; listen 80; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://rustdesk-api:21114/; } } server { listen 21118; server_name <server>; location / { proxy_pass http://rustdesk-server:21118; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } server { listen 21119; server_name <server>; location / { proxy_pass h…

Nginx 常用配置
type: item
date: 2025-06-06T07:28:00+00:00
description: Nginx 常用配置静态资源location / { root /usr/share/nginx/html; index index.html; }静态资源(单页面应用)location / { root /usr/share/nginx/html; index index.html; try_files $uri /index.html; }反代API接口location /api { proxy_pass http://server:port; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } SSL 配置 listen 443 ssl; http2 on; server_name xxx.com; root /usr/share/nginx/html/html/xxx; access_log /var/log/nginx/xxx.access.log main; ssl_certificate /cert/fullchain.pem; ssl_certificate_key /cert/privkey.pem; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; add_header Strict-Transport-Security "max-age=31536000"; 反代WSlocation /ws/api { proxy_pass http://server:port; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } 最大请求/响应等限制location /upload/ { # 对于上传，可以适当增大此值，让小文件直接在内存中处理 client_body_buffer_size 128k; client_max_body_size 200m; }配置项作用默认值推荐设置场景client_max_body_size限制请求体大小1m最常用。在 location 块中为文件上传接口设置较大值（如 100m）。proxy_buffer_size代理响应头缓冲区大小4k/8k当后端响应头很大时，或日志有相关警告时。proxy_buffers代理响应体缓冲区8 4k/8k当后端返回大文件或数据，需要优化性能时。proxy_max_temp_file_size代理临时文件最大大小1024m当后端响应可能超过1GB时。large_client_header_buffers限制请求头大小4 8k当 URL 或 Cookie 特别长时。limit_req_zone/limit_req限制请求速率N/A强烈推荐。用于防御 DDoS 和暴力破解，保护登录、搜索等关键接口。

Docker 部署
type: item
date: 2025-06-06T07:24:45+00:00
description: Docker 部署参考链接Docker 官方文档安装 Docker Engine]在 Ubuntu 上安装 Docker Engine在 CentOS 上安装 Docker Engine在 CentOS 上安装 Docker Engine要安装 Docker Engine，需要以下的 CentOS 版本：CentOS 9（stream）1.卸载旧版本sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine2. 安装Docker Engine2.1 通过 rpm 存储库安装安装 dnf-plugins-coresudo dnf install -y dnf-plugins-core添加存储库sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo安装 Docker 软件包 sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin启动 Docker Engine sudo systemctl enable --now docker通过运行映像来验证安装是否成功：hello-world sudo docker run hello-world2.2 通过离线包安装访问https://download.docker.com/linux/centos/ 并选择对应的 CentOS 版本。然后浏览并下载要安装的 Docker 文件安装 Docker Enginesudo dnf install /path/to/package.rpm启动 Docker Enginesudo systemctl enable --now docker通过运行映像来验证安装是否成功：hello-worldsudo docker run hello-world