Graylog 登录时出现 404 错误
404 Error at Graylog login
我目前正在尝试让 Graylog 工作。我安装了以下 graylog-settings.json :
local-ip 是我们网络上的 graylog 服务器本地 ip。
graylog.domain.com是我们的graylog外域
{
"timezone": "Europe/Paris",
"smtp_server": "smtp.gmail.com",
"smtp_port": 465,
"smtp_user": "xxxx",
"smtp_password": "xxxx",
"smtp_from_email": "graylog@graylog",
"smtp_web_url": "http://graylog",
"smtp_no_tls": false,
"smtp_no_ssl": false,
"master_node": "127.0.0.1",
"local_connect": false,
"current_address": "local-ip",
"last_address": "local-ip",
"enforce_ssl": false,
"journal_size": 1,
"node_id": false,
"internal_logging": true,
"web_listen_uri": false,
"web_endpoint_uri": false,
"rest_listen_uri": false,
"rest_transport_uri": false,
"external_rest_uri": "http://graylog.domain.com:9000/",
"custom_attributes": {
}
}
我们有一个 PFSense(我在每个端口上都列入了白名单)。
我配置了一个 NAT 条目以在我的 graylog 服务器上发送所有 9000 请求。
我将我的 NGinx 代理配置为将所有 graylog.domain.com 发送到 local-ip
这是问题所在:
如果我到达 graylog.domain.com:80,我可以看到登录页面,但是任何登录尝试,我都会得到:
Error - the server returned: 404 - cannot POST
http://graylog.domain.com:9000/system/sessions (404)
如果我达到 graylog.domain.com:9000,我会直接得到这个错误(没有登录页面):
We are experiencing problems connecting to the Graylog server running
on http://local-ip:9000/api/. Please verify that the server is
healthy and working correctly.
You will be automatically redirected to the previous page once we can
connect to the server.
Do you need a hand? We can help you.
More details
我是 RTFM,但我无法获得正确的配置。有人可以帮忙吗?
编辑:
感谢@joschi,我设法让它工作。现在这是我的 conf 文件:
{
"timezone": "Europe/Paris",
"smtp_server": "smtp.gmail.com",
"smtp_port": 465,
"smtp_user": "xxx",
"smtp_password": "xxx",
"smtp_from_email": "graylog@graylog",
"smtp_web_url": "http://graylog",
"smtp_no_tls": false,
"smtp_no_ssl": false,
"master_node": "127.0.0.1",
"local_connect": false,
"current_address": "local-ip",
"last_address": "local-ip",
"enforce_ssl": false,
"journal_size": 1,
"node_id": false,
"internal_logging": true,
"web_listen_uri": false,
"web_endpoint_uri": false,
"rest_listen_uri": false,
"rest_transport_uri": false,
"external_rest_uri": "http://external-ip:9000/api/",
"custom_attributes": {
}
}
我使用以下命令更新我的 conf 文件:
sudo graylog-ctl set-external-ip "http://external-ip:9000/api/"
当然,external-ip就是我们的public IP。
您的external_rest_uri
设置有误。它必须指向 Graylog REST API.
的 URI
您也不应该手动编辑 graylog-settings.json
(除非您确实需要一些高级设置),而是使用 graylog-ctl
命令。
有关 graylog-ctl
命令的更多信息,请阅读 http://docs.graylog.org/en/2.1/pages/configuration/graylog_ctl.html。
我目前正在尝试让 Graylog 工作。我安装了以下 graylog-settings.json :
local-ip 是我们网络上的 graylog 服务器本地 ip。
graylog.domain.com是我们的graylog外域
{
"timezone": "Europe/Paris",
"smtp_server": "smtp.gmail.com",
"smtp_port": 465,
"smtp_user": "xxxx",
"smtp_password": "xxxx",
"smtp_from_email": "graylog@graylog",
"smtp_web_url": "http://graylog",
"smtp_no_tls": false,
"smtp_no_ssl": false,
"master_node": "127.0.0.1",
"local_connect": false,
"current_address": "local-ip",
"last_address": "local-ip",
"enforce_ssl": false,
"journal_size": 1,
"node_id": false,
"internal_logging": true,
"web_listen_uri": false,
"web_endpoint_uri": false,
"rest_listen_uri": false,
"rest_transport_uri": false,
"external_rest_uri": "http://graylog.domain.com:9000/",
"custom_attributes": {
}
}
我们有一个 PFSense(我在每个端口上都列入了白名单)。
我配置了一个 NAT 条目以在我的 graylog 服务器上发送所有 9000 请求。
我将我的 NGinx 代理配置为将所有 graylog.domain.com 发送到 local-ip
这是问题所在:
如果我到达 graylog.domain.com:80,我可以看到登录页面,但是任何登录尝试,我都会得到:
Error - the server returned: 404 - cannot POST http://graylog.domain.com:9000/system/sessions (404)
如果我达到 graylog.domain.com:9000,我会直接得到这个错误(没有登录页面):
We are experiencing problems connecting to the Graylog server running on http://local-ip:9000/api/. Please verify that the server is healthy and working correctly.
You will be automatically redirected to the previous page once we can connect to the server.
Do you need a hand? We can help you.
More details
我是 RTFM,但我无法获得正确的配置。有人可以帮忙吗?
编辑:
感谢@joschi,我设法让它工作。现在这是我的 conf 文件:
{
"timezone": "Europe/Paris",
"smtp_server": "smtp.gmail.com",
"smtp_port": 465,
"smtp_user": "xxx",
"smtp_password": "xxx",
"smtp_from_email": "graylog@graylog",
"smtp_web_url": "http://graylog",
"smtp_no_tls": false,
"smtp_no_ssl": false,
"master_node": "127.0.0.1",
"local_connect": false,
"current_address": "local-ip",
"last_address": "local-ip",
"enforce_ssl": false,
"journal_size": 1,
"node_id": false,
"internal_logging": true,
"web_listen_uri": false,
"web_endpoint_uri": false,
"rest_listen_uri": false,
"rest_transport_uri": false,
"external_rest_uri": "http://external-ip:9000/api/",
"custom_attributes": {
}
}
我使用以下命令更新我的 conf 文件:
sudo graylog-ctl set-external-ip "http://external-ip:9000/api/"
当然,external-ip就是我们的public IP。
您的external_rest_uri
设置有误。它必须指向 Graylog REST API.
您也不应该手动编辑 graylog-settings.json
(除非您确实需要一些高级设置),而是使用 graylog-ctl
命令。
有关 graylog-ctl
命令的更多信息,请阅读 http://docs.graylog.org/en/2.1/pages/configuration/graylog_ctl.html。