Proxy settings for influxdb using nginx

Hello! I’m newbie to setting proxies for a server. I use influxdb together with chronograf in the docker on the AWS EC2 instance and want to configure proxies for influxdb for greater security, but when I try to do this, I get errors related to the incorrect configuration of the nginx file, please tell me how to configure it.
My nginx conf: nginx conf
My docker-compose file: docker-compose