Skip to content

Instantly share code, notes, and snippets.

@minhajuddin
Created December 14, 2010 11:59
Show Gist options
  • Select an option

  • Save minhajuddin/740325 to your computer and use it in GitHub Desktop.

Select an option

Save minhajuddin/740325 to your computer and use it in GitHub Desktop.
nginx configuration file for unicorn
upstream foobar_server {
# This is the socket we configured in unicorn.rb
server unix:/home/ubuntu/apps/foobar/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name *.foobar.com;
root /home/ubuntu/apps/foobar/public;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://foobar_server;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment