Skip to content

Instantly share code, notes, and snippets.

@msyfls123
Last active September 11, 2025 11:20
Show Gist options
  • Select an option

  • Save msyfls123/f4494937ea98d8b202ee0a68eb33a09f to your computer and use it in GitHub Desktop.

Select an option

Save msyfls123/f4494937ea98d8b202ee0a68eb33a09f to your computer and use it in GitHub Desktop.
n8n config
n8n:
image: n8n-custom:1
ports:
- "5678:5678"
volumes:
- ./n8n_data:/root/.n8n
- ./local-files:/files
environment:
- DOMAIN_NAME=ebichu.cc
- SUBDOMAIN=lab
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=m****@gmail.com
- N8N_BASIC_AUTH_PASSWORD=*******
- WEBHOOK_URL=https://lab.ebichu.cc/
- GENERIC_TIMEZONE=Asia/Shanghai
# - N8N_PUSH_BACKEND=sse
# 你可以根据需要添加更多环境变量
# 使用 node:20 作为基础镜像
FROM node:20
# 安装 ffmpeg
RUN apt-get update && apt-get install -y ffmpeg
# 安装 n8n
RUN npm install -g n8n
# 创建工作目录
WORKDIR /data
# 暴露 n8n 默认端口
EXPOSE 5678
# 启动 n8n
CMD ["n8n"]
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 843 ssl;
#请填写绑定证书的域名
server_name lab.ebichu.cc;
#请填写证书文件的相对路径或绝对路径
ssl_certificate conf.d/lab.ebichu.cc_nginx/lab.ebichu.cc_bundle.crt;
#请填写私钥文件的相对路径或绝对路径
ssl_certificate_key conf.d/lab.ebichu.cc_nginx/lab.ebichu.cc.key;
ssl_session_timeout 5m;
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#请按照以下协议配置
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
location / {
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Origin 'https://lab.ebichu.cc';
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# docker default host machine ip
proxy_pass http://172.17.0.1:5678;
}
error_log /opt/web/logs/error-lab-443.log error;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment