1

I used reverse proxy but seeing the nginx log it changes the address to ip and it doesn't work because the destination server is vhost and it only works with domains.

location  = /video {
    resolver 8.8.8.8;
    if ( $arg_net != "" ) {
        proxy_pass https://$arg_net.serverA.com;
    }
    proxy_redirect off;
  }

I see in the nginx log

... upstream: "https://[2a02:2518:4:3875::d]:443/video?net=...

How can I use it only with the domain??

Joe
  • 11
  • 2

1 Answers1

1

That's why proxy_set_header exists, and you need

proxy_pass https://$arg_net.serverA.com;
proxy_set_header Host "$arg_net.serverA.com";

https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/#passing-request-headers

Lex Li
  • 1,235
  • 8
  • 10