获取NET :: err_connection_refuse with Node.js服务器服务视频&音频文件

发布于 2025-01-22 23:36:20 字数 1924 浏览 2 评论 0 原文

当我使用其他设备访问视频 audio 文件时,请遇到问题。

我正在使用Angular作为前端,并用作后端,并使用NGINX在本地系统中托管了它。

当我使用http://localhost/api/media/audio/audio.mp3时,它的工作正常非常好。

音频正在播放

当我使用 http://192.168.0.0.100/api/api/media/media/audio/audio/audio/audio.mp3

音频文件不播放

图像在两个 http:///192.168.0.0.100/api/media/media/image/hulk.jpg (我的计算机的LAN IP)和

和其他文件也可以正常工作

文本文件工作

在192.168.0.100中工作的前端(在LAN上)但是YouTube嵌入不起作用

frontend

nginx-> /etc/nginx/stites-abailable 默认文件


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;

        }

请有人帮助我解决这个问题

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文