Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response code for missing remote mp4 file #468

Closed
apolovov opened this issue Nov 24, 2016 · 4 comments
Closed

Response code for missing remote mp4 file #468

apolovov opened this issue Nov 24, 2016 · 4 comments

Comments

@apolovov
Copy link

apolovov commented Nov 24, 2016

Hello, I have an issue with response codes of nginx-vod-module. If I try to GET chunk or playlist for non existent remote mp4 file and nginx-vod-module returns 502 Bad Gateway instead of 404.

How to get "404" response for this case.

request:
http://myserver.example/video/XXX_,350,950,3800,.mp4.urlset/master.m3u8

kaltura config (simplified):
` server {
access_log /var/log/nginx/kaltura_access.log main;
error_log /var/log/nginx/kaltura_error.log;

    sendfile off;

    vod_mode remote;
	vod_upstream_location /remote;

    vod_cache_buffer_size 16m;
vod_metadata_cache metadata_cache 32768m;
    vod_response_cache response_cache 256m;
    vod_base_url ''; # for relative path

    open_file_cache          max=1000 inactive=5m;
    open_file_cache_valid    2m;
    open_file_cache_min_uses 1;
    open_file_cache_errors   on;

    location ^~ /remote/ {
        internal;
        proxy_pass http://backend-video/;
        proxy_buffers 16 512k;
        proxy_buffer_size 512k;
    proxy_set_header X-Limit $limit_header;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
    }

    location ~* (.m3u8|.ts)$ {
		vod hls;
		expires 100d;
    }
    location ~* (.mpd|.m4f|.m4s|init[a-z0-9-]+.mp4)$ {
		vod dash;
		expires 100d;
    }
}

upstream backend-video {
    server 1.1.1.1;
    server 2.2.2.2;

    server 3.3.3.3 backup;
    server 4.4.4.4 backup;
}

`

kaltura_error.log:
2016/11/25 02:11:14 [error] 10110#10110: *73546194 ngx_child_request_wev_handler: upstream returned a bad status 404 while sending to client, client: 5.5.5.5, server: , request: "GET /video/XXX_,350,950,3800,.mp4.urlset/master.m3u8 HTTP/1.1"
kaltura_access.log:
5.5.5.5 [25/Nov/2016:02:11:14 +0300] GET "http://myserver.example/video/XXX_,350,950,3800,.mp4.urlset/master.m3u8" HTTP/1.1 502

All "backend-video" upstreams return 404.

Thank you!

@erankor
Copy link
Contributor

erankor commented Dec 8, 2016

Sorry for the late reply.
Currently, nginx-vod-module returns 502 for any error status returned from upstream. I agree that in your use case, it would be more correct to return 404.
This issue is low priority for us, so will probably take a while until we get to handle it, but I'll add it to the todo.

@apolovov
Copy link
Author

apolovov commented Dec 8, 2016

Thank you for reply! I'll be watching the changelogs.
In my case I'll use some workaround.

@apolovov apolovov closed this as completed Dec 8, 2016
@kuznetcoff777
Copy link

@erankor Hello! Is there any news in this case? I did not mention fix for this issue in changelog...

@erankor
Copy link
Contributor

erankor commented Jun 25, 2017

No news, still prioritized low

bgaudaen added a commit to SRGSSR/nginx-vod-module that referenced this issue Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants