Re: Writing Header to Logfile

2017-07-07 Thread Zhang Chao
I would like to log a header which is send with the incoming request into a custom log field. How can this be done? you mean the request header? On 7 July 2017 at 23:55:36, mailinglis...@simonhoenscheid.de ( mailinglis...@simonhoenscheid.de) wrote: Hello List, I would like to log a header wh

Re: nginx -s reload terminates connections

2017-07-07 Thread rlx01
I found worker_shutdown_timeout and the code for graceful shutdown was fairly easy to follow, so we've patched it to do what we want. Thanks! Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275328,275370#msg-275370 ___ nginx mailing list ngi

Re: nginx -s reload terminates connections

2017-07-07 Thread rlx01
Hi Maxim, Thank you for the link to the ticket. IMHO this "during configuration reload existing connections are closed as soon as they are idle" is kind of misleading as the connection is not idle since it's being slammed with requests, it's "idle" in the sense that nginx processed the last reque

Writing Header to Logfile

2017-07-07 Thread mailinglisten
Hello List, I would like to log a header which is send with the incoming request into a custom log field. How can this be done? Kind Regards Simon ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: NGINX stale-while-revalidate cluster

2017-07-07 Thread Owen Garrett
There are a couple of options described here that you could consider if you want to share your cache between NGINX instances: https://www.nginx.com/blog/shared-caches-nginx-plus-cache-clusters-part-1/ describes a shard

How to handle 500 Error on upstream itself, While Nginx handle other 5xx errors

2017-07-07 Thread ender ulusoy
We have a NGINX reverse proxy (clustered) with 45 upstreams (22 domains, 20 subdomains, 11 apps). Some of our projects hosts apis for some users globally. Our developers designed special custom 500 responses for special cases and want to show that messages only for tomcat_api upstream. They want

Re: NGINX stale-while-revalidate cluster

2017-07-07 Thread Peter Booth
You could do that but it would be bad. Nginx' great performance is based on serving files from a local Fisk and the behavior of a Linux page cache. If you serve from a shared (nfs) filsystem then every request is slower. You shouldn't slow down the common case just to increase cache hit rate. S

Re: NGINX stale-while-revalidate cluster

2017-07-07 Thread Frank Dias
Have you thought about using a shared file system for the cache. This way all the nginx 's are looking at the same cached content. On Jul 7, 2017 5:30 AM, Joan Tomàs i Buliart wrote: Hi Lucas On 07/07/17 12:12, Lucas Rolff wrote: > Instead of doing round robin load balancing why not do a URI ba

Re: nginx -s reload terminates connections

2017-07-07 Thread Maxim Dounin
Hello! On Fri, Jul 07, 2017 at 05:49:18AM -0400, JackB wrote: > Tested ab and confirmed terminated requests with reloads during run > (complete output pasted at the end). > > Failed requests:180 >(Connect: 0, Receive: 24, Length: 78, Exceptions: 78) > > ab reports reports terminated

Re: NGINX stale-while-revalidate cluster

2017-07-07 Thread Joan Tomàs i Buliart
Hi Lucas On 07/07/17 12:12, Lucas Rolff wrote: Instead of doing round robin load balancing why not do a URI based load balancing? Then you ensure your cached file is only present on a single machine behind the load balancer. Yes, we considered this option but it forces us to deploy and mainta

Re: NGINX stale-while-revalidate cluster

2017-07-07 Thread Lucas Rolff
Instead of doing round robin load balancing why not do a URI based load balancing? Then you ensure your cached file is only present on a single machine behind the load balancer. Sure there will be moments where this is not the case – let's assume that a box goes down, and traffic will switch, b

NGINX stale-while-revalidate cluster

2017-07-07 Thread Joan Tomàs i Buliart
Hi, We are implementing an stale-while-revalidate webserver cluster with NGINX. We are using the new proxy_cache_background_update to answer request as soon as possible while NGINX updates the content from the origin in the background. This solution works perfectly when the requests for the sa

Re: nginx -s reload terminates connections

2017-07-07 Thread JackB
Tested ab and confirmed terminated requests with reloads during run (complete output pasted at the end). Failed requests:180 (Connect: 0, Receive: 24, Length: 78, Exceptions: 78) ab reports reports terminated connections while receiving. This should not happen at all when executing a r