【发布时间】:2015-03-14 16:24:22
【问题描述】:
我正在尝试为我的 NodeJS Beanstalk 实例安装 SSL 证书。根据这些instructions from Amazon,我创建了 YAML 文件并插入了我的信息。
每次我尝试部署时都会收到此错误:
应用程序版本 0.0.3 中的配置文件 .ebextensions/singlessl.config 包含无效的 YAML 或 JSON。 YAML 异常:在扫描下一个标记时发现无法在“”中启动任何标记的字符 '\t',第 10 行,第 1 列:^,JSON 异常:位置 0 处的意外字符 (R).. 更新配置文件。
我已经用细齿梳理了这件事,在多个验证器中进行了验证,甚至在多个操作系统上编写了它……但我似乎无法动摇这个假定的制表符。
有没有人在 JSON 中有这样的配置文件示例?我的其他配置是 JSON 格式,效果很好。如果没有,谁能看到我在这里做错了什么?
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {Ref : MyIDHere}
IpProtocol: tcp
ToPort: 443
FromPort: 443
CidrIp: 0.0.0.0/0
files:
/etc/nginx/conf.d/ssl.conf:
mode: "000755"
owner: root
group: root
content: |
# HTTPS server
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate /etc/pki/tls/certs/server.crt;
ssl_certificate_key /etc/pki/tls/certs/server.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
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;
}
}
/etc/pki/tls/certs/server.crt:
mode: "000400"
owner: root
group: root
content: |
-----BEGIN CERTIFICATE-----
CERT DATA HERE
-----END CERTIFICATE-----
/etc/pki/tls/certs/server.key:
mode: "000400"
owner: root
group: root
content: |
-----BEGIN RSA PRIVATE KEY-----
KEY DATA HERE
-----END RSA PRIVATE KEY-----
【问题讨论】:
-
你能解释一下你是怎么去 https 运行的吗?
标签: json node.js ssl amazon-web-services yaml