【发布时间】:2018-12-30 09:24:57
【问题描述】:
当我部署新版本时,我遇到了这个错误。我试图遵循关于堆栈溢出的几个指令,但没有帮助。当我部署时,健康状态首先是成功的,然后当我访问该网站时,它会变为降级。
在网站上我得到错误
502 网关错误
nginx/1.12.1
错误
2018/07/22 23:11:55 [error] 3038#0: *5502 connect() to unix:///var/run/puma/my_app.sock failed (111: Connection refused) while connecting to upstream, client: 68.228.233.169, server: _, request: "GET /robots.txt HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/robots.txt", host: "borroupenv.us-east-1.elasticbeanstalk.com"
2018/07/22 23:11:55 [error] 3038#0: *5498 connect() to unix:///var/run/puma/my_app.sock failed (111: Connection refused) while connecting to upstream, client: 68.228.233.169, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "borroupenv.us-east-1.elasticbeanstalk.com", referrer: "http://borroupenv.us-east-1.elasticbeanstalk.com/"
这是来自 puma.rb
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
port ENV.fetch("PORT") { 3000 }
environment ENV.fetch("RAILS_ENV") { "development" }
bind "unix:///var/run/puma/my_app.sock"
pidfile "/var/run/puma/my_app.sock"
plugin :tmp_restart
这是来自 config/environments/production.rb
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.read_encrypted_secrets = true
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.js_compressor = :uglifier
config.assets.compile = false
config.log_level = :debug
config.log_tags = [ :request_id ]
config.action_mailer.perform_caching = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.mailgun.org',
port: 587,
domain: 'borroup.com',
enable_starttls_auto: true,
authentication: 'plain',
user_name: '',
password: ''
}
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger =
ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger =
ActiveSupport::TaggedLogging.new(logger)
end
config.active_record.dump_schema_after_migration =
false
end
【问题讨论】:
标签: ruby-on-rails node.js amazon-web-services nginx amazon-ec2