Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. map $upstream_http_location $redirect_uri {
  2. default "";
  3. "~http(?:s)?://[^/]/(?<location_uri>.*)$" "$location_uri";
  4. }
  5.  
  6.  
  7. upstream origin {
  8. server origin1.com;
  9. }
  10.  
  11.  
  12. server {
  13.  
  14. listen 80;
  15. server_name nginx-front.com;
  16.  
  17. proxy_set_header Host "origin1.com";
  18. proxy_redirect http://origin1.com/ /;
  19.  
  20. location ~ ^/m3ugen/hls/(w+).mp4.m3u8$ {
  21. proxy_pass http://origin/m3ugen/segsrc/$1.mp4;
  22. error_code 301 302 = @handler;
  23. }
  24.  
  25. location @handler {
  26. rewrite ^ /$redirect_uri;
  27. proxy_pass http://origin;
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement