REST API browser (graylog 3.1) not accessible behind nginx reverse proxy

I was visiting /api/api-browser but that is not the correct url it seems.

I clicked the global api browser in system/nodes and it redirects me to:
https://localhost/graylog/api/graylog/api-browser/global/index.html which gives me a 404 not found

I then manually edit the url to https://localhost/graylog/api/api-browser/global/index.html which does load the api browser visually but it does not function.

Closer inspection shows that the console has ~69 errors all like this:

shred.bundle.js:2608 GET https://localhost/graylog/api/api-docs/global/streams/{streamid}/alerts/{alertId}/history 500 (Internal Server Error)

The HTTP response is:

java.net.URISyntaxException: Illegal character in path at index 48: http://localhost:80/api/api-docs/global/streams/{streamid}/alerts/{alertId}/history

thanks!