rails project request pass to nginx virtual host

upstream myapp {
  server 127.0.0.1:3000;
  server 127.0.0.1:3001;
  server 127.0.0.1:3002;
}
server {
  listen   80;
  server_name ruby.local;

  error_log  /home/wwwroot/rails_app/log/error.log;
  root     /home/wwwroot/rails_app/blog;
  index    index.html;

  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;
    try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby ;
  }

  location @ruby {
    proxy_pass http://myapp;
  }
}

你可能感兴趣的:(rails project request pass to nginx virtual host)