0

I am using nginx as a reverse proxy.graylog uri conf

graylog.conf:

rest_listen_uri= http://127.0.0.1:9000/
rest_transport_uri = http://192.168.1.1:9000/api/

nginx.conf:

server {
      server_name graylog.example.in;
      listen      80 default_server;

      return 301 https://$server_name$request_uri;

    }

    server {

      server_name graylog.example.in;
      listen      443 ssl;



      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 https://graylog.example.in/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:12219/;
      #}
    }

I am getting error from nginx log

91#0: *1148 connect() failed (111: Connection refused) while connecting to upstream,

nginx log 2017/03/08 23:57:11 [error] 1194#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 137.97.3.237, server: , request: "POST /api/cluster/metrics/multiple HTTP/1.1", upstream: "http://127.0.0.1:9000/api/cluster/metrics/multipl

tessie
  • 101
  • 5
  • Please refer to http://docs.graylog.org/en/2.2/pages/configuration/web_interface.html for *working* example configurations for running nginx in front of Graylog. – joschi Mar 08 '17 at 08:33
  • Hi, Your Graylog configuration miss some configuration : web_endpoint_uri = https://graylog.example.in/api/ . However, the Nginx Error log does not involve in the above configuration. Please check your Graylog is running on 127.0.0.1:9000 – Summer Nguyen Mar 08 '17 at 11:14
  • Seems I found the issue.I am facing disk out of space.and Elastic search clusters was in red state – tessie Mar 08 '17 at 11:17

1 Answers1

0

here's mine

graylog

web_listen_uri = http://0.0.0.0:9000/
rest_listen_uri = http://0.0.0.0:12900/
rest_transport_uri = http://127.0.0.1:12900/

nginx

    location / {
    proxy_http_version 1.1;
    proxy_set_header X-Graylog-Server-URL https://graylog.example.com/api;
    proxy_pass http://127.0.0.1:9000;
}
location /api/ {
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:12900/;
Jacob Evans
  • 7,886
  • 3
  • 29
  • 57