Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 localhost:3000/sinatraapp.

Please suggest me, How will i configure above requirement.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.