0

My nginx.conf should all be set up to add the environmental variable, see:

# snippet from nginx-test.conf
proxy_set_header Authorization ${CREDS};
etc
etc

And then my docker run command is set up as so:

docker run -e CREDS='Basic mycredsthatihavetohide' --name container-one --v /home/x/x/x/x/Flask/nginx-test.conf:/etc/nginx/nginx.conf.:ro -d -p 8081:80 nginx 

But from reading online, I have spotted I need to add envsubst in order for this to work, but I have no idea how and was hoping for some help?

  • I think this could help https://stackoverflow.com/a/65529290/5099059 – KeKru Apr 07 '21 at 19:12
  • The issue is that the answer provided uses a Dockerfile, and I don't. So I'm not sure how to tweak it so that it fits into a docker run command. – user8981199 Apr 07 '21 at 19:19
  • If you use nginx 1.19 you could put your config as a '/etc/nginx/templates/*.template' in the volume. See https://hub.docker.com/_/nginx I did not try this yet, but seems to be what you want – KeKru Apr 07 '21 at 19:38

0 Answers0