华为云 ECS 安装 Nginx 的端口问题
VIEW CONTENTS

华为云 ECS 安装 Nginx 的端口问题

2019-2-13 00:00| 发布者: xtyly| 查看: 432| 评论: 0|来自: 网络
版权声明:本文为博主原创文章,转载请注明出处。

服务器之迁徙

私人服务器从腾讯云迁到便宜的华为ECS,重装系统。
node ,
mongodb
nginx

检测nginx 正常

nginx -t 正常

启动nginx 服务,一切正常

service nginx start 

查看进程 正常

ps -ef |grep nginx

浏览器打开
在这里插入图片描述

http://ip
无法访问

排查

服务器 ping 外网

root@ruff-server-01:~# ping www.baidu.com
PING www.a.shifen.com (180.97.33.107) 56(84) bytes of data.
64 bytes from 180.97.33.107: icmp_seq=1 ttl=47 time=30.2 ms
64 bytes from 180.97.33.107: icmp_seq=2 ttl=47 time=29.8 ms
64 bytes from 180.97.33.107: icmp_seq=3 ttl=47 time=29.7 ms
64 bytes from 180.97.33.107: icmp_seq=4 ttl=47 time=29.7 ms
64 bytes from 180.97.33.107: icmp_seq=5 ttl=47 time=29.7 ms
64 bytes from 180.97.33.107: icmp_seq=6 ttl=47 time=29.8 ms
64 bytes from 180.97.33.107: icmp_seq=7 ttl=47 time=29.7 ms
64 bytes from 180.97.33.107: icmp_seq=8 ttl=47 time=29.7 ms

正常

ping 服务器

PING xx.xx.xx.xx(xx.xx.xx.xx): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3

curl 请求本地

root@ruff-server-01:~# curl 127.0.0.1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
 
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
 
<p><em>Thank you for using nginx.</em></p>
</body>
</html>

问题所在

打开华为云服务器的控制台,打开服务器的更改安全组> 修改安全组 > 配置规则。
将你要用的端口添加到规则中,出方向 入方向都需要添加。
在这里插入图片描述

在这里插入图片描述

打勾并添加。在这里插入图片描述

重启服务器

之前配置的服务已能正常使用。
在这里插入图片描述


路过

雷人

握手

鲜花

鸡蛋
腾讯云服务器优惠

相关阅读

最新评论




在线客服(工作时间:9:00-22:00)
400-600-6565

内容导航

微信客服

Copyright   ©2015-2019  云服务器社区  Powered by©Discuz!  技术支持:尊托网络     ( 湘ICP备15009499号-1 )