我在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_HOST
到app_search.external_url
现在一切正常