Nginx未知指令“上游"部署Rails时出错 [英] Nginx unknown directive "upstream" error when deploying Rails

查看:77
本文介绍了Nginx未知指令“上游"部署Rails时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装标准的Rails应用.经过教程 https://coderwall.com/p/yz8cha 之后,我陷入了最后一步.

I am trying to install an standard Rails app. After going through a tutorial https://coderwall.com/p/yz8cha I am stuck at last step.

尝试重新启动Nginx时,出现以下错误- Restarting nginx: nginx: [emerg] unknown directive "upstream" in /etc/nginx/nginx.conf:1 ; nginx: configuration file /etc/nginx/nginx.conf test failed

When trying to restart nginx I get the following error - Restarting nginx: nginx: [emerg] unknown directive "upstream" in /etc/nginx/nginx.conf:1 ; nginx: configuration file /etc/nginx/nginx.conf test failed

我严格遵守 https://coderwall.com/p/yz8cha 中的所有步骤,因此我的conf文件和unicorn.rb文件与项目名称和用户的更改几乎相同.

I have strictly followed all the steps in https://coderwall.com/p/yz8cha so my conf files and unicorn.rb files are pretty much same with changes in projectname and user.

我的nginx conf文件- http://pastebin.com/bd0RRDxK

My nginx conf file - http://pastebin.com/bd0RRDxK

推荐答案

此处提到的nginx.conf https://coderwall.com/p/yz8cha 应该放在config/nginx.conf的rails应用中.

The nginx.conf mentioned here https://coderwall.com/p/yz8cha is supposed to be put in your rails app at config/nginx.conf.

然后将此文件符号链接以获取nginx.

This file is then sym linked for nginx to be picked up.

这篇关于Nginx未知指令“上游"部署Rails时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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