Skip to content

Base url used in responses from FHIR service use internal urls when behind an Application Gateway #3526

Open
@dfjones1981

Description

@dfjones1981

Describe the bug
We have a FHIR server running in an Azure Health Data Services workspace. The FHIR server is not accessible directly, all requests are routed through a public endpoint at an Application Gateway. This means the url of the FHIR server is not exposed or usable externally. When we make requests to the FHIR server via the application gateway, the responses contain hateoas links to things like the next page of search results, but those links are using the internal url and therefore do not work. Is it possible to configure the FHIR server or the Application Gateway so that those urls use the correct external base url?

We've tried various options in the gateway backend settings for "Host name - Override with new host name". If we select No then every request returns 502 Bad Gateway.

If we select Yes and choose a specific Host Name other than the host name of the backend FHIR service i.e. xxx.fhir.azurehealthcareapis.com we get 502 Bad Gateway

If we select Yes and set the Host Name to the host name of the backend FHIR service then we get a correct response, but all the links in the response are internal links.

FHIR Version?
R4

Data provider?
SQL Server (Azure Health Data Services FHIR Service so inaccessible to us)

To Reproduce
Steps to reproduce the behavior:

  1. Configure an Azure Application Gateway to route requests to an Azure Health Data Services FHIR service
  2. Make a FHIR search query to the Gateway front end url
  3. Inspect the next and current properties of the response

Expected behavior
The next and current properties should be in the form https://my-external-url.com/

Actual behavior
The next and current properties are in the form https://xxx.fhir.azurehealthcareapis.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug bug bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions