nginx routing based on ip address

2016-02-23 Thread keeyong
I am wondering if it is possible to compute some kind of hash value from ip address or do modulo operation on the last numeric value from ip address (for example on 24 given 172.16.4.24)? Based on this, I want to send the request to different endpoints (not to different servers). If this can be don

Matching multiple endpoints in location of nginx.conf

2014-11-23 Thread keeyong
I can't really test this easily so I am asking instead. I have this location statement in my nginx.conf: location ~* ^/(api/abcd)/ { ... } Now I want to match against "api/efgh". Then the regex should be something like this? location ~* ^/(api/(abcd|efgh))/ {

Re: How to extract multiple values of a header for logging

2014-11-23 Thread keeyong
Good to know. I don't have the module installed though. But I will keep that in mind. Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,254961,255056#msg-255056 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/list

Re: How to extract multiple values of a header for logging

2014-11-20 Thread keeyong
Thanks Maxim for the confirmation Posted at Nginx Forum: http://forum.nginx.org/read.php?2,254961,255012#msg-255012 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

How to extract multiple values of a header for logging

2014-11-19 Thread keeyong
I have a custom header in http response and it can appear more than once. Let's say it is called x-extra. In my nginx configuration, I want to extract all of its values and log them together but I found it is always extracting the very first one. Is it possible to do this somehow? Thanks in adv

Logging POST body

2014-10-15 Thread keeyong
I am using ngixing as a reverse proxy in front of apache (PHP) as a load balancer and a logger. For some endpoints, I want to log their POST bodies and I looked up the Web and found some solution requiring to install HttpEchoModule. Is there any other way of achieving this? Preferably without insta

How to list all nginx plugin installed

2014-10-10 Thread keeyong
Is there a way to list all plugins installed in my nginx? I am particularly interested in knowing whether HttpEchoModule is installed or not. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,253901,253901#msg-253901 ___ nginx mailing list nginx

Re: proxy_hide_header question

2014-10-08 Thread keeyong
Thanks. That was it! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,253819,253843#msg-253843 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

proxy_hide_header question

2014-10-07 Thread keeyong
I am using nginx as a reverse proxy and am trying to log some variables set by apache to nginx log. So certain HTTP response headers are set by apache (PHP) and then I log them successfully with $sent_http_* variables. But then I don't want the info to be exposed to outside world so I tried to rem