【ruby-on-rails – 如何用铁轨等完全擦拭rubygems】教程文章相关的互联网学习教程文章

ruby-on-rails-Nginx将上游头传递给远程请求【代码】

这个问题类似于this one,但是在aws s3资源上执行x-accel-redirect.前者试图将上游头设置为本地请求.这很好.但是现在我已将内容移至亚马逊s3,并且我想对s3对象实施相同的受限下载. 这是我的nginx配置proxy_pass_header X-Accel-Redirect; passenger_pass_header X-Accel-Redirect;location ~* ^/download_zip/(.*) {internal;resolver 8.8.8.8 valid=300s;proxy_buffering off;proxy_set_header Content-Length ""; proxy_set_heade...

ruby-on-rails-为什么我们需要在生产设置上使用薄的Nginx?

为什么我们需要在生产设置中安装带有Thin的nginx,因为Thin本身就是Web服务器.人们每篇博文都使用Nginx稀薄吗?解决方法:正如Michael nginx所说的那样,天平很薄(无论什么意思).但是在任何ruby服务器之前使用nginx的另一个原因是要提供静态文件(如果您使用页面缓存,nginx也可以提供它们),这意味着请求甚至不会碰到ruby应用程序,从而大大提高了性能.还有nginx,尽管它似乎是ruby/轨道社区中的流行选择,但还有其他替代方法,例如apache.

ruby-on-rails-如何将ImageMagick环境变量传递给nginx mongrels?【代码】

我的Rails应用程序使用ImageMagick,但是该应用程序在尝试执行ImageMagick命令(“ identify”)时失败.我通过在Apache配置中传递以下环境变量来解决开发中的问题(正在运行Apache / Passenger):SetEnv MAGICK_HOME /opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16SetEnv DYLD_LIBRARY_PATH /opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16/opt/local/libSetEnv PATH /usr/bin:/opt/local/var/macports/sof...

ruby-on-rails-Rails-Elastick Beanstalk nginx / error.log【代码】

尝试将我的Rails应用程序上传到弹性beantalk.我已经成功部署了我的应用程序并创建了postgres数据库.我的应用程序可在开发服务器上的sqlite3上运行. 我的eb状态已准备就绪,健康状况良好. 我的eb日志文件;/var/log/nginx/error.log ------------------------------------- 2016/05/27 11:15:44 [warn] 2797#0: conflicting server name "localhost" on 0.0.0.0:80, ignored 2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to u...

ruby-on-rails – net :: ERR_INCOMPLETE_CHUNKED_ENCODING nginx【代码】

我在2个不同的服务器上托管了2个RoR Web应用程序.对于一个特定页面,请求从第二个应用程序提供.对于其余页面,请求由主应用程序提供.主应用程序的Nginx设置location /customer/help/ {proxy_pass http://second-application:3020/help_and_support/; } location /assets/ {proxy_pass http://second-application:3020/assets/; }这工作到昨天一直很好.现在,/ customer / help / page未正确加载.在Firefox中它显示一个空白页面,在chro...

ruby-on-rails – 生产中带有自定义(非80)端口的Rails’* _url助手. (Nginx,独角兽)【代码】

我是铁轨生产环境中的菜鸟.我可以配置nginx和unicorn来响应其他(非80)端口吗?我不需要任何域名,我只需要ip和端口.这是我的应用程序的nginx配置(80端口):server {listen 80;server_name localhost;root /home/my_app_folder/web-app/public;client_max_body_size 32m;location / {try_files $uri @unicorn;}location @unicorn {proxy_set_header Client-Ip $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwa...

ruby-on-rails – Access-Control-Allow-Origin无法使用Backbone json请求,Nginx设置“全开”,标题看起来很好【代码】

您好我需要从Backbone向API发出json请求(我可以控制服务器端)..虽然响应头看起来很好,但我一直得到Access-Control-Allow-Origin. 以下是Nginx设置:location / {if ($request_method = 'OPTIONS') {add_header 'Access-Control-Allow-Origin' '*';add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-Req...

ruby-on-rails – rvmsudo passenger-install-nginx-module:没有这样的文件或目录【代码】

我正在尝试将passenger / nginx安装到ubuntu 12.10上. 当我尝试运行rvmsudo passenger-install-nginx-module时,我得到:/usr/bin/env: passenger-install-nginx-module: No such file or directory$PATH结果bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/games:/home/deploy/.rvm/bin:/home/deploy/.rvm/bin: No such file or directoryRVM信息:ruby-2.0.0-p247:system:uname: ...

ruby-on-rails – 坏URI(不是URI?)在ubuntu终端中运行rails时【代码】

我一直试图在我的一个项目上运行rails.我是RoR的完全初学者,只是试图通过首先尝试运行文件并查看网站的外观来开始.但是,似乎我陷入了这个问题,我无法真正找到解决方案.谁能帮我? 这是错误:/home/peh/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/uri/common.rb:176:in `split': bad URI(is not URI?): (URI::InvalidURIError) from /home/peh/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/uri/common.rb:211:in `parse' from /h...

ruby-on-rails – nginx:从命名位置的proxy_pass中删除路径【代码】

我有这个nginx配置来提供rails应用程序:location ^~ /api/ {alias /srv/www/rails/public/;try_files $uri @unicorn;}location @unicorn {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header Host $http_host;proxy_redirect off;proxy_pass http://127.0.0.1:2007;}我想从路径的开头删除/ api /,然后将其传递给rails app,但由于它是一个命名位置,我不能...

ruby-on-rails – 如何阻止rails nginx-passenger应用程序?【代码】

我使用nginx产生的乘客.服务器上还有许多使用乘客的其他rails应用程序(每个应用程序在nginx中都有自己的虚拟主机). 我可以像这样重启Rails / Nginx / Passenger应用程序:touch tmp/restart.txt我怎么能阻止它? 这不起作用:touch tmp/stop.txt touch tmp/shutdown.txt解决方法:方法1 删除应用程序的虚拟主机条目并重新启动Nginx. Phusion Passenger将不再提供服务. 方法2 如果您想保留应用程序的虚拟主机条目,但实际上并未运行该...

ruby-on-rails – 如何在Nginx和Amazon ElasticBeanstalk中解决错误413请求实体太大?【代码】

我在项目中上传大图像时遇到问题,我的配置是用puma和RoR.我在elasticbeanstalk中的用户是ec2-user. 我尝试过很多我看过的配置,但它无法正常工作. .ebextensions中的文件就像这样:files:"/etc/nginx/conf.d/proxy.conf" :mode: "000777"owner: rootgroup: rootcontent: |client_max_body_size 4G;其他配置,但它不起作用files:"/etc/nginx/conf.d/proxy.conf" :mode: "000755"owner: ec2-usergroup: ec2-usercontent: |client_max_b...

ruby-on-rails – rails nginx puma在/ etc / nginx / sites-enabled中复制上游“puma”【代码】

我为本教程设置了服务器(https://coderwall.com/p/ttrhow/deploying-rails-app-using-nginx-puma-and-capistrano-3) 当我使用一个项目时,一切正常,但当我向这个VPS添加另一个项目时,我有错误[emerg] 20737#0:在/ etc / nginx / sites-enabled / vsejalreg中复制上游“puma”:1 我的nginx的配置upstream puma {server unix:///home/deployer/apps/vsejalreg/shared/tmp/sockets/vsejalreg-puma.sock; }server {listen 80;server_n...

ruby-on-rails – 没有nginx使用独角兽是不是很糟糕?为什么?

我读到unicorn快速提供静态内容,减慢用户速度,重定向. 为什么更好的nginx独角兽只运行独角兽,并在需要时扩展独角兽工人的数量? 你有没有数字显示nginx在这些事情上的速度有多快(重定向,代理,提供静态内容)?解决方法:As Heroku DevCenter claims,独角兽工人容易受到慢客户的影响. 每个工作人员只能处理单个请求,如果客户端尚未准备好接受整个答案(也称为“慢速客户端”),则Unicorn工作人员在发送响应时被阻止,无法处理下一个响应....

ruby-on-rails – Rails Puma Nginx每隔几天Bad Gateway 502【代码】

我有一个使用Puma在Nginx上运行的rails应用程序,就像发条一样,应用程序每隔几天就会出现502 Bad Gateway错误. 我的nginx日志包含很多这样的错误:2015/07/23 14:43:49 [error] 14044#0: *7036 connect() to unix:///var/www/myapp/myapp_app.sock failed (111: Connection refused) while connecting to upstream, client: 12.123.12.12, server: myapp.com, request: "GET /arrangements HTTP/1.1", upstream: "http://unix:///va...