Actions after cache miss is detected

2018-08-10 Thread Roger Fischer
Hello, Is there a way to perform an action after a cache miss is detected but before the request is forwarded to the upstream server? Specifically, on a cache miss I want to: Return a response instead of forwarding the request to the upstream server. Trigger a handler (module or script) that exe

Re: Multiple Domain CORS

2018-08-10 Thread Andrey Oktyabrskiy
On 10.08.2018 15:17, Andrey Oktyabrskiy wrote: ### /etc/nginx/inc/cors_options.inc if ($request_method = 'OPTIONS') {   add_header Access-Control-Allow-Credentials    true;   add_header Access-Control-Allow-Origin $cors_origin;   add_header Access-Control-Allow-Methods    OPTIONS; -

Re: Multiple Domain CORS

2018-08-10 Thread Andrey Oktyabrskiy
On 10.08.2018 14:38, Sathish Kumar wrote: Is there anyway to allow CORS domain like based on Host Origin.For Options, Get and other methods. Something like this should do what you want: location / { include inc/cors_options.inc; ... include inc/cors_headers.inc; } ### /etc/nginx/inc/cors

Multiple Domain CORS

2018-08-10 Thread Sathish Kumar
Hi All, I would like to use cloudfront.net content inside my webapp and its throwing Access-Control-Allow-Origin error and have added the header for single host on Nginx to make it work now. The problem is we have multiple environments which is trying to do the same and I have to whitelisted all

Re: keepalive not work with grpc

2018-08-10 Thread Maxim Dounin
Hello! On Fri, Aug 10, 2018 at 03:10:11AM -0400, hunterqin wrote: > I found the problem. > I used the wireshark to analyse the packets between nginx server and grpc > server and I found that in the last packet from grpc server to nginx client, > there are five frames,SETTINGS, HEADERS, DATA, HEAD

Re: keepalive not work with grpc

2018-08-10 Thread hunterqin
I found the problem. I used the wireshark to analyse the packets between nginx server and grpc server and I found that in the last packet from grpc server to nginx client, there are five frames,SETTINGS, HEADERS, DATA, HEADERS, WINDOW_UPDATE. The second HEADERS set the 'end_stream' and ngx_http_grp