腾讯云服务器安全组策略问题

在安装nodejs, 架设nodejs http服务时,发现这个以下问题。

多次尝试安全组策略后发生,端口高于3000的http服务无法通过安全组策略,即使在安全组策略中打开所有端口也不行。

通过内网可以正常访问3000端口,但外网无法访问。

可通过ngnix代理3000端口解决。

sever{
# pass the request to the node.js server with the correct headers
  # and much more can be added, see nginx config options
  location /nodejs {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://app_timesheet/;
    proxy_redirect off;
  }
}
# the IP(s) on which your node server is running. I chose port 3001.
upstream app_timesheet {
server 127.0.0.1:3001;
keepalive 8;
}

已发布

分类

来自

标签:

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注