Puma 및 Nginx를 실행하는 AWS Elastic Beanstalk를 사용하는 Rails 앱 502

Puma 및 Nginx를 실행하는 AWS Elastic Beanstalk를 사용하는 Rails 앱 502

Passenger를 사용하여 Beanstalk에서 애플리케이션을 성공적으로 실행할 수 있었지만 Puma에서는 운이 없었습니다. Puma 스택에 배포할 때마다 502 오류가 발생하고 로그 파일에 양말 파일을 찾을 수 없다고 표시됩니다.

2014/05/15 21:00:15 [crit] 1684#0: *4 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 10.184.156.117, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "app-env-89spnxpcai.elasticbeanstalk.com"

내 앱은 Ruby Ruby 2.0.0p451 및 Rails 4.1.1을 사용하여 구축되었습니다.

내 .ebextensions 구성은 다음과 같습니다.

packages:
  yum:
    git: []

commands:
  add_bundle_exec:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: perl -pi -e 's/(rake)/bundle exec $1/' 11_asset_compilation.sh 12_db_migration.sh
  add_deployment_flag:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: perl -pi -e 's/(bundle install)/$1 --deployment/' 10_bundle_install.sh
  make_vendor_bundle_dir:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    command: mkdir /var/app/support/vendor_bundle
  set_vendor_bundle_var:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/support
    command: sed -i '12iexport EB_CONFIG_APP_VENDOR_BUNDLE=$EB_CONFIG_APP_SUPPORT/vendor_bundle' envvars
  symlink_vendor_bundle:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: sed -i 's/\(^cd $EB_CONFIG_APP_ONDECK\)/\1\nln -s $EB_CONFIG_APP_VENDOR_BUNDLE .\/vendor\/bundle/' 10_bundle_install.sh
  z_write_post_provisioning_complete_file:
    cwd: /opt/elasticbeanstalk/support
    command: touch .post-provisioning-complete 

내가 뭘 잘못하고 있는 걸까요? Puma와 함께 작동하려면 특별한 것이 필요한가요?

답변1

이 문제는 최신 버전(Ruby 2.0(Puma)을 실행하는 64비트 Amazon Linux 2014.03 v1.0.5)에서는 발생하지 않습니다.

답변2

문제가 해결 config.force_ssl = true되도록 변경false

관련 정보