The server returned: 404 - cannot POST

Hi all!
I know this issue has been created in several other post but I am not sure the fix is the same…
So in fact I have set those 2 settings:

rest_listen_uri = http://192.168.1.10:9000/api/
web_listen_uri = http://192.168.1.10:8000/

I need the rest api to be on a specific IP because I use the filebeat sidecar
I also set the web interface to an ip ans a port to reach it instead of using a tunnel.
My issue is when I use nginx to access the web interface. This is what I have from the doc:

server
{
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name 192.168.1.10;

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 http://$server_name/api;
  proxy_pass       http://192.168.1.10:8000;
}

}

With this setting, I got the issue of 404 - cannot POST.

Any advice on this?
Note that I am using graylog server 2.4.6 and sidecar 0.1.6 installed onto another host.

Update
I have tested with:
web_listen_uri = http://127.0.0.1:8000/
and
proxy_pass http://127.0.0.1:8000

and got the same issue…

Possible FIX

This nginx config seems to work!! (ref: API browser (Swagger interface) does not work with AWS appliance · Issue #3519 · Graylog2/graylog2-server · GitHub)

server
{
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name 172.31.254.42;

location / {
  proxy_set_header Host $http_host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_pass       http://192.168.1.10:8000;
}

}

Thanks!

What Version of Graylog did you use?

Did you checked running API and Web on the same port?

Check that part of the configuration: http://docs.graylog.org/en/2.4/pages/configuration/web_interface.html#making-the-web-interface-work-with-load-balancers-proxies

check the settings that are assumed in the examples and adjust that to your configuration - or change the configuration to the examples.

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