Nginx on Windows in 5 minutes or less with Docker
Wait whaat? Nginx on Windows, who cares about that?? Actually many people do. Fortunately now is the greatest time to be a software engineer! Here is why.
I bet you heard about Docker in the past. If you didn’t then you probably living under a rock and you need to come out of there soon. …
Nginx upstream timed out (why and how to fix)
Nginx upstream timed out (110: Connection timed out) while reading response header from upstream is pretty common error. Lets find out why it happens and how to avoid it.
When you get this error, it usually means your upstream is slow and while there are couple easy fixes which I’ll show below, …
HAProxy vs Nginx – what’s in your wallet?
“HAProxy vs Nginx, which one should I choose??” – I get asked this question almost every day and while I’m not a fan of “vs” style posts, I’ll try to express my opinion on the topic that may or may not help you to select a product for your particular use case. …
Nginx resolver explained
Nginx resolver is playing very important part in creating fault tolerant setups, especially when it comes to the free open source version. In this article I’ll explain why we need Nginx resolver and how it works.
I remember the moment about a year or so ago when I came to the office and found people screaming that one of our sites was hacked. …
405 not allowed Nginx fix for POST requests
Today I wanted to write a little useful tip for people trying to do POST requests to static files. Apparently Nginx returns 405 not allowed response in those cases.
Here are the couple workarounds to get you going again:
server { listen 80; ...
Nginx Access-Control-Allow-Origin and CORS
Nginx Access-Control-Allow-Origin header is part of CORS standard (stands for Cross-origin resource sharing) and used to control access to resources located outside of the original domain sending the request.
This standard was created to overcome same-origin security restrictions in browsers, that prevent loading resources from different domains. …
What is nginx server_name and how it works?
Nginx server_name is a special directive used for server block configuration selection. Let say you have multiple server sections in your Nginx config file:
server { listen 80; server_name test.com; ... } server { listen 80; server_name example.com; ... }
When we get incoming request with test.com “Host” …
Secure way to serve protected files with Nginx Sendfile (X-Accel-Redirect)
If you are running some kind of e-commerce store, it’s quite possible that your product images are protected with watermark. At the same time original uploaded images are not available for public access.
All nice and good! But what if some of your partners request access to original images without watermarks? …
Little trick to get AWS instance_id as variable in Nginx
If you are running in AWS environment it might be useful to get Amazon instance_id in Nginx for different purposes (logging, headers etc).
To do that we need to compile Nginx with Perl support (–with-http_perl_module flag during compilation). After that is done we can put this snippet inside of our httpd Nginx config section:
Important: While the Perl module is performing a long-running operation, …
Use Nginx basic auth to protect HTTP services like Solr
Sometimes it might be useful to add simple permissions layer on top of unprotected HTTP services ( especially if you would like to open those to the public! ). Recently we had to secure our Solrcloud install to be able to provide read only access to our FTS index to a partner, …