-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx error when using proxy-wide configuration #378
Comments
I seem to get the same behavior if I try to build a new image that inherits from FROM jwilder/nginx-proxy
COPY path-routing.conf /etc/nginx/conf.d/ |
Looking at the Need to think a little about how we might solve this... |
I was able to make it work by doing some hacking in the container I build: # Dockerfile
FROM jwilder/nginx-proxy
COPY Procfile /app/
COPY path-routing.conf /etc/nginx/conf.d/
RUN rm /etc/nginx/conf.d/default.conf and the nginx: while [ ! -f /etc/nginx/conf.d/default.conf ]; do echo "*** Waiting to start nginx..."; sleep 1; done; echo "*** Starting nginx..."; nginx
dockergen: echo "*** Starting docker-gen..."; docker-gen -watch -only-exposed -notify "nginx -s reload" /app/nginx.tmpl /etc/nginx/conf.d/default.conf This works great:
|
This prevents nginx from failing when there is a custom nginx config that depends on things in the generated nginx config. Fixes: nginx-proxyGH-378
This hopefully lets nginx start after dockergen is done. This prevents nginx from failing when there is a custom nginx config that depends on things in the generated nginx config. Fixes: nginx-proxyGH-378
See #379 for a possible solution. |
Tribute Grandma |
I am trying to follow the instructions on proxy-wide configuration.
Specifically, I want to add a custom nginx config file that can map various paths to various vhosts -- here's what I have:
and:
When I try to start the
nginx-proxy
container, I get:The
vhost
log format should already be declared indefault.conf
. I tried to work around this by copying the definition of thevhost
log format topath-routing.conf
, but then I get:It can't find the upstream "anonweb.marcs-local-docker-machine.com" but that's also defined in
default.conf
.The kicker is I can remove this stuff and get the container to start and then copy in this
path-routing.conf
file and nginx reloads just fine.Any ideas? Is nginx-proxy or docker-gen trying to work with this file in isolation or before
default.conf
has been generated?The text was updated successfully, but these errors were encountered: