大网数据广告活动
服务器运维问答

Can't connect to nginx server from public IP Address

· 52CE 我爱测

Hi I have a nginx server running on a linux machine. I can connect it to from localhost using curl -v http://localhost:8080 fine. But can't connect it to using curl -v http://<machine-ip>:8080 , or from browsers in some other mac…

问题原文

原帖链接 · Deepak Saini · CC BY-SA 4.0

Hi I have a nginx server running on a linux machine. I can connect it to from localhost using curl -v http://localhost:8080 fine. But can't connect it to using curl -v http://<machine-ip>:8080, or from browsers in some other machine.

The config file is

server {
        listen 8080;
        listen [::]:8080;

        root /var/www/html;

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

        server_name _;

        location / {
                try_files $uri $uri/ =404;
        }
    }

Port 8080 is being listened to on IPv4 and IPv6, as sudo netstat -tulpn | grep nginx gives

tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      123495/nginx: maste
tcp6       0      0 :::8080                 :::*                    LISTEN      123495/nginx: maste

The firewall is down, as doing sudo ufw status tell status: inactive. I have looked at a lot of answers on various stack exchange sites, but can't figure out the issue. Would appreciate any help. TIA.

已采纳解答

原帖链接 · Deepak Saini · CC BY-SA 4.0

The error was that the port was not open from the Azure side. Follow this to allow incoming traffic on port 8080 as described here, reboot the machine and it works fine now.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-01-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。