使用Node.js connect.vhost指令与NGINX proxy_pass的虚拟主机? [英] vhost using Node.js connect.vhost directive vs NGINX proxy_pass?

查看:90
本文介绍了使用Node.js connect.vhost指令与NGINX proxy_pass的虚拟主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将具有connect.vhost指令的node.js用作路由器而不是使用proxy_pass的NGINX的优缺点是什么?

What are the advantages/disadvantages of using node.js with a connect.vhost directive as a router rather than NGINX using proxy_pass?

推荐答案

Connect.vhost

优点

  • 非常简单
  • 只需要担心一台服务器
  • 在同一主机上,您不会有多个进程在争夺相同的内存
  • Connect.vhost

    pros

    • fairly simple
    • only one server to worry about
    • you won't have multiple processes on the same host fighting for the same memory
      • 不能扩展到超过1个内核,如果您需要群集到一台机器之外,无论如何您还是会返回nginx或类似的版本.
      • 您仍然需要一种将端口80重定向到node.js(除非您可以以root身份正常运行节点)的解决方案,例如iptables或nginx.
      • 成千上万个网站使用它作为前端或仅用作服务器
      • 不会增加太多开销
      • 您可以直接提供静态文件,而无需node.js完成

      默认情况下,我会选择很多Nginx,但是我可以看到将Connect.vhost用于需要快速且不需要扩展的东西.

      I'd pick nginx pretty much by default, but I could see using Connect.vhost for something I need quick and won't need to scale on.

      这篇关于使用Node.js connect.vhost指令与NGINX proxy_pass的虚拟主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆