V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
PeiXyJ
V2EX  ›  程序员

项目拥有了 Gateway(zuul/spring gate) 还需要 Nginx 吗?

  •  
  •   PeiXyJ · Oct 21, 2020 · 7339 views
    This topic created in 2013 days ago, the information mentioned may be changed or developed.

    如题, 打算写个微服务的项目,但是已经拥有了网关,还需要 Nginx 在前面再包一层吗? 各位大佬的项目是怎么处理的?

    23 replies    2020-10-21 21:21:02 +08:00
    chogath
        1
    chogath  
       Oct 21, 2020
    我们是加了一层 Nginx
    PeiXyJ
        2
    PeiXyJ  
    OP
       Oct 21, 2020
    @chogath 是拿 Nginx 来再做网关的负载吗
    anonydmer
        3
    anonydmer  
       Oct 21, 2020
    SSL,static files,这些我们都仍然用的 nginx
    chogath
        4
    chogath  
       Oct 21, 2020
    @PeiXyJ
    qwerthhusn
        5
    qwerthhusn  
       Oct 21, 2020   ❤️ 3
    NGINX 做 SSL 消除,响应压缩,多网关 LB
    还要做一些静态页面或资源的服务
    PeiXyJ
        6
    PeiXyJ  
    OP
       Oct 21, 2020
    @anonydmer
    @qwerthhusn
    好的多谢大佬,我大概知道咋玩了.
    lavvrence
        7
    lavvrence  
       Oct 21, 2020
    nginx 做 4 层 LB,gateway 做 7 层 LB
    haosamax
        8
    haosamax  
       Oct 21, 2020
    @jaylee4869 大佬,能大概说下,4 层、7 层都是啥意思吗
    q474818917
        9
    q474818917  
       Oct 21, 2020
    @haosamax 应用层、传输层
    haosamax
        10
    haosamax  
       Oct 21, 2020
    @q474818917 哦哦,原来是第 4 层、第 7 层
    lavvrence
        11
    lavvrence  
       Oct 21, 2020
    haosamax
        12
    haosamax  
       Oct 21, 2020
    @jaylee4869
    @q474818917
    淦,以前看的时候一直以为 4 层,7 层? 还不如不翻译 直接 layer 4 、layer 7 更好理解
    securityCoding
        13
    securityCoding  
       Oct 21, 2020
    gateway 偏向对接业务 ,前端还是要挂一层 nginx 对接前端的
    slyang5
        14
    slyang5  
       Oct 21, 2020
    gateway 直接给前端不是一样吗 ?没必要多加一层网络层的消耗
    xuanbg
        15
    xuanbg  
       Oct 21, 2020
    要的,Nginx 做一层反向代理。一来方便提供 https,二来可以给网关做负载均衡,还可以在 Nginx 上做各种骚操作。
    axbx
        16
    axbx  
       Oct 21, 2020
    前端不是自己部署的服务的话,需要 nginx 来做转发
    xuanbg
        17
    xuanbg  
       Oct 21, 2020
    @slyang5 Nginx 是放在 Web 服务前面的,user->nginx->web server->gateway->service->database 。
    chenhbang
        18
    chenhbang  
       Oct 21, 2020
    Nginx + gateway 的
    nazor
        19
    nazor  
       Oct 21, 2020
    @haosamax 确实,一般都说 L4, L7 。
    egglin
        20
    egglin  
       Oct 21, 2020
    @xuanbg web server 是啥
    stramkismet
        21
    stramkismet  
       Oct 21, 2020
    需要,ng 转到 gateway 上,直接用 gateway 撑不住的。
    slyang5
        22
    slyang5  
       Oct 21, 2020
    @xuanbg 多此一举。
    xuanbg
        23
    xuanbg  
       Oct 21, 2020
    @egglin web 应用肯定需要有个 Web 服务,要不然浏览器访问谁去……

    我们用的是 node 。当然 Nginx 本身也能提供 web 服务。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   977 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 23:00 · PVG 07:00 · LAX 16:00 · JFK 19:00
    ♥ Do have faith in what you're doing.