Skip to content

Instantly share code, notes, and snippets.

View luisacarrion's full-sized avatar

M. Luisa Carrión luisacarrion

View GitHub Profile
@luisacarrion
luisacarrion / nginx.conf
Last active February 7, 2017 07:05
Nginx configuration file used by AWS Elastic Beanstalk
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.fedora.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
@luisacarrion
luisacarrion / 01_nginx.config
Created February 7, 2017 04:30
AWS Elastic Beanstalk .ebextensions 1
files:
"/etc/nginx/conf.d/01_proxy.conf":
mode: "000644"
owner: root
group: root
content: |
client_max_body_size 10M;
@luisacarrion
luisacarrion / 01_nginx.config
Created February 7, 2017 06:12
AWS Elastic Beanstalk .ebextensions - nginx reload
files:
"/etc/nginx/conf.d/01_proxy.conf":
mode: "000644"
owner: root
group: root
content: |
client_max_body_size 10M;
container_commands:
01_reload_nginx:
@luisacarrion
luisacarrion / webapp_healthd.conf
Created February 7, 2017 07:06
Nginx configuration file used by AWS Elastic Beanstalk
upstream my_app {
server unix:///var/run/puma/my_app.sock;
}
log_format healthd '$msec"$uri"'
'$status"$request_time"$upstream_response_time"'
'$http_x_forwarded_for';
server {
listen 80;
@luisacarrion
luisacarrion / 01_nginx.config
Last active March 27, 2019 07:44
AWS Elastic Beanstalk .ebextensions - custom location block
files:
"/etc/nginx/conf.d/01_proxy.conf":
mode: "000644"
owner: root
group: root
content: |
client_max_body_size 10M;
"/etc/nginx/conf.d/02_app_server.conf":
mode: "000644"
@luisacarrion
luisacarrion / 02_db_seed.config
Created February 7, 2017 20:41
AWS Elastic Beanstalk .ebextensions - rake db:seed based on 12_db_migration.sh
files:
# Files in the location /opt/elasticbeanstalk/hooks/appdeploy/pre/
# are executed before the app is deployed and are executed in alphabetical order.
"/opt/elasticbeanstalk/hooks/appdeploy/pre/13_db_seed.sh":
mode: "000755"
owner: root
group: root
content: |
# The content of this file is based on the content of /opt/elasticbeanstalk/hooks/appdeploy/pre/12_db_migration.sh
@luisacarrion
luisacarrion / 02_db_seed.config
Created February 7, 2017 21:14
AWS Elastic Beanstalk .ebextensions - rake db:seed with container_commands
container_commands:
01_db_seed:
command: rake db:seed
@luisacarrion
luisacarrion / aws_ruby_settings_example.config
Last active February 7, 2017 21:40
AWS Elastic Beanstalk .ebextensions - rake db:seed from AWS Documentation
option_settings:
aws:elasticbeanstalk:application:environment:
BUNDLE_WITHOUT: test
RACK_ENV: development
RAILS_ENV: development
RAILS_SKIP_ASSET_COMPILATION: true
RAILS_SKIP_MIGRATIONS: true
LOGGING: debug
# Run shell commands during a deployment
@luisacarrion
luisacarrion / 01_nginx.config
Last active February 19, 2020 02:00
AWS Elastic Beanstalk .ebextensions - get S3 file with commands key
commands:
01_get_nginx_conf_file:
command: aws s3 cp s3://your-bucket-name/shared_config/an_nginx_http.conf /home/ec2-user
container_commands:
01_move_nginx_conf_file:
command: mv -f /home/ec2-user/an_nginx_http.conf /etc/nginx/conf.d/an_nginx_http.conf
02_reload_nginx:
command: "sudo service nginx reload"
@luisacarrion
luisacarrion / 01_nginx.config
Last active October 12, 2018 02:13
AWS Elastic Beanstalk .ebextensions - get S3 file with files key and source option
Resources:
AWSEBAutoScalingGroup:
Metadata:
AWS::CloudFormation::Authentication:
S3Auth:
type: "s3"
buckets: ["your-bucket-name"]
roleName:
"Fn::GetOptionSetting":
Namespace: "aws:autoscaling:launchconfiguration"