Skip to content

Instantly share code, notes, and snippets.

@hayeah
Created October 21, 2012 04:45
Show Gist options
  • Save hayeah/3925801 to your computer and use it in GitHub Desktop.
Save hayeah/3925801 to your computer and use it in GitHub Desktop.
sample nginx rails config
server {
# server_name baolaika.com api.baolaika.com demo.baolaika.com;
server_name pfadmin.baolaika.com;
root /home/deploy/www/puffant-admin/current/public;
location ~ ^/assets/sdk {
access_log off;
gzip_static on;
}
location ~ ^/assets/ {
access_log off;
expires 1y;
add_header Cache-Control public;
gzip_static on; # to serve pre-gzipped version
break;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if (!-f $request_filename) {
proxy_pass http://localhost:4000;
# proxy_pass http://unix:/home/ruby/www/puffant-rails/current/shared/unicorn.sock;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment