为什么将 nginx 与 Catalyst/Plack/Starman 一起使用? [英] Why use nginx with Catalyst/Plack/Starman?

查看:34
本文介绍了为什么将 nginx 与 Catalyst/Plack/Starman 一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Plack/Starman 部署我的小型 Catalyst 网络应用程序.所有文档似乎都表明我想将它与 nginx 结合使用.这有什么好处?为什么不直接在 80 端口上使用 Starman?

I am trying to deploy my little Catalyst web app using Plack/Starman. All the documentation seems to suggest I want to use this in combination with nginx. What are the benefits of this? Why not use Starman straight up on port 80?

推荐答案

它不必特别是 nginx,但出于以下几个原因,您需要某种前端服务器代理到您的应用程序服务器:

It doesn't have to be nginx in particular, but you want some kind of frontend server proxying to your application server for a few reasons:

  1. 这样您就可以以普通用户的身份在高端口上运行 Catalyst 服务器,同时在端口 80 上运行前端服务器.

  1. So that you can run the Catalyst server on a high port, as an ordinary user, while running the frontend server on port 80.

提供静态文件(图像、JS 和 CSS 等普通资源,以及您可能希望使用 X-Sendfile 或 X-Accel-Redirect 的任何类型的下载),而无需绑定 perl 进程在下载期间.

To serve static files (ordinary resources like images, JS, and CSS, as well as any sort of downloads you might want to use X-Sendfile or X-Accel-Redirect with) without tying up a perl process for the duration of the download.

如果您想继续使用更复杂的配置,例如Edge Side Includes,或者让网络服务器直接从 memcached 或 mogilefs(nginx 可以做的事情)或负载平衡/HA 配置提供服务.

It makes things easier if you want to move on to a more complicated config involving e.g. Edge Side Includes, or having the webserver serve directly from memcached or mogilefs (both things that nginx can do), or a load-balancing / HA config.

这篇关于为什么将 nginx 与 Catalyst/Plack/Starman 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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