首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx:[emerg] url "https://x.x.x.x./live/rtmp/auth"?“中的端口无效

nginx:[emerg] url "https://x.x.x.x./live/rtmp/auth"?“中的端口无效
EN

Stack Overflow用户
提问于 2021-04-20 16:24:02
回答 1查看 247关注 0票数 1

在将我的auth url更改为https后,我收到此消息。有没有办法把回调改成https,或者on_publish指令不支持?FYI - ngixn启用了ssl。

EN

回答 1

Stack Overflow用户

发布于 2021-08-24 10:44:38

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

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

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

代码语言:javascript
复制
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 :

代码语言:javascript
复制
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;
        }

}

如果它帮助了其他人:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67175128

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档