mustafabarakat
mustafabarakat

Reputation: 419

Elastic Search - APPSearch host not working with docker

i'm using elastic search with appsearch docker images, all is working fine on localhost, but when i try to host the images and route using nginx, appsearch keeps routing to localhost:3002 instead of the host url

Dockercompose file

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

using reverse proxy on nginx from mywebsite.com to localhost:3002 everytime i access mywebsite.com, it redirects to localhost:3002, any solution ?

Upvotes: 1

Views: 459

Answers (1)

mustafabarakat
mustafabarakat

Reputation: 419

changed SERVER_HOST to app_search.external_url all is working good now

Upvotes: 1

Related Questions