Hello dear community,
I’m setting up a graylog as a demo server for my company.
I first tested the thing with no reverse proxy and with the following configuration in server.conf
rest_listen_uri = my lan ip:9000/api
web_listen_uri = my lan ip:9000/
It worked like a charm.
I wanted something more complex : separate api and web ports, and use nginx.
I switched to this :
Nginx :
server
{
listen 80 default_server;
server_name 192.168.41.68;
access_log /var/log/nginx/graylog.access.log;
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://192.168.41.68/api;
proxy_pass http://127.0.0.1:9000;
}
location /api/ {
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_pass http://127.0.0.1:12900/;
}
}
and this in server.conf : web_listen_uri and web_endpoint_uri commented.
rest_listen_uri = http://127.0.0.1:12900/api/
rest_transport_uri = http://192.168.41.68:12900/api/
I get a 404 :
Error message
cannot GET http://192.168.41.68/api/ (404)
I’m out of ideas … Do you have something in mind ?