Proxy and cache external resource with nginx

3proxy nginx
proxy_cache_path /home/nginx levels=1:2 keys_zone=CACHE:50m max_size=12G inactive=30d;

server {

	location / {
		proxy_cache_key "$uri";
		proxy_pass https://$path$is_args$args;
		proxy_cache            CACHE;
		access_log      off;
		expires max;
		add_header X-Proxy-Cache $upstream_cache_status;
		proxy_set_header Referer "";
		proxy_cache_valid 200 30d;
		proxy_cache_valid 403 10m;
		proxy_cache_valid 404 10m;
		proxy_ssl_server_name on;
                proxy_ssl_name $proxy_host;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot