I am deploy a ruby on rails application in a nginx, my application is as follow:
app/
...(omit other files)
views/
...(omit other files)
static_pages/
....(omit other files)
home.html.erb
public/
404.html
422.html
500.html
config/
routes.rb
....(omit other files)
Here is the routes.rb:
Rails.application.routes.draw do
root 'static_pages#home'
end
Here is the Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'bootstrap-sass', '~> 3.3.1'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '~> 3.1.7'
gem 'faker'
gem 'carrierwave'
gem 'mini_magick'
gem 'fog'
gem 'nokogiri'
gem 'will_paginate', '~> 3.0.6'
gem 'will_paginate-bootstrap'
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :test do
gem 'minitest-reporters'
gem 'mini_backtrace'
gem 'guard-minitest'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor'
gem 'unicorn'
end
as you can see, my home page is app/views/static_pages/home.html.erb and only some error pages are in public/.
So how can I config nginx to point to my home page?(my application is in /home/roger/blog/)
server {
listen 80 default;
server_name example.com;
location {
root ?????????;
index ?????????;
}
}