overwrite nwaf.conf file with docker volume

manhkhoa168

New member
how can I override /etc/nginx/nwaf/conf/global/nwaf.conf file with docker volume without breaking nwaf-dyn working flow, I want to put the config file outside the machine main and just run docker-compose up instead of having to add another step of editing the config file.
I also realized the configuration files in this directory resulted from the command running ln -sf /nginx.configs/nwaf/conf /etc/nginx/nwaf/ from the file /opt/nwaf_dyn.start that nwaf-dyn did presently
 

support

Well-known member
Staff member
how can I override /etc/nginx/nwaf/conf/global/nwaf.conf file with docker volume without breaking nwaf-dyn working flow, I want to put the config file outside the machine main and just run docker-compose up instead of having to add another step of editing the config file.
I also realized the configuration files in this directory resulted from the command running ln -sf /nginx.configs/nwaf/conf /etc/nginx/nwaf/ from the file /opt/nwaf_dyn.start that nwaf-dyn did presently
Hello!
If you want to change the location of the configuration files, you must specify a new path in the run command in the -v parameter, e.g:

docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 -p 5672:5672 nemesida/nwaf-dyn

In this case you can replace /opt/nwaf/waf-config with /usr/share/waf-config or any other path where your configurations will be stored. After replacing the command, it will look like this:

docker run --rm -d -v /usr/share/waf-config:/nginx.configs -p 80:80 -p 5672:5672 nemesida/nwaf-dyn

You can also create your own volume with docker and mount it when the container runs:

docker run --rm -d -v nwaf_volume:/nginx.configs -p 80:80 -p 5672:5672 nemesida/nwaf-dyn
 
Top