部署
1
| mkdir -p ~/app/axonhub && cd ~/app/axonhub
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| cat > docker-compose.yml <<EOF version: "3"
services: axonhub: image: looplj/axonhub:latest environment: AXONHUB_DB_DIALECT: sqlite3 AXONHUB_DB_DSN: file:/data/axonhub.db?cache=shared&_fk=1 volumes: - ./data:/data restart: unless-stopped
networks: default: external: true name: ngpm EOF
|
1
| mkdir data && chmod 777 data && sudo docker compose up -d
|

Nginx Proxy Manager 自定义 Nginx 配置
在 Nginx Proxy Manager 的站点配置中,添加以下自定义 Nginx 配置以启用 CORS:
1 2 3 4 5 6 7 8 9 10
| add_header Access-Control-Allow-Origin * always; add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, PATCH, OPTIONS" always; add_header Access-Control-Allow-Headers * always; add_header Access-Control-Max-Age 86400 always;
if ($request_method = OPTIONS) { return 204; }
|
同时为了避免 SSE 流式响应延迟,添加以下配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| proxy_buffering off; proxy_cache off; gzip off;
tcp_nodelay on; tcp_nopush off;
proxy_connect_timeout 10s; proxy_read_timeout 3600s; proxy_send_timeout 3600s; send_timeout 3600s;
add_header X-Accel-Buffering no always; add_header Cache-Control no-store always;
|
渠道