Traefik reverse proxy and redirects

Are you having trouble getting Virtual Radar Server installed and running? If so then this is the place to ask about it.
Post Reply
benfayers
Posts: 4
Joined: Tue Jul 02, 2019 10:10 pm

Traefik reverse proxy and redirects

Post by benfayers » Fri Jul 05, 2019 7:58 pm

I have "Reverse" proxy mode set in the VRS Web Admin settings.

If I go to vrs.[mydomain]/VirtualRadar/desktop.html it works perfectly fine, however If i go to vrs.[mydomain]/VirtualRadar I am redirected to 192.168.0.213:8080/VirtualRadar/desktop.html

What can I do to stop this and make it redirect to the domain properly?

Here is my Traefik config for this subdomain:

Code: Select all

[http.middlewares]
    [http.middlewares.vrsPrefix.AddPrefix]
      prefix = "/VirtualRadar/"
    [http.middlewares.gotohttps.redirectscheme]
      scheme = "https"
    [http.middlewares.vrsHeaders.headers]
      Host = "vrs.[mydomain]"
      
 [http.routers.vrsRouter]
      rule = "Host(`vrs.[mydomain]`)"
      service = "vrs"
      middleswares = ["vrsHeaders", "gotohttps"]
      [http.routers.vrsRouter.tls]
Thanks,
Ben

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Traefik reverse proxy and redirects

Post by agw » Mon Jul 22, 2019 9:28 pm

Sorry for the late reply.

I think the proxy setting in VRS modifies how it builds the redirection URL when a request comes in for a partial address. Looking at the code I think when it's set to reverse proxy it uses the endpoint address off the request, if it's a forward proxy it uses the domain specified in the request.

I think you might just need to flip the VRS proxy type from reverse proxy to forward proxy?

Post Reply