kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

vod_remote_upstream_location is not calling my location #1445

Open HenriqueOtsuka opened 1 year ago

HenriqueOtsuka commented 1 year ago

Hey guys,

I'm using Openresty nginx 1.19.9.1 and I've built it with kaltura/nginx-vod-module.

Into nginx.conf, I've added include /usr/local/openresty/nginx/conf/sites-enabled/*.*;

My current configuration is sites-enabled/kaltura.conf

server {
    listen 80;

    location ~ ^/video/(?<video_id>.+) {
        vod hls;
        vod_remote_upstream_location /get_file; 
        vod_upstream_location /s3proxy;
    }

   location ~ ^/get_file/(?<video_id>.+)$ {
        internal;
        proxy_pass_request_body off;
        proxy_set_header Content-Length "";
        proxy_set_header X-Original-URI $request_uri;
        proxy_pass http://app:8080/video/$video_id;
    }

    location ~ ^/s3proxy/(?<bucket>[^/]+)/(?<file_path>.+) {
        internal;
        set $s3_bucket $bucket.s3.amazonaws.com;
        proxy_pass http://$s3_bucket/$file_path;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Authorization '';
        proxy_hide_header 'x-amz-id-2';
        proxy_hide_header 'x-amz-request-id';
    }
}

My app:8080/video/$video_id; returns the JSON Simple mapping

{
    "sequences": [
        {
            "clips": [
                {
                    "path": "/my-s3-bucket/my-s3-file.mp4",
                    "type": "source"
                }
            ]
        }
    ]
}

My problem is that when I try to test it with a curl request like curl http://localhost/video/exampleId, it's not even call the location /get_file and then don't make the proxy_pass to get the JSON Map.

I really tried to do everything and nothing is working.

May anyone help me, please?

erankor commented 1 year ago

Maybe vod_mode mapped? I don't see it here...

HenriqueOtsuka commented 1 year ago

Sorry for the late response.

I've tried another example different than that with a simpler configuration and also using the vod_mode, but without success.

I will try again in few weeks, then I give you a feedback about another way to do it.

Thank you in advance

francoism90 commented 1 month ago

@HenriqueOtsuka Did you ever solve this? It also looks up the wrong upstream url for me.

Edit: solved by creating two servers (mapped, mapped + remote)