0

My docker compose and nginx config are given below:

docker compose lml

version: '3.7'
services:
  nginx:
    build:
      context: ./nginx
      dockerfile: Dockerfile
    ports:
      - 80:80
    depends_on:
      - weaviate
    links:
      - weaviate

  weaviate:
    image: semitechnologies/weaviate:1.19.6
    restart: on-failure:0
    command:
      - --host
      - 0.0.0.0
      - --port
      - '5555'
      - --scheme
      - http
    ports:
      - "5555:5555"
    volumes:
      - "./data_vector:/var/lib/weaviate"
    environment:
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'text2vec-openai'
      ENABLE_MODULES: 'text2vec-openai,qna-openai'
      CLUSTER_HOSTNAME: 'node1'

inside nginx folder, there are two files, one is a docker file and an nginx.conf. Dockerfile

FROM nginx

ADD nginx.conf /etc/nginx/nginx.conf

EXPOSE 80

nginx.conf

events {}
http {
    upstream weaviate {
            server weaviate:5555;
    }

    server {

        listen 80 default_server;
        listen [::]:80 default_server;

        location /weaviate {
            proxy_pass http://weaviate;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
            break;
        }

        location /health-check {
          return 200;
          access_log off;
        }
    }
}

But when I run it, localhost/weaviate, localhost:80/weaviate gives {"code":404,"message":"path /weaviate was not found"}. Just localhost gives 404. I am very new to this. Why isn't it working?

It would be great if someone can suggest some courses that will help get a quick grasp on nginx

Removed the authentication from weaviate added a links and depends on tried adding upstream (what happens in I just route I host multiple such containers in an ec2 using env0 template. I have a parent nginx container routing all the requests in that server to respective end points. So I didn't add new networks as I am not aware of how it works.

0 Answers0