Improve and simplify Solr logging with Nginx proxy
In efforts to provide better visibility to all parts of our application framework we decided to collect and send Solr query logs to our logging farm for further analysis and smoke tests. For logging aggregation we use Logstash with Kibana – …
Story behind X-Forwarded-For and X-Real-IP headers
This was suppose to be 10 minutes fix..
Or so I thought. If you read my blog you probably know that for the most part I’m doing operations stuff for FastCompany. That means sometimes I deal with little tricky problems like the one I’m going to talk about today. …
Nginx X-Accel-Redirect with proxy_pass and Host change..
I already wrote about using Nginx and X-Accel-Redirect. But today I would like to get back to it, since recently I’ve spent a lot of time trying to solve similar problem..
The problemo
We have a cdn in front of our sites and multiple pointers to static assets like a.static-example.com b.static-example.com etc. …
Internal redirect to another domain with proxy_pass and Nginx
Let say we have multiple sites a.com b.com and c.com and created some shared resourse (widget) under shared.com. For simplicity just imagine Disqus where you need to embed comments widget (shared resourse) to every site, but don’t want to deal with AJAX “same origin policy” problems and Iframes ( actually sometimes Iframes are not so bad and could be used with care, …
Use Nginx to proxy files from remote location using X-Accel-Redirect
Nginx supports X-Accel-Redirect for local files with no extra hassle, but what happens if you need to serve files located in some remote location like s3 and you don’t want to expose direct urls to the files? Sometimes you may want that to have control over stats or to keep an option to migrate to another file server without changing original urls. …
Proxy parts of Drupal site with Nginx.
Sometimes it could be quite useful to proxy a section of your site to the different multisite install, running different version of Drupal.
Real world scenario: When you go to www.fastcompany.com/mba (which is sadly still running on Drupal 5 at the time of writing ), …
Nginx proxy_read_timeout catch or double php script execution
I was working on import script recently. Expected execution time was more than 60 seconds, the default value of proxy_read_timeout directive in Nginx that’s why Nginx displayed nice 504 Gateway Timeout error every time I run the script, even though the script was still running on the back end. …