I am getting this message after changing my auth url to https. Is there a way to change callback to https or is it not supported for on_publish directive ? FYI - ngixn is ssl enabled.
Asked
Active
Viewed 1,114 times
1
-
Your "question title" should be a summary of the problem, not an error message. https://stackoverflow.com/help/how-to-ask. Something like `Receiving 'invalid port error' after switching auth url to https` would be more appropriate – Michael Hoobler Apr 20 '21 at 11:17
1 Answers
0
I don't know if you have solved the problem, but I have encountered the same one. In researching, it seems that the on_* directives do not support secure connections.
So I tried to work around the problem by serving my web application locally in http like this:
- /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;
}
}
If it helps others :)

Matéo
- 121
- 1
- 8