Why do you need an editor inside the container? You should be writing your own Dockerfile and/or docker-compose file that takes the stock nginx container image and customizes it to your liking. Then you just launch that.
I do agree there are occasions when it’s faster to experiment by changing a file on the fly, but even then I use docker cp to copy the file out, make my changes on the host and then docker cp the file back in. Or I just bind mount the config dir and make my edits on the host.
So please describe the problem you are trying to solve and maybe we can suggest a better work flow for you.