Docker NGINX issue -- unable to edit nginx.conf
I suggest you mount your conf file as a volume:

docker run -v nginx.conf:/etc/nginx/nginx.conf ....


This way you can easily change the file outside the container and then just restart the container. If you change your config file inside the container and then you should have to restart nginx to pick-up the changes. At that point your container will stop because you stopped the main process.

Your local nginx.conf should already have the initial configuration which you can copy from inside the container (cat /etc/nginx/nginx.conf).