0

I know this is very basic, but I'm very new to the reverse proxy, network admin world. Could someone provide a high level overview how a reverse proxy knows which server/port to route traffic to? Does it use a HTTP Referer/Origin Header or what?a

Let's say I have a public facing reverse proxy server on my domain: example.com. I want to have maaany subdomains, but do I have to have a public IP address for each subdomain?b Or can I use DNS entries to route that subdomain, e.g.: pl.example.com to my reverse proxyc, which will then route the pl subdomain to a port 1234 on any machine in my private network, which can also be the reverse proxy itself but on another port?d

Here comes what I don't understand, when I route the traffic from pl.example.com to the reverse proxy, how does it know that the traffic came from that particular domain (pl.example.com)?e

I've marked each question with a superscript for easy answering. Feel free to group them together and just link me to something. Thank you!

koral
  • 103
  • 1
  • shortly said since we have dns we only need one ip for a Million sub Domains. the reverseproxy knows that, about the request headers and its configuration. so if pl.dom.corp is entered in the Browser it will first do a dns lookup and then ask the ip for host pl.dom.corp, the reverseproxy has been configured to use 192.168.1.2/ for this and will fetch (from 192.168.1.2) or deliver from cache the content (not 100% correctly but its written to understanding) – djdomi Dec 07 '19 at 12:24

1 Answers1

2

Just as any other web server, an HTTP reverse proxy can look at the Host header to figure out which address the client used to reach the server. This is the same mechanism that is also used by what's known as VirtualHosts.

Bear in mind that with HTTPS the reverse proxy will have to terminate the TLS connection and either forward the request to the backend unencrypted or start a new TLS connection. Alternatively a TLS client can provide the requested host via SNI, Server Name Indication.

al.
  • 925
  • 6
  • 17