You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I start the proxy container using docker compose up and navigate to the /etc/nginx/templates folder to see if everything got mounted correctly I get the following output:
➜ docker git:(develop) ✗ docker exec -it nginx-proxy bash
root@d9d62440ba84:/app# cd /etc/nginx/templates
root@d9d62440ba84:/etc/nginx/templates# ls
custom.conf.template
root@d9d62440ba84:/etc/nginx/templates# cat custom.conf.template
keepalive_requests ${KEEPALIVE_REQUESTS};
The issue
However when after that I navigate to the /etc/nginx/conf.d folder, I just see the default.conf file. I expected to see custom.conf aswell.
root@d9d62440ba84:/etc/nginx/templates# cd /etc/nginx/conf.d
root@d9d62440ba84:/etc/nginx/conf.d# ls
default.conf
The entrypoint of nginx-proxy is different so your substitutes are not processed.
But I think your keepalive_request tweak is very easy to implement. I am using something similar to adjust a global setting.
Map your extra config file (custom.conf.template) to the container as custom.conf in the /etc/nginx/conf.d/ (nginx automatically loads all files ending in .conf in this folder)
@Jannick94 I ran into the same thing a few months ago.
Ideally I'd like nginx-proxy to execute the same startup scripts as the upstream nginx images, without re-implementing their entrypoint. I'll see what I can do.
Can't get .conf.template files to work with env variables/file
I'm having an issue getting .conf.template files to generate a .conf file within the
/etc/nginx/conf.d
directory.I have the following docker-compose.yml file:
Within the mounted config folder I have the following
custom.conf.template
file and .env fileWhen I start the proxy container using
docker compose up
and navigate to the/etc/nginx/templates
folder to see if everything got mounted correctly I get the following output:The issue
However when after that I navigate to the
/etc/nginx/conf.d
folder, I just see thedefault.conf
file. I expected to seecustom.conf
aswell.Using the base nginx container does work
I also tried this exact same setup using a base
nginx:1.25.4
image, and everything worked just fine.It seems as if the parent nginx image entrypoints (mainly https://github.com/nginxinc/docker-nginx/blob/master/stable/debian/20-envsubst-on-templates.sh) arent triggered correctly/overridden by something the proxy does?
Thanks! 🙏🏻
The text was updated successfully, but these errors were encountered: