Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.backend.{name} in toml always create backend with overide_host set as the address #1268

Open
noguxun opened this issue Aug 5, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@noguxun
Copy link
Contributor

noguxun commented Aug 5, 2024

In toml, get below setup, notice that there is no setting field override_host .

[setup]
  [setup.backends]
    [setup.backends.example]
      address = "example.org"
      description = "example"
      port = 443

After running fastly compute publish
We get a service with a backend that has "override host" set to example.org

Currently, there is no way to set up a backend with an empty "override host"

@noguxun noguxun added the bug Something isn't working label Aug 5, 2024
@cee-dub
Copy link
Contributor

cee-dub commented Aug 5, 2024

Have you tried removing the setting in the management console after the fact? In my experience, this makes the backend stop functioning, so setting this value seems necessary.

@noguxun
Copy link
Contributor Author

noguxun commented Aug 5, 2024

In many cases, getting override host set is needed for backend like example.org and and httpbin.org.
but in some situations, I need this field to be blank so that my customized backend to receive the host header of the same value as the client's request.

@noguxun
Copy link
Contributor Author

noguxun commented Aug 5, 2024

By the way, local_server has a functional override_host field (with or without the setting makes a difference).

[local_server]
  [local_server.backends]
    [local_server.backends.backend_b]
      url = "https://example.org/"
      override_host = "example.org"

@cee-dub
Copy link
Contributor

cee-dub commented Aug 5, 2024

in some situations, I need this field to be blank so that my customized backend to receive the host header of the same value as the client's request

The platform doesn't allow this, unless your code registers a dynamic backend. The override host field is not the correct place to allow this feature.

@JakeChampion
Copy link
Contributor

in some situations, I need this field to be blank so that my customized backend to receive the host header of the same value as the client's request

The platform doesn't allow this, unless your code registers a dynamic backend. The override host field is not the correct place to allow this feature.

When making a static backend in the UI, this is exactly how it works, the platform allows it, override_host was added as a way to improve this for users because many users wanted to set the host header value in the backend definition rather than in their code. We've since come to a place where we are inconsistent in what we do by default for users. The UI will not add override host by default, but the cli will.

@cee-dub
Copy link
Contributor

cee-dub commented Aug 5, 2024

We've since come to a place where we are inconsistent in what we do by default for users. The UI will not add override host by default, but the cli will.

I thought it was the opposite, but I could be mistaken.

@noguxun
Copy link
Contributor Author

noguxun commented Aug 6, 2024

The UI will not add override host by default, but the cli will.

Not only cli will (add override host by default), there is no way to let cli to not do it

@kpfleming
Copy link
Contributor

Indeed, the current data model for setup in fastly.toml doesn't offer any mechanism to set override_host, cert_host, and use_sni even though the local_server block does. This is quite unfortunate as the behavior should be consistent. I'll do some investigating today to see if this can be added relatively quickly, without waiting for the fastly.toml redesign that we've been discussing.

@kpfleming
Copy link
Contributor

Well, the fix won't be quick as it will require extensive work in the test suite for the deploy command, but it will get done anyway. Look for some progress in a week or two.

@kpfleming kpfleming self-assigned this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants