AWS Elastic Beanstalk:未在JAVA env(glassfish)上部署Nginx反向代理

时间:2018-01-31 19:09:01

标签: amazon-web-services nginx elastic-beanstalk glassfish-4.1 nginx-reverse-proxy

我尝试按照此文档(https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-se-nginx.html)但无法构建自定义nginx conf。 我能够部署应用程序和环境,它可以工作。在测试工作环境后,我想修改一些nginx配置,然后按照以下步骤进行操作:

cd WS
mkdir -p .ebextensions/nginx/conf.d
cp ~/dozee.conf .ebextensions/nginx/conf.d
eb deploy

WS 是eb部署完美运行的目录。将(ssh)记录到eb环境创建的实例后,我可以看到 /var/app/current/.ebextensions/nginx/conf.d / dozee.conf >但未出现在 /etc/nginx/conf.d /.

我可能在这里缺少什么?任何帮助表示赞赏:)

1 个答案:

答案 0 :(得分:0)

最可能的问题是您的.ebextensions文件夹未包含在您的构建中。你可以发布你的buildspec.yml吗?为了让您知道需要发生什么,这是我的一个:

version: 0.2

phases:
  install:
    commands:
      - echo Entering install phase...
      - echo Nothing to do in the install phase...
  pre_build:
    commands:
       - echo Entering pre_build phase...
       - echo Running tests...
       - mvn test
  build:
    commands:
      - echo Entering build phase...
      - echo Build started on `date`
      - mvn package -Dmaven.test.skip=true
  post_build:
    commands:
      - echo Entering post_build phase...
      - echo Build completed on `date`
      - mv target/app.war app.war
artifacts:
  type: zip
  files:
    - app.war
    - .ebextensions/**/*