Is it reasonable to put nginx in front of nodejs to serve static assets?

Problem courtesy of: Alexey Zakharov


Yes you can do that. I like using Node with Express and the thin stack that results. I believe with early versions of Node using a web server like Nginx was recommended due to performance concerns. I'm not sure that's valid anymore.

Solution courtesy of: johans


I asked on # node.js irc and Ryan replied for security - "you just may be hacked when some yet-unknown buffer overflow is discovered. Not that that couldn't happen behind nginx, but somehow having a proxy in front makes me happy".

That said is you use a hosted Node service like joyent default app runs on port 80 without Nginx as far as I know.

To setup Node with Nginx see:

Discussion courtesy of: johans

This recipe can be found in it's original form on Stack Over Flow .

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

主题: Nginx
tags: Node,nginx,Nginx,courtesy,like,front,nodejs
本文标题:Is it reasonable to put nginx in front of nodejs to serve static assets?

技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(85)