Skip to content

Instantly share code, notes, and snippets.

@avsej
Created April 9, 2012 19:20
Show Gist options
  • Select an option

  • Save avsej/2345830 to your computer and use it in GitHub Desktop.

Select an option

Save avsej/2345830 to your computer and use it in GitHub Desktop.
nginx config for thin
upstream thin_cluster {
server unix:/var/run/thin.0.sock;
server unix:/var/run/thin.1.sock;
server unix:/var/run/thin.2.sock;
}
server {
server_name squish.demo.couchbase.com;
root /home/couchbase/couchbase-squish/public;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://thin_cluster;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment