hello everyone ! i need help !!!!
when i use nginx to proxy kibana ,i find a tricky problem.
at the beginning ,everything is ok. but several minutes later, 502 bad gateway is starting to appear! i hava no idea to solve the problem!
my kibana is running in a docker container
hear is my nginx config:
location /kibana/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_pass http://192.168.197.36:5601;
}
and here is my kibana.yml
server.host: "0.0.0.0"
server.shutdownTimeout: "5s"
monitoring.ui.container.elasticsearch.enabled: true
i18n.locale: "zh-CN"
elasticsearch.hosts: ['https://172.18.0.2:9200']
elasticsearch.serviceAccountToken: AAEAAWVsYXN0aWMva2liYW5hL2Vucm9sbC1wcm9jZXNzLXRva2VuLTE3MDM2OTU1MTY4MjM6dzlscHBzMGtRY2U1cmdRM2Y2VXFGZw
elasticsearch.ssl.certificateAuthorities: [/usr/share/kibana/data/ca_1703695517724.crt]
xpack.fleet.outputs: [{id: fleet-default-output, name: default, is_default: true, is_default_monitoring: true, type: elasticsearch, hosts: ['https://172.18.0.2:9200'], ca_trusted_fingerprint: a4eda4584e65805baae3f907bf9760f980496eb299273ce139892b1b0721e987}]
server.basePath: "/kibana"
server.rewriteBasePath: true
so , when i use these config, at the beginning , no errors, after two or three minites, 502 ! 502! 502! why ???
and i also found , i did nothing ,but maybe ten minutes later ,everything is ok, 502 disappear,why ???
by the way , here is the kibana's error info when 502 bad gateway:
Error: Batch request failed with status 502
at search_interceptor_SearchInterceptor.handleSearchError (https://myurl/kibana/55572/bundles/plugin/data/kibana/data.plugin.js:1:410387)
at https://myurl/kibana/55572/bundles/plugin/data/kibana/data.plugin.js:1:413128
at https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:364:106267
at s._error (https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:29524)
at t.error (https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:88987)
at https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:329:46099
at o (https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:252982)
at t.error (https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:329:45966)
at Object.error (https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:430606)
at e.error (https://myurl/kibana/55572/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:89793)