I am trying to update self signed SSL/TLS on AWS Elastic Beanstalk (node.js sample application) single instance.
I have folowed the below aws documentation however I am not successful, could anyone please help me how I can achieve this.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-ssl.html
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-nodejs.html
`files:
“/etc/nginx/ssl/self-signed.crt”:
mode: “000644”
owner: root
group: root
content: |
—–BEGIN CERTIFICATE—–
-----END CERTIFICATE-----
“/etc/nginx/ssl/self-signed.key”:
mode: “000600”
owner: root
group: root
content: |
—–BEGIN PRIVATE KEY—–
-----END PRIVATE KEY-----
container_commands:
01_create_ssl_directory:
command: “mkdir -p /etc/nginx/ssl”
02_copy_ssl_certificate:
command: “cp .ebextensions/self-signed.crt /etc/nginx/ssl/self-signed.crt”
03_copy_ssl_key:
command: “cp .ebextensions/self-signed.key /etc/nginx/ssl/self-signed.key”
04_configure_nginx:
command: “mv .ebextensions/ssl-nginx.conf /etc/nginx/conf.d/ssl.conf”
files:
“/.ebextensions/ssl-nginx.conf”:
mode: “000644”
owner: root
group: root
content: |
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/ssl/self-signed.crt;
ssl_certificate_key /etc/nginx/ssl/self-signed.key;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
`