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.

k8dev
  • 1
  • 1
  • 1
  • I cannot find any converter which converts curl or http request to URL which can be executed in browsers like chrome – k8dev Nov 25 '21 at 13:44
  • To get the first request the URL might be http://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. – NiKiZe Nov 25 '21 at 15:41

2 Answers2

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.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
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.

hardillb
  • 1,275
  • 1
  • 9
  • 19
  • I was thining some thing like this should be possible-https://serverfault.com/questions/371907/can-you-pass-user-pass-for-http-basic-authentication-in-url-parameters/471667#471667. I need this in URL format to pass as a target to blackbox-exporter – k8dev Nov 25 '21 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. – TomTom Nov 25 '21 at 14:45