Getting net::ERR_CONNECTION_REFUSED error with Node.Js server serving Video & Audio file

331 Views Asked by At

Getting issue when I'm using other device to access the video and audio file alike image file and json and other text file.

I am using Angular as frontend and Express as backend and I have hosted it in my local system using Nginx.

It is working perfectly fine when I'm using http://localhost/api/media/audio/audio.mp3 to get the file from the backend.

audio is playing

It is not working when I using http://192.168.0.100/api/media/audio/audio.mp3

audio file is not playing

Images are working fine on both http://192.168.0.100/api/media/image/hulk.jpg (my computer's lan ip) and http://127.0.0.1/api/media/image/hulk.jpghttp://192.168.0.100/api/media/image/hulk.jpg

image working

And Other files also working

Text file working

The frontend working over 192.168.0.100 (over LAN) but Youtube embed not working

frontend

Nginx -> /etc/nginx/sites-available default file


server {
    listen 80 default_server;
    listen [::]:80 default_server;



    root /var/www/html;


    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        try_files $uri $uri/ /index.html;
    }


    location /api {
        # proxy pass for the backend server
        proxy_pass http://127.0.0.1:3000;

        }

Please someone do help me with this problem

0

There are 0 best solutions below