Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.38k stars 1.06k forks source link

API browser should use relative links #1576

Open kroepke opened 8 years ago

kroepke commented 8 years ago

It seems like certain proxy setups have problems with the links the API browser code generates.

Since this is adapted Swagger code we don't have direct control over it, investigate if we can update the version or tweak it so that proxy support is actually possible.

juhau1 commented 8 years ago

+1 for getting this fixed. API browser is currently not working behind proxy.

Swagger has options to change the UI path, see options.apiDocs and options.swaggerUi in https://github.com/apigee-127/swagger-tools/blob/master/docs/Middleware.md.

davama commented 6 years ago

I know this is quite old. @jalogisch kindly referenced me to this ticket. Any chance to attempt this? Thanks!

ntimo commented 4 years ago

Any chance this is going to be fixed soon? Would be nice to be able to explore the API behind a reverse proxy.

xWTF commented 3 months ago

I'm a bit surprised that this issue still wasn't fixed in Graylog 6.0.

If you're using Nginx, here's one way to fix it using http_sub_module:

location ~ ^/api/api-(browser/$|docs/) {
    proxy_set_header Accept-Encoding "";

    sub_filter 'http://<Your Node IP>:80/' '$scheme://$host/';
    sub_filter_once off;
    sub_filter_types text/html application/json;

    proxy_pass http://<Your Node IP>;
}