nginx.conf文件如下:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:3000/;
}
location /events/ {
proxy_pass http://localhost:3001/;
proxy_buffering off;
proxy_read_timeout 1000s;
}
}
}
将以下内容存储在〜/ .ec2 /中(可能需要移动以使capistrano工作)
cert-123456789ABCDEF0123456789ABCDEF0.pem
pk-123456789ABCDEF0123456789ABCDEF0.pem
ec2-keypair
目前有以下deploy.rb(但它不能正常工作)
set :application, "clashcentral"
set :repository, "git@github.com:HairyMezican/GameLobby.git"
set :branch, "master"
set :repository_cache, "git_cache"
set :deploy_via, :remote_cache
set :ssh_options, { :forward_agent => true }
set :scm, :git
ssh_options[:keys] = [File.join(ENV["HOME"], ".ec2", "ec2-keypair")]
role :web, "ec2-12-34-56-789.compute-1.amazonaws.com"
role :app, "ec2-12-34-56-789.compute-1.amazonaws.com"
role :db, "ec2-12-34-56-789.compute-1.amazonaws.com", :primary => true
connection failed for: ec2-12-34-56-789.compute-1.amazonaws.com (Net::SSH::AuthenticationFailed: Empty)
set :user, "ec2-user"
行添加failed: "sh -c 'if [ -d /u/apps/clashcentral/shared/git_cache ]; then cd /u/apps/clashcentral/shared/git_cache && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd && git clean -q -d -x -f; else git clone -q git@github.com:HairyMezican/GameLobby.git /u/apps/clashcentral/shared/git_cache && cd /u/apps/clashcentral/shared/git_cache && git checkout -q -b deploy cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd; fi'" on ec2-12-34-56-789.compute-1.amazonaws.com
答案 0 :(得分:1)
我相信你需要添加:
set :user, "ec2-user"
到您的deploy.rb
文件,如下所示:http://wiki.dreamhost.com/Capistrano#Automate_Deployment_with_Capistrano_.28.22capify.22.29