gpt4 book ai didi

docker - Elasticsearch -APPSearch主机无法与Docker配合使用

转载 作者:行者123 更新时间:2023-12-02 19:22:45 25 4
gpt4 key购买 nike

我在appsearch docker镜像上使用 flex 搜索,在localhost上一切正常,但是当我尝试托管镜像并使用nginx路由时,appsearch会继续路由到localhost:3002而不是主机url

Dockercompose文件

version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.0
environment:
- "node.name=es-node"
- "discovery.type=single-node"
- "cluster.name=app-search-docker-cluster"
- "bootstrap.memory_lock=true"
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
appsearch:
image: docker.elastic.co/app-search/app-search:7.3.0
environment:
- "elasticsearch.host=http://elasticsearch:9200"
- "allow_es_settings_modification=true"
- "JAVA_OPTS=-Xmx256m"
- "SERVER_HOST=https://mywebsite.com"
ports:
- 3002:3002

在从mywebsite.com到localhost:3002的nginx上使用反向代理
每次我访问mywebsite.com时,它都会重定向到localhost:3002,有什么解决方案吗?

最佳答案

更改SERVER_HOSTapp_search.external_url现在一切正常

关于docker - Elasticsearch -APPSearch主机无法与Docker配合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58579115/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com