unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Jerrold Thompson <jet@whidbey.com>
To: mongrel-unicorn@rubyforge.org
Subject: 403 Forbidden from nginx when unicorn started in debug mode
Date: Tue, 04 Dec 2012 13:57:54 -0800	[thread overview]
Message-ID: <50BE71E2.6040504@whidbey.com> (raw)

I am using nginx with unicorn as a reverse proxy.

Has been fantastic, but needed to look through some code
for first time.

Using ruby 1.9.3p194 with rails 3.2.9, development mode with ssl enabled,

I start unicorn with -d

...and it does not get served up by nginx.

Any ideas, or more information needed?

Thanks!

    Jet

Below is my unicorn.rb for developent:

# config/unicorn.rb

env =  "development"

preload_app true

timeout 30

listen "/tmp/unicorn.sock", :backlog => 64

if env == 'development'
   pid 
"/home/jet/RailsApps/spree/aceleathergoods/tmp/pids/unicorn.aceleathergoods.pid"
   stderr_path "/var/www/aceleathergoods/shared/log/unicorn.stderr.log"
   stdout_path "/var/www/aceleathergoods/shared/log/unicorn.stdout.log"
end


before_fork do |server, worker|
   if defined?(ActiveRecord::Base)
     ActiveRecord::Base.connection.disconnect!
   end

   old_pid = "#{shared_path}/pids/unicorn.aceleathergoods.pid.oldbin"
   if File.exists?(old_pid) && server.pid != old_pid
     begin
       Process.kill("QUIT", File.read(old_pid).to_i)
     rescue Errno::ENOENT, Errno::ESRCH
       # someone else did our job for us
     end
   end
end

after_fork do |server, worker|
   if defined?(ActiveRecord::Base)
     ActiveRecord::Base.establish_connection
   end
end

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

             reply	other threads:[~2012-12-05  0:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 21:57 Jerrold Thompson [this message]
2012-12-04 22:01 ` 403 Forbidden from nginx when unicorn started in debug mode Jerrold Thompson
2012-12-05  0:10 ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50BE71E2.6040504@whidbey.com \
    --to=jet@whidbey.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).