我创建了一个项目。我将此项目部署到AWS Elasticbeanstalk.But这是使用端口8081但我想在端口号80上运行我的项目。为此我在项目文件夹结构中创建了自定义配置文件 .ebextensions / nginx.config。
files:
"/tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf" :
mode: "000755"
owner: ec2-user
group: ec2-user
content: |
upstream nodejs {
server 127.0.0.1:80;
keepalive 256;
}
server {
listen 8082;
location / {
proxy_pass http://nodejs;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
我在我的系统中安装了EBCLI。从此我尝试部署我的项目然后它给出了错误
ubuntu@ip-127.12.14.12:~/cloudtester$ eb deploy
Creating application version archive "app-150707_0944125".
Uploading cstest/app-150707_094446.zip to S3. This may take a while.
Upload Complete.
INFO: Environment update is starting.
ERROR: .ebextensions/nginx.config contains the following invalid key: content. For information about valid keys, see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
ERROR: Failed to deploy application.
ERROR: Failed to deploy application.
如何解决此错误。提前谢谢