Hello,
I had a node media server running on a DO droplet and it was working as expected but now I want to migrate all my services to a different droplet because I have other domains running on the first droplet so the problem is the following:
I have: example.com example2.com example3.com
when I run node media server all domains can access the rmtp and I want only example.com to access it.
My idea was to use a reverse proxy for all my services this way:
server {
server_name rtmp.example.com www.rtmp.example.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:3003/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
server_name api.example.com www.api.example.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:3001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
But it is not working and I think nginx is blocking the rtmp protocol.
Do you know how can I enable rtmp traffic
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I need this also as I have installed nginx and installed node-media-server in /var/www/html folder, By running node app.js it is working and also publishing to ip but I want to configure in via my domain with nginx server setup.
Any help would be appreciated.
Hi Arturo, to use Nginx with an RTMP app you will need to install and import the RTMP module for Nginx. Here are the instructions from the official docs https://docs.nginx.com/nginx/admin-guide/dynamic-modules/rtmp/
Thanks for your response, but I am using https://github.com/illuspas/Node-Media-Server and it is managing the rtmp server in nodejs.
So I think that if I install that ngnix module node-media-server wont work
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.