Ruby on rails Nginx和Unicorn for Rails 4应用程序不工作
config/unicorn.rbRuby on rails Nginx和Unicorn for Rails 4应用程序不工作,ruby-on-rails,ruby,nginx,unicorn,production,Ruby On Rails,Ruby,Nginx,Unicorn,Production,config/unicorn.rb working_directory "/var/www/subdomain.myapp.com/public_html" pid "/var/www/subdomain.myapp.com/public_html/tmp/pids/unicorn.pid" stderr_path "/var/www/subdomain.myapp.com/public_html/log/unicorn.log" stdout_path "/var/www/subdomain.
working_directory "/var/www/subdomain.myapp.com/public_html"
pid "/var/www/subdomain.myapp.com/public_html/tmp/pids/unicorn.pid"
stderr_path "/var/www/subdomain.myapp.com/public_html/log/unicorn.log"
stdout_path "/var/www/subdomain.myapp.com/public_html/log/unicorn.log"
listen "/tmp/unicorn.subdomain.myapp.com.sock"
worker_processes 2
timeout 30
在:/etc/nginx/sites下启用
subdomain.myapp.com -> /var/www/subdomain.myapp.com/public_html/config/nginx.conf
这是我在/var/www/subdomain.myapp.com/public\u html/config/nginx.conf中看到的
upstream unicorn {
server unix:/tmp/unicorn.subdomain.myapp.com.sock fail_timeout=0;
}
server {
listen 80;
# server_name example.com;
root /var/www/subdomain.myapp.com/public_html;
#try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unicorn;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
我是这样运行它的:
bundle exec unicorn-c config/unicorn.rb
当我运行上面的命令时,什么也没有发生。当我进入浏览器时,我会看到Nginx的默认页面。我已经删除了默认设置的所有引用,它仍在显示
谢谢,
H.您正在向http://unicorn... 有什么事吗?unicorn正在监听哪个端口进行传入连接?@RubyRacer for socket connection不需要端口。不,那里什么都没有。我复制了设置中的内容。这个http://unicorn; 正看着上游,所以技术上应该可行。不知道我错过了什么。