proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Referer $http_referer;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Ssl on;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_set_header X-Content-Type-Options nosniff;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Destination $http_destination;
proxy_connect_timeout 90;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_cache_bypass $http_upgrade;
proxy_buffering on;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 64;
proxy_buffer_size 128k;
proxy_buffers 32 64k;
proxy_busy_buffers_size 128k;
proxy_max_temp_file_size 2048m;
proxy_temp_file_write_size 128k;
proxy_cookie_domain www.$host $host;
proxy_pass_header server;