A story of a web server installation

A recent interaction with AWS support reminded me of something that happened to me and a co-worker some years ago in a previous job. The people and companies in the story have been anonymized, but I’m “Eric”. I (“Eric”) worked for the online development team of a large media company (The Company) “somewhere in Europe”.… Continue reading A story of a web server installation

Published
Categorized as IT

Explicit workspaces for Terraform

NOTE 2019-06-26: The original way this check worked with Terraform 11 no longer works with Terraform 12, as v12 checks that attribute names are valid. The code has been updated accordingly. Instead of a null resource, we now use a local_file data source with Terraform 12. I’ve recently begun working with Terraform at work to… Continue reading Explicit workspaces for Terraform

Published
Categorized as IT Tagged

Elastic Beanstalk applications using two ports and Websockets

This blog post describes how to set up and deploy an AWS Elastic Beanstalk application written in Node.js that listens to both regular HTTP requests and Websocket connections. TL;DR: Download the sample application, and deploy it into an EB environment created using eb create alb-test-app-dev1 –elb-type application. By default, applications in Elastic Beanstalk only listen… Continue reading Elastic Beanstalk applications using two ports and Websockets

Published
Categorized as IT

Useful paths for debugging Elastic Beanstalk deployments

Sometimes it can be painful to try and get an Elastic Beanstalk application to deploy cleanly. In order to effectively debug the issues, it’s necessary to SSH into the instance. This requires that you’ve added a Key Pair in the EB environment configuration before launching the instance(s). The address to SSH to can be found… Continue reading Useful paths for debugging Elastic Beanstalk deployments

Published
Categorized as IT

Nginx as origin for S3 with authentication, with CDN on top

We recently had a small problem with our content delivery system. The setup is as follows: – AWS S3 bucket that requires authentication – EC2 instance, running Nginx with ngx_aws_auth – ELB load balancer in front of the EC2 instance – CDN configured to use the ELB as the origin The problem was that the… Continue reading Nginx as origin for S3 with authentication, with CDN on top

Nginx: Reject request if header is not present

It was surprisingly difficult to find a full working example of this, so here’s my take on “How to make Nginx require that a certain header is present with a certain value in the incoming request”: nginx.conf: http { map $http_x_mycustomheader $is_mycustomheader_not_ok { default “1”; MyApprovedValue “0”; } … } mysite.conf: server { … location… Continue reading Nginx: Reject request if header is not present

Published
Categorized as IT