Accessing Nexus with CloudFront

my Nexus server is installed on a EC2 instance and i would like to access it through CloudFront.
i have tried numerous methods but i understand from AWS support that in order to make it work i will have to change / edit some of it’s headers to allow caching, since i cannot edit anything code related to Nexus i though i will install a Nginx server to convert these headers for me.
i have tried configuring Nginx by what Sonatype documentation suggested but it still fails.

i would appreciate any kind of help here!