Skip to content

Docsify fails to load markdown files behind Kubernetes NGINX Ingress #2672

@cem256

Description

@cem256

I am trying to deploy a Docsify based documentation site behind Kubernetes using NGINX Ingress. The setup works correctly in all other environments but fails when accessed through the ingress.

What works

  1. Running docsify serve . locally works as expected
  2. Serving the same content via Docker works without issues
  3. index.html loads successfully through Kubernetes NGINX Ingress

What does not work

When accessed through Kubernetes NGINX Ingress only index.html is loaded. Markdown files cannot be fetched and the documentation content never renders.

Requests for .md files fail only when traffic goes through the ingress. The same container and files work correctly when accessed directly without ingress.

Ingress configuration

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: docs-ingress
  namespace: docs-namespace
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/proxy-buffering: "off"
    nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
    nginx.ingress.kubernetes.io/use-forwarded-headers: "true"
    nginx.ingress.kubernetes.io/configuration-snippet: |
      chunked_transfer_encoding off;
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - docs.example.com
      secretName: docs-tls-secret
  rules:
    - host: docs.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: docs-service
                port:
                  number: 3000

Any guidance on required Docsify configuration such as basePath routing or headers for Kubernetes NGINX Ingress would be appreciated.

Expected behavior

Docsify should be able to fetch markdown files normally when served behind Kubernetes NGINX Ingress just like it does locally or in Docker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triagebugconfirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions