Skip to content

bug: coder_app produces wrong subdomain url when using subfolders #161

Closed
@daschatten

Description

@daschatten

Given a python app with fastapi which serves the api docs at http://localhost:8000/docs.

This coder_app:

resource "coder_app" "api" {
  agent_id  = coder_agent.main.id
  slug      = "api"
  icon      = "https://upload.wikimedia.org/wikipedia/commons/a/a6/Api_logo.jpg"
  url       = "http://localhost:8000/docs"
  subdomain = true
  share     = "authenticated"

  healthcheck {
    url       = "http://localhost:8000/ping"
    interval  = 10
    threshold = 30
  }
}

Generates this url:

https://my-subdomain-url/
# Which is redirect to
https://my-subdomain-url/docs

On the server side this happens:

INFO:     10.0.23.3:0 - "GET /docs/ HTTP/1.1" 307 Temporary Redirect
INFO:     10.0.23.3:0 - "GET /docs/docs HTTP/1.1" 404 Not Found

When using url = "http://localhost:8000" and manually appending /docs to generated http link it works fine.

It seems there is an issue with the subdomain url generation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions