1

将我的身份验证网址更改为 https 后,我收到此消息。有没有办法将回调更改为 https 或者 on_publish 指令不支持?仅供参考 - ngixn 已启用 ssl。

4

1 回答 1

0

我不知道你是否解决了这个问题,但我遇到了同样的问题。在研究中,似乎 on_* 指令不支持安全连接。

因此,我尝试通过在 http 中本地提供我的 Web 应用程序来解决这个问题,如下所示:

  • /etc/nginx/sites-available/yourdomain.conf :
rtmp {

        server {


                listen 1935;
                chunk_size 4096;

                application live {

                        deny play all;

                        record off;

                        live on;
                        on_publish http://127.0.0.1:8080/api/stream;
                        on_done http://127.0.0.1:8080/api/stream/end;

                }

        }

}
  • /etc/nginx/nginx.conf :
server {

        listen [::]:443 ssl ipv6only=on; # managed by Certbot
        listen 443 ssl; # managed by Certbot

        root /var/www/html/myapp/public;

        index index.html index.php;

        server_name yourdomain.com www.yourdomain.com;

        # rest of your config...

}

# then, serve your app on localhost for call api locally with http from on_* directives

server {

        listen 8080;
        listen [::]:8080;

        server_name 127.0.0.1;

        root /var/www/html/myapp/public;

        index index.html index.php;

        location / {

                try_files $uri $uri/ /index.php?$query_string;

        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php8.0-fpm.sock;
        }

}

如果它帮助别人:)

于 2021-08-24T10:44:37.537 回答