Sunday, December 13, 2015

nginx local proxy




I wanted just a simple nginx setup to forward to a local app.  Here's the result:


http {
...

    server {
      server_name  52.62.72.255;
      #access_log   /var/log/nginx/histories.log;
      location / {
        proxy_pass      http://127.0.0.1:3000;
      }
    }



For some reason it was hard to find this info!  I had to pull it from one of my other servers.  But one good example is this reference: http://wiki.nginx.org/FullExample


Wednesday, July 15, 2015

Unable to SSH to new AWS servers, until: route table

Symptoms: I've had an AWS account for years, and I went back and created some instances this past week but then I couldn't access them (via SSH: "Operation timed out"). One oddity was that my old instances had no VPC ID, but every new instance had one (and the VPC was created if none existed).

Solution: I found this troubleshooting guide for connecting, and I followed the step on route tables and added a route with a destination of 0.0.0.0/0 and target of igw... (which is auto-filled with my internet gateway ID).

I've never had to do this before.  Hopefully I'll remember!

Tuesday, May 5, 2015

PermanentRedirect when accessing AWS S3 bucket

When running this on the command-line:
aws s3 ls s3://my-bucket/
I kept getting this error:
A client error (PermanentRedirect) occurred when calling the ListObjects operation: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
The problem was that my region wasn't set. I did this to fix it:
export AWS_DEFAULT_REGION=us-west-2
This is a pretty stupid situation: when using the web console, the S3 service says that there's no need to choose a region, and it won't even let you select one. But obviously it's very important for configurations. Dumb.