allanlei / wsgi-rtmpt

RTMPT frontend to a RTMP backend as a WSGI server
1 stars 0 forks source link

Using with nginx #1

Open hreinnbeck opened 10 years ago

hreinnbeck commented 10 years ago

Hi,

So been doing some tests with wsgi-rtmpt. It works fine on it's own but I'm mostly interested in using it with nginx-rtmp to enable rtmpt along side HLS.

Anyways - I can't seem to get nginx to play along with wsgi-rtmpt.

Has anyone else been trying or succeeded at the same?

allanlei commented 10 years ago

When I was doing this originally, I was using also using nginx-rtmp to test with and didn't run into any major problems.

Its lacking docs, something I will have to get to in the future.

Please describe the problem you are having.

hreinnbeck commented 10 years ago

When running through nginx I get this wsgi-rtmpt output:

127.0.0.1 - - [18/Oct/2014 20:32:40] code 400, message Bad request syntax ('\x00\x03\x03\x00\x0c\x00QUERY_STRING\x00\x00\x0e\x00REQUEST_METHOD\x04\x00POST\x0c\x00CONTENT_TYPE\x11\x00application/x-fcs\x0e\x00CONTENT_LENGTH\x01\x001\x0b\x00REQUEST_URI\x0b\x00/fcs/ident2\t\x00PATH_INFO\x0b\x00/fcs/ident2\r\x00DOCUMENT_ROOT\x08\x00/var/www\x0f\x00SERVER_PROTOCOL\x08\x00HTTP/1.1\x0c\x00UWSGI_SCHEME\x04\x00http\x0b\x00REMOTE_ADDR\r\x00127.0.0.1\x0b\x00REMOTE_PORT\x05\x0028633\x0b\x00SERVER_PORT\x02\x0080\x0b\x00SERVER_NAME\x00\x00\t\x00HTTP_HOST\r\x00127.0.0.1\x0f\x00HTTP_CONNECTION')

And a dump of the HTTP headers with unicode characters.

The nginx error log gives:

2014/10/18 20:33:20 [error] 27916#0: *170 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /send/%3Chtml%3E/0 HTTP/1.1", upstream: "uwsgi://127.0.0.1:8000", host: "127.0.0.1", referrer: "http://127.0.0.1/jw5/index.html"

My nginx.conf is very sparse for these tests:

user www-data;
worker_processes 1;
pid /run/nginx.pid;

events {
    worker_connections 4069;
}

http {

    upstream uwsgicluster {
        server 127.0.0.1:8000 fail_timout=30;
    }

    server {
       listen 80;

       root /var/www;
       index index.html index.htm;

        location / {
            uwsgi_pass         uwsgicluster;
        }
    }
}

rtmp {
    server {
        listen 1935;

        application mila {
            live on;
        }
}