Nginx is a great tool for load balance, reverse proxy and more if you know Lua scripts (check out OpenResty if you are interested). Besides HTTP, Nginx can do TCP and UDP proxy as well. Here is a sample config for https > http, ldaps > ldap proxy. https://gist.github.com/jc1518/35cb055bf779f1a70a5fc6e72637407a
Tag: Nginx
HTTP Code 499
Http status code 499 is a non-standard status code introduced by nginx for the case when a client closes the connection while nginx is processing the request. I just encountered the 499 code in the nginx log a couple days ago. The reason of that is I wrote a Ajax to make a API call to the … Continue reading HTTP Code 499
AWS API Gateway behind Nginx
If you happen to have a Nginx upstream using AWS API Gateway, and gets this error 'SSL_do_handshake() failed (SSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure) while SSL handshaking to upstream' Here is the fix - you need to add 'proxy_ssl_server_name on;' in your nginx.conf. The directive is only available since version 1.7.0. Reference: proxy_ssl_server_name Syntax: proxy_ssl_server_name … Continue reading AWS API Gateway behind Nginx
Nginx upstream key exchange issue
Continue with my previous post. Now it is about phase #3. Theoretically, it should be very straightward. All Nginx needs to do is just fowarding the Akamai reqeusts to the upstream. Right? But in real life, whatever can go wrong will go wrong 😦 In the testing, we always get '502 Bad Gateway' error. I … Continue reading Nginx upstream key exchange issue
Akamai protocol rewrite issue
I have been working on a API gateway project (Akamai + Nginx + Lua) for quite a few weeks. There are lots of things that I would like to write and share. This post is one of them. The high level architecture looks like this: Phases: Users send http(s) GET or POST requests to Akamai. Akamai … Continue reading Akamai protocol rewrite issue