代理Kibana

时间:2016-01-21 08:50:59

标签: nginx proxy kibana

我遇到了一些(很多)困难,试图为Kibana设置反向代理。

一般的想法是我们想要设置反向代理,以便选择客户可以访问Kibana。例如。当客户A转到“kibana.company.com/ customera”时,他会自动转发到Kibana,并可以访问有关其数据的物流。我们需要代理多个客户,因此最终我们将设置ldap或AD,以帮助我们处理此问题。

到目前为止,我已经尝试了Apache2和Nginx,但我遇到了使用它们的问题。我目前正在研究Apache,配置非常简单。

http://pastebin.com/1gt5KLyP

当我去localhost / kibana /我转发到localhost / app / kibana时,我收到了一条未找到网址的消息。

就NginX而言,我遇到了一个问题,我转发到Kibana,但它无限期地陷入了加载循环。 (“Kibana正在加载blablabla ......好东西将被缓存”),但我从未真正显示仪表板,无论我尝试哪种配置,我都无法显示仪表板。这是一个示例配置,但在测试过程中它发生了很大变化。

http://pastebin.com/PP4Fu1Cs

我是以正确的方式去做,还是他们做我想做的事情的简单方法。

编辑:我现在在添加

后得到与Apache相同的结果

ProxyPass / kibana / http:// ip / app / kibana

ProxyPassReverse / kibana / http:// ip / app / kibana

3 个答案:

答案 0 :(得分:0)

你能做一个FIDDLER,看看它被困在哪里。

我使用Apache成功完成了一个反向代理,并成功完成了以下配置。

ProxyPreserveHost ON

ProxyPass /portal1     http://IP1/home

ProxyPassReverse /portal2   http://IP2/home

这些是我加载的模块

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

<IfModule mod_proxy.c>
ProxyVia On
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
</IfModule>

答案 1 :(得分:0)

要摆脱Kibana永久停留在加载屏幕上的问题,您可以尝试以下方法:

  1. 在Ubuntu上停止Kibana服务:

    sudo service kibana stop

  2. 删除optimize/bundles目录:

    sudo rm -rf /opt/kibana/optimize/bundles

  3. 在Ubuntu上启动Kibana服务:

    sudo service kibana start

  4. 在重新加载浏览器之前等待一分钟左右(您可以关注/var/log/kibana.log上的日志以查看服务器何时再次准备就绪。

答案 2 :(得分:0)

我认为你的代理阻止了一些kibana的请求。检查浏览器检查员的所有请求和响应,不应该有任何错误。

nginx中有一个简单的配置:

import Foundation
import CoreBluetooth

class BluetoothController : NSObject, CBPeripheralManagerDelegate {
    var delegate : BluetoothControllerDelegate?
    var manager : CBPeripheralManager?

    init(_ delegate : BluetoothControllerDelegate) {
        super.init()
        manager = CBPeripheralManager(delegate: self, queue: nil)
        self.delegate = delegate

        self.delegate?.statusUpdate("init")
    }

    func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager){
        delegate?.statusUpdate("Perepheral did update state : \(peripheral.state)")

        if(peripheral.state == CBManagerState.poweredOn){
            addServices()
        }
    }

    func addServices(){
        let service = CBMutableService(type: CBUUID.init(string: "e1fa36b4-9700-414b-a4e0-382a3e249e56"), primary: true)
 //       service.
        manager?.add(service)
    }

    func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?){
        delegate?.statusUpdate("Service was added : \(service.uuid)")
        manager?.startAdvertising(getAdvertisementData(service))

    }

    func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?){
        delegate?.statusUpdate("peripheralManagerDidStartAdvertising : \(peripheral.isAdvertising) : \(error.debugDescription)")
    }


    private func getAdvertisementData(_ service : CBService) -> Dictionary<String, Any>{
        var data : Dictionary<String, Any> = Dictionary<String, Any>()

        data["CBAdvertisementDataLocalNameKey"] = "e1fa36b4-9700-414b-a4e0-382a3e249e56"

        data["CBAdvertisementDataServiceUUIDsKey"] = [service.uuid]

        return data
    }
}

如果您只想显示没有任何其他按钮和面板的图表,只需将 class Program { static void Main(string[] args) { BluetoothLEAdvertisementWatcher watcher = new BluetoothLEAdvertisementWatcher(); watcher.ScanningMode = BluetoothLEScanningMode.Active; watcher.Received += Watcher_Received; DeviceWatcher devWatcher = DeviceInformation.CreateWatcher(); devWatcher.Added += DevWatcher_Added; devWatcher.Updated += DevWatcher_Updated; watcher.Start(); devWatcher.Start(); while (true) { } } private static void DevWatcher_Updated(DeviceWatcher sender, DeviceInformationUpdate args) { Console.Write("\nUpdated\n"); } private static void DevWatcher_Added(DeviceWatcher sender, DeviceInformation args) { // Console.Write("Added : "+args.Name+"\n"); } static List<ulong> tried = new List<ulong>(); private static async void Watcher_Received(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args) { if (tried.Contains(args.BluetoothAddress)) { return; } tried.Add(args.BluetoothAddress); Console.Write("Device found ================================================="); Console.Write("\nDataSections: " + args.Advertisement.DataSections[0].Data); //BluetoothLEDevice device = BluetoothLEDevice device = await BluetoothLEDevice.FromBluetoothAddressAsync(args.BluetoothAddress); try { Console.Write("\n GattServices: " + device.GetGattService(Guid.Parse("e1fa36b4-9700-414b-a4e0-382a3e249e56")).Uuid); }catch(Exception e) { Console.Write(e.ToString()); } if(device.DeviceInformation == null) { Console.Write("DeviceInformation null"); return; } if(device.DeviceInformation.Pairing == null) { Console.Write("Pairing null"); return; } var res = await device.DeviceInformation.Pairing.PairAsync(DevicePairingProtectionLevel.None); Console.Write("Pair complete (?) ========================================"+res.Status); } } 参数添加到您的网址即可。

location ~ (|/app/kibana|/bundles/|/status|/plugins|/elasticsearch/|)  {
    proxy_pass http://kibana:5601;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    rewrite /(.*)$ /$1 break;
}