毕设项目要求利用 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;
}
}
1
hanguofu 2022-02-26 07:52:38 +08:00
难道 Nginx 不是 支持 webdav 的吗 ? 通过浏览器直接看 webdav 里面的内容不就行了 ?
|
2
dream4ever 2022-02-26 08:10:18 +08:00
毕设是要求只能用 Nginx 完成这几项功能?第一条和第二条我觉得用常规编程语言写个服务来实现更合适。
|
3
xQmQ OP @hanguofu 我查了你提到的 webdav ,这种实现的话跟毕设要求不相符
@dream4ever 单纯的实现功能,已经有诸如 Nginx-rtmp-module 这样的方案。写论文的话没有内容,写模块集成进 Nginx 可以借用他的架构,这样在调优方面也可以写一些内容进论文;直接用别的语言实现,不太切开题报告 |