Coder Social home page Coder Social logo

krzkrzkrz / opsworks_ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ajgon/opsworks_ruby

0.0 1.0 0.0 1.01 MB

Set of chef recipes for OpsWorks based Ruby projects.

Home Page: http://opsworks-ruby.rzegocki.pl/

License: MIT License

Ruby 90.60% Dockerfile 0.57% Shell 0.06% HTML 8.76%

opsworks_ruby's Introduction

Forked version

We use a forked version mainly for opsworks_ruby/templates/default/appserver.nginx.conf.erb which has the following custom configurations:

  1. Ability for the load balancer to perform health checks:
location /ping {
  access_log off;
  return 200;
}
  1. 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;
    }
    ...
  }
  ...
}
  1. To redirect the bare domain names to the https counterpart, i.e:

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;";
  }
}

opsworks_ruby Cookbook

Chef cookbook Build Status Coverage Status Documentation Status Commitizen friendly license

A chef cookbook to deploy Ruby applications to Amazon OpsWorks.

Quick Start

Refer to Getting Started guide in documentation.

Development

You can either install eveyrthing locally using rvm and pip or use the Docker container which includes all necessary dependencies inside it.

Build documentation

docker-compose run cookbook bash -c "cd docs && make html"

Contributing

Please see CONTRIBUTING for details.

Author and Contributors

Author: Igor Rzegocki (@ajgon)

Contributors

License

License: MIT

opsworks_ruby's People

Contributors

ajgon avatar krzkrzkrz avatar nickmarden avatar phongsi avatar waghanza avatar interu avatar olbrich avatar fpbouchard avatar avalade avatar kpheasey avatar beirigo avatar npflood avatar senjai avatar djgable avatar vincecoss avatar porter77 avatar ruzia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.