Why should one use a http server in front of a framework web server?

前端 未结 5 1491
感动是毒
感动是毒 2020-12-05 03:15

Web applications frameworks such as sinatra (ruby), play (scala), lift (scala) produces a web server listening to a specific port.

I know there are some reasons like

5条回答
  •  [愿得一人]
    2020-12-05 03:27

    Quite often the frameworks do everything you need, but sometimes, adding a layer on top of that can give you seemingly free functionality like compression, security, session management, load balancing, etc. Still, adding a web server may also introduce security issues, for example, chances are your web server security may be compromised easier than Lift by itself. Also, some of the web frameworks are extremely scalable and may even be hampered by an ill chosen web server.

    In summary, if you require web server like functionality that is not provided by the framework, then a web server may be a very good option, but keep in mind that it's one more thing to configure properly and update regularly with security patches, etc.

    If for example, you just need encryption, or compression, then you may find that adding the correct library or plug-in to your framework may do just that (and only that)

提交回复
热议问题