Здравствуйте. Есть приложение на Rails 3.2.2(работает на продакшн сервере). В него нужно внести изменения + в дальнейшем установка на сервера клиентов. Я в соответсвии с параметрами основного сервера настроил окружение нового сервера, скопировал приложение и его базу данных(mysql). Приложение запускается, но работает только главная страница, при переходе куда либо - Routing error(хотя в листинге rake routes все есть). Также на сервере нет доступа ка assets'ам. Конфиги серверов одинаковые(за исключением имени сервера в nginx.conf).
nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
include sites-enabled/*;
}
/etc/nginx/sites-enabled/site.conf
upstream e-script_upstream {
server unix:/tmp/unicorn.site.sock fail_timeout=0;
}
server {
server_name www.site.com.ua site.com.ua;
sendfile on;
server_tokens off;
tcp_nopush on; # off may be better for *some* Comet/long-poll stuff
tcp_nodelay off; # on may be better for some Comet/long-poll stuff
gzip on;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 12 4k;
gzip_types text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# client_header_timeout 60;
# client_body_timeout 260;
# send_timeout 260;
# keepalive_timeout 60;
# proxy_read_timeout 1800;
client_max_body_size 200M;
keepalive_timeout 5;
root /var/www/site/public;
if ($host != 'www.site.com.ua' ) {
rewrite ^/(.*)$ http://www.site.com.ua/$1 permanent;
}
location ~ ^/uploads/ {
expires max;
add_header Cache-Control public;
access_log off;
add_header Last-Modified "";
add_header ETag "";
break;
}
location ~ ^/assets/ {
# gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
access_log off;
add_header Last-Modified "";
add_header ETag "";
break;
}
try_files $uri/index.html $uri.html $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://site_upstream;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/site/public;
}
}
unicorn.conf.rb
APP_ROOT = File.expand_path(File.dirname(File.dirname(__FILE__)))
require "redis"
worker_processes 2
#user "unprivileged_user", "unprivileged_group"
working_directory APP_ROOT
listen "/tmp/unicorn.site.sock", :backlog => 64
#listen 8081, :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default)
timeout 30
pid "#{APP_ROOT}/tmp/pids/unicorn.pid"
stderr_path "#{APP_ROOT}/log/unicorn.stderr.log"
stdout_path "#{APP_ROOT}/log/unicorn.stdout.log"
preload_app true
GC.respond_to?(:copy_on_write_friendly=) and
GC.copy_on_write_friendly = true
before_fork do |server, worker|
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
old_pid = "#{server.config[:pid]}.oldbin"
if old_pid != server.pid
begin
sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
Process.kill(sig, File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
end
end
sleep 1
end
after_fork do |server, worker|
# per-process listener ports for debugging/admin/migrations
# addr = "127.0.0.1:#{9293 + worker.nr}"
# server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
$redis = Redis.connect
end
Подскажите в какую сторону копать?