[英]Rewrite URL to MP4 video with nginx
I want to rewrite example.com/videos/name/
to the MP4 file videos/name.mp4
and serve it with content type video/mp4
as if the user would have requested the video directly with example.com/videos/name.mp4
.我想将
example.com/videos/name/
重写为 MP4 文件videos/name.mp4
并使用内容类型video/mp4
提供它,就好像用户会直接使用example.com/videos/name.mp4
请求视频一样.
How can I do that with nginx
?我怎么能用
nginx
做到这一点?
I got it:我知道了:
location = /videos/ {
types { } default_type "video/mp4";
rewrite ^/name/$ /videos/name.mp4 last;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.