K
K
kiranananda2019-01-24 19:18:56
Nginx
kiranananda, 2019-01-24 19:18:56

Docker nginx losing 403 host?

Hello.
There are 2 problems.
If I start nginx in a container and the certbot name doesn't exist yet (it's running in a different container), then nginx doesn't start.
nginx | 2019/01/24 16:17:27 [emerg] 1#1: host not found in upstream "certbot" in /etc/nginx/acme:2
nginx | nginx: [emerg] host not found in upstream "certbot" in /etc/nginx/acme:2

location /.well-known {                                                                                                                        
    proxy_pass http://certbot;                                                                                                                 
}

The second problem is that if certbot changes ip address. For example, I stopped the container with certbot, and then launched it after 5 minutes, then nginx gives a 403 error. And it doesn’t restore the status in any way. It seems that it is not trying to resolve again .... I
am slowly preparing the ground for the cluster, and there the change of ip can be normal...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2019-01-25
@kiranananda

In docker_compose.yml for services: nginx add depends_on: certbot
Use only the name from services instead of IP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question