如何使用Nginx在乘客中运行Sinatra应用程序?

我正在尝试使用我现有的Nginx&Passenger设置来运行一个非常简单的Sinatra应用程序。 我熟悉在乘客上运行Rails,但这是我第一次创建Sinatra。

我已经通过捆绑器和RVM安装了Sinatra。 看看我的配置,并告诉我我做错了什么。

Nginx conf:

server {
  listen       80;
  server_name  demo.my-example.com;
  root /home/user/demo.my-example.com/sinatra;     

  passenger_ruby /usr/local/rvm/wrappers/ruby-2.3.1@my_gemset/ruby;
  passenger_enabled on;
}

/home/user/demo.my-example.com/sinatra/config.ru

require 'rubygems'
Gem.clear_paths
disable :run, :reload
set :environment, :production

require "./stripe"
run StripeApp

/home/user/demo.my-example.com/sinatra/stripe.rb

require 'sinatra/base'
class StripeApp < Sinatra::Base
  get '/' do 
   "Hello world"
  end
end
链接地址: http://www.djcxy.com/p/5563.html

上一篇: How to run Sinatra App in Passenger with Nginx?

下一篇: Troubleshoot: Setting up rails project with nginx + passenger locally (on a mac)