Nginx反代m3u8资源加速HLS流媒体
现在很多直播源采用HLS流媒体传输协议,只需获得m3u8链接就可以在浏览器上播放,使用简单设备兼容性好。平时有些小众源速度跟不上卡顿,于是研究了下如何反代加速。起初在Github上找现成解决方案,不过类似项目很少且长时间没更新,测试用不了。索性试试Nginx反代,最终弄了个简单版。
反代方法
1. 安装Nginx和确保有http_sub_module替换模块。
2. 编辑Nginx虚拟机配置文件,加入反代规则。
# 适用任何符合指定后缀的请求 location ~* \.(m3u8|ts|aac)$ { proxy_cache off; # 禁用代理缓存 expires -1; # 禁用页面缓存 proxy_pass http://example.com; # 反代目标 URL sub_filter 'http://example.com/' 'http://$host/'; # 替换 m3u8 文件里的资源链接 sub_filter_last_modified off; # 删除原始响应里的浏览器缓存值 sub_filter_once off; # 替换所有匹配内容 sub_filter_types *; # 匹配任何 MIME 类型 }
3. 保存后运行nginx -t
命令检查语法是否有问题,避免添加到错误位置。
4. systemctl restart nginx
重启Nginx服务生效。之后就可以通过反代访问了。
例如原链接是http://example.com/hls/skynews/playlist.m3u8
,将域名改为你自己的,其它不变。
效果测试

hydroxychloroquine stock ticker https://hydroxychloroquine.webbfenix.com/
zovirax for shingles https://www.herpessymptomsinmen.org/productacyclovir/
best generic careprost reviews https://carepro1st.com/
ivermectin dosage humans https://ivermectin.webbfenix.com/
levitra vs vidalista for hardness https://vidalista.mlsmalta.com/
can clomiphene cause heart attack https://salemeds24.wixsite.com/clomid
azithromycin and strep throat https://keflex.webbfenix.com/
reviews on cialis daily http://www.lm360.us/
hydroxychloroquine 700 https://hydroxychloroquine.mlsmalta.com/
ivermectin cost https://ivermectin.mlsmalta.com/
brand viagra online canadian pharmacy http://droga5.net/
online pharmacy canada generic priligy https://ddapoxetine.com/
vidalista soft tabs review https://vidalista40mg.mlsmalta.com/
price of albuterol hfa inhaler https://amstyles.com/
how to use cialis daily https://wisig.org/
tadalafil liquid research chems https://tadalafil.cleckleyfloors.com/
ask a doctor free chat https://edmeds.buszcentrum.com/
ask a doctor free chat https://buymeds.mlsmalta.com/
chloroquine for sale online https://hydroxychloroquinee.com/
taking dapoxetine with dapoxetine https://dapoxetine.confrancisyalgomas.com/
over counter antibiotics at walmart https://amoxycillin1st.com/
prednisone 20 tablet https://bvsinfotech.com/
chewable cenforce soft tabs http://cavalrymenforromney.com/
I was wondering iff you ever considered changing the page layout of your site?
Its very well written; I love what youve gott to say.
But maybe you could a little more in the way of content
soo people could connect with it better. Youve goot an awful
lot of text for ojly hhaving 1 or two images. Maybe you could space it out
better?
Have a look at my page :: https://www.cheapdiamondpainting.com/happy-cats-diamond-painting.html
cialis vs viagra living https://cialis.adicbc.com/
cialis vs viagra living https://cialis.advantagetriseal.com/
Post writing is also a fun, if you be familiar with afterward you can write
or else it is complex to write. http://antiibioticsland.com/Stromectol.htm
side effect of hydroxychloroquine https://hhydroxychloroquine.com/
Thank you for thee good writeup. It in fact was a amusement accounnt it.
Loook advanced to more addded agreeable from you!
By the way, hhow could we communicate?
My site Diamond Painting accessories
tadalafil pills 20mg: http://tadalafilonline20.com/ tadalafil gel
Thanks for sharing such a pleasant thinking, paragraph is pleasant, thats why i
have read it fully http://herreramedical.org/ivermectin
india pharmacy mail order: https://genericwdp.com/ pills without a doctor prescription
cheap generic drugs from india purchase tadalafil
vidalista 10mg
buy medication without an rx medications without a doctor’s prescription
generic pills for sale: https://genericwdp.com/ buying prescription drugs from canada
kamagra
https://www.tanhu.com.tr
Muchas gracias. ?Como puedo iniciar sesion?
google buy hacklink services instagram.
https://www.idigic.net/buy-instagram-likes/
google buy hacklink services instagram.
https://blastup.com/buy-likes-on-instagram
google buy hacklink services instagram.
https://www.influencive.com/10-best-sites-to-buy-instagram-likes-real-and-safe/
google buy hacklink services instagram.
https://famoid.com/buy-instagram-likes/
google buy hacklink services tiktok.
https://tikfuel.com/
google buy hacklink services youtube and social media.
https://www.qqtube.com/en/
google buy hacklink services instagram and social media.
https://azbigmedia.com/business/buy-instagram-views/
I do believe aall of the ideas you’ve offered on your post.
They’re really convincing and can definitely work.
Nonetheless, the posts are very short for newbies.
May just you please lengthen them a little from subsequent time?
Thanks for the post.
my blog: https://www.diamondpaintingclearance.com/christmas-diamond-painting-kit-5d-season-2-54
google buy hacklink services instagram and social media.
https://azbigmedia.com/business/buy-instagram-views/
google buy hacklink services instagram and social media.
https://sproutsocial.com/insights/buy-instagram-likes/
google buy hacklink services facebook and social media.
https://www.fbpostlikes.com/
this web site best buy hacklink services and twitter services.
https://follows.com/twitter/likes
this web site best buy hacklink services and twitter and tiktok services.
https://celebian.com/buy-tiktok-likes
google buy Instagram hacklink services.
https://socialnomics.net/2021/02/15/buy-instagram-comments/