Name-based Virtual Host Support to access backend URL

Tried proxy passing first.domain.com to second.domain.com domain using the below traefik toml entries. But facing issues to Name-based Virtual Hosted urls.

While trying, the request wont reach properly to backend url if the url configured at destination is nginx virtual host , but instead traefik forwards requests to default site in that nginx configuration.

This setup works fine if we point the backend url to a service listening in port http://<BACKEND_SERVER_IP>:<BACKEND_SERVER_PORT>

traefik.toml entry below:-

[backends]
[backends.postgrest]
    [backends.postgrest.servers]
        [backends.postgrest.servers.server0]
        url = "https://second.domain.com"

[frontends.domain]
  entryPoints = ["https"]
  backend = "postgrest"
  passHostHeader = true
  [frontends.domain.routes]
    [frontends.domain.routes.route0]
    rule = "Host:first.domain.com"

Tried with traefik version 1.7 and version 2.2