0

I have web app deployed in K8 in aws & configured LoadBalancer to call the same from internet. In the Postman I call like ,

GET https://myteams.myorg.net/config Headers: Host doom.myteams.myorg.net I can convert as corresponding http request as below

GET /config HTTP/1.1 Host: myteams.myorg.net Host: doom.myteams.myorg.net

But I want to call the same from browser URL ? I tried several ways but can't successfully include a http header in the URL tried - https://myteams.myorg.net/config/doom.myteams.myorg.net but the "/config/doom.myteams.myorg.net" is being treated as params.

2
  • I cannot find any converter which converts curl or http request to URL which can be executed in browsers like chrome Commented Nov 25, 2021 at 13:44
  • To get the first request the URL might be doom.myteams.myorg.net/https://myteams.myorg.net/config The Host should come from the URL and the GET /xxxx is the path of the url, we can see that the Get part is weird, I would say a broken client generated that request. Commented Nov 25, 2021 at 15:41

2 Answers 2

1

You need to add a subdomain doom.myteams.example.net to your DNS, which points to the IP address of your server.

After that, opening https://doom.myteams.example.net will get your request to the correct virtual host.

If you want this to be available for one computer only, you can edit /etc/hosts (*nix) or C:\Windows\System32\drivers\etc\hosts (Windows) and add the hostname + ip address in the file.

0

You don't.

You can't set HTTP headers as part of URL, it's not the way it works.

At best you may be able to use a browser plugin to add/set arbitrary HTTP headers, but that will depend on the browser you are using. And will be a one off test/development option.

The Host variable needs to match the host portion of the URL, this is how the Ingress controller knows which service to route the request to.

2
  • I was thining some thing like this should be possible-serverfault.com/questions/371907/…. I need this in URL format to pass as a target to blackbox-exporter Commented Nov 25, 2021 at 14:44
  • Yeah, except this is NOT A HOST HEADER. it is basic authentication parameters encoded in the URL - and a target that expects this. What you mean would add a parameter to EVERY URL (making them unique) AND would have to be supported by the load balancer - totally different game. Commented Nov 25, 2021 at 14:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.