I get a 404 error every time I login /n8n/n8n/

version: "3"

services:
  n8n:
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=yourpassword
      - GENERIC_TIMEZONE=Asia/Taipei
      - N8N_RUNNERS_ENABLED=true
      - N8N_PATH=/n8n/
      - N8N_HOST=mydomain
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://mydomain/n8n/
      - N8N_EDITOR_BASE_URL=https://mydomain/n8n
      - N8N_DISABLE_UI_REVERSE_PROXY_WARNING=true
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

The above is my docker-compose.yml setting

# n8n API 與 UI 反向代理設定
location /n8n/ {

    proxy_pass http://127.0.0.1:5678/;

    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;

    proxy_set_header Authorization $http_authorization;

    proxy_buffering off;
    proxy_cache off;
}
location = /n8n {
    return 301 $scheme://$host/n8n/;
}
location = /n8n/n8n/ {

    return 302 /n8n/;
}

Every time I log in to https://mydomain/n8n/, I see the login screen: https://mydomain/n8n/signin?redirect=%252Fn8n%252F

After logging in, I’ll be redirected to https://mydomain/n8n/n8n/ and receive a 404 error.
How do I set and adjust

i have same issue in this case. nowhere can handle it please fixed it n8n!!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.