FYI : The eventual solution I came up with (for Node.js) is to tail the Nginx access.log instead. module.exports = child = require('child_process'); var tail = child.spawn("tail", ["-fn0", '/path/to/access.log']); tail.stdout.on("data", function (data) { myFuncToHandleAccesses(data.toString('utf8')); });by Mark - How to...
I want to do a geoip lookup only when a "location" cookie doesn't exist, and then only when Nginx isn't serving the file for me. Everything works except for the conditional (I know about the IfisEvil etc - this is shown for the logic ....) Is there a way to achieve what I am trying to do in this example? location @app { if ($http_cookie !~* "location") { proby Mark - How to...
Ok, it looks like I can emulate it with TCP from info in this old post : http://mailman.nginx.org/pipermail/nginx/2007-June/001069.html > No, I do not plan to add piped logs. > However, you can use named pipe (FIFO). > > Also you can use the post_action to track downloading: > > location /xar/ { > internal; > > root ...; > pby Mark - How to...
Perfect! Many thanks. Спасибо большое.by Mark - Nginx Mailing List - English
Developing static files on the local filesystem I use index.html instead of / for the home page. When I push them to the remote server I want http://domain.com/index.html to be redirected to http://domain.com/ for SEO reasons. I've Googled but the best I seem to be able to achieve is a redirect loop. What do I need to do? Here are my failed rules : # rewrite ^index.html$ $scheme://domain.by Mark - Nginx Mailing List - English
Ok, it would help if I wasn't an idiot :-) if ($http_x_requested_with = XMLHttpRequest) { rewrite ^(.*)$ /ajax/$1 break; } I found the http_ tip after more digging around.by Mark - How to...
I'm caching partials with the intention that Ajax requests can receive them directly from Nginx without hitting my Rails server. I've tried : if ($x_requested_with = XMLHttpRequest) { rewrite ^(.*)$ /ajax/$1 break; } which gives me : unknown "x_requested_with" variable. What should be the approach here? Thanks.by Mark - How to...