nginx on davidchua https://dchua.com/tags/nginx/ Recent content in nginx on davidchua Hugo -- gohugo.io en-us Sun, 01 Jan 2017 00:00:00 +0000 Supercharge your Nginx with Openresty and Lua https://dchua.com/posts/2017-01-01-supercharge-your-nginx-with-openresty-and-lua/ Sun, 01 Jan 2017 00:00:00 +0000 https://dchua.com/posts/2017-01-01-supercharge-your-nginx-with-openresty-and-lua/ Turn your Nginx into an API Gateway. Modify requests and responses from Nginx itself using Openresty and Lua. Objectives To deploy Openresty on a development/production environment As a reverse proxy, to modify incoming request params and pass it on to another server As a reverse proxy, to modify response from proxied server before returning to user Openresty Openresty is a open-sourced NGINX bundle that combines NGINX and various 3rd-party NGINX modules and Lua Libraries. Running Deis on Digitalocean - A Nginx/Haproxy LB Setup https://dchua.com/posts/2016-10-25-running-deis-on-digitalocean/ Tue, 25 Oct 2016 00:00:00 +0000 https://dchua.com/posts/2016-10-25-running-deis-on-digitalocean/ DigitalOcean users generally tend to get the short end of the stick when it comes to convenience. When building your Deis cluster on DigitalOcean, you’ll realize you don’t get the benefit of being able to provision cloud-provider specific load balancers like (AWS ELB, GCE Load Balancers) to route inbound traffic into the kubernetes cluster and into your deis-router. In this article, I’ll quickly go through setting up a (nginx + haproxy) load balancer that sits infront of deis. Removing DNS caching on NGINX proxy pass https://dchua.com/posts/2016-09-29-removing-dns-caching-on-nginx-proxy-pass/ Thu, 29 Sep 2016 00:00:00 +0000 https://dchua.com/posts/2016-09-29-removing-dns-caching-on-nginx-proxy-pass/ If you’re passing hostnames into your nginx’s proxy_pass and made a change to the hostname’s ip address, you might experience times when nginx is still referencing the old ip address despite your DNS TTL having already been expired. This is because nginx caches the ip of all hostnames resolved in its configuration. In order to ensure that any IP change is quickly resolved, you should specify a valid period so that nginx will force a cache refresh on its ip storage. Deploying Node.JS on Nginx with Capistrano/Capper https://dchua.com/posts/2013-05-28-deploying-node-js-on-nginx-with-capistranocapper/ Tue, 28 May 2013 00:00:00 +0000 https://dchua.com/posts/2013-05-28-deploying-node-js-on-nginx-with-capistranocapper/ The other day on a single-day internal hackathon, together with Ernest and the rest of the One Cent Movement guys, we decided to do up an internal check-in mobile webapp where we can see where each of us were at anytime of the day. This is a simple guide to deploy your node.js app onto a production server. Which in my case is an Amazon EC2 m1.small instance. Pre-requsite: NPM is assumed to be the defacto package manager.