thin

Rack ssl not working with Thin

和自甴很熟 提交于 2019-12-30 09:58:46
问题 I installed rack ssl for Rails 3.07 per these instructions: http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/ It is not working. The first https request (for the login page) is made and the page is served securely, but when you login it redirects to a non-secure http URL. I am running Thin server. Does it work for Thin? What about Webrick? Any ideas? Thanks. 回答1: For Thin, you can pass your SSL information in using the following options: $ thin --help SSL options: -

Multiple Rails apps over NGINX (reverse proxy)

懵懂的女人 提交于 2019-12-25 12:42:40
问题 I have two rails apps on my server. Each of them is running on a Thin server. I am also using NGINX. This is my NGINX configuration file: server{ location /blog { proxy_pass http://127.0.0.1:8082; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /website1 { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header

Multiple Rails apps over NGINX (reverse proxy)

三世轮回 提交于 2019-12-25 12:41:49
问题 I have two rails apps on my server. Each of them is running on a Thin server. I am also using NGINX. This is my NGINX configuration file: server{ location /blog { proxy_pass http://127.0.0.1:8082; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /website1 { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header

Rails with thin and ssl: http request not auto-redirected to https

*爱你&永不变心* 提交于 2019-12-25 06:47:01
问题 Recently I wanted to secure my rails 4.2.1 app with https the easiest way . I found this question as well as this answer about WEBrick+SSL, both referencing to this post which is unfortunately not reachable any more. Then I found this answer recommending to use thin instead (naming other advantages of using thin). Then I followed this step-by-step guide, finally running thin start --ssl --ssl-key-file .ssl/key.pem --ssl-cert-file .ssl/cert.pem -e production with self-signed certificate. My

Thin + EventMachine fails to start

谁说我不能喝 提交于 2019-12-25 05:23:09
问题 While loading a Thin webserver for a sinatra app I keep getting Unable to load the EventMachine C extension; To use the pure-ruby reactor, require em/pure_ruby'<path>/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:8:in `require': cannot load such file -- rubyeventmachine (LoadError) from <path>/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:8:in `<top (required)>' from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin.rb:7:in

Starting multiple instances of Thin Server on Windows with a batch script

僤鯓⒐⒋嵵緔 提交于 2019-12-25 03:10:38
问题 I'm writing a script to automatically deploy a ruby on rails application in Windows. I have everything automated except for the thin cluster startup; it turns out that daemonizing is not supported in Windows so I cannot use the -servers command when calling thin. A previous question I posted: Starting a Thin cluster on Windows I'm now looking for an alternative approach to getting three instances up programatically. Does anyone know how I might be able to accomplish this? Thanks for your time

Why does this rackup file work with Thin, but not WEBrick or Unicorn?

一世执手 提交于 2019-12-25 02:19:42
问题 I am having a strange issue running my static website locally (for testing). Both WEBrick and Unicorn are causing an assertion failure in Rack when navigating to root. However Thin works perfectly. My rackup file 'config.ru': # This is the root of our app @root = File.expand_path(File.dirname(__FILE__)) + '/site' default_charset = "; charset=UTF-8" run Proc.new { |env| # Extract the requested path from the request path = Rack::Utils.unescape(env['PATH_INFO']) index_file = @root + "#{path}

Running a modular Sinatra app with Thin and EventMachine. It starts twice?

蹲街弑〆低调 提交于 2019-12-24 14:26:48
问题 I have a modular Sinatra web app running using Thin, with EventMachine running additional tasks. It works, but there's something a bit odd about the webserver: Any requests, whether successful or 404s, don't appear in the log output from Thin/Sinatra. And when I cancel the process, the server ends twice. Here's the rough, basic structure of the app: Procfile: web: ruby app.rb app.rb: require 'thin' require 'eventmachine' require 'app/frontend' EM.run do # Start some background tasks here...

Getting thin to read configured user environment

痞子三分冷 提交于 2019-12-24 00:27:23
问题 I'm starting thin with a parameter set like the following under ubuntu chdir: /var/www/myuser/current rackup: /var/www/myuser/current/config.ru environment: production address: 0.0.0.0 port: 3000 timeout: 30 log: log/thin.log pid: tmp/pids/thin.pid max_conns: 1024 max_persistent_conns: 512 require: [] wait: 30 servers: 3 daemonize: true user: myuser group: myuser And I want to define a set of environment variables for "myuser" so they can be accessible in the rack application I'm deploying in

In Rails, should I enable serve_static_assets?

♀尐吖头ヾ 提交于 2019-12-23 18:53:17
问题 I am currently using Apache to proxy to Thin (using this article) None of my static assets work (e.g. stylesheets, javascripts). Is Apache supposed to be serving them or do I have to enable config.serve_static_assets in config/environments/production.rb ? If Apache is supposed to serve them, then what am I probably doing wrong? Here is my Apache config: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /home/r/public_html/example/public RewriteEngine On <Proxy