We use a forked version mainly for opsworks_ruby/templates/default/appserver.nginx.conf.erb
which has the following custom configurations:
- Ability for the load balancer to perform health checks:
location /ping {
access_log off;
return 200;
}
- Load balancer uses the SSL certificate to terminate the connection and then decrypt requests from clients before sending them to the instances (also known as SSL termination).
Which also means, anyone landing on the following domains, should be redirected to the https protocol. For example:
To achieve this. I have:
server {
listen <%= @out[:port] %>; # Typically listens on port 80
...
location @<%= @name %> {
...
# Any request that did not originally come in to the ELB over HTTPS gets redirected
if ($http_x_forwarded_proto != "https") {
rewrite ^(.*)$ https://$server_name$1 permanent;
}
...
}
...
}
- To redirect the bare domain names to the https counterpart, i.e:
- http://domain-name.com to https://www.domain-name.com
- https://domain-name.com to https://www.domain-name.com
I have the following:
# If request is made to the bare domain (i.e. domain-name.com)
# Issue a redirect 301 response
server {
listen 80;
server_name domain-name.com;
location /ping {
access_log off;
return 200;
}
location / {
return 301 https://www.$server_name$request_uri;
# Add HTTP Strict Transport Security for good measure
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";
}
}
A chef cookbook to deploy Ruby applications to Amazon OpsWorks.
Refer to Getting Started guide in documentation.
You can either install eveyrthing locally using rvm and pip or use the Docker container which includes all necessary dependencies inside it.
docker-compose run cookbook bash -c "cd docs && make html"
Please see CONTRIBUTING for details.
Author: Igor Rzegocki (@ajgon)
- Nick Marden (@nickmarden)
- Phong Si (@phongsi)
- Kevin Olbrich (@olbrich)
- Kevin Pheasey (@kpheasey)
- Nathan Flood (@npflood)
- Teruo Adachi (@interu)
- Marcos Beirigo (@marcosbeirigo)
License: MIT