{
  "schema_version": 2,
  "id": "operate/redisinsight/proxy",
  "title": "Subpath proxy",
  "url": "https://redis.io/docs/latest/operate/redisinsight/proxy/",
  "summary": "",
  "tags": [
    "docs",
    "operate",
    "redisinsight"
  ],
  "last_updated": "2026-10-05T16:11:44+01:00",
  "page_type": "content",
  "content_hash": "7d4dc83060bf47629a7b7b1b7c598e1395cf2dad0d7d4a59501bd2833b6538f0",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "You can enable the subpath proxy by setting the `RI_PROXY_PATH` environment variable.\n\n\nWhen `RI_PROXY_PATH` is being set with a path, Redis Insight is\naccessible only on that subpath. The default routes are given the\nprovided prefix subpath. There isn’t any way to add another proxy behind\nthis one unless the same subpath is used for the new one.\n\n> [!NOTE]\n> Once you set the static subpath environment variable, Redis Insight is only reachable on the provided subpath. The default endpoint won't work."
    },
    {
      "id": "using-redis-insight-behind-a-reverse-proxy",
      "title": "Using Redis Insight behind a reverse proxy",
      "role": "content",
      "text": "When you configure Redis Insight to run behind a reverse proxy like NGINX, set the request timeout to over 30 seconds on the reverse proxy because some requests can be long-running.\n\nRedis Insight also allows you to manage its connection timeout on the form to configure the connection details. The default timeout is 30 seconds.\n\nHosting Redis Insight behind a prefix path (path-rewriting) is not supported."
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": ""
    },
    {
      "id": "docker-compose-file",
      "title": "Docker compose file",
      "role": "content",
      "text": "[code example]"
    },
    {
      "id": "nginx-config",
      "title": "nginx config",
      "role": "content",
      "text": "[code example]"
    },
    {
      "id": "login-page",
      "title": "Login page",
      "role": "content",
      "text": "![RedisInsight login page](https://redis.io/docs/latest/images/ri/ri-reverse-proxy-login.png)"
    },
    {
      "id": "after-login",
      "title": "After login",
      "role": "content",
      "text": "![RedisInsight after login](https://redis.io/docs/latest/images/ri/ri-reverse-proxy-post-login.png)"
    }
  ],
  "examples": [
    {
      "id": "docker-compose-file-ex0",
      "language": "yaml",
      "code": "version: \"3.7\"\nservices:\n  redis-stack:\n    image: redis/redis-stack-server\n    networks:\n      - redis-network\n\n  redisinsight:\n    image: redis/redisinsight\n    environment:\n      - RIPORT=${RIPORT:-5540}\n      - RITRUSTEDORIGINS=http://localhost:9000\n    depends_on:\n      - redis-stack\n    networks:\n      - redis-network\n\n  nginx-basicauth:\n    image: nginx\n    volumes:\n      - ./nginx-basic-auth.conf.template:/etc/nginx/templates/nginx-basic-auth.conf.template\n    ports:\n      - \"${NGINX_PORT:-9000}:${NGINX_PORT:-9000}\"\n    environment:\n      - FORWARD_HOST=redisinsight\n      - FORWARD_PORT=${RIPORT:-5540}\n      - NGINX_PORT=${NGINX_PORT:-9000}\n      - BASIC_USERNAME=${BASIC_USERNAME:-redis}\n      - BASIC_PASSWORD=${BASIC_PASSWORD:-password}\n    command:\n      - bash\n      - -c\n      - |\n        printf \"$$BASIC_USERNAME:$$(openssl passwd -1 $$BASIC_PASSWORD)\\n\" >> /etc/nginx/.htpasswd\n        /docker-entrypoint.sh nginx -g \"daemon off;\"\n    depends_on:\n      - redisinsight\n    networks:\n      - redis-network",
      "section_id": "docker-compose-file"
    },
    {
      "id": "nginx-config-ex0",
      "language": "plaintext",
      "code": "server {\n listen ${NGINX_PORT} default_server;\n\n location / {\n     auth_basic             \"redisinsight\";\n     auth_basic_user_file   .htpasswd;\n\n     proxy_pass             http://${FORWARD_HOST}:${FORWARD_PORT};\n     proxy_read_timeout     900;\n }\n}",
      "section_id": "nginx-config"
    }
  ]
}
