Proxy requests from NGINX to Cloudfront system stop working when using a variable in proxy_pass

Solution 1:

Seems like a duplicate of question: https://stackoverflow.com/questions/46230270/nginx-using-variable-in-proxy-pass-breaks-routing

My guess is that it's sending https://upstream.example.com/assets/assets/.

When variabilizing, try and set proxy_pass to https://$backend_website$request_uri;