fix: убран nginx-static контейнер, n8n теперь отдаёт статику сам

Проблема: статические файлы содержали необработанные шаблоны {{BASE_PATH}}
из-за неправильной конфигурации nginx-static контейнера.

Решение:
- Удалён n8n-static контейнер (nginx)
- Упрощён роутинг Traefik - один роутер на весь домен
- N8n теперь отдаёт статику напрямую из контейнера
- Добавлена переменная N8N_PROXY_HOPS=1 для работы за reverse proxy

Все данные и credentials сохранены в Docker volume n8n-data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SamoilenkoVadym 2025-11-20 18:44:04 +00:00
parent 610a45dc60
commit 5317e45b1c

View file

@ -70,34 +70,13 @@ services:
memory: 512M
labels:
- "traefik.enable=true"
# Webhook роутер БЕЗ Authelia
- "traefik.http.routers.n8n-webhook.rule=Host(`n8n.ai-impress.com`) && (PathPrefix(`/webhook/`) || PathPrefix(`/webhook-test/`))"
- "traefik.http.routers.n8n-webhook.entrypoints=websecure"
- "traefik.http.routers.n8n-webhook.tls.certresolver=cloudflare"
- "traefik.http.routers.n8n-webhook.service=n8n-shared-service"
- "traefik.http.routers.n8n-webhook.priority=200"
# OAuth роутер БЕЗ Authelia
- "traefik.http.routers.n8n-oauth.rule=Host(`n8n.ai-impress.com`) && PathPrefix(`/rest/oauth`)"
- "traefik.http.routers.n8n-oauth.entrypoints=websecure"
- "traefik.http.routers.n8n-oauth.tls.certresolver=cloudflare"
- "traefik.http.routers.n8n-oauth.service=n8n-shared-service"
- "traefik.http.routers.n8n-oauth.priority=150"
# Основной роутер БЕЗ Authelia
# Единственный роутер для всего домена
- "traefik.http.routers.n8n-shared.rule=Host(`n8n.ai-impress.com`)"
- "traefik.http.routers.n8n-shared.entrypoints=websecure"
- "traefik.http.routers.n8n-shared.tls.certresolver=cloudflare"
- "traefik.http.routers.n8n-shared.service=n8n-shared-service"
- "traefik.http.routers.n8n-shared.priority=50"
- "traefik.http.routers.n8n-shared.middlewares=n8n-nocache"
# Middleware для отключения кэширования
- "traefik.http.middlewares.n8n-nocache.headers.customresponseheaders.Cache-Control=no-cache, no-store, must-revalidate"
- "traefik.http.middlewares.n8n-nocache.headers.customresponseheaders.Pragma=no-cache"
- "traefik.http.middlewares.n8n-nocache.headers.customresponseheaders.Expires=0"
# Сервис
- "traefik.http.services.n8n-shared-service.loadbalancer.server.port=5678"
@ -313,35 +292,6 @@ services:
cpus: '1'
memory: 1G
# Nginx для раздачи статических файлов
n8n-static:
image: nginx:alpine
container_name: n8n-static
restart: unless-stopped
networks:
- traefik-public
volumes:
- ./static:/usr/share/nginx/html:ro
labels:
- "traefik.enable=true"
# Роутер для главной страницы
- "traefik.http.routers.n8n-static-root.rule=Host(`n8n.ai-impress.com`) && (Path(`/`) || Path(`/index.html`))"
- "traefik.http.routers.n8n-static-root.entrypoints=websecure"
- "traefik.http.routers.n8n-static-root.tls.certresolver=cloudflare"
- "traefik.http.routers.n8n-static-root.service=n8n-static-service"
- "traefik.http.routers.n8n-static-root.priority=300"
# Роутер для статических файлов /assets/*, /static/*
- "traefik.http.routers.n8n-static.rule=Host(`n8n.ai-impress.com`) && (PathPrefix(`/assets/`) || PathPrefix(`/static/`) || Path(`/favicon.ico`) || PathRegexp(`^/.*\\.wasm$`))"
- "traefik.http.routers.n8n-static.entrypoints=websecure"
- "traefik.http.routers.n8n-static.tls.certresolver=cloudflare"
- "traefik.http.routers.n8n-static.service=n8n-static-service"
- "traefik.http.routers.n8n-static.priority=250"
# Сервис
- "traefik.http.services.n8n-static-service.loadbalancer.server.port=80"
volumes:
n8n-data: