12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- upstream unicorn {
- server crm:3001;
- }
- server {
- server_name localhost;
- root $RAILS_ROOT/public;
- index index.html;
- access_log $RAILS_ROOT/log/nginx.access.log;
- error_log $RAILS_ROOT/log/nginx.error.log;
- location ~ /\. {
- deny all;
- }
- location ~* ^.+\.(rb|log)$ {
- deny all;
- }
- location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ {
- try_files $uri @rails;
- access_log off;
- gzip_static on; # to serve pre-gzipped version
- expires max;
- add_header Cache-Control public;
- add_header Last-Modified "";
- add_header ETag "";
- break;
- }
- location / {
- try_files $uri @rails;
- }
- location @rails {
- 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;
- proxy_pass http://unicorn;
- }
- }
|