Graylog API-Browser Broken after change to https

After changing the Graylog API to https, the api-browser is dead, it only shows me a login field with no css loaded.

The console outputs me:

Uncaught ReferenceError: $ is not defined
at api-browser:30
(anonymous) @ api-browser:30
api-browser:6 Resource interpreted as Stylesheet but transferred with MIME type text/html: "".
api-browser:5 Resource interpreted as Stylesheet but transferred with MIME type text/html: "".
api-browser:7 Resource interpreted as Stylesheet but transferred with MIME type text/html: "".

Graylog config:

rest_listen_uri =
rest_transport_uri =
web_listen_uri =

Nginx config:

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
      listen 80;

      if ($host = '' ){
          rewrite ^/(.*)$ permanent;
      return 301$request_uri;
      error_page 502 /502.html;
      location  /502.html {
    server {
      listen 443 ssl;

      if ($host = '' ){
          rewrite ^/(.*)$ permanent;

      ssl on;
      ssl_dhparam /etc/nginx/ca/dhparams.pem;
      ssl_certificate /etc/nginx/ca/graylog.crt;
      ssl_certificate_key /etc/nginx/ca/graylog.key;
      ssl_session_timeout 5m;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_prefer_server_ciphers on;

  location /
        proxy_set_header    Host $http_host;
        proxy_set_header    X-Forwarded-Host $host;
        proxy_set_header    X-Forwarded-Server $host;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Graylog-Server-URL;

      location /api/ {
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    Host $http_host;

      error_page 502 /502.html;
      location  /502.html {

Which version of Graylog are you using?

Oh sorry i missed that:

Graylog 2.2.0+d9681cb on (Oracle Corporation 1.8.0_131 on Linux 3.10.0-514.16.1.el7.x86_64)

And i want to wait with the Upgrade to 2.3 bcs of the huge ES upgrade.

What’s the URI you’re using to access the API Browser (Swagger UI)?

I use the Button in the Graylog GUI next to the Node information.

It gives me:

Graylog 2.2.0 should use the path component of rest_transport_uri to build URIs in Swagger:

EDIT: Wrong, Graylog 2.2.0 is using the path component of rest_listen_uri to build URIs in Swagger

So, my graylog config is not correct, or my nginx config is not correct? I dont get it. :disappointed_relieved:

Argh, my fault. And it’s even saying it in the code…

Graylog 2.2.0 is using the path component of the rest_listen_uri setting, which is empty (or /) in your case. Try setting rest_listen_uri = (also see the default in Graylog 2.2.0).

Is there any reason you’re not using the default setting for rest_listen_uri (especially the port)?

rest_listen_uri = was my old configuration, I prefer to use only https for the api. So rest_listen_uri = would expose it without TLS.

You’re using a reverse proxy for terminating the HTTPS endpoint, so the schema used in rest_listen_uri doesn’t matter here.

I see, so when i change it to rest_listen_uri = Graylog GUI doesnt work anymore i get: We are experiencing problems connecting to the Graylog server running on Please verify that the server is healthy and working correctly.

You have to adapt your nginx configuration to the changed URI of the Graylog REST API.

FWIW, using the same port for the Graylog REST API and the web interface, and using the nginx configuration from the documentation at would save you some hassle.

Ok thanks, i changed it, so its the same as described in

REST API and Web Interface on one port (using HTTPS/SSL):

But I get the same ERROR as in the Post above.

EDIT: Changing the rest_listen_uri to rest_listen_uri = solved it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.