Passing custom config to nginx conf

Hi,

While deploying the openvidu stack, openvidu proxy which is the nginx image, I need to modify the nginx conf file due to some security testing advised by the sec team.
How can I pass a custom config to nginx.
I tried to login to nginx container and updated the nginx conf then nginx -t gives successful but unable to reload the conf. If I restart container the configs are removed and default configs are retained. Adding as volume also does not work as the conf from the image is downloaded to host and when I make a change to it and start the container it gets overwritten from images again.

Regards
Sayan

create new image with changed old running container using
docker commit command

Thanks’