Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Custom SSL #809

Closed
admin-4virtuals opened this issue Dec 7, 2013 · 2 comments
Closed

AWS Custom SSL #809

admin-4virtuals opened this issue Dec 7, 2013 · 2 comments

Comments

@admin-4virtuals
Copy link

I see you guys use AWS S3 to host your dashboard files. Do you mind explaining to me how you guys use SSL? It looks like your files are coming from https://dashboard.balancedpayments.com/css/base.min-.css. Do you guys have to pay the $600 a month for the custom SSL certificate?

Thanks,
Twosick

@mjallday
Copy link
Contributor

mjallday commented Dec 8, 2013

Great question @twosick

When we started the dashboard project AWS did not have the custom SSL option available so we made our own solution.

Since we already had a bunch of machines already serving content we piggybacked on them and served dashboard.balancedpayments.com from those machines. These machines simply proxy the S3 hosted file and handle the SSL cert.

The relevant section from our nginx config looks like this:

server {
    listen        443;
    server_name   dashboard.balancedpayments.com;
    ssl           on;
    ssl_certificate       /etc/nginx/balancedpayments.com.crt;
    ssl_certificate_key   /etc/nginx/balancedpayments.com.pem;

    location = / {
        proxy_pass https://s3-us-west-1.amazonaws.com/balanced-dashboard/index.html;
        expires 0;
    }

    location / {
        proxy_pass https://s3-us-west-1.amazonaws.com/balanced-dashboard/;
        expires max;
    }
}

The key here is that we upload the root index.html file with no caching/expiration data so every time you request the dashboard you get that page and it points to hashed versions of the actual application with heavy caching so you still get reasonable performance from it.

This is a neat trick so we only end up paying for the cost of running the instances rather than the $600 SSL cert option that you mentioned. The downside is that it's more likely that our machines will go down than AWS's S3 but in that case we have bigger problems since the dashboard consumes our API anyway.

Let us know if you want any more info on this setup.

@mjallday mjallday closed this as completed Dec 8, 2013
@admin-4virtuals
Copy link
Author

Yes that is what I thought you guys probably did. I took some tips from your grunt config file and applied them to my own projects(like the no cache on index.html). I approached it just about the same way.

I use the AWS ELB to terminate the SSL then have my content servers proxy the index.html from Cloudfront/S3. Oh and I also use Ember too. It's makes your life alot simpler :).

Thanks for the faster response than from some other company I know(Stripe...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants