A
A
Alexey Belov2018-08-25 17:16:41
Nginx
Alexey Belov, 2018-08-25 17:16:41

Why doesn't Nginx work with docker-compose?

server {
    listen 80;
    server_name tnd.zaoios.ru;
    
    location / {
        uwsgi_pass django:2021;
        include  /container/tnd/docker/uwsgi_params;
    }

    location ~ ^/(static|media) {
        root /container/tnd/;
        gzip_static on;
        gzip_types text/plain text/xml text/css text/comma-separated-values
            text/javascript application/x-javascript application/atom+xml;
        access_log off;
        expires 30d;
    }
}

There is such an nginx config and this is how it looks in docker-compose
nginx:
    image: nginx
    restart: always
    volumes:
      - ../:/container/tnd
      - ./nginx:/etc/nginx/conf.d
    ports:
      - "8080:80"
    depends_on:
      - django
    command: /bin/bash -c '/container/tnd/docker/run_nginx.sh'
    container_name: container-nginx

Everything starts and works, inside the nginx container is in perfect order, all the configs are where they should be, but for some reason the host is empty, there is simply nothing, no Apache, no nginx errors

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2018-08-25
@POS_troi

Because compose thinks for you and without it you need to think for yourself :)
Study the documentation for the tools https://docs.docker.com/network/links/#communicati...
section Communication across links

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question