毕设项目要求利用 Nginx 实现一个流媒体服务器,提供视频点播功能
初步设想的处理步骤:
目前测试了 Nginx 对 .m3u8 的支持,可以直接拉片源目录中的 .m3u8 到播放器里播放;也测试了 Nginx-upload-module 在 upload_pass
中启动其他模块的功能
想请教各位大佬:
$upload_file_name
等是变量吗,如何在自己编写的模块中引用他们的数据呢感谢大佬指点
server {
client_max_body_size 100m;
listen 80;
# Upload form should be submitted to this location
location /upload/ {
# Pass altered request body to this location
upload_pass @test;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
upload_store /tmp 1;
# Allow uploaded files to be read only by user
upload_store_access user:r;
# Set specified fields in request body
upload_set_form_field $upload_field_name.name "$upload_file_name";
upload_set_form_field $upload_field_name.content_type "$upload_content_type";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
# Inform backend about hash and size of a file
upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";
upload_pass_form_field "^submit$|^description$";
upload_cleanup 400 404 499 500-505;
}
# Pass altered request body to a backend
location @test {
proxy_pass http://localhost:8080;
}
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.