Redmineをnginxで動かす

今日はmacで動いているRedmineapacheで動いているので
nginxで運用したいので以下のサイトを参考にうまくいきました。

さくらVPSで nginx + MySQL + Unicorn + Redmine の運用

基本的に行ったことは。
1、Gemfileに gem 'unicorn'を追加して。
2、bundle install
3、config/unicorn.rbを作成 中身は上のサイト参考
4、bundle exec unicorn_rails -c config/unicorn.rb -E production -D -p 5001
5、Nginxの設定を作成 中身は上のサイト参考
違いは、 nginx.confではなく。
nginx/site-availableにredmineを作成した

upstream redmine{
  server 127.0.0.1:5001;
}
server {
  listen 80;
  server_name redmine.example.com;

  access_log /var/log/nginx_redmine_access.log;
  error_log /var/log/nginx_redmine_error.log;

  proxy_connect_timeout 60;
  proxy_read_timeout    60;
  proxy_send_timeout    60;

  location / {

    root /home/www/rails/redmine/public;
    if (-f $request_filename){
      break;
    }

    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_pass http://redmine;
    proxy_redirect off;
  }
}