Reverse proxy not working after 3.0 upgrade

Hello. We recently upgraded to Graylog 3.0 and updated server.conf and everything is working, with the exception of our reverse proxy. Everything in the setup is the same with the exception of ‘X-Graylog-Server-URL https://$server_name/api’ which I changed to ‘X-Graylog-Server-URL https://$server_name/’.

When I hit the proxy, I see a 502 error, but when I hit the IP:9000 everything works. Any idea what might be happening?

Thanks!

Make sure you set the “new” http settings in the server.conf - if you use it with the old settings, strange things happen :slight_smile:

@benvanstaveren I think so? I transferred all of the things that were supposed to be transferred. I assume if the web UI works at the IP:port then it would stand to reason that the UI should work with the proxy? In addition, if I do a curl from the proxy machine, I get the HTML for the Graylog web ui. That said, it still throws a 502.

With 3.0 do I have to specifically tell Graylog that it will be running at graylog.example.com?

Nope, you only need the external http uri setting if you’re running behind a loadbalancer (at least, that’s how I think it works), but yeah, I’m unsure as to why it wouldn’t work - could you maybe post your config (or the relevant pieces of it, at any rate) because I have no idea why it’d give you a 502 :frowning:

Sweet, here that is:
https://paste.laravel.io/18626dfb-a95b-45f7-8306-cde8e174de5b

This one is weird!

I also tried commenting out http_publish_uri and that results in the UI still working but the same 502.

Okay so you can reach the UI on the 192 IP, but not through your reverse proxy? Are you sure the reverse proxy is pointed at the right IP/port? If you’re using nginx (I assume so), ensure the upstream statement and/or proxy-pass statement go to the 192 IP on port 9000.

Alternatively check the nginx error log, see what it has to say about it :slight_smile:

Exactly. In addition, the curl command from the reverse proxy works just fine. Here’s the location block:

location / {
allow 192.168.0.0/16;
deny all;
proxy_pass http://192.168.50.81:9000;
proxy_read_timeout 90s;
proxy_connect_timeout 90s;
proxy_send_timeout 90s;
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 https://$server_name/;
}

The error log actually does not say anything, because this is the weirdest error ever.

Oh! I found it. It fails when you add the header:
<p>org.glassfish.jersey.message.internal.HeaderValueException: Unable to parse &quot;Accept&quot; header value: &quot;*/* X-Graylog-Server-URL:

Wait, damn it, it was a bad curl command. Never mind, even adding the header works just fine.

I am an idiot. It was DNS. I’m fired.

:smiley:

Hand over your geek pass at reception! :stuck_out_tongue:

Anyway, problem solved, all is well, no buildings burnt down, so great success! Shit happens :wink:

@benvanstaveren thanks man - I appreciate your chill attitude after I wasted your time :slight_smile: Have a great weekend!

Hah no worries, it’s never a waste of time :slight_smile:

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