Deploying sinatra app on rails app sub uri using( unicorn and nginx)

pravinmishra88 nginx-forum at
Wed Jul 10 21:15:05 UTC 2013

I  have rails app running on unicorn+nginx. below is the nginx.conf and
unicorn.rb configuration.


upstream unicorn {
  server unix:/tmp/unicorn.todo.sock fail_timeout=0;

  listen 80 default deferred;
  #server_name localhost;
  root /var/www/demo/public;
  try_files $uri/index.html $uri @unicorn;

  location @unicorn {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn;

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;


working_directory "/var/www/demo"
pid "/var/www/demo/tmp/pids/"
stderr_path "/var/www/demo/unicorn.log"
stdout_path "/var/www/demo/unicorn.log"

listen "/tmp/unicorn.todo.sock"
worker_processes 2
timeout 30

It's working fine for me. Now i wanted to deploy another small sinatra app
rails app sub uri(localhost:3000/sinatraapp). DETAILS: As we know rails app
running on localhost:3000, Now i am trying to configure sinatra app on

Please suggest me, How will i configure above requirement.

Posted at Nginx Forum:,240739,240739#msg-240739

More information about the nginx mailing list