Created
          October 18, 2015 14:15 
        
      - 
      
 - 
        
Save clinx/0ddeed8cc223c8b2cc17 to your computer and use it in GitHub Desktop.  
    nginx sample conf
  
        
  
    
      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
    
  
  
    
  | upstream foo_app { | |
| server 127.0.0.1:3000; | |
| } | |
| server { | |
| listen 80; | |
| # listen [::]:80 default_server ipv6only=on; | |
| root /home/user/foo/foo_web/public; | |
| server_name foo.it www.foo.it; | |
| underscores_in_headers on; | |
| client_max_body_size 4g; | |
| location ~ ^/(assets)/ { | |
| gzip_static on; | |
| expires max; | |
| add_header Cache-Control 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_connect_timeout 300; | |
| proxy_read_timeout 300; | |
| proxy_pass_request_headers on; | |
| proxy_pass http://foo_app; | |
| } | |
| } | |
| ## /etc/nginx/sites-enabled/foo-production (END) | |
| upstream foo_app_api { | |
| server 127.0.0.1:3001; | |
| } | |
| server { | |
| listen 80; | |
| root /home/user/foo/foo_web/public; | |
| server_name api.foo.it; | |
| underscores_in_headers on; | |
| client_max_body_size 4g; | |
| 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_connect_timeout 300; | |
| proxy_read_timeout 300; | |
| proxy_pass_request_headers on; | |
| proxy_pass http://foo_app_api; | |
| } | |
| } | |
| ## /etc/nginx/sites-enabled/foo-production-api (END) | |
| upstream foo_app_api_uploader { | |
| server 127.0.0.1:3002; | |
| } | |
| server { | |
| listen 80; | |
| listen [::]:80 default_server ipv6only=on; | |
| root /home/user/foo/foo_web/public; | |
| server_name api-uploader.foo.it; | |
| underscores_in_headers on; | |
| client_max_body_size 4g; | |
| 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_connect_timeout 300; | |
| proxy_read_timeout 300; | |
| proxy_pass_request_headers on; | |
| proxy_pass http://foo_app_api_uploader; | |
| } | |
| } | |
| ## /etc/nginx/sites-enabled/foo-production-api-uploader (END) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment