Re: rewrite with regex to use proxy_pass

2017-06-30 Thread Wandenberg Peixoto
If I'm not wrong the rewrite is applied only for the path, not for querystring. To parse the arguments using a regex use a map with $args as input or use the $arg_ARGNAME to the rewrite. On Jun 30, 2017 20:49, "Alexandre" wrote: > Do you have solutions for my problem ? > >

Re: ngx_list_create in shm_zone

2016-08-23 Thread Wandenberg Peixoto
Use ngx_queue_t On Aug 23, 2016 09:41, "Raghavan, Gopal" wrote: > I can store as ngx_rbtree_t. > Any suggestion on how to store a struct with list of items, something like > this in shared memory? > > typedef struct { > ngx_rbtree_node_t node; >

Re: Nginx Caching Error Response Code like 400 , 500 , 503 ,etc

2016-08-07 Thread Wandenberg Peixoto
Check if your backend server is setting cache headers on errors like Cache-Control / Expires. Nginx by default uses these headers to know if the response should be cached or not. When these headers are not present it uses the configuration done with proxy_cache_valid. On Sun, Aug 7, 2016 at 9:43

500 response with HIT status and cached file is with 200 status

2016-08-04 Thread Wandenberg Peixoto
Hey, I'm with a weird situation on an nginx instance. The object on the cache was stored with 200 OK status, but sometimes when a client request this same object nginx log something like 500 as status, HIT as cache status, 0 bytes sent and 0 ms as response time. Have any of you seen an error

Re: enable module for specific site

2016-06-21 Thread Wandenberg Peixoto
No, is the same way. You may create a custom directive to set if you module is activated or not on the location. And check this flag as the first action of your module. What I mean is, all requests will reach your module, but only the ones target to the location where it is "on" will handle the

Re: enable module for specific site

2016-06-20 Thread Wandenberg Peixoto
It depends on the module. If it is configurable on main, server or location blocks. But generally you can enable/disable at any of these 3 levels On Jun 20, 2016 11:44, "Justin Kennedy" wrote: > I'll try to simply the question: Can a module be enabled only for specific >

Re: DNS Caching Issue For community version

2016-05-16 Thread Wandenberg Peixoto
You have to configure your nginx to use it like any other module. For instance, cd /Downloads/nginx ./configure --add-module=/Downloads/nginx-upstream-dynamic-servers-master make make install On May 16, 2016 01:28, "RT.Nat" wrote: > I cannot install the above module.

Re: dns name for upstream

2016-03-19 Thread Wandenberg Peixoto
You can try to use this module to resolve the DNS ;) https://github.com/GUI/nginx-upstream-dynamic-servers On Wed, Mar 16, 2016 at 1:34 PM, Valentin V. Bartenev wrote: > On Friday 11 March 2016 07:01:49 Frank Liu wrote: > > Hi Valentin, > > Thanks for clearing up . I was

Re: Problem with proxy cache misses

2016-02-29 Thread Wandenberg Peixoto
The location = / is a exactly match. To execute a "catch all" returning a 404 you can do a location / { return 404; } On Feb 29, 2016 16:15, "Payam Chychi" wrote: > Look at your proxy cache path... (proxy_cache_path /var/www/test_cache) > Are you sure the path exists and

Re: Should ngx_atoi and ngx_atof functions change their signature?!

2015-12-10 Thread Wandenberg Peixoto
ember 2015 14:55:32 Wandenberg Peixoto wrote: > > Hi, > > > > today I realized a possible problem on the ngx_atoi and ngx_atof > functions > > (may be on all ngx_ato* functions). > > > > There is no way to distinguish between an error and a valid "-1" stri

Should ngx_atoi and ngx_atof functions change their signature?!

2015-12-10 Thread Wandenberg Peixoto
Hi, today I realized a possible problem on the ngx_atoi and ngx_atof functions (may be on all ngx_ato* functions). There is no way to distinguish between an error and a valid "-1" string. For instance, ngx_str_t some_string = ngx_string("-1"); ngx_int_t x = ngx_atoi(some_string.data,

Re: nginx: worker process is shutting down

2015-10-22 Thread Wandenberg Peixoto
Make sense On Thu, Oct 22, 2015 at 7:43 PM, Christos Chatzaras wrote: > I think I found a patch for this: > https://github.com/jrkettle/nginx-http-auth-digest/commit/6846a2a94b5497ec999a826618552717b3853bb9 > ___ > nginx mailing

Re: Nginx and Apach2

2015-06-23 Thread Wandenberg Peixoto
Take a look on *port_in_redirect http://nginx.org/en/docs/http/ngx_http_core_module.html#port_in_redirect *and *proxy_pass http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass* configuration. You probably have to do a proxy_pass to Apache and ensure that the port number is removed

Re: Nginx upstream delays

2015-03-09 Thread Wandenberg Peixoto
You also have to consider the rate your client get data from the server. The request time is the entire time spent from the beginning of the request until the end of response. So you may not have a problem on your server, just a lazy client :) On Mon, Mar 9, 2015 at 1:05 PM, B.R.

How to start a new process?

2015-03-07 Thread Wandenberg Peixoto
Hi, I would like to know what is the right way to start a new process like the cache manager to execute jobs non related with directly with user requests. Can you help me? Regards, Wandenberg ___ nginx-devel mailing list nginx-devel@nginx.org

Re: Issues with HttpChunkinModule

2014-11-26 Thread Wandenberg Peixoto
Hey Arun, as docs says you do not need to compile this module anymore, or even try to set chunkin on; The nginx core will detect when your response does not have a Content-Length set, and will enable the chunk mode automatically. Just remove that line from your configuration and be happy :D

Re: Disable keep_alive based on specific useragent

2014-11-18 Thread Wandenberg Peixoto
Try to remove the last 's' This should work. map $http_user_agent $katimeout { default 300; } On Tue, Nov 18, 2014 at 2:25 AM, Robert Mueller r...@fastmail.fm wrote: Hi Thanks for your responses. Unfortunately, they don't seem to work. and then use the evil IF: if ($ios_ua) {

Re: How to disable access_log to images but log 404s

2014-10-30 Thread Wandenberg Peixoto
Try to set log_not_found http://nginx.org/en/docs/http/ngx_http_core_module.html#log_not_found to off On Thu, Oct 30, 2014 at 11:56 AM, Igal @ getRailo.org i...@getrailo.org wrote: hi, I am suppressing the access_log for images and other files in the /res/ directory: location ^~ /res/

Re: How to make Nginx forget a hostname?

2014-10-12 Thread Wandenberg Peixoto
Did you execute a reload on nginx after remove the configuration file? On Oct 12, 2014 4:14 AM, Francis Daly fran...@daoine.org wrote: On Sat, Oct 11, 2014 at 06:23:28PM -0400, jbjares wrote: Hi there, I'm with a issue related a removed configuration file for a specific hostname. So, I

Re: Distributed cache

2014-10-02 Thread Wandenberg Peixoto
Take a look on SRCache module http://wiki.nginx.org/HttpSRCacheModule if it is suitable for you. On Thu, Oct 2, 2014 at 9:24 AM, Bertrand Paquet bertrand.paq...@gmail.com wrote: Hi, I need to have the same cache content on every frontend nodes. I'm seeking a solution to do what the nginx

Re: Weird behavior when checking the existence of a cookie

2014-09-26 Thread Wandenberg Peixoto
By default the $uri is appended to the proxy_pass directive. Since you defined as proxy_pass http://upstream*/*; and the $uri starts with a slash you will have a double slash. Try to set proxy_pass like proxy_pass http://upstream; On Fri, Sep 26, 2014 at 2:02 PM, Marcello Rocha

Re: Override Content-Type header with proxied requests

2014-08-08 Thread Wandenberg Peixoto
One question, your backend are sending the content-type header if you made the request to it? If yes, the value is right? If not, I think the problem is on backend configuration. You can set it on the nginx using the map like I suggest, but will have to add all possible file types on the map, like

Re: Override Content-Type header with proxied requests

2014-08-07 Thread Wandenberg Peixoto
Did you tried to only hide the header with proxy_hide_header Content-Type; and let nginx use the mime.types to set the content type? Do not set the add_header Content-Type manually. Let me know the result. On Thu, Aug 7, 2014 at 12:57 PM, manish-ezest nginx-fo...@nginx.us wrote: Hello

Re: Why cannot the same path for cache be used several times?

2014-08-06 Thread Wandenberg Peixoto
Hi, The key_zone is just the name of a shared memory area where some metadata about the cache entries will be saved. The files stored on the cache_path does not use the key_zone. They are different configurations to two different purposes. To do what you are imagining, the file stored on

Re: Override Content-Type header with proxied requests

2014-08-06 Thread Wandenberg Peixoto
Hello, you can use many values on the map, take a look on its docs. One quickly example may be (not tested) map $uri $custom_content_type { default text/html; ~(.*\.json)$ application/json; } location ~ \.json$ { proxy_hide_header Content-Type; add_header Content-Type

Re: pid file location even after setting pid directive

2014-08-01 Thread Wandenberg Peixoto
The configuration file used to start the server is the same been used to stop it? If you start as nginx -c /some/confi/file.conf and stop as nginx -c /some/confi/file.conf -s stop it should work. If you are only doing nginx -s stop it will use default configuration that point to another pid file

Re: [PATCH] Core: merge adjacent free slab pages to ameliorate fragmentation from multi-page blocks (Was Re: Help with shared memory usage)

2014-06-03 Thread Wandenberg Peixoto
Thanks agentzh, Maxim and Igor On Tue, Jun 3, 2014 at 11:00 AM, Maxim Dounin mdou...@mdounin.ru wrote: Hello! On Mon, Jun 02, 2014 at 08:42:50PM +0400, Maxim Dounin wrote: Hello! On Sat, May 31, 2014 at 11:46:28PM -0300, Wandenberg Peixoto wrote: Hello Maxim, I executed my

Re: Help with shared memory usage

2014-05-31 Thread Wandenberg Peixoto
wrote: Hello! On Wed, Jan 22, 2014 at 01:39:54AM -0200, Wandenberg Peixoto wrote: Hello Maxim, did you have opportunity to take a look on this last patch? It looks more or less correct, though I don't happy with the checks done, and there are various style issues. I'm

Re: [PATCH] Core: merge adjacent free slab pages to ameliorate fragmentation from multi-page blocks (Was Re: Help with shared memory usage)

2014-05-31 Thread Wandenberg Peixoto
larger than a page size are possible from the pool. While this isn't a problem for nginx itself, it is known to be bad for various 3rd party modules. Fix is to merge adjacent blocks of free pages in the ngx_slab_free_pages() function. Prodded by Wandenberg Peixoto and Yichun Zhang. diff

Re: Does ngx_pool_t survives reload ?

2014-05-07 Thread Wandenberg Peixoto
As far as I know, ngx_pool_t are created on process memory area, so, after a reload the new process has a new memory area and do not have access to the old. You can recompile the regex on your module startup, at init worker hook. On Wed, May 7, 2014 at 6:16 AM, MAGNIEN, Thierry

Re: Help with shared memory usage

2014-01-21 Thread Wandenberg Peixoto
Hello Maxim, did you have opportunity to take a look on this last patch? Regards, Wandenberg On Thu, Dec 26, 2013 at 10:12 PM, Wandenberg Peixoto wandenb...@gmail.comwrote: Hello Maxim, I changed the patch to check only the p-next pointer. And checking if the page is in an address less

Re: Help with shared memory usage

2013-12-26 Thread Wandenberg Peixoto
, Wandenberg On Fri, Dec 20, 2013 at 2:49 PM, Maxim Dounin mdou...@mdounin.ru wrote: Hello! On Tue, Dec 17, 2013 at 09:05:16PM -0200, Wandenberg Peixoto wrote: Hi Maxim, sorry for the long delay. I hope you remember my issue. In attach is the new patch with the changes you suggest. Can

Re: Help with shared memory usage

2013-12-17 Thread Wandenberg Peixoto
I check to be sure the next and the previous free pages can be accessed, without problems and I will make the changes. Regards, Wandenberg On Sun, Oct 6, 2013 at 6:37 AM, Maxim Dounin mdou...@mdounin.ru wrote: Hello! On Wed, Jul 31, 2013 at 12:28:02AM -0300, Wandenberg Peixoto wrote

Re: Help with shared memory usage

2013-09-02 Thread Wandenberg Peixoto
Hi Maxim, did you have opportunity to take a look on this patch? Regards, Wandenberg On Wed, Jul 31, 2013 at 12:28 AM, Wandenberg Peixoto wandenb...@gmail.comwrote: Hello! Thanks for your help. I hope that the patch be OK now. I don't know if the function and variable names are on nginx

Re: Handlers

2013-08-14 Thread Wandenberg Peixoto
including yours, and than execute the final handler. Regards, Wandenberg On Tue, Aug 13, 2013 at 9:04 PM, Myla John-B22173 b22...@freescale.comwrote: Hi Wandenberg Peixoto, ** ** I appreciate your response. ** ** I have a simple follow-up question. I have looked at the function

Re: Help with shared memory usage

2013-07-30 Thread Wandenberg Peixoto
; + +ngx_slab_merge_with_neighbour(pool, page); } On Tue, Jul 30, 2013 at 7:09 AM, Maxim Dounin mdou...@mdounin.ru wrote: Hello! On Mon, Jul 29, 2013 at 04:01:37PM -0300, Wandenberg Peixoto wrote: [...] What would be an alternative to not loop on pool-pages? Free memory blocks are linked in pool

Re: Help with shared memory usage

2013-07-27 Thread Wandenberg Peixoto
-0300, Wandenberg Peixoto wrote: Hi, I'm trying to understand how the shared memory pool works inside the Nginx. To do that, I made a very small module which create a shared memory zone with 2097152 bytes, and allocating and freeing blocks of memory, starting from 0 and increasing

Help with shared memory usage

2013-06-28 Thread Wandenberg Peixoto
Hi, I'm trying to understand how the shared memory pool works inside the Nginx. To do that, I made a very small module which create a shared memory zone with 2097152 bytes, and allocating and freeing blocks of memory, starting from 0 and increasing by 1kb until the allocation fails. The strange