Nginx & Unicorn setup

Hi, I’m having a bit of aggro getting Unicorn and Nginx setup to where
Uncorn.rb actually loads. Second prob is getting Nginx to properly
recognize the new app listed as server in nginx.conf

Does anyone know of any good articles on this setup? I’ve looked a tried
a
few but with no success. Puma & Apache setup worked just fine, but I’m
really keep to go Nginx/Unicorn. Thanks.

Sounds like there’s something wrong with your nginx config and/or
unicorn.conf. Could you put a github gist link for each of these
configurations?

Cheers,
Dwight S. (@denzuko)

For some reason the first gist didn’t include the nginx.conf file.

Here it is:

Dwight Spencer wrote in post #1118529:

Sounds like there’s something wrong with your nginx config and/or
unicorn.conf. Could you put a github gist link for each of these
configurations?

Cheers,
Dwight S. (@denzuko)
ComputekIndustries.com

Hi Dwight,

Thanks for your help, I’ve made a number of changes to the nginx conf
files so may be way off target by now. Getting Nginx, Rails, Postgres
pretty straight foward, the unicorn thing is a bit challenging despite
following a few blog article how tos. Here’s my github gist on 4 files:

  1. nginx.conf
  2. modelesprit.com - file for the app
  3. unicorn_connector.conf - file included in 2 for unicorn
  4. railo_connector.conf - file included in 2 for Railo coldfusion server
    as I have some legacy coldfusion apps to support

Thanks,
Pardeep.

Dwight Spencer wrote in post #1118596:

Hi Pardeep,

I’m glad to help. I did get to review both of the gists you posted up
and your nginx configuration does look proper. This leads me to suspect
there is a config issue with unicorn. Do you have a gist of the unicorn
config I can look at?

Also, are you making sure to have unicorn listen on a unix socket
located at /tmp/unicorn.modelesprit.sock instead of a tcp port?

Cheers,
Dwight S. (@denzuko)
ComputekIndustries.com

Hi Dwight,

Sorry for the delay, my unicorn.rb file in the rails app config folder
is as follows:

root = “/srv/www/modelesprit.com/”
working_directory root
pid “#{root}/tmp/pids/unicorn.pid”
stderr_path “#{root}/log/unicorn.log”
stdout_path “#{root}/log/unicorn.log”

listen “/tmp/unicorn.modelesprit.sock”
worker_processes 2
timeout 30

Best,
Pardeep.

Hi Pardeep,

I’m glad to help. I did get to review both of the gists you posted up
and your nginx configuration does look proper. This leads me to suspect
there is a config issue with unicorn. Do you have a gist of the unicorn
config I can look at?

Also, are you making sure to have unicorn listen on a unix socket
located at /tmp/unicorn.modelesprit.sock instead of a tcp port?

Cheers,
Dwight S. (@denzuko)