I am looking for a way to change some config parameters dynamically before running NGINX. Perfectly by using command line parameters. I want to write a bash script that takes for example two parameters:
- root directory of files to be served,
- name of the php docker container to process php files.
These parameters are normally defined in config file:
files to be served:
Since they are hardcoded I need to create a specific configuration for every project I want to run with NGINX. I want to avoid that and have one bash script that reads CLI parameters and starts NGINX with them.
I could not find any other NGINX CLI Parameters than these and did not find a suitable candidates to achieve my goal. Maybe there are other CLI parameters I could use, maybe I could use environmental variable inside default.conf so values of root and fastcgi_pass aren't hardcoded, or maybe there is a plugin that could provide additional CLI parameters to NGINX?