Closed SuperITMan closed 7 years ago
I've started seeing this on new instances as well. Edit: I messed up the volumes so /etc/nginx/vhost.d/default wasn't available. Can't reproduce.
Hello, I don't understand why the subject is closed. Am I alone to have this issue ?
Thanks for your time.
@SuperITMan There are several things that could go wrong to produce that output. Could you show us the nginx configuration generated? docker exec -it nginx cat /etc/nginx/conf.d/default.conf
@SuperITMan I was struggling with this earlier too, the key is no servers are inside upstream in /etc/nginx/conf.d/default.conf:36
. If you open your 'default.conf' you should see empty upstream
configuration. If that's the case remove
-only-exposed
from your docker-gen
command
-notify-sighup nginx -watch
-only-exposed
-wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
Ref: https://github.com/jwilder/nginx-proxy/issues/479 EDIT Also https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/pull/81
If the upstream configuration is empty it's that the "backend" web server doesn't expose any port ?
If it is the case add a --expose port
when you start the backend container
@JrCs I think you meant --expose port
. Some how with -only-exposed
docker-gen didn't pickup those with default EXPOSE
from Dockerfile
. Anyway I'm not really an expert here but removing -only-exposed
resolved my issue I had that day
Some how with -only-exposed docker-gen didn't pickup those with default EXPOSE from Dockerfile.
I expose ports with EXPOSE
and have not had this problem.
@ryneeverett you're right, my bad. I left out EXPOSE
in my Dockerfile
. Thanks
I have the same issue,
I expose the port (8787) in the Dockerfile, I have an expose in the docker-compose.yml but with -only-exposed nothing happens. Without it the server appears in upstream but marked as "down".
Here's the dockerfile:
FROM rocker/hadleyverse
MAINTAINER Stefan Fritsch <fritsch@stat-up.com>
RUN apt-get update \
&& apt-get -y install nginx-light nano procps jags r-cran-rjags \
&& apt-get clean
RUN echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen \
&& echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen
RUN update-locale
EXPOSE 8787
WORKDIR /
CMD ["/init"]
and here the docker-compose.yml (nginx&co. run on the same network, and as mentioned apache-php works)
version: '2'
networks:
default:
external:
name: external
services:
rstudio-server:
build: .
image: stefanfritsch/rstudio_statup:3.3.2
restart: unless-stopped
mem_limit: 60000m
container_name: rstudio-server
environment:
- VIRTUAL_HOST=rstudio.stat-up.com
- LETSENCRYPT_HOST=rstudio.stat-up.com
- LETSENCRYPT_EMAIL=it@stat-up.com
expose:
- "8787"
Try with publishing the port.
Hello,
I'm using your project since one month and I find it awesome ! Thanks for this :)
Yesterday, I decided to use your project as you recommended, in 3 different dockers. Unfortunately, it does not work. Impossible to get my sites in https and when I go on them via http, I obtain an error 503... I precise that this works when I launch only two containers.
This is the error I obtained when letsencrypt should generate the certificate :
For the 3 dockers, I made theses commands :
# Launch nginx
docker run -d -it -p 80:80 -p 443:443 \
--name nginx \
-v /etc/nginx/conf.d \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /etc/nginx/certs:/etc/nginx/certs:ro \
--restart="always" \
nginx
# Download template
curl https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl > /tmp/templates/nginx.tmpl
# Launch docker-gen for nginx
docker run -d \
--name nginx-gen \
--volumes-from nginx \
-v /tmp/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/docker-gen \
-notify-sighup nginx -watch -only-exposed -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
# Launch letsencrypt-companion
docker run -it -d \
--name nginx-letsencrypt \
-e "NGINX_DOCKER_GEN_CONTAINER=nginx-gen" \
--volumes-from nginx \
-v /etc/nginx/certs:/etc/nginx/certs:rw \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
jrcs/letsencrypt-nginx-proxy-companion
I have no idea of the reason why it does not work but if some one of you has one it would be really cool !
I hope I give all necessary infos :)
PS: Sorry for my English, it's not my mother tonge