I am running Stellar core and Horizon behind an Nginx reverse proxy and encountering issues with the _link.href output by Horizon. The SSL is terminated at nginx, with the connection to Horizon non-SSL.

The Horizon API is accessed via https://xxx-test.example.com but the output by Horizon _links is always of the form http://xxx-test.example.com/accounts (ie non HTTPS).

I cant seem to find a definitive resource in the docs for how to modify the output to be https (or even change the base url) for all links. I see from the public Stellar testnet, that all of the _links.href values are https, so I know it is possible but just unsure how.

Is the output URL protocol dynamic based on the incoming protocol? Is there a config I can use to override?

1 Answer 1


You have to set the X-Forwarded-Proto: https header in your proxy.

how to nginx

or haproxy:

backend ...    
    http-request set-header X-Forwarded-Proto https
  • This appears to fix the issue for me. To confirm: there is no config or override I can set with Horizon in order to set the base URL and protocol and avoid it being dynamic?
    – Chris I
    Commented Mar 15, 2019 at 13:19
  • I remember how I wanted to use a different base URL with a sub path, but as far as I know the URL is constructed and not configurable at all.
    – sui
    Commented Mar 15, 2019 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.