Created
          October 21, 2012 04:45 
        
      - 
      
- 
        Save hayeah/3925801 to your computer and use it in GitHub Desktop. 
    sample nginx rails config
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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