2016-10-27 5 views
1

범위 헤더가 사용자에 의해 전달되면 nginx가 원본 서버를 보내도록하려면 어떻게해야합니까? nginx 프록시 콘텐츠 범위를 넘기

현재 나는이 시도했지만 작동하지 오전 :

server { 
    location/{ 
     if ($http_range) { 
      set $var_arg_range $http_range; 
     } 
     if ($arg_range) { 
      set $var_arg_range "bytes=$arg_range"; 
     } 
     proxy_set_header Range $var_arg_range; 
     proxy_pass https://content-na.drive.amazonaws.com; 
     proxy_set_header If-Range ""; 
     proxy_set_header Host content-na.drive.amazonaws.com; 
     proxy_set_header Range $var_arg_range; 
     proxy_set_header Accept-Encoding ""; 
    } 
} 

내가 HTML5 비디오를 스트리밍 할 필요가있다.

답변

2

마침내 발견했습니다. proxy_pass_request_headers으로 원본 서버에 헤더를 전달해야합니다. 맞춤 리퍼러 헤더를 전달하는 것을 잊지 마세요.

server { 
      postpone_output 0; 
      resolver 8.8.8.8; 
      proxy_set_header Referer  "https://content-na.drive.amazonaws.com"; 
      proxy_set_header Host   "content-na.drive.amazonaws.com"; 
      proxy_pass_request_headers  on; 
      proxy_ssl_verify    off; 
      proxy_method     "GET"; 
      proxy_pass      https://content-na.drive.amazonaws.com; 
}