经常遇到需要把http配置成https的情况,但是在配置kibana的时候加上路径可能会遇到困难,不加路径没有问题,这里说的是假路径,因为kibana的跳转路径是他自己写死的,例如登录等,其实只需要nginx配置kibana一起配置即可。
1.nginx常规配置,配的443端口给到kibana
1 server { 2 listen 443 ssl; 3 #listen 10080; 4 server_name _; 5 #ssl on; 6 ssl_certificate /isearch/nginx/conf/ssl/server.crt; # 改成你的证书的名字 7 ssl_certificate_key /isearch/nginx/conf/ssl/server.key; # 你的证书的名字 8 ssl_verify_depth 1; 9 #charset koi8-r; 10 11 #access_log logs/host.access.log main; 12 error_page 404 403 500 502 503 504 /404.html; 13 14 location = /404.html { 15 root /isearch/nginx/html; 16 } 17 18 19 location /els { 20 proxy_pass http://192.168.0.184:5601; 21 } 22 }
这里配置了路径为els,那么接下来我们需要去配置kibana所对应的配置
1 # Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values. 2 # The default is ‘localhost‘, which usually means remote machines will not be able to connect. 3 # To allow connections from remote users, set this parameter to a non-loopback address. 4 server.host: "192.168.0.184" 5 6 # Enables you to specify a path to mount Kibana at if you are running behind a proxy. 7 # Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath 8 # from requests it receives, and to prevent a deprecation warning at startup. 9 # This setting cannot end in a slash. 10 server.basePath: "/els" 11 12 # Specifies whether Kibana should rewrite requests that are prefixed with 13 # `server.basePath` or require that they are rewritten by your reverse proxy. 14 # This setting was effectively always `false` before Kibana 6.3 and will 15 # default to `true` starting in Kibana 7.0. 16 server.rewriteBasePath: true
这里面重点是
1.server.basePath: "/els" 这个配置需要个nginx里面一致。
2.server.rewriteBasePath: true 这个配置需要打开
目前这个是我遇到nginx配置kibana的https遇到的问题。
原文:https://www.cnblogs.com/insearch/p/12926997.html