nginx的安装配置在前面的博客中有提到过,这里记录下如何配置访问log目录。
1 首先,设置权限
配置须要访问的log目录有权限

chmod -R /.../...
1在nginx.conf文件中,添加或覆盖下面一行
user root;
12 配置server节点
server {
listen 64001;
server_name beta3.hadoop.feidai.com;
charset utf-8;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
autoindex on;
}
location /feidai-kafka-kudu/bin/slog {
root /root;
autoindex on;
}
location /feidai-canal-kafka/bin/slog {
root /root;
autoindex on;
}
......
1234567891011121314151617181920212223242526个中添加了两个location节点,配置autoindex on;使其能展示目录。
在location节点里面配置alas会把指定路径当作文件路径,
而配置root会把指定路径拼接到文件路径后,再进行访问。
这里利用root配置。
访问实例:http://beta3.hadoop.feidai.com:64001/feidai-kafka-kudu/bin/slog/
整合到监控平台的效果如下图