Skip to content

Adding transform through environment variables #1430

Answered by Tratcher
lejsekt asked this question in Q&A
Discussion options

You must be logged in to vote

That example worked when I tested it by adding this in Program.Main:
Environment.SetEnvironmentVariable("ReverseProxy__Routes__route1__Transforms__0__RequestHeaderOriginalHost", "true");

It combine with:

  "ReverseProxy": {
    "Routes": {
      "route1": {
        "ClusterId": "cluster1",
        "Match": {
          "Methods": [ "GET", "POST" ],
          "Hosts": [ "localhost" ],
          "Path": "/api/{**catch-all}"
        }
      },

What does the rest of your config look like? Arrays in config can be tricky, I don't think it will work if you already have a transforms section for that route, they'll overlap.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Tratcher
Comment options

Tratcher Dec 6, 2021
Collaborator

@samsp-msft
Comment options

@lejsekt
Comment options

Answer selected by Tratcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants