Skip to content

Allow Specifying Command or Headers for Load Balanced Web Service #2817

Open
@dstarner

Description

Request

I need to explicitly set a defined HOST header so that my web service will accept the request instead of returning a 404.

  • Allow setting either a command like the Backend Service allows so that I can override the host header
  • Allow settings a headers dict that gets included in the healthcheck request
  • Allow setting a host key of where the request should originate from

How We Ended Up Here

We are running our application in a multi-tenant manner, where each tenant gets a separate subdomain and database schema. What this means is that specific host headers must be provided that align with one of the known tenant subdomains for a response to return 2xx. Even our global/public domain is technically a tenant, so when the healthcheck is hitting it with an unknown host header, its constantly returning a 404.

What I'm Doing Right Now

Currently I am allowing 404s to be accepted in the healthcheck, which is not ideal at all.

My Details

MacBook Pro (13-inch, M1, 2020); M1 Chip; 11.4 Big Sur

$ copilot version
version: v1.10.0, built for darwin

Edit: I was able to get around this further by using a custom middleware in my request lifecycle that just short-circuits a response if the request is going to /healthcheck so that none of the multi-tenancy code has a chance to run. I will keep this open in case its something that the project still feels like including.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area/svcIssues about services.type/requestIssues that are created by customers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions