How can I update the nginx config directly in discourse/docker ..?

Can you explain why you want to do that?

“Photos” can in any case be uploaded to Discourse. Image upload and optimisation is built into Discourse already.