This does not seem to be the way it is working for me. This looks like it works for you because your example you are not changing the domain. Event though I am setting the headers at both the gateway or on the post it does not seem like the code is using them for generating the location.
Setup.
- docker running on web app. url: https://myserver.azurewebsites.net
- Application gateway. This does a rewrite rule to forward this request from xxx.domain.com/reportserver/jsr to docker app (line 1). I did add a X-Forwarded-For hearder on gateway for domain(did not help) screenshot below.
- appPath to be /reportserver/jsr. This fixes the pathing in the browser and directs request to the correct url because of application gateway.
Screen shot from jseport showing correct url for the api to post requests to.
This is a screen shot from postman posting to the url. As you can see the location has the azure web app url along with the appPath.
app gateway rewrite rule for X-Forwarded-For
Additional attempt to apps the X-Forwarded-For and X-Forwarded-Host headers in the postman request.
Is there a way to see if the headers are making it to jsreport? Also is there a way to turn on a verbose logging to see what the app log is doing?