Skip to content

Instantly share code, notes, and snippets.

View vivekbeas's full-sized avatar

vivek vivekbeas

View GitHub Profile
@vivekbeas
vivekbeas / 06_nginx_restart.config
Last active April 29, 2020 00:25
AWS Elastic beanstalk application configuration to restart the nginx server
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/06_restart_nginx.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
service nginx restart
@vivekbeas
vivekbeas / 05_redirect_http_to_https.config
Created April 29, 2020 00:18
AWS Elastic beanstalk application configuration to HTTP redirection to HTTPS rule on the load balancer
Resources:
PublicLoadBalancerHttpRedirectListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- RedirectConfig:
Host: "#{host}"
Path: "/#{path}"
Port: 443
Protocol: "HTTPS"
@vivekbeas
vivekbeas / 04_managed_platform_updates.config
Created April 29, 2020 00:10
AWS Elastic beanstalk application configuration to enable minor/patch update of the platform
option_settings:
aws:elasticbeanstalk:managedactions:
ManagedActionsEnabled: true
PreferredStartTime: "Sun:21:00"
aws:elasticbeanstalk:managedactions:platformupdate:
UpdateLevel: minor
InstanceRefreshEnabled: false
@vivekbeas
vivekbeas / 04_managed_platform_updates.config
Created April 29, 2020 00:10
AWS Elastic beanstalk application configuration to enable minor/patch update of the platform
option_settings:
aws:elasticbeanstalk:managedactions:
ManagedActionsEnabled: true
PreferredStartTime: "Sun:21:00"
aws:elasticbeanstalk:managedactions:platformupdate:
UpdateLevel: minor
InstanceRefreshEnabled: false
@vivekbeas
vivekbeas / 03_health_reporting_advanced.config
Created April 28, 2020 23:54
Elastic beanstalk application configuration for advanced health reporting
option_settings:
aws:elasticbeanstalk:healthreporting:system:
SystemType: enhanced
aws:elasticbeanstalk:environment:
ServiceRole: aws-elasticbeanstalk-service-role
@vivekbeas
vivekbeas / 02_proxy.config
Created April 28, 2020 23:11
Nginx secure server configuration for AWS Elastic beanstalk
files:
"/etc/nginx/conf.d/02_proxy.conf":
mode: "00644"
owner: root
group: root
content: |
server_tokens off;
add_header Content-Security-Policy "script-src 'self'";
@vivekbeas
vivekbeas / 02_proxy.config
Created April 28, 2020 23:11
Nginx secure server configuration for AWS Elastic beanstalk
files:
"/etc/nginx/conf.d/02_proxy.conf":
mode: "00644"
owner: root
group: root
content: |
server_tokens off;
add_header Content-Security-Policy "script-src 'self'";