Error 502 with HTPassword

for some reason when i use HTPassword on my docker registry, the tunnel returns a 502. Im not sure how to solve this issue

502 error means a bad gateway. This means the tunnel can not communicate with your registry.

thats what i thought, but if i remove/comment out the htpassword stuff from the registry it works fine. port dosent change or anything i dont think

my compose:

  registry:
    container_name: registry
    image: registry:2
    ports:
      - 5002:5000
    environment:
      REGISTRY_AUTH: htpassword
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
    volumes:
      - ${REGISTRY_PATH}/auth:/auth
      - ${REGISTRY_PATH}/data:/var/lib/registry
    restart: unless-stopped
    
  cicd_tunnel:
    container_name: cicd_tunnel
    image: cloudflare/cloudflared:latest 
    command: tunnel --no-autoupdate run --token ${CLOUDFLARE_TOKEN}

the recomended compose

registry:
  restart: always
  image: registry:2
  ports:
    - 5000:5000
  environment:
    REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
    REGISTRY_HTTP_TLS_KEY: /certs/domain.key
    REGISTRY_AUTH: htpasswd
    REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
    REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
  volumes:
    - /path/data:/var/lib/registry
    - /path/certs:/certs
    - /path/auth:/auth

i dont need the tls cert and key because Cloudflare sorts that for me, so im just defining the auth method being htpassword. but when its defined i get a 502, when it isnt it connects fineā€¦ im very perplexed by this.

i had a bad environment variable. disregard.

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