From mat999 at gmail.com Thu Sep 1 01:57:30 2011 From: mat999 at gmail.com (SplitIce) Date: Thu, 1 Sep 2011 11:57:30 +1000 Subject: upstream keepalive - call for testing In-Reply-To: <6a9ebe9133762e47eb7d9b732d7bcd9b.NginxMailingListEnglish@forum.nginx.org> References: <20110829014709.GT1137@mdounin.ru> <6a9ebe9133762e47eb7d9b732d7bcd9b.NginxMailingListEnglish@forum.nginx.org> Message-ID: I havent had any crashes on 3x10mbit servers (90% utilisation) or 2x100mbit servers (20% utilisation). Seems very stable. On Thu, Sep 1, 2011 at 6:04 AM, magicbear wrote: > OK, It works for 3 days with 40 million request haven't coredump. > Thanks. > > Maxim Dounin Wrote: > ------------------------------------------------------- > > Hello! > > > > On Sun, Aug 28, 2011 at 01:07:25PM -0400, > > magicbear wrote: > > > > > Hello, tested for 2 days, the segmentation > > failure frequence is > > > decreased, but sometime still will dead. > > > > > > Here is the coredump information. It seems > > appear too at official > > > without patch version. > > > > [...] > > > > > (gdb) bt > > > #0 0x000000000045bd99 in > > ngx_http_upstream_handler (ev=0x7f99438901e8) > > > at src/http/ngx_http_upstream.c:921 > > > #1 0x0000000000427839 in > > ngx_event_expire_timers () at > > > src/event/ngx_event_timer.c:149 > > > > Could you please test if the attached patch fixes > > things for you? > > > > You may also grab it from here: > > http://mdounin.ru/files/patch-nginx-ssl-shutdown.t > > xt > > > > Maxim Dounin > > # HG changeset patch > > # User Maxim Dounin > > # Date 1314581235 -14400 > > # Node ID 804454a04e22d32c064a3af8e7b24326c7fc2d63 > > # Parent 4b58ea791d9f09b0e2d019fcdea340c0a390af6c > > Handle quiet ssl shutdown. > > > > OpenSSL's SSL_shutdown() may still try to talk to > > network even if > > SSL_set_shutdown(SSL_RECEIVED_SHUTDOWN|SSL_SENT_SH > > UTDOWN) was used. > > This happens if there are some unsent alerts. > > > > Use SSL_set_quiet_shutdown() to actually shutdown > > quitely if we were asked > > to. Note that SSL_set_shutdown() is still > > required as not setting it will > > invalidate session. > > > > diff --git a/src/event/ngx_event_openssl.c > > b/src/event/ngx_event_openssl.c > > --- a/src/event/ngx_event_openssl.c > > +++ b/src/event/ngx_event_openssl.c > > @@ -1205,6 +1205,7 @@ > > ngx_ssl_shutdown(ngx_connection_t *c) > > > > if (c->timedout) { > > mode = > > SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN; > > + > > SSL_set_quiet_shutdown(c->ssl->connection, 1); > > > > } else { > > mode = > > SSL_get_shutdown(c->ssl->connection); > > @@ -1216,6 +1217,10 @@ > > ngx_ssl_shutdown(ngx_connection_t *c) > > if (c->ssl->no_send_shutdown) { > > mode |= SSL_SENT_SHUTDOWN; > > } > > + > > + if (c->ssl->no_wait_shutdown && > > c->ssl->no_send_shutdown) { > > + > > SSL_set_quiet_shutdown(c->ssl->connection, 1); > > + } > > } > > > > SSL_set_shutdown(c->ssl->connection, mode); > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,213207,214602#msg-214602 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Sep 1 03:16:42 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 31 Aug 2011 23:16:42 -0400 Subject: A bug when Host header contain IPv6 address In-Reply-To: <20110831090804.GO1137@mdounin.ru> References: <20110831090804.GO1137@mdounin.ru> Message-ID: <1b1e24f5621e0c7ada55750e10c9367d.NginxMailingListEnglish@forum.nginx.org> Thanks. the general idea of that patch is similar to mine but better. So I'll apply it. If you can tell me why you feel that patch is not enough, I can help to improve it. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214541,214605#msg-214605 From erik at erikwickstrom.com Thu Sep 1 05:48:54 2011 From: erik at erikwickstrom.com (Erik Wickstrom) Date: Wed, 31 Aug 2011 22:48:54 -0700 Subject: Serving stale items from cache Message-ID: I have a web application where the objects are expensive to generate, yet each individual object is accessed infrequently (a few times a week). The dataset in total is about 24 GB. Can Nginx be configured to cache these items for a short amount of time (say 20 minutes), but also have a relatively long (i.e. 7 days) stale setting so clients will always get a fast response (but at the same time will trigger an update of the cached item). proxy_cache_path /var/lib/nginx/cache levels=2:2:2 keys_zone=staticfilecache:512m inactive=7d max_size=25000m; # serve stale cache when the cache is updating, or there is a timeout or error. proxy_cache_use_stale timeout updating error invalid_header http_500 http_502 http_503 http_504; proxy_cache_valid 200 20m; My understanding is that the by setting proxy_cache_path to inactive=7d, cached items will be kept for 7 days and available to be served as stale objects. Basically any request that comes in after 20 minutes will get a stale object from the cache for up to 7 days (and at the same time refresh the cache with the latest version from the backend). However, in testing, it appears that stale objects are not returned, but instead a fresh request is made to my appservers. Here is some sample data from my logs (Notice the $upstream_cache_status and $request_time at the end of the log line) 71.111.3.11 - - [31/Aug/2011:19:44:26 +0000] "GET /?p=3093 HTTP/1.1" 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1" - EXPIRED 15.789 71.111.3.11 - - [31/Aug/2011:19:44:42 +0000] "GET /?p=3093 HTTP/1.1" 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1" - HIT 0.000 71.111.3.11 - - [31/Aug/2011:19:51:02 +0000] "GET /?p=3093 HTTP/1.1" 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1" - HIT 0.000 71.111.3.11 - - [31/Aug/2011:20:01:50 +0000] "GET /?p=3093 HTTP/1.1" 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1" - HIT 0.000 71.111.3.11 - - [31/Aug/2011:21:03:56 +0000] "GET /?p=3093 HTTP/1.1" 200 3851 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1" - EXPIRED 0.725 71.111.3.11 - - [31/Aug/2011:21:14:55 +0000] "GET /?p=3093 HTTP/1.1" 200 3851 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1" - HIT 0.000 71.111.3.11 - - [31/Aug/2011:21:54:18 +0000] "GET /?p=3093 HTTP/1.1" 200 3833 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1" - EXPIRED 0.856 71.111.3.11 - - [31/Aug/2011:22:01:25 +0000] "GET /?p=3093 HTTP/1.1" 200 3833 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1" - HIT 0.000 71.111.3.11 - - [01/Sep/2011:00:02:01 +0000] "GET /?p=3093 HTTP/1.1" 200 3847 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1" - MISS 11.019 Basically I'm trying to keep my cache warm, without overwhelming my app servers. Is this doable? Thanks! Erik From nginx-forum at nginx.us Thu Sep 1 07:30:34 2011 From: nginx-forum at nginx.us (bigplum) Date: Thu, 01 Sep 2011 03:30:34 -0400 Subject: doubt with proxy busy buffer Message-ID: <8c559c7af61f18e50b47dd6f606bcca0.NginxMailingListEnglish@forum.nginx.org> Hi, I write a module for file download, but sometimes it will alert "the http output chain is empty while sending to client". And I check the code, it seems that if proxy busy buffer run out, write_filter will always return ngx error. Is that right? In function: ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) line 540: out = NULL; if (bsize >= (size_t) p->busy_size) { flush = 1; goto flush; } //If busy size is larger than that value in ngix.conf, //out chain will be NULL and goto fulsh //and call output_filter with NULL out chain. line 617: flush: ............... rc = p->output_filter(p->output_ctx, out); //So get into ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in), //print the alert log and return error. line: 186 if (size == 0 && !(c->buffered & NGX_LOWLEVEL_BUFFERED)) { if (last) { r->out = NULL; c->buffered &= ~NGX_HTTP_WRITE_BUFFERED; return NGX_OK; } if (flush) { // flush will never be true, because of NULL in chain do { r->out = r->out->next; } while (r->out); c->buffered &= ~NGX_HTTP_WRITE_BUFFERED; return NGX_OK; } ngx_log_error(NGX_LOG_ALERT, c->log, 0, "the http output chain is empty"); ngx_debug_point(); return NGX_ERROR; -- Best Regard. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214608,214608#msg-214608 From mdounin at mdounin.ru Thu Sep 1 08:01:37 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Sep 2011 12:01:37 +0400 Subject: doubt with proxy busy buffer In-Reply-To: <8c559c7af61f18e50b47dd6f606bcca0.NginxMailingListEnglish@forum.nginx.org> References: <8c559c7af61f18e50b47dd6f606bcca0.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110901080136.GC1137@mdounin.ru> Hello! On Thu, Sep 01, 2011 at 03:30:34AM -0400, bigplum wrote: > Hi, > > I write a module for file download, but sometimes it will alert > "the http output chain is empty while sending to client". > And I check the code, it seems that if proxy busy buffer run out, > write_filter will always return ngx error. > > Is that right? If ngx_http_write_filter() is called with NULL, r->out must not be empty. If it's empty - this means that buffer(s) to flush disappeared somewhere, and alert will warn you about this problem. Maxim Dounin From nginx-forum at nginx.us Thu Sep 1 08:17:28 2011 From: nginx-forum at nginx.us (bigplum) Date: Thu, 01 Sep 2011 04:17:28 -0400 Subject: doubt with proxy busy buffer In-Reply-To: <20110901080136.GC1137@mdounin.ru> References: <20110901080136.GC1137@mdounin.ru> Message-ID: <26c4f70c115aecb734dac57044c1eaa9.NginxMailingListEnglish@forum.nginx.org> Thanks to Maxim, I make a mistake that do not read the r->out statements. The r->out is NULL, so something goes wrong. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214608,214610#msg-214610 From john at bitfieldconsulting.com Thu Sep 1 08:38:58 2011 From: john at bitfieldconsulting.com (John Arundel) Date: Thu, 1 Sep 2011 09:38:58 +0100 Subject: Connections time out before proxy_connect_timeout In-Reply-To: <20110831170758.GA1137@mdounin.ru> References: <20110831170758.GA1137@mdounin.ru> Message-ID: On Wed, Aug 31, 2011 at 6:07 PM, Maxim Dounin wrote: > Connect timeout is limited by your OS's SYN retransmit count limit > and timeout. ?Under FreeBSD it's 75s by default (3 retransmits > with exponential backoff: 3s + 6s + 12s + 24s), under Linux it's > looks like something about 20s by default. ?Looks like you are > hitting this limit. > > The only way to enlarge this limit is to tune OS, e.g. on Linux > try adjusting net.ipv4.tcp_syn_retries sysctl. Yes, that fixed it. Thanks a lot! Regards, John -- Bitfield Consulting: we make software that makes things work http://bitfieldconsulting.com/ From toplek at polok.pl Thu Sep 1 08:42:43 2011 From: toplek at polok.pl (Piotr Polok) Date: Thu, 01 Sep 2011 10:42:43 +0200 Subject: upload file problem (500 Internal Server Error) Message-ID: <5d1a65521a0d9db8f54c1e9b4031e9e8@polok.pl> HI, I'm using version: 'nginx version: nginx/1.1.0' While uploading file I'm getting an error: '500 Internal Server Error' This is an nginx.log result: ------ 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open files) 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open files) 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open files) 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open files) 2011/09/01 10:39:49 [alert] 28764#0: *13013 socket() failed (24: Too many open files) while connecting to upstream, client: 127.0.0.1, server: 192.168.0.222, request: "POST /upload HTTP/1.0", upstream: "http://127.0.0.1:80/upload", host: "localhost", referrer: "http://192.168.0.222/CRM/upload4.html" 2011/09/01 10:39:49 [crit] 28764#0: *13013 open() "/var/www/50x.html" failed (24: Too many open files), client: 127.0.0.1, server: 192.168.0.222, request: "POST /upload HTTP/1.0", upstream: "http://127.0.0.1:80/upload", host: "localhost", referrer: "http://192.168.0.222/CRM/upload4.html" ------ The 'lsof -n | wc -l' command gives a result: '1980' value. The 'cat /proc/sys/fs/file-max' command gives a result: '203296'. So it is not a too many open files problem? The upload4.html containt: ----- Test upload

Select files to upload


----- Please help ;) -- best regards Piotr Polok From chinix at gmail.com Thu Sep 1 09:20:33 2011 From: chinix at gmail.com (chinix) Date: Thu, 01 Sep 2011 17:20:33 +0800 Subject: How to define multiple resolvers? Message-ID: <4e5f4e5e.6731440a.12df.fffff98f@mx.google.com> I want to define more than one resolver to failover if one server is down,how to do this? 2011-09-01 chinix -------------- next part -------------- An HTML attachment was scrubbed... URL: From zjay1987 at gmail.com Thu Sep 1 09:49:29 2011 From: zjay1987 at gmail.com (li zJay) Date: Thu, 1 Sep 2011 17:49:29 +0800 Subject: upload file problem (500 Internal Server Error) In-Reply-To: <5d1a65521a0d9db8f54c1e9b4031e9e8@polok.pl> References: <5d1a65521a0d9db8f54c1e9b4031e9e8@polok.pl> Message-ID: try this? > worker_rlimit_nofile 10000; > On Thu, Sep 1, 2011 at 4:42 PM, Piotr Polok wrote: > HI, > > I'm using version: 'nginx version: nginx/1.1.0' > > While uploading file I'm getting an error: '500 Internal Server Error' > > This is an nginx.log result: > > ------ > 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open > files) > 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open > files) > 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open > files) > 2011/09/01 10:39:49 [alert] 28764#0: accept() failed (24: Too many open > files) > 2011/09/01 10:39:49 [alert] 28764#0: *13013 socket() failed (24: Too many > open files) while connecting to upstream, client: 127.0.0.1, server: > 192.168.0.222, request: "POST /upload HTTP/1.0", upstream: " > http://127.0.0.1:80/upload", host: "localhost", referrer: " > http://192.168.0.222/CRM/**upload4.html > " > 2011/09/01 10:39:49 [crit] 28764#0: *13013 open() "/var/www/50x.html" > failed (24: Too many open files), client: 127.0.0.1, server: 192.168.0.222, > request: "POST /upload HTTP/1.0", upstream: "http://127.0.0.1:80/upload", > host: "localhost", referrer: "http://192.168.0.222/CRM/**upload4.html > " > ------ > > The 'lsof -n | wc -l' command gives a result: '1980' value. > The 'cat /proc/sys/fs/file-max' command gives a result: '203296'. > > So it is not a too many open files problem? > > The upload4.html containt: > ----- > > > Test upload > > >

Select files to upload

>
>
> > >
> > > ----- > > > Please help ;) > > -- > best regards > Piotr Polok > > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -- ?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From simone.fumagalli at contactlab.com Thu Sep 1 09:53:51 2011 From: simone.fumagalli at contactlab.com (Simone Fumagalli) Date: Thu, 1 Sep 2011 11:53:51 +0200 Subject: Wordpress Setup (Nginx + Apache) In-Reply-To: <1314803185467-6746900.post@n2.nabble.com> References: <1314803185467-6746900.post@n2.nabble.com> Message-ID: <4E5F562F.90407@contactlab.com> On 08/31/2011 05:06 PM, antituhan wrote: > Hello fellas, I've been setup wordpress blog using NginX as front end > and Apache as a backend. If you are using this setup you might be interested in this plugin http://wordpress.org/extend/plugins/nginx-manager/ In this way you can serve directly with Nginx static version of your pages and offload Apache Ciao -- Simone Fumagalli From zjay1987 at gmail.com Thu Sep 1 10:01:31 2011 From: zjay1987 at gmail.com (li zJay) Date: Thu, 1 Sep 2011 18:01:31 +0800 Subject: EmbeddedPerlModule question Message-ID: I want to access nginx $uri variable in perl, the following is my nginx.conf worker_processes 1; > > events { > worker_connections 1024; > } > > http { > perl_set $perlvar 'sub {return "ngx_uri:$uri";}'; > > server { > listen 80; > location / { > add_header "perlvar" $perlvar; > empty_gif; > } > } > }* > * but it doesn't work, nginx $uri variable is empty in perl, can somebody figure out what the problem is? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From toplek at polok.pl Thu Sep 1 10:02:49 2011 From: toplek at polok.pl (Piotr Polok) Date: Thu, 01 Sep 2011 12:02:49 +0200 Subject: upload file problem (500 Internal Server Error) In-Reply-To: References: <5d1a65521a0d9db8f54c1e9b4031e9e8@polok.pl> Message-ID: <87bd7ee8ed3c1a8bc0f33206b4db4a37@polok.pl> On Thu, 1 Sep 2011 17:49:29 +0800, li zJay wrote: > try this? > >> worker_rlimit_nofile 10000; HI, Thank you, The 'worker_rlimit_nofile 10000' is not solving the problem. I have added a 'fastcgi_pass 127.0.0.1:9000' to a '/upload' location and now I'm getting the 'No input file specified.' error on html form and the '/var/log/nginx/error.log' is clear. This is my '/upload' configuration: ------ location /upload { #Pass altered request body to this location upload_pass @test; #Store files to this directory #The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist upload_store /var/www/upload; #Allow uploaded files to be read only by user #upload_store_access user:r; upload_store_access user:rw group:rw all:r; #Set specified fields in request body upload_set_form_field $upload_field_name.name "$upload_file_name"; upload_set_form_field $upload_field_name.content_type "$upload_content_type"; upload_set_form_field $upload_field_name.path "$upload_tmp_path"; #Inform backend about hash and size of a file upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5"; upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size"; upload_pass_form_field "^submit$|^description$"; upload_cleanup 400 404 499 500-505; fastcgi_pass 127.0.0.1:9000; } # Pass altered request body to a backend location @test { proxy_pass http://localhost:80; } ------ -- best regards Piotr Polok From igor at sysoev.ru Thu Sep 1 10:06:18 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 1 Sep 2011 14:06:18 +0400 Subject: EmbeddedPerlModule question In-Reply-To: References: Message-ID: <20110901100617.GB25615@nginx.com> On Thu, Sep 01, 2011 at 06:01:31PM +0800, li zJay wrote: > I want to access nginx $uri variable in perl, the following is my nginx.conf > > worker_processes 1; > > > > events { > > worker_connections 1024; > > } > > > > http { > > perl_set $perlvar 'sub {return "ngx_uri:$uri";}'; You should use $r->variable() method to get nginx variable: 'sub { my $r = shift; return $r->variable("uri"); }'; or special $r->uri() method for URI: 'sub { my $r = shift; return $r->uri; }'; > > server { > > listen 80; > > location / { > > add_header "perlvar" $perlvar; > > empty_gif; > > } > > } > > }* > > * > > > but it doesn't work, nginx $uri variable is empty in perl, can somebody > figure out what the problem is? > > Thanks! > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Igor Sysoev From igor at sysoev.ru Thu Sep 1 10:14:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 1 Sep 2011 14:14:56 +0400 Subject: How to define multiple resolvers? In-Reply-To: <4e5f4e5e.6731440a.12df.fffff98f@mx.google.com> References: <4e5f4e5e.6731440a.12df.fffff98f@mx.google.com> Message-ID: <20110901101456.GC25615@nginx.com> On Thu, Sep 01, 2011 at 05:20:33PM +0800, chinix wrote: > I want to define more than one resolver to failover if one server is down,how to do this? Currently it's not possible. -- Igor Sysoev From zjay1987 at gmail.com Thu Sep 1 10:30:36 2011 From: zjay1987 at gmail.com (li zJay) Date: Thu, 1 Sep 2011 18:30:36 +0800 Subject: EmbeddedPerlModule question In-Reply-To: <20110901100617.GB25615@nginx.com> References: <20110901100617.GB25615@nginx.com> Message-ID: Thank you, it works! On Thu, Sep 1, 2011 at 6:06 PM, Igor Sysoev wrote: > On Thu, Sep 01, 2011 at 06:01:31PM +0800, li zJay wrote: > > I want to access nginx $uri variable in perl, the following is my > nginx.conf > > > > worker_processes 1; > > > > > > events { > > > worker_connections 1024; > > > } > > > > > > http { > > > perl_set $perlvar 'sub {return "ngx_uri:$uri";}'; > > You should use $r->variable() method to get nginx variable: > > 'sub { > my $r = shift; > return $r->variable("uri"); > }'; > > or special $r->uri() method for URI: > > 'sub { > my $r = shift; > return $r->uri; > }'; > > > > server { > > > listen 80; > > > location / { > > > add_header "perlvar" $perlvar; > > > empty_gif; > > > } > > > } > > > }* > > > * > > > > > > but it doesn't work, nginx $uri variable is empty in perl, can somebody > > figure out what the problem is? > > > > Thanks! > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at ohlste.in Thu Sep 1 12:00:04 2011 From: jim at ohlste.in (Jim Ohlstein) Date: Thu, 01 Sep 2011 08:00:04 -0400 Subject: nginx and Apache killer In-Reply-To: <20110827081104.GB47641@nginx.com> References: <20110827081104.GB47641@nginx.com> Message-ID: <4E5F73C4.2050100@ohlste.in> On 8/27/11 4:11 AM, Igor Sysoev wrote: > Following "Apache Killer" discussions and the advisory from 2011-08-24 > (Advisory: Range header DoS vulnerability Apache HTTPD 2.x CVE-2011-3192) > we'd like to clarify a couple of things in regards to nginx behavior > either in standalone or "combo" (nginx+apache) modes. > > First of all, nginx doesn't favor HEAD requests with compression, > so the exact mentioned attack doesn't work against a standalone > nginx installation. > > If you're using nginx in combination with proxying to apache backend, > please check your configuration to see if nginx actually passes range > requests to the backend: > > 1) If you're using proxying WITH caching then range requests are not > sent to backend and your apache should be safe. > > 2) If you're NOT using caching then you might be vulnerable to the attack. > > In order to mitigate this attack when your installation includes > apache behind nginx we recommend you the following: > > 1. Refer to the above mentioned security advisory CVE-2011-3192 for apache > and implement described measures accordingly. Apache 2.2.20 has been released to address this issue. Please see http://www.apache.org/dist/httpd/Announcement2.2.html. > > 2. Consider using nginx configuration below (in server{} section of > configuration). This particular example filters 5 and more ranges > in the request: > > if ($http_range ~ "(?:\d*\s*-\s*\d*\s*,\s*){5,}") { > return 416; > } > > We'd also like to notify you that for standalone nginx installations > we've produced the attached patch. This patch prevents handling > malicious range requests at all, instead outputting just the entire file > if the total size of all ranges is greater than the expected response. > > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Jim Ohlstein From nginx-forum at nginx.us Thu Sep 1 13:38:00 2011 From: nginx-forum at nginx.us (magicbear) Date: Thu, 01 Sep 2011 09:38:00 -0400 Subject: upstream keepalive - call for testing In-Reply-To: References: Message-ID: I use at 2x100Mbps server (40% and 10% utilisation), when stable enought, then I will continue to test at 1000Mbps server. splitice Wrote: ------------------------------------------------------- > I havent had any crashes on 3x10mbit servers (90% > utilisation) or 2x100mbit > servers (20% utilisation). > > Seems very stable. > > On Thu, Sep 1, 2011 at 6:04 AM, magicbear > wrote: > > > OK, It works for 3 days with 40 million request > haven't coredump. > > Thanks. > > > > Maxim Dounin Wrote: > > > -------------------------------------------------- > ----- > > > Hello! > > > > > > On Sun, Aug 28, 2011 at 01:07:25PM -0400, > > > magicbear wrote: > > > > > > > Hello, tested for 2 days, the segmentation > > > failure frequence is > > > > decreased, but sometime still will dead. > > > > > > > > Here is the coredump information. It seems > > > appear too at official > > > > without patch version. > > > > > > [...] > > > > > > > (gdb) bt > > > > #0 0x000000000045bd99 in > > > ngx_http_upstream_handler (ev=0x7f99438901e8) > > > > at src/http/ngx_http_upstream.c:921 > > > > #1 0x0000000000427839 in > > > ngx_event_expire_timers () at > > > > src/event/ngx_event_timer.c:149 > > > > > > Could you please test if the attached patch > fixes > > > things for you? > > > > > > You may also grab it from here: > > > > http://mdounin.ru/files/patch-nginx-ssl-shutdown.t > > > xt > > > > > > Maxim Dounin > > > # HG changeset patch > > > # User Maxim Dounin > > > # Date 1314581235 -14400 > > > # Node ID > 804454a04e22d32c064a3af8e7b24326c7fc2d63 > > > # Parent > 4b58ea791d9f09b0e2d019fcdea340c0a390af6c > > > Handle quiet ssl shutdown. > > > > > > OpenSSL's SSL_shutdown() may still try to talk > to > > > network even if > > > > SSL_set_shutdown(SSL_RECEIVED_SHUTDOWN|SSL_SENT_SH > > > UTDOWN) was used. > > > This happens if there are some unsent alerts. > > > > > > Use SSL_set_quiet_shutdown() to actually > shutdown > > > quitely if we were asked > > > to. Note that SSL_set_shutdown() is still > > > required as not setting it will > > > invalidate session. > > > > > > diff --git a/src/event/ngx_event_openssl.c > > > b/src/event/ngx_event_openssl.c > > > --- a/src/event/ngx_event_openssl.c > > > +++ b/src/event/ngx_event_openssl.c > > > @@ -1205,6 +1205,7 @@ > > > ngx_ssl_shutdown(ngx_connection_t *c) > > > > > > if (c->timedout) { > > > mode = > > > SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN; > > > + > > > SSL_set_quiet_shutdown(c->ssl->connection, 1); > > > > > > } else { > > > mode = > > > SSL_get_shutdown(c->ssl->connection); > > > @@ -1216,6 +1217,10 @@ > > > ngx_ssl_shutdown(ngx_connection_t *c) > > > if (c->ssl->no_send_shutdown) { > > > mode |= SSL_SENT_SHUTDOWN; > > > } > > > + > > > + if (c->ssl->no_wait_shutdown && > > > c->ssl->no_send_shutdown) { > > > + > > > SSL_set_quiet_shutdown(c->ssl->connection, 1); > > > + } > > > } > > > > > > SSL_set_shutdown(c->ssl->connection, > mode); > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > Posted at Nginx Forum: > > > http://forum.nginx.org/read.php?2,213207,214602#ms > g-214602 > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,214622#msg-214622 From nginx-forum at nginx.us Thu Sep 1 14:19:57 2011 From: nginx-forum at nginx.us (ssaravalli) Date: Thu, 01 Sep 2011 10:19:57 -0400 Subject: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth In-Reply-To: <20110831122554.GD1468@nginx.com> References: <20110831122554.GD1468@nginx.com> Message-ID: Igor Sysoev Wrote: > > You should > 1) use either the same user/password on both nginx > and Apache, It's not possible in my situation. NGINX uses basic auth based on a file, while Apache uses basic auth through LDAP. > 2) or enable authentication only on one host: on > nginx OR Apache, I can't because I need two layer of authentication. The first one on NGINX and the second one on the web apps with authentication based on our LDAP server. > 3) or enable authentication on nginx and go to > Apache as some > backend user: > > proxy_set_header Authorization > base64_encoding_of_"user:password"; > This is not my case. So, is there a way to tell NGINX to manage only the first authentication level and when the user provides username/password (LDAP) for the backend web app, these credentials must be managed by the backend web server? Another solution may be to keep on the backend the LDAP auth and on the frontend (NGINX) a form based authentication? Thanks, Simone Saravalli Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214550,214624#msg-214624 From mdounin at mdounin.ru Thu Sep 1 14:50:49 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Sep 2011 18:50:49 +0400 Subject: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth In-Reply-To: References: <20110831122554.GD1468@nginx.com> Message-ID: <20110901145049.GD1137@mdounin.ru> Hello! On Thu, Sep 01, 2011 at 10:19:57AM -0400, ssaravalli wrote: [...] > So, is there a way to tell NGINX to manage only the first authentication > level and when the user provides username/password (LDAP) for the > backend web app, these credentials must be managed by the backend web > server? There is no levels of authentication possible in HTTP authentication. More strictly, there are two levels: proxy and client. The proxy level is reserved to working with proxies, and it's not generally possible to use it anywhere else (additionally, I believe it's not supported by majority of software). Please refer to RFC 2616 and RFC 2617 for more details. > Another solution may be to keep on the backend the LDAP auth and on the > frontend (NGINX) a form based authentication? This should work. Maxim Dounin From lists at ruby-forum.com Thu Sep 1 16:13:47 2011 From: lists at ruby-forum.com (Hongli Lai) Date: Thu, 01 Sep 2011 18:13:47 +0200 Subject: Please open the Nginx SVN repository In-Reply-To: References: <2116ea892041ed6fae726223de1a154c@ruby-forum.com> Message-ID: The SVN repository seems to be down. $ svn list svn://svn.nginx.org svn: No repository found in 'svn://svn.nginx.org' -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Thu Sep 1 16:16:36 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Sep 2011 20:16:36 +0400 Subject: Please open the Nginx SVN repository In-Reply-To: References: <2116ea892041ed6fae726223de1a154c@ruby-forum.com> Message-ID: <20110901161635.GE1137@mdounin.ru> Hello! On Thu, Sep 01, 2011 at 06:13:47PM +0200, Hongli Lai wrote: > The SVN repository seems to be down. > > $ svn list svn://svn.nginx.org > svn: No repository found in 'svn://svn.nginx.org' http://mailman.nginx.org/pipermail/nginx-devel/2011-August/001115.html Maxim Dounin From nginx-forum at nginx.us Thu Sep 1 23:17:06 2011 From: nginx-forum at nginx.us (magicbear) Date: Thu, 01 Sep 2011 19:17:06 -0400 Subject: upload file problem (500 Internal Server Error) In-Reply-To: <87bd7ee8ed3c1a8bc0f33206b4db4a37@polok.pl> References: <87bd7ee8ed3c1a8bc0f33206b4db4a37@polok.pl> Message-ID: you can try to add such line to /etc/security/limits.conf nginx soft nofile 131072 nginx hard nofile 1048576 and fastcgi_pass to run PHP you need to set SCRIPT_FILENAME, you may first include fastcgi_params at /etc/nginx (if you install nginx with binary), and then add such line before fastcgi_pass: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; Piotr Polok Wrote: ------------------------------------------------------- > On Thu, 1 Sep 2011 17:49:29 +0800, li zJay wrote: > > try this? > > > >> worker_rlimit_nofile 10000; > > HI, > > Thank you, The 'worker_rlimit_nofile 10000' is not > solving the problem. > > I have added a 'fastcgi_pass 127.0.0.1:9000' to a > '/upload' location > and now I'm getting the 'No input file specified.' > error on html form > and the '/var/log/nginx/error.log' is clear. > > This is my '/upload' configuration: > > ------ > location /upload { > #Pass altered request body to this location > upload_pass @test; > > #Store files to this directory > #The directory is hashed, subdirectories 0 1 2 3 > 4 5 6 7 8 9 should > exist > upload_store /var/www/upload; > > #Allow uploaded files to be read only by user > #upload_store_access user:r; > upload_store_access user:rw group:rw all:r; > > #Set specified fields in request body > upload_set_form_field $upload_field_name.name > "$upload_file_name"; > upload_set_form_field > $upload_field_name.content_type > "$upload_content_type"; > upload_set_form_field $upload_field_name.path > "$upload_tmp_path"; > > #Inform backend about hash and size of a file > upload_aggregate_form_field > "$upload_field_name.md5" > "$upload_file_md5"; > upload_aggregate_form_field > "$upload_field_name.size" > "$upload_file_size"; > > upload_pass_form_field "^submit$|^description$"; > > upload_cleanup 400 404 499 500-505; > > fastcgi_pass 127.0.0.1:9000; > } > > # Pass altered request body to a backend > location @test { > proxy_pass http://localhost:80; > } > ------ > > -- > best regards > Piotr Polok > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214612,214639#msg-214639 From nginx-forum at nginx.us Fri Sep 2 06:03:03 2011 From: nginx-forum at nginx.us (James_Lee) Date: Fri, 02 Sep 2011 02:03:03 -0400 Subject: The patch of Nginx SSL: PEM pass phrase problem Message-ID: <8c1d65b918b52351b2382a2fa6c5d4ae.NginxMailingListEnglish@forum.nginx.org> Hi, If we configured SSL in Nginx and the Private Key files are encrypted, then the following dialog occurs at Nginx startup time: Enter PEM pass phrase: It maybe difficulty for management. Sometimes it's needed to avoid the interactive dialogue at startup time. So I develop the patch for Nginx ssl module. Wish it helpful! Directive: ssl_pass_phrase_dialog -------------------------------------------------------------------- Description: Type of pass phrase dialog for encrypted private keys Syntax: ssl_pass_phrase_dialog type Default: ssl_pass_phrase_dialog builtin Context: http, server Usage: -------------------------------------------------------------------- When Nginx starts up it has to read the various Certificate (see ssl_certificate) and Private Key (see ssl_certificate_key) files of the SSL-enabled virtual servers. Because for security reasons the Private Key files are usually encrypted, ngx_ssl module needs to query the administrator for a Pass Phrase in order to decrypt those files. This query can be done in two ways which can be configured by type: * builtin This is the default where an interactive terminal dialog occurs at startup time. Here the administrator has to manually enter the Pass Phrase for each encrypted Private Key file. * exec:/path/to/program Here an external program is configured which is called at startup for each encrypted Private Key file. Example: -------------------------------------------------------------------- (1) ssl_pass_phrase_dialog builtin; The "Enter PEM pass phrase:" will occurs at the Nginx startup time. (2) ssl_pass_phrase_dialog "exec:/home/ssl_files/ssl_pass_phrase.sh"; The code of ssl_pass_phrase.sh: #!/bin/sh echo "password" The relevant configuration in Apache is: http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#sslpassphrasedialog If more information is needed, please refer to the Nginx HttpSslModule: http://wiki.nginx.org/HttpSslModule Patch? -------------------------------------------------------------------- This patch has been tested in nginx-0.8.54. The download url is : http://www.cx.com/dl/?sn=f3c7b79133b7 Author: -------------------------------------------------------------------- beagem#163.com (Here # is @ in fact) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214641,214641#msg-214641 From nginx-forum at nginx.us Fri Sep 2 06:09:06 2011 From: nginx-forum at nginx.us (ssaravalli) Date: Fri, 02 Sep 2011 02:09:06 -0400 Subject: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth In-Reply-To: <20110901145049.GD1137@mdounin.ru> References: <20110901145049.GD1137@mdounin.ru> Message-ID: <9ae4ed579af1b1731379d0ed94d15745.NginxMailingListEnglish@forum.nginx.org> Hello Maxim Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Thu, Sep 01, 2011 at 10:19:57AM -0400, > ssaravalli wrote: > > [...] > > > So, is there a way to tell NGINX to manage only > the first authentication > > level and when the user provides > username/password (LDAP) for the > > backend web app, these credentials must be > managed by the backend web > > server? > > There is no levels of authentication possible in > HTTP > authentication. > > More strictly, there are two levels: proxy and > client. The > proxy level is reserved to working with proxies, > and it's not > generally possible to use it anywhere else > (additionally, I > believe it's not supported by majority of > software). > > Please refer to RFC 2616 and RFC 2617 for more > details. ok, trank you > > Another solution may be to keep on the backend > the LDAP auth and on the > > frontend (NGINX) a form based authentication? > > This should work. > I'll try with this solution. Thank you for your reply! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214550,214642#msg-214642 From zblut at cerego.com Fri Sep 2 07:27:08 2011 From: zblut at cerego.com (Zev Blut) Date: Fri, 2 Sep 2011 16:27:08 +0900 Subject: Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module? Message-ID: <4E60854C.3040001@cerego.com> Hello, I have a configuration in a server rule that typically only allows access by either an auth basic request or by certain ip addresses. Something along the lines of this: server { listen 80; charset off; server_name authsite; satisfy any; auth_basic "Auth Message"; auth_basic_user_file xyz.passwd; # Allow Internal Network allow 192.168.1.0/24; deny all; # many includes and location directives below } We have a use case were we need to allow an external agent to have access to this site. I'd rather not play whack-a-mole and keep adding ip addresses for this agent. At the same time I cannot give the agent an login and password, because we can't control the URLs. So I was wondering if there is a way to also allow access to this site based on the user agent? I tried using an if directive but that is not working. Thanks for any ideas -- Zev Blut Cerego Japan Inc Developer Development / Technology ?? ???? ???????????? ???? ??? Office : +81-3-3463-7266 Email : zblut at cerego.com Corporate website: http://www.cerego.com Core service website: http://iknow.jp From agentzh at gmail.com Fri Sep 2 08:24:50 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 2 Sep 2011 16:24:50 +0800 Subject: [ANN] ngx_lua v0.3.0 released: new regex API, request args API, header filter hooks, and more In-Reply-To: References: Message-ID: Hello, folks! After two months' active development of our contributors, I'm happy to announce the v0.3.0 release of our ngx_lua module. You can get the release tarball from the download page: ??? https://github.com/chaoslawful/lua-nginx-module/downloads This release contains a new PCRE regex API for Lua, an API for retrieving parsed URI query arguments and POST query arguments, as well as the new hooks that allow you to define nginx header filters directly in Lua. Also, the special "ngx.ctx" table is implemented so that you can store arbitrary Lua values into this data which will have a lifetime identical to the current nginx request. There's many more new features and bug fixes that you can find out in the following complete change log for this release: ??? http://wiki.nginx.org/HttpLuaModule#v0.3.0 Special thanks go to our contributors and users, Liseen Wan, Lance, Ou Yuanning, Bertrand Mansion (golgote), James Hurst, Patrick Crosby, Bill Donahue, Jiang Dapao, and others. This module embeds the Lua interpreter or LuaJIT into the nginx core and integrates the powerful Lua threads (aka Lua coroutines) into the nginx event model by means of nginx subrequests. Unlike Apache's mod_lua and Lighttpd's mod_magnet, Lua code written atop this module can be 100% non-blocking on network traffic as long as you use the ngx.location.capture or ngx.location.capture_multi interfaces to let the nginx core do all your requests to mysql, postgresql, memcached, redis, upstream http web services, and etc etc etc. This module is also included and enabled by default in our ngx_openresty bundle: http://openresty.org/ You can find the complete documentation for this module on the following wiki page: ??? http://wiki.nginx.org/HttpLuaModule And you always get the latest source code from the git repository here: ??? https://github.com/chaoslawful/lua-nginx-module Have fun! -agentzh From mdounin at mdounin.ru Fri Sep 2 08:31:05 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Sep 2011 12:31:05 +0400 Subject: Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module? In-Reply-To: <4E60854C.3040001@cerego.com> References: <4E60854C.3040001@cerego.com> Message-ID: <20110902083105.GH1137@mdounin.ru> Hello! On Fri, Sep 02, 2011 at 04:27:08PM +0900, Zev Blut wrote: > Hello, > > I have a configuration in a server rule that typically only allows > access by either an auth basic request or by certain ip addresses. > > Something along the lines of this: > > server { > listen 80; > > charset off; > server_name authsite; > > satisfy any; > > auth_basic "Auth Message"; > auth_basic_user_file xyz.passwd; > > # Allow Internal Network > allow 192.168.1.0/24; > deny all; > > # many includes and location directives below > } > > > We have a use case were we need to allow an external agent to have > access to this site. > I'd rather not play whack-a-mole and keep adding ip addresses for this > agent. > At the same time I cannot give the agent an login and password, because > we can't control the URLs. > > So I was wondering if there is a way to also allow access to this > site based on the user agent? > > I tried using an if directive but that is not working. Something like this should work: server { ... location / { error_page 418 = @allowed; if ($http_user_agent ~ something) { return 418; } satisfy any; allow ... auth_basic ... } location @allowed { # ... } } Alternatively, you may use auth request module[1] and write something like this: server { ... location / { satisfy any; allow ... auth_basic ... auth_request /auth; } location = /auth { if ($http_user_agent ~ something) { return 200; } return 403; } } [1] http://mdounin.ru/hg/ngx_http_auth_request_module/ Maxim Dounin From zblut at cerego.com Fri Sep 2 09:34:14 2011 From: zblut at cerego.com (Zev Blut) Date: Fri, 2 Sep 2011 18:34:14 +0900 Subject: Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module? In-Reply-To: <20110902083105.GH1137@mdounin.ru> References: <4E60854C.3040001@cerego.com> <20110902083105.GH1137@mdounin.ru> Message-ID: <4E60A316.4050701@cerego.com> Hello, On 09/02/2011 05:31 PM, Maxim Dounin wrote: > On Fri, Sep 02, 2011 at 04:27:08PM +0900, Zev Blut wrote: >> We have a use case were we need to allow an external agent to have >> access to this site. >> I'd rather not play whack-a-mole and keep adding ip addresses for this >> agent. >> At the same time I cannot give the agent an login and password, because >> we can't control the URLs. >> >> So I was wondering if there is a way to also allow access to this >> site based on the user agent? >> >> I tried using an if directive but that is not working. > Alternatively, you may use auth request module[1] and write something > like this: > > > server { > ... > > location / { > satisfy any; > > allow ... > auth_basic ... > auth_request /auth; > } > > location = /auth { > if ($http_user_agent ~ something) { > return 200; > } > return 403; > } > } > > [1] http://mdounin.ru/hg/ngx_http_auth_request_module/ Thanks for the link to the auth request module That might serve my purposes best without have to refactor and duplicate my configs as much as the extra location will. Thanks, Zev From nginx-forum at nginx.us Fri Sep 2 11:50:32 2011 From: nginx-forum at nginx.us (ykse) Date: Fri, 02 Sep 2011 07:50:32 -0400 Subject: nginx and php header + flush Message-ID: Hello guys, I've got strange problem with my webserver. I've got nginx and apache with php as backend www server, and now when I tryin to run this code -> ( it's on apache ) nginx returns something like this -> 8 sometext 0 As you can see it's returns some numbers, but why ? When I'm openning same script directly from apache it's returns only "sometext" without any numbers. Do you have any idea why nginx returns this numbers ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214654,214654#msg-214654 From mdounin at mdounin.ru Fri Sep 2 11:57:16 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Sep 2011 15:57:16 +0400 Subject: nginx and php header + flush In-Reply-To: References: Message-ID: <20110902115716.GL1137@mdounin.ru> Hello! On Fri, Sep 02, 2011 at 07:50:32AM -0400, ykse wrote: > Hello guys, > I've got strange problem with my webserver. I've got nginx and apache > with php as backend www server, and now when I tryin to run this code > -> > > > header('HTTP/1.x 404 Not Found'); > echo "sometext"; > flush(); > ?> > > ( it's on apache ) > > nginx returns something like this -> > > > 8 sometext 0 > > > As you can see it's returns some numbers, but why ? When I'm openning > same script directly from apache it's returns only "sometext" without > any numbers. > > > Do you have any idea why nginx returns this numbers ? These numbers are from chunked encoding incorrectly sent by apache to nginx. This behaviour is the result of a bug in apache's mod_php which forces HTTP/1.1 reply despite the fact client (nginx) uses HTTP/1.0 in request. To fix this, just change header('HTTP/1.1 ...'); to header('HTTP/1.0 ...'); in your php code, or use "SetEnv downgrade-1.0" in apache config as a workaround if changing code is problematic for some reason. See [1] for more information. [1] http://mailman.nginx.org/pipermail/nginx/2011-August/028508.html Maxim Dounin From nginx-forum at nginx.us Fri Sep 2 12:00:21 2011 From: nginx-forum at nginx.us (ykse) Date: Fri, 02 Sep 2011 08:00:21 -0400 Subject: nginx and php header + flush In-Reply-To: <20110902115716.GL1137@mdounin.ru> References: <20110902115716.GL1137@mdounin.ru> Message-ID: Maxim, now it's works fine! Thanks a lot! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214654,214656#msg-214656 From andrew at nginx.com Fri Sep 2 15:59:50 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Fri, 2 Sep 2011 19:59:50 +0400 Subject: Serving stale items from cache In-Reply-To: References: Message-ID: <4262924B-D501-46F1-95D8-C0DA85D975D3@nginx.com> Erik, That's not currently doable with nginx. Proxy_cache_use_stale directive works when you've got your backend down. What you want is more like doing a triggered update of the content in background and it's not possible at this time. Hope this helps On Sep 1, 2011, at 9:48 AM, Erik Wickstrom wrote: > I have a web application where the objects are expensive to generate, > yet each individual object is accessed infrequently (a few times a > week). The dataset in total is about 24 GB. > > Can Nginx be configured to cache these items for a short amount of > time (say 20 minutes), but also have a relatively long (i.e. 7 days) > stale setting so clients will always get a fast response (but at the > same time will trigger an update of the cached item). > > proxy_cache_path /var/lib/nginx/cache levels=2:2:2 > keys_zone=staticfilecache:512m inactive=7d max_size=25000m; > # serve stale cache when the cache is updating, or there is a timeout or error. > proxy_cache_use_stale timeout updating error invalid_header http_500 > http_502 http_503 http_504; > proxy_cache_valid 200 20m; > > My understanding is that the by setting proxy_cache_path to > inactive=7d, cached items will be kept for 7 days and available to be > served as stale objects. Basically any request that comes in after 20 > minutes will get a stale object from the cache for up to 7 days (and > at the same time refresh the cache with the latest version from the > backend). > > However, in testing, it appears that stale objects are not returned, > but instead a fresh request is made to my appservers. Here is some > sample data from my logs (Notice the $upstream_cache_status and > $request_time at the end of the log line) > > 71.111.3.11 - - [31/Aug/2011:19:44:26 +0000] "GET /?p=3093 HTTP/1.1" > 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 > Safari/535.1" - EXPIRED 15.789 > 71.111.3.11 - - [31/Aug/2011:19:44:42 +0000] "GET /?p=3093 HTTP/1.1" > 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 > Safari/535.1" - HIT 0.000 > 71.111.3.11 - - [31/Aug/2011:19:51:02 +0000] "GET /?p=3093 HTTP/1.1" > 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 > Safari/535.1" - HIT 0.000 > 71.111.3.11 - - [31/Aug/2011:20:01:50 +0000] "GET /?p=3093 HTTP/1.1" > 200 3849 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 > Safari/535.1" - HIT 0.000 > 71.111.3.11 - - [31/Aug/2011:21:03:56 +0000] "GET /?p=3093 HTTP/1.1" > 200 3851 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 > Safari/535.1" - EXPIRED 0.725 > 71.111.3.11 - - [31/Aug/2011:21:14:55 +0000] "GET /?p=3093 HTTP/1.1" > 200 3851 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 > Safari/535.1" - HIT 0.000 > 71.111.3.11 - - [31/Aug/2011:21:54:18 +0000] "GET /?p=3093 HTTP/1.1" > 200 3833 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 > Safari/535.1" - EXPIRED 0.856 > 71.111.3.11 - - [31/Aug/2011:22:01:25 +0000] "GET /?p=3093 HTTP/1.1" > 200 3833 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 > Safari/535.1" - HIT 0.000 > 71.111.3.11 - - [01/Sep/2011:00:02:01 +0000] "GET /?p=3093 HTTP/1.1" > 200 3847 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 > Safari/535.1" - MISS 11.019 > > > Basically I'm trying to keep my cache warm, without overwhelming my > app servers. Is this doable? > > Thanks! > Erik > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Fri Sep 2 20:32:32 2011 From: nginx-forum at nginx.us (Xan) Date: Fri, 02 Sep 2011 16:32:32 -0400 Subject: Strange directory behaviour: rename causes 404 error Message-ID: <86f14be754becd175c07a61f1db101ba.NginxMailingListEnglish@forum.nginx.org> Hi, I have strange behaviour. I have a directory "@docencia". All is ok: 172.26.0.6 - - [02/Sep/2011:22:26:10 +0200] "GET /@docencia/ HTTP/1.1" 200 218 "https://172.26.0.3/" "Mozilla/5.0 (X11; Linux i686; rv:6.0.1) Gecko/20100101 Firefox/6.0.1" but when I rename to "docencia", I have: 172.26.0.6 - - [02/Sep/2011:22:27:59 +0200] "GET /docencia/ HTTP/1.1" 404 244 "https://172.26.0.3/" "Mozilla/5.0 (X11; Linux i686; rv:6.0.1) Gecko/20100101 Firefox/6.0.1" I don't know why. Any hint. Please, help me. Xan. My nginx.conf is: user www-data; worker_processes 1; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; # =logs: access_log|_/var/log/nginx/access.log; error_log /var/log/nginx/error.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; # =compressi?: gzip on; gzip_min_length 100; gzip_types text/plain text/css text/xml application/x-javascript application/atom+xml; # =inclusi? dels servidors virtuals include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } and /etc/nginx/sites-enabled/ only has default: # You may add here your # server { # ... # } # statements for each of your virtual hosts # Servidor pla (http). server { listen 80 default; server_name localhost; location / { rewrite ^(.*)$ https://$host$1 permanent; } # Per a qu? no me doni error si el navegador me demana favicon.ico i no el # tenc. De [http://wiki.nginx.org/Piwik] # location = /favicon.ico { # try_files /favicon.ico =204; #} # Seguint http://wiki.nginx.org/ThttpdCGI #location ~ \.pl$ { # #include proxy.conf; # proxy_intercept_errors on; # proxy_pass http://127.0.0.1:8082; # proxy_redirect off; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header Host $host; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # #proxy_redirect default; # #real_ip_header X-Real-IP; # #proxy_set_header Connection Close; # #proxy_intercept_errors on; #} #location ~ \.php$ { # #include proxy.conf; # proxy_intercept_errors on; # proxy_pass http://127.0.0.1:8082; #8082 --> lighttpd # proxy_redirect off; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header Host $host; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # #proxy_redirect default; # #real_ip_header X-Real-IP; # #proxy_set_header Connection Close; # #proxy_intercept_errors on; #} # Estat de les connexions del nginx. # De [http://kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/] #location /status { # stub_status on; # access_log off; # allow 127.0.0.1; # allow 172.26.0.0/24; # deny all; #} # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } # Servidor SSL (https) server { server_name localhost; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server.key; location / { root /var/www; index index.html index.htm index.php; autoindex on; autoindex_exact_size off; } location /doc { root /usr/share; autoindex on; autoindex_exact_size off; allow 127.0.0.1; allow 172.26.0.0/24; deny all; } # 400 = Bad request error_page 400 /400.html; location = /400.html { root /var/www/code-pages; } # 401 = Unauthorized error_page 401 /401.html; location = /401.html { root /var/www/code-pages; } # 403 = Forbidden page error_page 403 /403.html; location = /403.html { root /var/www/code-pages; } # 404 = Not found error_page 404 /404.html; location = /404.html { root /var/www/code-pages; } # 500 = Internal Server Error # error_page 500 /500.html; location = /500.html { root /var/www/code-pages; } # 501 = Not Implemented # error_page 501 /501.html; location = /501.html { root /var/www/code-pages; } # 502 = Bad Gateway # error_page 502 /502.html; location = /502.html { root /var/www/code-pages; } # 503 = Service Unavaliable # error_page 503 /503.html; location = /503.html { root /var/www/code-pages; } # 504 = Gateway Timeout # error_page 504 /504.html; location = /504.html { root /var/www/code-pages; } # 505 = HTTP Version Not Supported # error_page 505 /505.html; location = /505.html { root /var/www/code-pages; } # Per a qu? no me doni error si el navegador me demana favicon.ico i no el # tenc. De [http://wiki.nginx.org/Piwik] location = /favicon.ico { try_files /favicon.ico =204; } # Execuci? de scripts de perl per proxy i lighttpd # Informaci? original http://wiki.nginx.org/ThttpdCGI location ~ \.pl$ { #include proxy.conf; proxy_intercept_errors on; proxy_pass http://127.0.0.1:8082; #En teoria 8443; per ser segur entre servidors proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_redirect default; #real_ip_header X-Real-IP; #proxy_set_header Connection Close; #proxy_intercept_errors on; } # # Per executar php via fastcgi (php-fpm). # # NO descomentar. # location ~ \.php$ { # include /etc/nginx/fastcgi_params; # #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_pass 127.0.0.1:9000; # } # Execuci? de php per proxy a lighttpd location ~ \.php$ { #include proxy.conf; #proxy_intercept_errors on; proxy_pass http://127.0.0.1:8082; #8082 --> lighttpd ##proxy_set_header X-Forwarded-Host $host; ##proxy_set_header X-Forwarded-Server $host; ##proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_redirect off; #proxy_buffering off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; #$proxy_add_x_forwarded_for; #proxy_set_header X-Forwarded-Ssl on; ##proxy_redirect default; ##real_ip_header X-Real-IP; ##proxy_set_header Connection Close; ##proxy_intercept_errors on; } location /segur/ { auth_basic "Zona restringida"; auth_basic_user_file conf.d/contrasenyes; root /var/www/; autoindex on; } # Estat de les connexions del nginx. # De [http://kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/] location /status { stub_status on; access_log off; allow 127.0.0.1; allow 172.26.0.0/24; deny all; } } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #listen 8000; #listen somename:8080; #server_name somename alias another.alias; #location / { #root html; #index index.html index.htm; #} #} # HTTPS server # #server { #listen 443; #server_name localhost; #ssl on; #ssl_certificate cert.pem; #ssl_certificate_key cert.key; #ssl_session_timeout 5m; #ssl_protocols SSLv2 SSLv3 TLSv1; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; #ssl_prefer_server_ciphers on; #location / { #root html; #index index.html index.htm; #} #} Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214663,214663#msg-214663 From nginx-forum at nginx.us Fri Sep 2 20:36:00 2011 From: nginx-forum at nginx.us (Xan) Date: Fri, 02 Sep 2011 16:36:00 -0400 Subject: SOLVED Strange directory behaviour: rename causes 404 error In-Reply-To: <86f14be754becd175c07a61f1db101ba.NginxMailingListEnglish@forum.nginx.org> References: <86f14be754becd175c07a61f1db101ba.NginxMailingListEnglish@forum.nginx.org> Message-ID: <43d7cb0d9aef0ebb36575cfad40c285c.NginxMailingListEnglish@forum.nginx.org> Solved: simply change: "location /doc" to "location /doc/" That's all. :-) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214663,214664#msg-214664 From rami.essaid at gmail.com Fri Sep 2 20:42:39 2011 From: rami.essaid at gmail.com (Rami Essaid) Date: Fri, 2 Sep 2011 16:42:39 -0400 Subject: Storing URI in a cookie Message-ID: I dont know why I am struggling with this so much but I need a bit of help. I am trying to redirect users to a verification page and then back to their original requested URI but because of the rewrite I lose both the $uri and $request_uri variables. I figure the easiest way to solve this problem is to store the original URI in a cookie and read it from that after the verification page. I cant seem to store the cookie correctly and read it back. Can anyone provide some direction? Also, is there any risk that by doing this I disrupt other cookies being stored by my application? Thanks! Rami -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Sep 3 00:36:31 2011 From: nginx-forum at nginx.us (allegro) Date: Fri, 02 Sep 2011 20:36:31 -0400 Subject: How to take full advantage system memory? Message-ID: <3ece42c4e2934ac2dd6110e6c3b00432.NginxMailingListEnglish@forum.nginx.org> Hi,All: My host have a very large physical memory, how to get nginx take full advantage of memory as the file system cache? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214666,214666#msg-214666 From ianevans at digitalhit.com Sat Sep 3 00:51:11 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Fri, 02 Sep 2011 20:51:11 -0400 Subject: SSL location keep redirecting to non-SSL Message-ID: <4E6179FF.7060209@digitalhit.com> Ok...my brain's been hurting on this one tonight. My site's been running fine on nginx for years. have SSL and non-SSL locations. PHP runs through .shtml files Working on a Facebook app and right now need to have it work with both the SSL and non-SSL URL. Testing the coding on my server right now. If I go to http://www.example.com/myappsname the page loads. If I go to https://www.example.com/myappsname/index.shtml the page loads. <-note https If I go to https://www.example.com/myappsname/ the page redirects to http://www.example.com/myappsname. <-note https on first URL Here are the relevant locations in the SSL server section: location / { root /usr/local/apache/htdocs; rewrite ^(.+) http://www.digitalhit.com$1 permanent; index index.shtml index.php; } location ~ \.(shtml|php|inc)$ { root /usr/local/apache/htdocs; include /usr/local/nginx/conf/fastcgi-php.conf; fastcgi_pass 127.0.0.1:10004; } location ^~ /myappsname/ { index index.shtml root /usr/local/apache/htdocs/; fastcgi_intercept_errors on; include /usr/local/nginx/conf/fastcgi-php.conf; fastcgi_pass 127.0.0.1:10004; fastcgi_param HTTPS on; } I'll probably smack my head when this is pointed out to me. All my other SSL locations work fine. Any idea why including the filename stays SSL but dropping it redirects? Thanks. From nginx-forum at nginx.us Sat Sep 3 01:21:33 2011 From: nginx-forum at nginx.us (signe) Date: Fri, 02 Sep 2011 21:21:33 -0400 Subject: URL decode rewrite handling: + vs. %20 Message-ID: <2f879159200e58c32a5b1eb6b3d01cef.NginxMailingListEnglish@forum.nginx.org> Ubuntu Natty nginx/0.8.54 PHP 5.3.5 / FPM / FastCGI I'm just beginning to work with nginx for the first time. Converting my home server (very few hits) as an experiment for possible broader-scale testing and implementation on work servers (billions of hits per month). Everything has gone beautifully... up until I begin working on an older app: Gallery 2. Some of the photos in my Gallery contain spaces, so they're being encoded in the old-but-still-accepted + format. However, when I make the requests in nginx, it's passing the pathinfo through to fastcgi as an escaped + (%2b) instead of a space (+ or %20). The path is something like this: http://www.example.com/gallery/foo+bar.jpg.html which gets rewritten to http://www.example.com/gallery/main.php?g2_path=foo+bar.jpg.html In a path, + should be handled literally per RFC. In a query string, it's supposed to be interpreted as a space per x-www-form-urlencoded. This is the disparity - what once was path is now query string. Because of the conversion, Apache translates the + from literal string to encoded space during rewrite. nginx simply encodes the literal string. I don't know if there's a solid answer as to which one is strictly "correct"... but what I do need to know is if there's a way to achieve the same behavior in nginx? This is an interesting edge case... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214668,214668#msg-214668 From ianevans at digitalhit.com Sat Sep 3 08:17:27 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sat, 03 Sep 2011 04:17:27 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: <4E6179FF.7060209@digitalhit.com> References: <4E6179FF.7060209@digitalhit.com> Message-ID: <4E61E297.1070506@digitalhit.com> Been scratching my head on this one all night. Been working on it a bit and now if I go to: https://www.example.com/myfacebookapp/index.shtml the page loads but https://www.example.com/myfacebookapp is tossing a 404 I'm really boggled here because the other subdirs are woring and the only difference is they're password protected. Here's the full ssl server conf section: server { server_name www.example.com; listen 443; root /usr/local/apache/htdocs/; ssl on; ssl_certificate /usr/local/apache/conf/server.pem; ssl_certificate_key /usr/local/apache/conf/server.key; ssl_session_timeout 5m; error_page 404 /dhe404.shtml; location / { rewrite ^(.+) http://www.example.com$1 permanent; index index.shtml index.php; } location ~ \.(shtml|php|inc)$ { include /usr/local/nginx/conf/fastcgi-php.conf; fastcgi_pass 127.0.0.1:10004; } location ^~ /myfacebookapp/ { fastcgi_intercept_errors on; include /usr/local/nginx/conf/fastcgi-php.conf; fastcgi_pass 127.0.0.1:10004; fastcgi_param HTTPS on; } location ^~ /subdir2/ { index index.php; fastcgi_intercept_errors on; include /usr/local/nginx/conf/fastcgi-php.conf; fastcgi_pass 127.0.0.1:10004; fastcgi_index index.php; fastcgi_param HTTPS on; } location ^~ /subdir3/ { fastcgi_intercept_errors on; include /usr/local/nginx/conf/fastcgi-php.conf; fastcgi_pass 127.0.0.1:10004; fastcgi_param HTTPS on; auth_basic "example"; auth_basic_user_file /usr/local/apache/passwd/passwords; } location /subdir4/ { index index.shtml index.php index.html; auth_basic "example"; auth_basic_user_file /usr/local/apache/passwd/passwords; } location /subdir5/ { index index.html; auth_basic "example"; auth_basic_user_file /usr/local/apache/passwd/passwords; } location ~* ^.+\.(png|gif)$ { expires off; } # serve static files directly location ~* ^.+.(css|gif|jpe?g|bmp|js|png|ico)$ { expires 30d; } } From mdounin at mdounin.ru Sat Sep 3 08:44:45 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 3 Sep 2011 12:44:45 +0400 Subject: How to take full advantage system memory? In-Reply-To: <3ece42c4e2934ac2dd6110e6c3b00432.NginxMailingListEnglish@forum.nginx.org> References: <3ece42c4e2934ac2dd6110e6c3b00432.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110903084444.GN1137@mdounin.ru> Hello! On Fri, Sep 02, 2011 at 08:36:31PM -0400, allegro wrote: > Hi,All: > > My host have a very large physical memory, how to get nginx take > full advantage of memory as the file system cache? It's up to your OS to use memory as file system cache. Depending on your OS you may need to tune something, see your OS tuning guides for details. In nginx you may want to tune various buffer sizes if you have enough memory, e.g. output_buffers, proxy_buffers, fastcgi_buffers and so on. This is not about file system cache, but may reduce disk load if properly tuned for your typical use pattern. Maxim Dounin From nginx-forum at nginx.us Sat Sep 3 08:49:56 2011 From: nginx-forum at nginx.us (magicbear) Date: Sat, 03 Sep 2011 04:49:56 -0400 Subject: Storing URI in a cookie In-Reply-To: References: Message-ID: <212564c9ef34b2933c9f8d7c91b1bc83.NginxMailingListEnglish@forum.nginx.org> may try this: add_header Set-Cookie "uri=$uri; path=/"; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214665,214675#msg-214675 From nginx-forum at nginx.us Sat Sep 3 09:02:39 2011 From: nginx-forum at nginx.us (Samael) Date: Sat, 03 Sep 2011 05:02:39 -0400 Subject: Strange directory behaviour: rename causes 404 error In-Reply-To: <86f14be754becd175c07a61f1db101ba.NginxMailingListEnglish@forum.nginx.org> References: <86f14be754becd175c07a61f1db101ba.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6f364f206a797a344011329e8ca022fd.NginxMailingListEnglish@forum.nginx.org> Xan, I suggest you take a look at this link - https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214663,214676#msg-214676 From calin.don at gmail.com Sat Sep 3 09:04:50 2011 From: calin.don at gmail.com (Calin Don) Date: Sat, 3 Sep 2011 12:04:50 +0300 Subject: Storing URI in a cookie In-Reply-To: References: Message-ID: A better way to redirect users is to store the uri in the redirection url. Storing it in a cookie causes problems if user opens two different tabs with two different uris for example. On Sep 2, 2011 11:42 PM, "Rami Essaid" wrote: > I dont know why I am struggling with this so much but I need a bit of help. > I am trying to redirect users to a verification page and then back to their > original requested URI but because of the rewrite I lose both the $uri and > $request_uri variables. I figure the easiest way to solve this problem is > to store the original URI in a cookie and read it from that after the > verification page. I cant seem to store the cookie correctly and read it > back. Can anyone provide some direction? Also, is there any risk that by > doing this I disrupt other cookies being stored by my application? > > Thanks! > > Rami -------------- next part -------------- An HTML attachment was scrubbed... URL: From ianevans at digitalhit.com Sat Sep 3 09:20:30 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sat, 03 Sep 2011 05:20:30 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: <4E61E297.1070506@digitalhit.com> References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> Message-ID: <4E61F15E.7040808@digitalhit.com> still expermineting...just looked at the debug log. Even if I change the location to location = /myfacebookapp a call to myfacebookapp still isn't matching the location. Really don't get what's happening here. Why are my other ssl locations working? From calin.don at gmail.com Sat Sep 3 09:23:57 2011 From: calin.don at gmail.com (Calin Don) Date: Sat, 3 Sep 2011 12:23:57 +0300 Subject: SSL location keep redirecting to non-SSL In-Reply-To: <4E61E297.1070506@digitalhit.com> References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> Message-ID: You should set a serverwide index directive. You should move index index.shtml index.php; from location / {} to server {} Also your rewrite rule rewrite ^(.+) http://www.example.com$1 permanent; sould be rewritten into rewrite ^ http://www.example.com$request_uri? permanent; Take a look at http://wiki.nginx.org/Pitfalls On Sat, Sep 3, 2011 at 11:17, Ian Evans wrote: > Been scratching my head on this one all night. > > Been working on it a bit and now if I go to: > https://www.example.com/**myfacebookapp/index.shtmlthe page loads but > https://www.example.com/**myfacebookappis tossing a 404 > > I'm really boggled here because the other subdirs are woring and the only > difference is they're password protected. > > Here's the full ssl server conf section: > > server { > server_name www.example.com; > listen 443; > root /usr/local/apache/htdocs/; > > ssl on; > ssl_certificate /usr/local/apache/conf/server.**pem; > ssl_certificate_key /usr/local/apache/conf/server.**key; > ssl_session_timeout 5m; > error_page 404 /dhe404.shtml; > > location / { > rewrite ^(.+) http://www.example.com$1 permanent; > > index index.shtml index.php; > } > > location ~ \.(shtml|php|inc)$ { > include /usr/local/nginx/conf/fastcgi-**php.conf; > fastcgi_pass 127.0.0.1:10004; > } > > location ^~ /myfacebookapp/ { > > fastcgi_intercept_errors on; > include /usr/local/nginx/conf/fastcgi-**php.conf; > fastcgi_pass 127.0.0.1:10004; > fastcgi_param HTTPS on; > } > > location ^~ /subdir2/ { > index index.php; > > fastcgi_intercept_errors on; > include /usr/local/nginx/conf/fastcgi-**php.conf; > fastcgi_pass 127.0.0.1:10004; > fastcgi_index index.php; > fastcgi_param HTTPS on; > } > > location ^~ /subdir3/ { > > fastcgi_intercept_errors on; > include /usr/local/nginx/conf/fastcgi-**php.conf; > fastcgi_pass 127.0.0.1:10004; > fastcgi_param HTTPS on; > auth_basic "example"; > auth_basic_user_file /usr/local/apache/passwd/**passwords; > } > > location /subdir4/ { > index index.shtml index.php index.html; > auth_basic "example"; > auth_basic_user_file /usr/local/apache/passwd/**passwords; > } > > location /subdir5/ { > index index.html; > auth_basic "example"; > auth_basic_user_file /usr/local/apache/passwd/**passwords; > } > > location ~* ^.+\.(png|gif)$ { > expires off; > } > > # serve static files directly > location ~* ^.+.(css|gif|jpe?g|bmp|js|png|**ico)$ { > expires 30d; > > } > > } > > > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ianevans at digitalhit.com Sat Sep 3 09:34:57 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sat, 03 Sep 2011 05:34:57 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> Message-ID: <4E61F4C1.6000103@digitalhit.com> On 03/09/2011 5:23 AM, Calin Don wrote: > You should set a serverwide index directive. You should move index > index.shtml index.php; from location / {} to server {} > > Also your rewrite rule rewrite ^(.+) http://www.example.com > $1 permanent; sould be rewritten into rewrite ^ > http://www.example.com $request_uri? permanent; Made your suggested changes. After doing so tested location = /myfacebookapp which redirected to http, not what I want and location ~ /myfacebookapp which tossed a 404...also not what I want. 5:34 am...argh. :-) From drdr.xp at gmail.com Sat Sep 3 09:46:39 2011 From: drdr.xp at gmail.com (dr-dr xp) Date: Sat, 3 Sep 2011 17:46:39 +0800 Subject: nginx 1.0.2 AIO problem with open_file_cache Message-ID: Hello everybody. I recently have had some problem with AIO support and need some help or advice on it. With AIO on, everything was OK. But when I enabled open_file_cache, nginx frequently closed client connection directly without sending back any data. My platform is linux 2.6.30. CentOS 5.4; The nginx server that has this issue serves static file at backend. Another nginx serves as proxy in front of it. Backend nginx config is like this: ... aio on; directio 512; output_buffers 1 128k; ... location /files { internal; alias /; open_file_cache max=50000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 1; open_file_cache_errors on; With this config, on the frontend proxy server there are error logs like this: 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely closed connection while reading response header from upstream*, client: 221.193.212.77, server: , request: "GET .......... HTTP/1.1", upstream: "http://**/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", host..... And I saw in tcpdump output the connection was closed very quickly by backend nginx: 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S 1788188296:1788188296(0) win 5840 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S 350810413:350810413(0) ack 1788188297 win 5792 172.16.228.63.irdmi: . ack 1 win 46 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P 1:181(180) ack 1 win 46 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 181 win 54 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F 1:1(0) ack 181 win 54 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F 181:181(0) ack 2 win 46 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 182 win 54 On the backend nginx, strace shows that io_getevents got an error *"-22" EINVAL*. [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, u64=139850875540289}}}, 512, 5672) = 1 [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved Perman"..., 4096, 0, NULL, NULL) = 256 [pid 5275] close(201) = 0 [pid 5275] stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", {st_mode=S_IFREG|0600, st_size=122507, ...< [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, 40}}) = 1 [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, 512, 5671) = 1 [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, 0xf436d8, -22, 0}}, {0, 0}) = 1* [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) = 338 [pid 5275] close(48) And access.log shows that response length is ZERO: [03/Sep/2011:06:28:48 +0800] "GET /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- After I removed those *open_file_cache* directives, No such error occurred. And the shorter *inactive* is, the more often I get such errors. Anybody has idea about avoiding this or fixing it? -- ???????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sat Sep 3 10:03:36 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 3 Sep 2011 14:03:36 +0400 Subject: nginx 1.0.2 AIO problem with open_file_cache In-Reply-To: References: Message-ID: <20110903100335.GO1137@mdounin.ru> Hello! On Sat, Sep 03, 2011 at 05:46:39PM +0800, dr-dr xp wrote: > Hello everybody. I recently have had some problem with AIO support and need > some help or advice on it. > > With AIO on, everything was OK. But when I enabled open_file_cache, nginx > frequently closed client connection directly without sending back any data. > > > My platform is linux 2.6.30. CentOS 5.4; > > The nginx server that has this issue serves static file at backend. Another > nginx serves as proxy in front of it. > Backend nginx config is like this: > ... > aio on; > > > directio 512; > > > output_buffers 1 128k; > ... > location /files { > > > > internal; > > > alias /; > open_file_cache max=50000 inactive=20s; > > > open_file_cache_valid 30s; > > > open_file_cache_min_uses 1; > > > open_file_cache_errors on; > > > With this config, on the frontend proxy server there are error logs like > this: > > 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely closed > connection while reading response header from upstream*, client: > 221.193.212.77, server: , request: "GET .......... HTTP/1.1", upstream: > "http://**/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", > host..... > > > And I saw in tcpdump output the connection was closed very quickly by > backend nginx: > > 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S > 1788188296:1788188296(0) win 5840 0,nop,wscale 7> > 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S > 350810413:350810413(0) ack 1788188297 win 5792 1948226601 66< > 22:02:22.895695 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: . ack 1 win 46 > > 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P 1:181(180) > ack 1 win 46 > 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 181 win > 54 > 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F 1:1(0) ack > 181 win 54 > 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F 181:181(0) > ack 2 win 46 > 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 182 win > 54 > > > On the backend nginx, strace shows that io_getevents got an error *"-22" > EINVAL*. > > [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN (Resource > temporarily unavailable) > [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, > u64=139850875540289}}}, 512, 5672) = 1 > [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved Perman"..., > 4096, 0, NULL, NULL) = 256 > [pid 5275] close(201) = 0 > [pid 5275] > stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", > {st_mode=S_IFREG|0600, st_size=122507, ...< > [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, 40}}) = 1 > > > [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, 512, > 5671) = 1 > > [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 > [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, 0xf436d8, > -22, 0}}, {0, 0}) = 1* > [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) = 338 > [pid 5275] close(48) > > And access.log shows that response length is ZERO: > > [03/Sep/2011:06:28:48 +0800] "GET > /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 > HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- > > > After I removed those *open_file_cache* directives, No such error occurred. > > And the shorter *inactive* is, the more often I get such errors. > > > Anybody has idea about avoiding this or fixing it? Could you please provide debug log? See http://wiki.nginx.org/Debugging for more information. Additionally, some more info about file requested might be helpful: how big it is? whether it changed on backend during requests? if yes, is it changed atomically? Maxim Dounin From stef at caunter.ca Sat Sep 3 10:14:07 2011 From: stef at caunter.ca (Stefan Caunter) Date: Sat, 3 Sep 2011 06:14:07 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: <4E61E297.1070506@digitalhit.com> References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> Message-ID: On Sat, Sep 3, 2011 at 4:17 AM, Ian Evans wrote: > Been scratching my head on this one all night. > > Been working on it a bit and now if I go to: > https://www.example.com/myfacebookapp/index.shtml the page loads but > https://www.example.com/myfacebookapp is tossing a 404 > > I'm really boggled here because the other subdirs are woring and the only > difference is they're password protected. > > Here's the full ssl server conf section: > > server { > server_name www.example.com; > listen 443; > root /usr/local/apache/htdocs/; > > ssl on; > ssl_certificate /usr/local/apache/conf/server.pem; > ssl_certificate_key /usr/local/apache/conf/server.key; > ssl_session_timeout 5m; > error_page 404 /dhe404.shtml; > > location / { > rewrite ^(.+) http://www.example.com$1 permanent; > index index.shtml index.php; > } This looks odd to me, I've never seen a rewrite in an ssl config. It will complicate things. Leave the index to the server config, and take out the location / rewrite. Simplify. Get the general app working, and then apply specialized rules for directories and urls. Remember, if you have told nginx to do something that it *can* do, the logs won't show much except that it's doing what it's been told. > > location ~ \.(shtml|php|inc)$ { > include /usr/local/nginx/conf/fastcgi-php.conf; > fastcgi_pass 127.0.0.1:10004; > } > > location ^~ /myfacebookapp/ { > fastcgi_intercept_errors on; > include /usr/local/nginx/conf/fastcgi-php.conf; > fastcgi_pass 127.0.0.1:10004; > fastcgi_param HTTPS on; > } > > location ^~ /subdir2/ { > index index.php; > fastcgi_intercept_errors on; > include /usr/local/nginx/conf/fastcgi-php.conf; > fastcgi_pass 127.0.0.1:10004; > fastcgi_index index.php; > fastcgi_param HTTPS on; > } > > location ^~ /subdir3/ { > fastcgi_intercept_errors on; > include /usr/local/nginx/conf/fastcgi-php.conf; > fastcgi_pass 127.0.0.1:10004; > fastcgi_param HTTPS on; > auth_basic "example"; > auth_basic_user_file /usr/local/apache/passwd/passwords; > } > > location /subdir4/ { > index index.shtml index.php index.html; > auth_basic "example"; > auth_basic_user_file /usr/local/apache/passwd/passwords; > } > > location /subdir5/ { > index index.html; > auth_basic "example"; > auth_basic_user_file /usr/local/apache/passwd/passwords; > } > > location ~* ^.+\.(png|gif)$ { > expires off; > } > > # serve static files directly > location ~* ^.+.(css|gif|jpe?g|bmp|js|png|ico)$ { > expires 30d; > } > > } > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From ianevans at digitalhit.com Sat Sep 3 10:18:23 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sat, 03 Sep 2011 06:18:23 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> Message-ID: <4E61FEEF.6020206@digitalhit.com> On 03/09/2011 5:23 AM, Calin Don wrote: > Also your rewrite rule rewrite ^(.+) http://www.example.com > $1 permanent; sould be rewritten into rewrite ^ > http://www.example.com $request_uri? permanent; Just wondering...instead of a blanket redirect and then location that try to overide it, would it be better to have a rewrite that says "if not subdir1|subdir2|myfacebookapp rewrite to http". Then locations for those subdirs if they require passwords, etc. How would I do the if not subdir1|subdir2|myfacebookapp rewrite to http check? From mat999 at gmail.com Sat Sep 3 10:22:06 2011 From: mat999 at gmail.com (SplitIce) Date: Sat, 3 Sep 2011 20:22:06 +1000 Subject: URL decode rewrite handling: + vs. %20 In-Reply-To: <2f879159200e58c32a5b1eb6b3d01cef.NginxMailingListEnglish@forum.nginx.org> References: <2f879159200e58c32a5b1eb6b3d01cef.NginxMailingListEnglish@forum.nginx.org> Message-ID: edit the php script to do something like this before the rest of the script $_GET['g2_path'] = urldecode($_GET['g2_path']) ? On Sat, Sep 3, 2011 at 11:21 AM, signe wrote: > Ubuntu Natty > nginx/0.8.54 > PHP 5.3.5 / FPM / FastCGI > > I'm just beginning to work with nginx for the first time. Converting my > home server (very few hits) as an experiment for possible broader-scale > testing and implementation on work servers (billions of hits per > month). > > Everything has gone beautifully... up until I begin working on an older > app: Gallery 2. Some of the photos in my Gallery contain spaces, so > they're being encoded in the old-but-still-accepted + format. However, > when I make the requests in nginx, it's passing the pathinfo through to > fastcgi as an escaped + (%2b) instead of a space (+ or %20). > > The path is something like this: > > http://www.example.com/gallery/foo+bar.jpg.html > which gets rewritten to > http://www.example.com/gallery/main.php?g2_path=foo+bar.jpg.html > > In a path, + should be handled literally per RFC. In a query string, > it's supposed to be interpreted as a space per x-www-form-urlencoded. > This is the disparity - what once was path is now query string. Because > of the conversion, Apache translates the + from literal string to > encoded space during rewrite. nginx simply encodes the literal string. > > I don't know if there's a solid answer as to which one is strictly > "correct"... but what I do need to know is if there's a way to achieve > the same behavior in nginx? > > This is an interesting edge case... > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,214668,214668#msg-214668 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ianevans at digitalhit.com Sat Sep 3 10:24:59 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sat, 03 Sep 2011 06:24:59 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> Message-ID: <4E62007B.6010601@digitalhit.com> On 03/09/2011 6:14 AM, Stefan Caunter wrote: > > This looks odd to me, I've never seen a rewrite in an ssl config. It > will complicate things. > > Leave the index to the server config, and take out the location / rewrite. > > Simplify. Stefan, The only reason I had the rewrite in there (and I think it was recommended to me years ago) was to prevent people or bots from calling the non-ssl directories of the site with https and creating duplicates in Google, etc. e.g. calling http://www.example.com/ and https://www.example.com/ when my homepage doesn't need https. I only needs https calls on my phpMyAdmin, webmail, facebookapp and site admin subdirectories. I just wrote another email in the thread asking if I should only do a rewrite if it's NOT those directories. From nginx-forum at nginx.us Sat Sep 3 10:32:29 2011 From: nginx-forum at nginx.us (signe) Date: Sat, 03 Sep 2011 06:32:29 -0400 Subject: URL decode rewrite handling: + vs. %20 In-Reply-To: References: Message-ID: <5e2ad7736ec3f420b7f1992a428e6969.NginxMailingListEnglish@forum.nginx.org> splitice Wrote: ------------------------------------------------------- > edit the php script to do something like this > before the rest of the script > > $_GET['g2_path'] = urldecode($_GET['g2_path']) > > ? That's not the problem - query parameters are automatically decoded by PHP before processing even begins. nginx is turning a + (space) into a %2b (plus). Once it's handed off to the application, it can't tell the difference between a filename that actually had a +, and one that was converted by nginx. It needs to happen before it's handed off to fastcgi. I've already modified G2 to present URLs which are more accurately encoded, but that doesn't resolve the issue since these URLs have been published for years. They're in search engines, blog posts, etc. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214668,214687#msg-214687 From nginx-forum at nginx.us Sat Sep 3 14:10:10 2011 From: nginx-forum at nginx.us (Xan) Date: Sat, 03 Sep 2011 10:10:10 -0400 Subject: SOLVED Strange directory behaviour: rename causes 404 error In-Reply-To: <43d7cb0d9aef0ebb36575cfad40c285c.NginxMailingListEnglish@forum.nginx.org> References: <86f14be754becd175c07a61f1db101ba.NginxMailingListEnglish@forum.nginx.org> <43d7cb0d9aef0ebb36575cfad40c285c.NginxMailingListEnglish@forum.nginx.org> Message-ID: Report as bug [https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/840358] in ubuntu. @ Samael: thanks. Xan. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214663,214688#msg-214688 From rami.essaid at gmail.com Sat Sep 3 14:43:03 2011 From: rami.essaid at gmail.com (Rami Essaid) Date: Sat, 3 Sep 2011 10:43:03 -0400 Subject: Storing URI in a cookie In-Reply-To: References: Message-ID: Thanks guys for the suggestions. @calin - I have tried doing that but it messes with the verification page and am not sure how to implement it correctly. @Magicbear - I have put that code in there before the rewrite but then after the rewrite when I try to access that cookie it is not there. I should have been a little more clear on what I have tried and my config. Here is the flow of the rewirte. location / { error_page 503 = @recaptcha; if ($verifyvariable) { return 503; } } location @recaptcha { add_header Set-Cookie "originrequest=$request_uri path=/ expires=2m"; secure_cookie $cookie_CAPTCHA_SESSION,$cookie_CAPTCHA_EXPIRES; rewrite ^ /captcha.html redirect; } location = /captcha.html { #this has a form that submits information and goes to /verify } location = /verify { eval_inherit_body on; eval_override_content_type 'text/plain'; eval $verify_content { proxy_method POST; proxy_set_header Accept-Encoding ""; proxy_set_body ; rewrite .* /recaptcha/api/verify break; proxy_pass 'http://www.google.com'; } if ($verify_content ~* ^true[\s\R]*(.*)) { set $error_code $1; rewrite .* /set_secure_cookie last; } } location = /set_secure_cookie { internal; ## SETTING rewrite ^ /$cookie_ originrequest redirect; } On Sat, Sep 3, 2011 at 5:04 AM, Calin Don wrote: > A better way to redirect users is to store the uri in the redirection url. > Storing it in a cookie causes problems if user opens two different tabs with > two different uris for example. > On Sep 2, 2011 11:42 PM, "Rami Essaid" wrote: > > I dont know why I am struggling with this so much but I need a bit of > help. > > I am trying to redirect users to a verification page and then back to > their > > original requested URI but because of the rewrite I lose both the $uri > and > > $request_uri variables. I figure the easiest way to solve this problem is > > to store the original URI in a cookie and read it from that after the > > verification page. I cant seem to store the cookie correctly and read it > > back. Can anyone provide some direction? Also, is there any risk that by > > doing this I disrupt other cookies being stored by my application? > > > > Thanks! > > > > Rami > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdr.xp at gmail.com Sat Sep 3 15:06:24 2011 From: drdr.xp at gmail.com (dr-dr xp) Date: Sat, 3 Sep 2011 23:06:24 +0800 Subject: nginx 1.0.2 AIO problem with open_file_cache In-Reply-To: <20110903100335.GO1137@mdounin.ru> References: <20110903100335.GO1137@mdounin.ru> Message-ID: The attachment is the error.log with only the failed request. And stat output of this file: stat //data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235 File: `//data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235' Size: 51163499 Blocks: 100048 IO Block: 4096 regular file Device: 821h/2081d Inode: 464404482 Links: 1 Access: (0664/-rw-rw-r--) Uid: ( 1003/ www) Gid: ( 1003/ www) Access: 2011-09-03 22:31:22.000000000 +0800 Modify: 2011-07-30 01:45:56.000000000 +0800 Change: 2011-07-30 01:45:56.000000000 +0800 Such error occurs randomly on random file. The only relavent thing seems like to be open_file_cache directive. File sizes are almost 5M to 20M. Files had not been changed. I checked the modify time of the files involved in these errors. At first I had thought it was caused by a file change too. But not. In my cluster there are also some other similar nodes running with the same open_file_cache parameters but without aio enabled(sendfile is used). They have no such issue. On Sat, Sep 3, 2011 at 6:03 PM, Maxim Dounin wrote: > Hello! > > On Sat, Sep 03, 2011 at 05:46:39PM +0800, dr-dr xp wrote: > > > Hello everybody. I recently have had some problem with AIO support and > need > > some help or advice on it. > > > > With AIO on, everything was OK. But when I enabled open_file_cache, nginx > > frequently closed client connection directly without sending back any > data. > > > > > > My platform is linux 2.6.30. CentOS 5.4; > > > > The nginx server that has this issue serves static file at backend. > Another > > nginx serves as proxy in front of it. > > Backend nginx config is like this: > > ... > > aio on; > > > > > > directio 512; > > > > > > output_buffers 1 128k; > > ... > > location /files { > > > > > > > > internal; > > > > > > alias /; > > open_file_cache max=50000 inactive=20s; > > > > > > open_file_cache_valid 30s; > > > > > > open_file_cache_min_uses 1; > > > > > > open_file_cache_errors on; > > > > > > With this config, on the frontend proxy server there are error logs like > > this: > > > > 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely > closed > > connection while reading response header from upstream*, client: > > 221.193.212.77, server: , request: "GET .......... HTTP/1.1", upstream: > > "http:// > **/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", > > host..... > > > > > > And I saw in tcpdump output the connection was closed very quickly by > > backend nginx: > > > > 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S > > 1788188296:1788188296(0) win 5840 > 0,nop,wscale 7> > > 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S > > 350810413:350810413(0) ack 1788188297 win 5792 > 1948226601 66< > > 22:02:22.895695 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: . ack 1 win > 46 > > > > 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P > 1:181(180) > > ack 1 win 46 > > 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 181 > win > > 54 > > 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F 1:1(0) > ack > > 181 win 54 > > 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F > 181:181(0) > > ack 2 win 46 > > 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 182 > win > > 54 > > > > > > On the backend nginx, strace shows that io_getevents got an error *"-22" > > EINVAL*. > > > > [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN > (Resource > > temporarily unavailable) > > [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, > > u64=139850875540289}}}, 512, 5672) = 1 > > [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved > Perman"..., > > 4096, 0, NULL, NULL) = 256 > > [pid 5275] close(201) = 0 > > [pid 5275] > > > stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", > > {st_mode=S_IFREG|0600, st_size=122507, ...< > > [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, 40}}) = > 1 > > > > > > [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, 512, > > 5671) = 1 > > > > [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 > > [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, 0xf436d8, > > -22, 0}}, {0, 0}) = 1* > > [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) = > 338 > > [pid 5275] close(48) > > > > And access.log shows that response length is ZERO: > > > > [03/Sep/2011:06:28:48 +0800] "GET > > > /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 > > HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- > > > > > > After I removed those *open_file_cache* directives, No such error > occurred. > > > > And the shorter *inactive* is, the more often I get such errors. > > > > > > Anybody has idea about avoiding this or fixing it? > > Could you please provide debug log? See > http://wiki.nginx.org/Debugging for more information. > > Additionally, some more info about file requested might be > helpful: how big it is? whether it changed on backend during > requests? if yes, is it changed atomically? > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- ???????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: error.log Type: application/octet-stream Size: 18946 bytes Desc: not available URL: From drdr.xp at gmail.com Sat Sep 3 15:10:03 2011 From: drdr.xp at gmail.com (dr-dr xp) Date: Sat, 3 Sep 2011 23:10:03 +0800 Subject: nginx 1.0.2 AIO problem with open_file_cache In-Reply-To: References: <20110903100335.GO1137@mdounin.ru> Message-ID: And this is the access log entry: 172.16.113.32 - - 172.16.228.63:8000 [03/Sep/2011:22:43:44 +0800] "GET /file/0d97e01d7fbc48e498897492f0863929/260674/26fd3732cd9f92f2413d10206cd8b0c9-5157235 HTTP/1.0" 206 0 0.002 "-" "-" "-" Range:bytes=1059980- usTime:0.001 us:unix:/tmp/storage_fcgi_sock RID:0000052a-1109-0322-4344-842b2b0c0467 ERR:- ReqLength:171 ReqBody:- COOKIE:"-" 0000052a is connection id in hex. 2011/9/3 dr-dr xp > The attachment is the error.log with only the failed request. And stat > output of this file: > > stat > //data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235 > File: > `//data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235' > Size: 51163499 Blocks: 100048 IO Block: 4096 regular file > Device: 821h/2081d Inode: 464404482 Links: 1 > Access: (0664/-rw-rw-r--) Uid: ( 1003/ www) Gid: ( 1003/ > www) > Access: 2011-09-03 22:31:22.000000000 +0800 > Modify: 2011-07-30 01:45:56.000000000 +0800 > Change: 2011-07-30 01:45:56.000000000 +0800 > > > Such error occurs randomly on random file. The only relavent thing seems > like to be open_file_cache directive. > File sizes are almost 5M to 20M. > Files had not been changed. I checked the modify time of the files involved > in these errors. At first I had thought it was caused by a file change too. > But not. > > In my cluster there are also some other similar nodes running with the same > open_file_cache parameters but without aio enabled(sendfile is used). They > have no such issue. > > > > > On Sat, Sep 3, 2011 at 6:03 PM, Maxim Dounin wrote: > >> Hello! >> >> On Sat, Sep 03, 2011 at 05:46:39PM +0800, dr-dr xp wrote: >> >> > Hello everybody. I recently have had some problem with AIO support and >> need >> > some help or advice on it. >> > >> > With AIO on, everything was OK. But when I enabled open_file_cache, >> nginx >> > frequently closed client connection directly without sending back any >> data. >> > >> > >> > My platform is linux 2.6.30. CentOS 5.4; >> > >> > The nginx server that has this issue serves static file at backend. >> Another >> > nginx serves as proxy in front of it. >> > Backend nginx config is like this: >> > ... >> > aio on; >> > >> > >> > directio 512; >> > >> > >> > output_buffers 1 128k; >> > ... >> > location /files { >> > >> > >> > >> > internal; >> > >> > >> > alias /; >> > open_file_cache max=50000 inactive=20s; >> > >> > >> > open_file_cache_valid 30s; >> > >> > >> > open_file_cache_min_uses 1; >> > >> > >> > open_file_cache_errors on; >> > >> > >> > With this config, on the frontend proxy server there are error logs like >> > this: >> > >> > 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely >> closed >> > connection while reading response header from upstream*, client: >> > 221.193.212.77, server: , request: "GET .......... HTTP/1.1", upstream: >> > "http:// >> **/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", >> > host..... >> > >> > >> > And I saw in tcpdump output the connection was closed very quickly by >> > backend nginx: >> > >> > 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S >> > 1788188296:1788188296(0) win 5840 > > 0,nop,wscale 7> >> > 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S >> > 350810413:350810413(0) ack 1788188297 win 5792 > 1460,sackOK,timestamp >> > 1948226601 66< >> > 22:02:22.895695 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: . ack 1 >> win 46 >> > >> > 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P >> 1:181(180) >> > ack 1 win 46 >> > 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 181 >> win >> > 54 >> > 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F 1:1(0) >> ack >> > 181 win 54 >> > 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F >> 181:181(0) >> > ack 2 win 46 >> > 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 182 >> win >> > 54 >> > >> > >> > On the backend nginx, strace shows that io_getevents got an error *"-22" >> > EINVAL*. >> > >> > [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN >> (Resource >> > temporarily unavailable) >> > [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, >> > u64=139850875540289}}}, 512, 5672) = 1 >> > [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved >> Perman"..., >> > 4096, 0, NULL, NULL) = 256 >> > [pid 5275] close(201) = 0 >> > [pid 5275] >> > >> stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", >> > {st_mode=S_IFREG|0600, st_size=122507, ...< >> > [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, 40}}) = >> 1 >> > >> > >> > [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, >> 512, >> > 5671) = 1 >> > >> > [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 >> > [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, >> 0xf436d8, >> > -22, 0}}, {0, 0}) = 1* >> > [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) = >> 338 >> > [pid 5275] close(48) >> > >> > And access.log shows that response length is ZERO: >> > >> > [03/Sep/2011:06:28:48 +0800] "GET >> > >> /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 >> > HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- >> > >> > >> > After I removed those *open_file_cache* directives, No such error >> occurred. >> > >> > And the shorter *inactive* is, the more often I get such errors. >> > >> > >> > Anybody has idea about avoiding this or fixing it? >> >> Could you please provide debug log? See >> http://wiki.nginx.org/Debugging for more information. >> >> Additionally, some more info about file requested might be >> helpful: how big it is? whether it changed on backend during >> requests? if yes, is it changed atomically? >> >> Maxim Dounin >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > > -- > ???????????????? > -- ???????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From calin at presslabs.com Sat Sep 3 14:11:07 2011 From: calin at presslabs.com (Calin Don) Date: Sat, 3 Sep 2011 17:11:07 +0300 Subject: Performance of map directive Message-ID: Hi, I understood that if you have only strings in a map directive the access time is O(1). What if you have the hostnames directive enabled and some of the items are in the format *.example.com? What about if you mix with regular expressions? Thanks, Calin -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Sat Sep 3 15:50:20 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 3 Sep 2011 19:50:20 +0400 Subject: Performance of map directive In-Reply-To: References: Message-ID: <20110903155020.GB86123@nginx.com> On Sat, Sep 03, 2011 at 05:11:07PM +0300, Calin Don wrote: > Hi, > > I understood that if you have only strings in a map directive the access > time is O(1). Yes. > What if you have the hostnames directive enabled and some of the items are > in the format *.example.com? nginx tests address by its parts, first "com", then "example". So access of the operation varies from O(1) to O(N) where N is number of parts of longest name. For example, if you test example.net only against *.example.com *.sub.domain.com then this will be O(1). If you test www.sub.domain.com, it will be O(3). > What about if you mix with regular expressions? The regular expressions tested sequentially. nginx tests map in the following order: 1) exact names, 2) *.names, 3) names.*, 4) regexes. The first match stops the tesing. -- Igor Sysoev From ianevans at digitalhit.com Sat Sep 3 19:51:00 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sat, 03 Sep 2011 15:51:00 -0400 Subject: SSL location keep redirecting to non-SSL In-Reply-To: <4E62007B.6010601@digitalhit.com> References: <4E6179FF.7060209@digitalhit.com> <4E61E297.1070506@digitalhit.com> <4E62007B.6010601@digitalhit.com> Message-ID: <4E628524.1070409@digitalhit.com> After a few hours sleep, it appears that the location was missing: fastcgi_index index.shtml; Seems to work now. From nginx at nginxuser.net Sat Sep 3 21:02:34 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 4 Sep 2011 00:02:34 +0300 Subject: http_auth_request_module Instructions? Message-ID: Is the any documentation for the http_auth_request_module anywhere? Trying to find out what the configuration parameters are if any. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sat Sep 3 22:25:15 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 4 Sep 2011 02:25:15 +0400 Subject: http_auth_request_module Instructions? In-Reply-To: References: Message-ID: <20110903222515.GP1137@mdounin.ru> Hello! On Sun, Sep 04, 2011 at 12:02:34AM +0300, Nginx User wrote: > Is the any documentation for the http_auth_request_module anywhere? Trying > to find out what the configuration parameters are if any. Try README in the module tarball. Alternatively, you may find it here: http://mdounin.ru/hg/ngx_http_auth_request_module/file/tip/README Maxim Dounin From agentzh at gmail.com Sun Sep 4 05:22:24 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 4 Sep 2011 13:22:24 +0800 Subject: [ANN] The lua-rds-parser Lua library and ngx_rds_csv nginx module In-Reply-To: References: Message-ID: Hello! Recently I wrote a Lua C library named lua-rds-parser for the ngx_openresty [1] world that we can now efficiently parse Resty DBD Stream (RDS) formatted data generated by ngx_drizzle [2] and ngx_postgres [3] into Lua data structures without using JSON as the intermediate data format. This can save both CPU time and memory for web applications running atop ngx_lua [4]. Here is the project homepage for this Lua library: ? ?https://github.com/agentzh/lua-rds-parser Also, there's a new Nginx filter module named ngx_rds_csv that can convert RDS output into the Comma-Separated Values (CSV) format in a streaming fashion: ??? https://github.com/agentzh/rds-csv-nginx-module Both of these two components have already been included and enabled by default in the latest ngx_openresty stable release [5] :) Enjoy! -agentzh [1] http://openresty.org [2] http://wiki.nginx.org/HttpDrizzleModule [3] http://github.com/FRiCKLE/ngx_postgres/ [4] http://wiki.nginx.org/HttpLuaModule [5] http://openresty.org/#Download From sy.meteor at msn.com Sun Sep 4 04:33:14 2011 From: sy.meteor at msn.com (Xin Liu) Date: Sun, 4 Sep 2011 12:33:14 +0800 Subject: php-fpm is very very slow... Message-ID: Hi all, After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very slow. Even I tried to roll back to php 5.3.6, it still doen't work. And there are lots of errors in php-fpm.log, [04-Sep-2011 12:28:27] WARNING: [pool www] child 18793, script '/web/www/forum.php' (request: "GET /forum.php") executing too slow (60.073197 sec), logging [04-Sep-2011 12:28:27] WARNING: [pool www] child 18784, script '/web/www/forum.php' (request: "GET /forum.php") executing too slow (60.080807 sec), logging [04-Sep-2011 12:28:27] NOTICE: child 18793 stopped for tracing [04-Sep-2011 12:28:27] NOTICE: about to trace 18793 [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) [04-Sep-2011 12:28:27] NOTICE: finished trace of 18793 [04-Sep-2011 12:28:27] NOTICE: child 18784 stopped for tracing [04-Sep-2011 12:28:27] NOTICE: about to trace 18784 [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) [04-Sep-2011 12:28:27] NOTICE: finished trace of 18784 And in php-fpm.slow [04-Sep-2011 12:27:30] [pool www] pid 18622 script_filename = /web/www/forum.php [0x000000080455aaa8] mysql_query() /web/www/source/class/class_core.php:815 [0x000000080455a958] query() /web/www/source/class/class_core.php:1003 [0x000000080455a858] _execute() /web/www/source/class/class_core.php:977 [0x00000008045591a0] query() /web/www/source/module/forum/forum_viewthread.php:514 [0x0000000804559058] +++ dump failed And one can help me about this issue? My server is running Freebsd 8.1 + nginx + php 5.3.8 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at benweblife.fr Sun Sep 4 09:32:56 2011 From: ben at benweblife.fr (Ben) Date: Sun, 04 Sep 2011 11:32:56 +0200 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: <4E6345C8.7060800@benweblife.fr> Le 04/09/2011 06:33, Xin Liu a ?crit : > Hi all, Hi, > After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very > slow. Even I tried to roll back to php 5.3.6, it still doen't work. > And one can help me about this issue? PHP (and PHP-FPM) is not part of nginx, you should post your issue on PHP lists. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainer at ultra-secure.de Sun Sep 4 11:37:06 2011 From: rainer at ultra-secure.de (Rainer Duffner) Date: Sun, 4 Sep 2011 13:37:06 +0200 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: <20110904133706.31a42c4a@linux-0n9l.site.local> Am Sun, 4 Sep 2011 12:33:14 +0800 schrieb "Xin Liu" : > Hi all, > > After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very > slow. Even I tried to roll back to php 5.3.6, it still doen't work. ... > And one can help me about this issue? > My server is running Freebsd 8.1 + nginx + php 5.3.8 Haven't had that one. If this is a test-server, upgrade to 8.2 and recompile everything. (make a pkg_info list, then pkg_delete everything, even /usr/local/lib/compat/, then install the pkgs again, as per your list.) If this is a production-server, maybe it's time to have a test-server.... But I agree - it's most likely not a problem with NGINX. Would still be slow with apache... From edho at myconan.net Sun Sep 4 12:23:28 2011 From: edho at myconan.net (Edho P Arief) Date: Sun, 4 Sep 2011 19:23:28 +0700 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: 2011/9/4 Xin Liu : > Hi all, > > After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very slow. > Even I tried to roll back to php 5.3.6, it still doen't work. > > [0x000000080455aaa8] mysql_query() /web/www/source/class/class_core.php:815 > [0x000000080455a958] query() /web/www/source/class/class_core.php:1003 > [0x000000080455a858] _execute() /web/www/source/class/class_core.php:977 > [0x00000008045591a0] query() > /web/www/source/module/forum/forum_viewthread.php:514 > [0x0000000804559058] +++ dump failed looks like db issue. Try turning on your db's slow query logging to see which query slowed the page down. From quan.nexthop at gmail.com Sun Sep 4 15:51:31 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Sun, 4 Sep 2011 23:51:31 +0800 Subject: =?UTF-8?Q?upstream_configuration_is_changed=EF=BC=9FThe_keyword_=28weight/?= =?UTF-8?Q?max=5Ffail/fail=5Ftimeout=29_is_not_supported=3F?= Message-ID: Hi All? I met a configuation issue. the configuration is as following:?NGINX is V0.7.68) and upstream is enabled when compiled. I also test it in V1.0.5, the issue happens again. ---------------------------------------------------------------------------------------------------------------------------------------------- server { listen 80; server_name aaa.com; server_name 192.168.2.140; location / { proxy_pass http://haha; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 1000m; client_body_buffer_size 256k; proxy_connect_timeout 600; proxy_temp_file_write_size 64k; } } upstream haha { server 1.1.1.2 max_fails=3 fail_timeout=30s; <---------max_fails/fail_timeouts/weight is not support ? server 1.1.1.1 weight=10; } ---------------------------------------------------------------------------------------------------------------------------------------------- When I run nginx, the error message print out as following: ./nginx Root# /etc/init.d/nginx restart [emerg]: invalid parameter "max_fails=3" in /var/log/nginx/conf/nginx.conf:19 ~ ~ ~ ~ -------------- next part -------------- An HTML attachment was scrubbed... URL: From quan.nexthop at gmail.com Sun Sep 4 15:52:39 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Sun, 4 Sep 2011 23:52:39 +0800 Subject: [ANN] The lua-rds-parser Lua library and ngx_rds_csv nginx module In-Reply-To: References: Message-ID: Thanks your share with us. george On Sun, Sep 4, 2011 at 1:22 PM, agentzh wrote: > Hello! > > Recently I wrote a Lua C library named lua-rds-parser for the > ngx_openresty [1] world that we can now efficiently parse Resty DBD > Stream (RDS) formatted data generated by ngx_drizzle [2] and > ngx_postgres [3] into Lua data structures without using JSON as the > intermediate data format. This can save both CPU time and memory for > web applications running atop ngx_lua [4]. > > Here is the project homepage for this Lua library: > > https://github.com/agentzh/lua-rds-parser > > Also, there's a new Nginx filter module named ngx_rds_csv that can > convert RDS output into the Comma-Separated Values (CSV) format in a > streaming fashion: > > https://github.com/agentzh/rds-csv-nginx-module > > Both of these two components have already been included and enabled by > default in the latest ngx_openresty stable release [5] :) > > Enjoy! > -agentzh > > [1] http://openresty.org > [2] http://wiki.nginx.org/HttpDrizzleModule > [3] http://github.com/FRiCKLE/ngx_postgres/ > [4] http://wiki.nginx.org/HttpLuaModule > [5] http://openresty.org/#Download > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sun Sep 4 16:34:13 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 4 Sep 2011 20:34:13 +0400 Subject: nginx 1.0.2 AIO problem with open_file_cache In-Reply-To: References: <20110903100335.GO1137@mdounin.ru> Message-ID: <20110904163413.GR1137@mdounin.ru> Hello! On Sat, Sep 03, 2011 at 11:06:24PM +0800, dr-dr xp wrote: > The attachment is the error.log with only the failed request. And stat > output of this file: > > stat > //data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235 > File: > `//data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235' > Size: 51163499 Blocks: 100048 IO Block: 4096 regular file > Device: 821h/2081d Inode: 464404482 Links: 1 > Access: (0664/-rw-rw-r--) Uid: ( 1003/ www) Gid: ( 1003/ www) > Access: 2011-09-03 22:31:22.000000000 +0800 > Modify: 2011-07-30 01:45:56.000000000 +0800 > Change: 2011-07-30 01:45:56.000000000 +0800 > > > Such error occurs randomly on random file. The only relavent thing seems > like to be open_file_cache directive. > File sizes are almost 5M to 20M. > Files had not been changed. I checked the modify time of the files involved > in these errors. At first I had thought it was caused by a file change too. > But not. > > In my cluster there are also some other similar nodes running with the same > open_file_cache parameters but without aio enabled(sendfile is used). They > have no such issue. Please try the attached patch. Maxim Dounin > > > > > On Sat, Sep 3, 2011 at 6:03 PM, Maxim Dounin wrote: > > > Hello! > > > > On Sat, Sep 03, 2011 at 05:46:39PM +0800, dr-dr xp wrote: > > > > > Hello everybody. I recently have had some problem with AIO support and > > need > > > some help or advice on it. > > > > > > With AIO on, everything was OK. But when I enabled open_file_cache, nginx > > > frequently closed client connection directly without sending back any > > data. > > > > > > > > > My platform is linux 2.6.30. CentOS 5.4; > > > > > > The nginx server that has this issue serves static file at backend. > > Another > > > nginx serves as proxy in front of it. > > > Backend nginx config is like this: > > > ... > > > aio on; > > > > > > > > > directio 512; > > > > > > > > > output_buffers 1 128k; > > > ... > > > location /files { > > > > > > > > > > > > internal; > > > > > > > > > alias /; > > > open_file_cache max=50000 inactive=20s; > > > > > > > > > open_file_cache_valid 30s; > > > > > > > > > open_file_cache_min_uses 1; > > > > > > > > > open_file_cache_errors on; > > > > > > > > > With this config, on the frontend proxy server there are error logs like > > > this: > > > > > > 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely > > closed > > > connection while reading response header from upstream*, client: > > > 221.193.212.77, server: , request: "GET .......... HTTP/1.1", upstream: > > > "http:// > > **/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", > > > host..... > > > > > > > > > And I saw in tcpdump output the connection was closed very quickly by > > > backend nginx: > > > > > > 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S > > > 1788188296:1788188296(0) win 5840 > > 0,nop,wscale 7> > > > 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S > > > 350810413:350810413(0) ack 1788188297 win 5792 > > 1948226601 66< > > > 22:02:22.895695 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: . ack 1 win > > 46 > > > > > > 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P > > 1:181(180) > > > ack 1 win 46 > > > 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 181 > > win > > > 54 > > > 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F 1:1(0) > > ack > > > 181 win 54 > > > 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F > > 181:181(0) > > > ack 2 win 46 > > > 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack 182 > > win > > > 54 > > > > > > > > > On the backend nginx, strace shows that io_getevents got an error *"-22" > > > EINVAL*. > > > > > > [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN > > (Resource > > > temporarily unavailable) > > > [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, > > > u64=139850875540289}}}, 512, 5672) = 1 > > > [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved > > Perman"..., > > > 4096, 0, NULL, NULL) = 256 > > > [pid 5275] close(201) = 0 > > > [pid 5275] > > > > > stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", > > > {st_mode=S_IFREG|0600, st_size=122507, ...< > > > [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, 40}}) = > > 1 > > > > > > > > > [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, 512, > > > 5671) = 1 > > > > > > [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 > > > [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, 0xf436d8, > > > -22, 0}}, {0, 0}) = 1* > > > [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) = > > 338 > > > [pid 5275] close(48) > > > > > > And access.log shows that response length is ZERO: > > > > > > [03/Sep/2011:06:28:48 +0800] "GET > > > > > /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 > > > HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- > > > > > > > > > After I removed those *open_file_cache* directives, No such error > > occurred. > > > > > > And the shorter *inactive* is, the more often I get such errors. > > > > > > > > > Anybody has idea about avoiding this or fixing it? > > > > Could you please provide debug log? See > > http://wiki.nginx.org/Debugging for more information. > > > > Additionally, some more info about file requested might be > > helpful: how big it is? whether it changed on backend during > > requests? if yes, is it changed atomically? > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > -- > ???????????????? > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- # HG changeset patch # User Maxim Dounin # Date 1315153882 0 # Node ID 16eaef9fbf7335a8ab02ce308799647b26bd11f9 # Parent 5d94f8b3e01d74ec6bd5bdcae176a8d3b998237d Bugfix: open_file_cache lost is_directio flag. On file retest open_file_cache lost is_directio if file wasn't changed. This caused unaligned operations under Linux to fail with EINVAL. It wasn't noticiable with AIO though, as errors wasn't properly logged. diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c --- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -290,6 +290,8 @@ ngx_open_cached_file(ngx_open_file_cache file->use_event = 1; } + of->is_directio = file->is_directio; + goto renew; } diff --git a/src/os/unix/ngx_file_aio_read.c b/src/os/unix/ngx_file_aio_read.c --- a/src/os/unix/ngx_file_aio_read.c +++ b/src/os/unix/ngx_file_aio_read.c @@ -86,6 +86,9 @@ ngx_file_aio_read(ngx_file_t *file, u_ch return aio->nbytes; } + ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno, + "aio read \"%s\" failed", file->name.data); + return NGX_ERROR; } diff --git a/src/os/unix/ngx_linux_aio_read.c b/src/os/unix/ngx_linux_aio_read.c --- a/src/os/unix/ngx_linux_aio_read.c +++ b/src/os/unix/ngx_linux_aio_read.c @@ -74,6 +74,10 @@ ngx_file_aio_read(ngx_file_t *file, u_ch } ngx_set_errno(-aio->res); + + ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno, + "aio read \"%s\" failed", file->name.data); + return NGX_ERROR; } From nginx at nginxuser.net Sun Sep 4 16:40:44 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 4 Sep 2011 19:40:44 +0300 Subject: http_auth_request_module Instructions? In-Reply-To: <20110903222515.GP1137@mdounin.ru> References: <20110903222515.GP1137@mdounin.ru> Message-ID: On Sun, Sep 4, 2011 at 1:25 AM, Maxim Dounin wrote: > Hello! > > On Sun, Sep 04, 2011 at 12:02:34AM +0300, Nginx User wrote: > > > Is the any documentation for the http_auth_request_module anywhere? > Trying > > to find out what the configuration parameters are if any. > > Try README in the module tarball. Alternatively, you may find it > here: > Hi Thanks for that. To clarify, My understanding of how this works is that when a request from a client (I'll call this "Client Request") hits Nginx, the module handler will spin off a request (I'll call this "Module Request") to a location where I would have arranged for authentication to occur. This can be auth basic etc or my own custom process. Assuming my own custom process, I should arrange for it to return status code "200" to allow access, status code "403" to deny access or status code "401" to ask for username and password (responding by 200, 403 or 401 as required). When the module receives a "200" code for the Module Request, it will pass the Client Request on through to the next normal stage of Nginx processing. If a "403" code is received, The user is sent the same and processing stops. Four queries: 1. Is my understanding of the process correct? 2. When the README says "it is not currently possible to use proxy_cache/proxy_store (and fastcgi_cache/fastcgi_store) for requests initiated by auth request module", does this apply to the Module Request only as it suggests and that the Client Request will proceed as normal or is there a twist to it? 3. Does the module cover "post" requests as well 4. I notice "proxy_set_header X-Original-URI $request_uri;" in the README example. Is this a requirement? Thanks again -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sun Sep 4 17:17:48 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 4 Sep 2011 21:17:48 +0400 Subject: =?UTF-8?Q?Re=3A_upstream_configuration_is_changed=EF=BC=9FThe_keyword_=28w?= =?UTF-8?Q?eight/max=5Ffail/fail=5Ftimeout=29_is_not_supported=3F?= In-Reply-To: References: Message-ID: <20110904171748.GU1137@mdounin.ru> Hello! On Sun, Sep 04, 2011 at 11:51:31PM +0800, Geoge.Q wrote: > Hi All? > > I met a configuation issue. the configuration is as following:?NGINX is > V0.7.68) and upstream is enabled when compiled. > I also test it in V1.0.5, the issue happens again. > > ---------------------------------------------------------------------------------------------------------------------------------------------- > server { > listen 80; > server_name aaa.com; > server_name 192.168.2.140; > location / { > proxy_pass http://haha; > proxy_redirect off; > proxy_buffering off; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > client_max_body_size 1000m; > client_body_buffer_size 256k; > proxy_connect_timeout 600; > proxy_temp_file_write_size 64k; > } > } > upstream haha { > server 1.1.1.2 max_fails=3 fail_timeout=30s; > <---------max_fails/fail_timeouts/weight is not support ? > server 1.1.1.1 weight=10; > } > ---------------------------------------------------------------------------------------------------------------------------------------------- > > When I run nginx, the error message print out as following: > ./nginx > > Root# /etc/init.d/nginx restart > [emerg]: invalid parameter "max_fails=3" in > /var/log/nginx/conf/nginx.conf:19 The problem is that you've tried to define upstream after it was already implicitly created by proxy_pass directive. Move upstream definition before it's first use. Maxim Dounin From nginx-forum at nginx.us Sun Sep 4 17:33:59 2011 From: nginx-forum at nginx.us (magicbear) Date: Sun, 04 Sep 2011 13:33:59 -0400 Subject: upstream keepalive - call for testing In-Reply-To: <20110801160725.GH1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> Message-ID: <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> Hello , when run for 5 days, today have 2 segment failure. 2011/09/04 12:00:47 [alert] 32147#0: worker process 8496 exited on signal 11 (core dumped) 2011/09/04 12:17:32 [alert] 8497#0: ignore long locked inactive cache entry 57c7c6c612a651727b880a1c9a2c7d2d, count:1 2011/09/04 12:21:31 [alert] 32147#0: worker process 19185 exited on signal 11 (core dumped) Core was generated by `nginx:'. Program terminated with signal 11, Segmentation fault. #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at src/http/ngx_http_upstream.c:915 915 ctx->current_request = r; (gdb) bt #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at src/http/ngx_http_upstream.c:915 #1 0x0000000000419e95 in ngx_event_expire_timers () at src/event/ngx_event_timer.c:149 #2 0x0000000000419ac7 in ngx_process_events_and_timers (cycle=0x21f1990) at src/event/ngx_event.c:261 #3 0x000000000041f76e in ngx_worker_process_cycle (cycle=0x21f1990, data=) at src/os/unix/ngx_process_cycle.c:800 #4 0x000000000041e16b in ngx_spawn_process (cycle=0x21f1990, proc=0x41f69d , data=0x0, name=0x463f3d "worker process", respawn=7) at src/os/unix/ngx_process.c:196 #5 0x000000000042008d in ngx_reap_children (cycle=0x21f1990) at src/os/unix/ngx_process_cycle.c:617 #6 ngx_master_process_cycle (cycle=0x21f1990) at src/os/unix/ngx_process_cycle.c:180 #7 0x0000000000406061 in main (argc=, argv=) at src/core/nginx.c:405 (gdb) bt full #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at src/http/ngx_http_upstream.c:915 c = 0x23b4160 r = 0x22a2780 ctx = u = 0x0 #1 0x0000000000419e95 in ngx_event_expire_timers () at src/event/ngx_event_timer.c:149 ev = 0x7fc45735f8a8 root = 0x7fc4574ffa30 sentinel = 0x689560 #2 0x0000000000419ac7 in ngx_process_events_and_timers (cycle=0x21f1990) at src/event/ngx_event.c:261 flags = 1 timer = delta = 21 #3 0x000000000041f76e in ngx_worker_process_cycle (cycle=0x21f1990, data=) at src/os/unix/ngx_process_cycle.c:800 i = c = #4 0x000000000041e16b in ngx_spawn_process (cycle=0x21f1990, proc=0x41f69d , data=0x0, name=0x463f3d "worker process", respawn=7) at src/os/unix/ngx_process.c:196 on = 1 pid = 0 s = 7 #5 0x000000000042008d in ngx_reap_children (cycle=0x21f1990) at src/os/unix/ngx_process_cycle.c:617 i = live = n = ch = {command = 2, pid = 8496, slot = 7, fd = -1} ccf = #6 ngx_master_process_cycle (cycle=0x21f1990) at src/os/unix/ngx_process_cycle.c:180 title = p = size = i = n = sigio = 0 set = {__val = {0 }} itv = {it_interval = {tv_sec = 0, tv_usec = 35114632}, it_value = {tv_sec = 0, tv_usec = 32146}} live = delay = 0 ls = ccf = 0x21f2188 #7 0x0000000000406061 in main (argc=, argv=) at src/core/nginx.c:405 i = log = 0x687380 cycle = 0x217ce70 init_cycle = {conf_ctx = 0x0, pool = 0x217c240, log = 0x687380, new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0, data = 0x0, action = 0x0}, files = 0x0, free_connections = 0x0, free_connection_n = 0, reusable_connections_queue = {prev = 0x0, next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, pathes = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0, write_events = 0x0, old_cycle = 0x0, conf_file = {len = 21, data = 0x4606b6 "/etc/nginx/nginx.conf"}, conf_param = {len = 0, data = 0x0}, conf_prefix = {len = 11, data = 0x4606b6 "/etc/nginx/nginx.conf"}, prefix = {len = 17, data = 0x4606a4 "/usr/local/nginx/"}, lock_file = {len = 0, data = 0x0}, hostname = {len = 0, data = 0x0}} ---Type to continue, or q to quit--- ccf = Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,214739#msg-214739 From nginx at nginxuser.net Sun Sep 4 17:38:04 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 4 Sep 2011 20:38:04 +0300 Subject: OpenResty Queries Message-ID: Some quick queries about some things missing from available documentation about OpenResty 1. Notice current version is bundled with Nginx 1.0.4. Is it possible for an end user to upgrade Nginx? I.E. can I download OpenResty and slip in Nginx 1.0.6? 2. The bundled modules are awesome but what is the process wants an extra third party module? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sun Sep 4 18:00:43 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 4 Sep 2011 22:00:43 +0400 Subject: http_auth_request_module Instructions? In-Reply-To: References: <20110903222515.GP1137@mdounin.ru> Message-ID: <20110904180042.GV1137@mdounin.ru> Hello! On Sun, Sep 04, 2011 at 07:40:44PM +0300, Nginx User wrote: > On Sun, Sep 4, 2011 at 1:25 AM, Maxim Dounin wrote: > > > Hello! > > > > On Sun, Sep 04, 2011 at 12:02:34AM +0300, Nginx User wrote: > > > > > Is the any documentation for the http_auth_request_module anywhere? > > Trying > > > to find out what the configuration parameters are if any. > > > > Try README in the module tarball. Alternatively, you may find it > > here: > > > > > Hi Thanks for that. > > To clarify, My understanding of how this works is that when a request from a > client (I'll call this "Client Request") hits Nginx, the module handler will > spin off a request (I'll call this "Module Request") to a location where I > would have arranged for authentication to occur. This can be auth basic etc > or my own custom process. Assuming my own custom process, I should arrange > for it to return status code "200" to allow access, status code "403" to > deny access or status code "401" to ask for username and > password (responding by 200, 403 or 401 as required). When the module > receives a "200" code for the Module Request, it will pass the Client > Request on through to the next normal stage of Nginx processing. If a "403" > code is received, The user is sent the same and processing stops. > > Four queries: > > 1. Is my understanding of the process correct? Yes. > 2. When the README says "it is not currently possible to use > proxy_cache/proxy_store (and fastcgi_cache/fastcgi_store) for requests > initiated by auth request module", does this apply to the Module Request > only as it suggests and that the Client Request will proceed as normal or is > there a twist to it? It applies only to auth subrequests. Client requests will proceed as usual. > 3. Does the module cover "post" requests as well Yes. Note though, request body won't be read at auth_request (and won't be passed to auth subrequest). > 4. I notice "proxy_set_header X-Original-URI $request_uri;" in the README > example. Is this a requirement? It's just an example how to pass original request uri to your custom auth script. Note though, that proxy_pass_request_body off; proxy_set_header Content-Length ""; is actually required when proxy_pass'ing auth subrequests, as request body won't read (see above). Maxim Dounin From ggarron at alketech.com Sun Sep 4 18:01:50 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Sun, 4 Sep 2011 14:01:50 -0400 Subject: Archives / or question Message-ID: <5B05EBB5-52E1-42EC-9AA6-EC754649A4F7@alketech.com> Hi, I'm new to the list, and I do not want to bother you, as I'm sure this has been posted in past please tell me where to find the archives. If for some reason someone has the answer here is my question: I've this setup. Gentoo Linux Nginx with this USE flags: www-servers/nginx http http-cache ipv6 pcre vim-syntax -aio -debug -libatomic -ssl nginx_modules_http_access nginx_modules_http_auth_basic anginx_modules_http_utoindex nginx_modules_http_browser nginx_modules_http_charset nginx_modules_http_empty_gif -nginx_modules_http_fastcgi nginx_modules_http_geo nginx_modules_http_gzip nginx_modules_http_limit_req nginx_modules_http_limit_zone map -nginx_modules_http_memcached nginx_modules_http_proxy nginx_modules_http_referer nginx_modules_http_rewrite -nginx_modules_http_scgi nginx_modules_http_split_clients -nginx_modules_http_ssi nginx_modules_http_upstream_ip_hash nginx_modules_http_userid nginx_modules_http_uwsgi -nginx_modules_http_addition -nginx_modules_http_cache_purge -nginx_modules_http_dav -nginx_modules_http_degradation -nginx_modules_http_ey_balancer -nginx_modules_http_flv -nginx_modules_http_geoip nginx_modules_http_gzip_static -nginx_modules_http_headers_more -nginx_modules_http_image_filter -nginx_modules_http_passenger -nginx_modules_http_perl -nginx_modules_http_push -nginx_modules_http_random_index -nginx_modules_http_realip -nginx_modules_http_secure_link -nginx_modules_http_slowfs_cache -nginx_modules_http_stub_status -nginx_modules_http_sub -nginx_modules_http_upload -nginx_modules_http_xslt -nginx_modules_mail_imap -nginx_modules_mail_pop3 -nginx_modules_mail_smtp Serving only static files (My blog is Jekyll generated, so only html/css/png files). Now I want to know how to achieve the best possible performance, leave my server as it is? or implement (on the same machine) Varnish in front of Nginx to serve from RAM instead of disk. I am using a Linode server with 512 Megs or RAM. thanks for your help, either answering me or pointing me in the right direction to find an answer. best regards. Guillermo Garron From mdounin at mdounin.ru Sun Sep 4 18:21:37 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 4 Sep 2011 22:21:37 +0400 Subject: upstream keepalive - call for testing In-Reply-To: <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110904182137.GW1137@mdounin.ru> Hello! On Sun, Sep 04, 2011 at 01:33:59PM -0400, magicbear wrote: > Hello , when run for 5 days, today have 2 segment failure. > > 2011/09/04 12:00:47 [alert] 32147#0: worker process 8496 exited on > signal 11 (core dumped) > 2011/09/04 12:17:32 [alert] 8497#0: ignore long locked inactive cache > entry 57c7c6c612a651727b880a1c9a2c7d2d, count:1 > 2011/09/04 12:21:31 [alert] 32147#0: worker process 19185 exited on > signal 11 (core dumped) > > > > > Core was generated by `nginx:'. > Program terminated with signal 11, Segmentation fault. > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > src/http/ngx_http_upstream.c:915 > 915 ctx->current_request = r; > (gdb) bt > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > src/http/ngx_http_upstream.c:915 > #1 0x0000000000419e95 in ngx_event_expire_timers () at > src/event/ngx_event_timer.c:149 > #2 0x0000000000419ac7 in ngx_process_events_and_timers > (cycle=0x21f1990) at src/event/ngx_event.c:261 Hm, this looks identical to one you've reported previously. Do you have patch from http://mailman.nginx.org/pipermail/nginx/2011-August/028809.html applied? > #3 0x000000000041f76e in ngx_worker_process_cycle (cycle=0x21f1990, > data=) at src/os/unix/ngx_process_cycle.c:800 > #4 0x000000000041e16b in ngx_spawn_process (cycle=0x21f1990, > proc=0x41f69d , data=0x0, name=0x463f3d > "worker process", respawn=7) at src/os/unix/ngx_process.c:196 > #5 0x000000000042008d in ngx_reap_children (cycle=0x21f1990) at > src/os/unix/ngx_process_cycle.c:617 > #6 ngx_master_process_cycle (cycle=0x21f1990) at > src/os/unix/ngx_process_cycle.c:180 > #7 0x0000000000406061 in main (argc=, argv= optimized out>) at src/core/nginx.c:405 > > > (gdb) bt full > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > src/http/ngx_http_upstream.c:915 > c = 0x23b4160 > r = 0x22a2780 > ctx = address 0x20)> > u = 0x0 Could you please show results of the following gdb commands: fr 0 p *ev p *((ngx_connection_t *) ev->data) Maxim Dounin From magicbearmo at gmail.com Sun Sep 4 18:31:54 2011 From: magicbearmo at gmail.com (MagicBear) Date: Mon, 5 Sep 2011 02:31:54 +0800 Subject: upstream keepalive - call for testing In-Reply-To: <20110904182137.GW1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> Message-ID: (gdb) fr 0 #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at src/http/ngx_http_upstream.c:915 915 ctx->current_request = r; (gdb) p *ev $1 = {data = 0x7fc4576aa750, write = 1, accept = 0, instance = 1, active = 1, disabled = 0, ready = 1, oneshot = 0, complete = 0, eof = 0, error = 0, timedout = 1, timer_set = 0, delayed = 0, read_discarded = 0, unexpected_eof = 0, deferred_accept = 0, pending_eof = 0, posted_ready = 0, available = 0, handler = 0x43bf9c , index = 3503345872, log = 0x21f1770, timer = {key = 0, left = 0x0, right = 0x0, parent = 0x0, color = 0 '\000', data = 0 '\000'}, closed = 0, channel = 0, resolver = 0, next = 0x0, prev = 0x0} (gdb) p *((ngx_connection_t *) ev->data) $2 = {data = 0x22a2780, read = 0x7fc4575008a8, write = 0x7fc45735f8a8, fd = 66, recv = 0x41cc50 , send = 0x41cf08 , recv_chain = 0x41cd00 , send_chain = 0x421050 , listening = 0x0, sent = 0, log = 0x21f1770, pool = 0x237ff70, sockaddr = 0x0, socklen = 0, addr_text = {len = 0, data = 0x0}, ssl = 0x0, local_sockaddr = 0x0, buffer = 0x0, queue = {prev = 0x0, next = 0x0}, number = 63713716, requests = 0, buffered = 0, log_error = 1, single_connection = 0, unexpected_eof = 0, timedout = 0, error = 0, destroyed = 0, idle = 0, reusable = 0, close = 0, sendfile = 1, sndlowat = 0, tcp_nodelay = 0, tcp_nopush = 0} 2011/9/5 Maxim Dounin > Hello! > > On Sun, Sep 04, 2011 at 01:33:59PM -0400, magicbear wrote: > > > Hello , when run for 5 days, today have 2 segment failure. > > > > 2011/09/04 12:00:47 [alert] 32147#0: worker process 8496 exited on > > signal 11 (core dumped) > > 2011/09/04 12:17:32 [alert] 8497#0: ignore long locked inactive cache > > entry 57c7c6c612a651727b880a1c9a2c7d2d, count:1 > > 2011/09/04 12:21:31 [alert] 32147#0: worker process 19185 exited on > > signal 11 (core dumped) > > > > > > > > > > Core was generated by `nginx:'. > > Program terminated with signal 11, Segmentation fault. > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > src/http/ngx_http_upstream.c:915 > > 915 ctx->current_request = r; > > (gdb) bt > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > src/http/ngx_http_upstream.c:915 > > #1 0x0000000000419e95 in ngx_event_expire_timers () at > > src/event/ngx_event_timer.c:149 > > #2 0x0000000000419ac7 in ngx_process_events_and_timers > > (cycle=0x21f1990) at src/event/ngx_event.c:261 > > Hm, this looks identical to one you've reported previously. Do > you have patch from > > http://mailman.nginx.org/pipermail/nginx/2011-August/028809.html > > applied? > > > #3 0x000000000041f76e in ngx_worker_process_cycle (cycle=0x21f1990, > > data=) at src/os/unix/ngx_process_cycle.c:800 > > #4 0x000000000041e16b in ngx_spawn_process (cycle=0x21f1990, > > proc=0x41f69d , data=0x0, name=0x463f3d > > "worker process", respawn=7) at src/os/unix/ngx_process.c:196 > > #5 0x000000000042008d in ngx_reap_children (cycle=0x21f1990) at > > src/os/unix/ngx_process_cycle.c:617 > > #6 ngx_master_process_cycle (cycle=0x21f1990) at > > src/os/unix/ngx_process_cycle.c:180 > > #7 0x0000000000406061 in main (argc=, argv= > optimized out>) at src/core/nginx.c:405 > > > > > > (gdb) bt full > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > src/http/ngx_http_upstream.c:915 > > c = 0x23b4160 > > r = 0x22a2780 > > ctx = > address 0x20)> > > u = 0x0 > > Could you please show results of the following gdb commands: > > fr 0 > p *ev > p *((ngx_connection_t *) ev->data) > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Sep 4 18:37:17 2011 From: nginx-forum at nginx.us (loganbest) Date: Sun, 04 Sep 2011 14:37:17 -0400 Subject: Can't fix "No input file specified." with php-fastcgi Message-ID: I've been trying to fix this pesky error for a couple days and no forums or anything is suggesting anything that is helping. I simply just need someone to login to my EC2 instance and figure out what's going on. I've tried reinstalling php to all the default configs and everything but nothing is working. I don't have any money to pay for this right now but you can invoice my paypal and I will get to it as soon as I have the money to give. My timeline for this is pretty quick as I have something that needs to be launched on tuesday. Please let me know if someone can fix this asap. Thanks in advance. Logan Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214746#msg-214746 From ggarron at alketech.com Sun Sep 4 18:40:45 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Sun, 4 Sep 2011 14:40:45 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: References: Message-ID: Do you really need it to be fastcgi now? I mean you can start with Apache behind nginx and switch to fastcgi later, after your launch. Regards Guillermo. On Sep 4, 2011 2:37 PM, "loganbest" wrote: I've been trying to fix this pesky error for a couple days and no forums or anything is suggesting anything that is helping. I simply just need someone to login to my EC2 instance and figure out what's going on. I've tried reinstalling php to all the default configs and everything but nothing is working. I don't have any money to pay for this right now but you can invoice my paypal and I will get to it as soon as I have the money to give. My timeline for this is pretty quick as I have something that needs to be launched on tuesday. Please let me know if someone can fix this asap. Thanks in advance. Logan Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214746#msg-214746 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Sep 4 18:46:07 2011 From: nginx-forum at nginx.us (loganbest) Date: Sun, 04 Sep 2011 14:46:07 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: References: Message-ID: <83b7a11505d9b23a1afd7deff640edf1.NginxMailingListEnglish@forum.nginx.org> I'm not sure what the standard practices of nginx+php are. This is my first time working with nginx and I didn't install nginx, I just installed fastcgi based on an article I found at the top of google. I've seen php-fpm and php-fastcgi and I don't know the differences or pro/cons of each. I'm really just looking for some quick help to get this running. I'd also rather not have both nginx and apache running on the same server since this isn't a very large ec2 instance I can't take the memory footprint of apache. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214748#msg-214748 From ggarron at alketech.com Sun Sep 4 19:03:29 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Sun, 4 Sep 2011 15:03:29 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: References: <83b7a11505d9b23a1afd7deff640edf1.NginxMailingListEnglish@forum.nginx.org> Message-ID: Well I've only worked in the past with nginx serving static files and sending php to apache behind. If you decide to go that way or not find help in the current scenario, I can help you then. Let me know, I'll be checking my blackberry, in 5 hours I will be available On Sep 4, 2011 2:46 PM, "loganbest" wrote: I'm not sure what the standard practices of nginx+php are. This is my first time working with nginx and I didn't install nginx, I just installed fastcgi based on an article I found at the top of google. I've seen php-fpm and php-fastcgi and I don't know the differences or pro/cons of each. I'm really just looking for some quick help to get this running. I'd also rather not have both nginx and apache running on the same server since this isn't a very large ec2 instance I can't take the memory footprint of apache. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214748#msg-214748 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.n... -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at nginxuser.net Sun Sep 4 19:08:30 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 4 Sep 2011 22:08:30 +0300 Subject: http_auth_request_module Instructions? In-Reply-To: <20110904180042.GV1137@mdounin.ru> References: <20110903222515.GP1137@mdounin.ru> <20110904180042.GV1137@mdounin.ru> Message-ID: On Sun, Sep 4, 2011 at 9:00 PM, Maxim Dounin wrote: > Hello! > > On Sun, Sep 04, 2011 at 07:40:44PM +0300, Nginx User wrote: > > > On Sun, Sep 4, 2011 at 1:25 AM, Maxim Dounin wrote: > > > > > Hello! > > > > > > On Sun, Sep 04, 2011 at 12:02:34AM +0300, Nginx User wrote: > > > > > > > Is the any documentation for the http_auth_request_module anywhere? > > > Trying > > > > to find out what the configuration parameters are if any. > > > > > > Try README in the module tarball. Alternatively, you may find it > > > here: > > > > > > > > > Hi Thanks for that. > > > > To clarify, My understanding of how this works is that when a request > from a > > client (I'll call this "Client Request") hits Nginx, the module handler > will > > spin off a request (I'll call this "Module Request") to a location where > I > > would have arranged for authentication to occur. This can be auth basic > etc > > or my own custom process. Assuming my own custom process, I should > arrange > > for it to return status code "200" to allow access, status code "403" to > > deny access or status code "401" to ask for username and > > password (responding by 200, 403 or 401 as required). When the module > > receives a "200" code for the Module Request, it will pass the Client > > Request on through to the next normal stage of Nginx processing. If a > "403" > > code is received, The user is sent the same and processing stops. > > > > Four queries: > > > > 1. Is my understanding of the process correct? > > Yes. > > > 2. When the README says "it is not currently possible to use > > proxy_cache/proxy_store (and fastcgi_cache/fastcgi_store) for requests > > initiated by auth request module", does this apply to the Module Request > > only as it suggests and that the Client Request will proceed as normal or > is > > there a twist to it? > > It applies only to auth subrequests. Client requests will proceed > as usual. > > > 3. Does the module cover "post" requests as well > > Yes. Note though, request body won't be read at auth_request (and > won't be passed to auth subrequest). > > > 4. I notice "proxy_set_header X-Original-URI $request_uri;" in the README > > example. Is this a requirement? > > It's just an example how to pass original request uri to your > custom auth script. > > Note though, that > > proxy_pass_request_body off; > proxy_set_header Content-Length ""; > > is actually required when proxy_pass'ing auth subrequests, as > request body won't read (see above). Brilliant. I think a bigger deal should be made of this module as it makes a nonsense of the "lack of a WAF" concern about Nginx. I'll suggest pushing it to the core as many are not aware of it. I think the low profile is also because it is not documented on the wiki. I had clicked on the link in the early days but on being taken to the sparse website with a few log items, I beat a hurried retreat. Since you have Igor's ear, I'll suggest you whisper the following into it: "Hey ?????! ? ????? ??? ?? ?????? ??????? ???? ?????? ???????? ?? ?????????. ??? ??????? ????? ??? FUD ?????? Nginx ? ????? ?????? WAF ? ?????? ????? ????." On second thoughts, don't ... He might think you have had too much vodka since that is machine translated. Last query on this. The information on the "satisfy" directive in the wiki states that: * all - Both Access *and* Auth Basic directives must grant access to the context * any - Either Access *or* Auth Basic directives grant access to the context Is this miss leading? Should it be something like: * all - All access phase handlers must grant access to the context * any - Any access phase handler can grant access to the context Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ano at bestmx.ru Sun Sep 4 19:33:51 2011 From: ano at bestmx.ru (Andrey N. Oktyabrski) Date: Sun, 04 Sep 2011 23:33:51 +0400 Subject: http_auth_request_module Instructions? In-Reply-To: References: <20110903222515.GP1137@mdounin.ru> <20110904180042.GV1137@mdounin.ru> Message-ID: <4E63D29F.1030209@bestmx.ru> On 04.09.11 23:08, Nginx User wrote: > "Hey ?????! ? ????? ??? ?? ?????? ??????? ???? ?????? ???????? ?? > ?????????. ??? ??????? ????? ??? FUD ?????? Nginx ? ????? ?????? WAF ? > ?????? ????? ????." Excuse me, your english much better than russian, please use it :-) From nginx at nginxuser.net Sun Sep 4 19:50:04 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 4 Sep 2011 22:50:04 +0300 Subject: http_auth_request_module Instructions? In-Reply-To: <4E63D29F.1030209@bestmx.ru> References: <20110903222515.GP1137@mdounin.ru> <20110904180042.GV1137@mdounin.ru> <4E63D29F.1030209@bestmx.ru> Message-ID: 2011/9/4 Andrey N. Oktyabrski > On 04.09.11 23:08, Nginx User wrote: > >> "Hey ?????! ? ????? ??? ?? ?????? ??????? ???? ?????? ???????? ?? >> ?????????. ??? ??????? ????? ??? FUD ?????? Nginx ? ????? ?????? WAF ? >> ?????? ????? ????." >> > Excuse me, your english much better than russian, please use it :-) You obviously type faster than you read since you managed to send your email before you finished reading the next line which says ... On second thoughts, don't ... He might think you have had too much vodka > since that is machine translated. You should learn to read a bit faster but we digress :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Sep 4 20:24:00 2011 From: nginx-forum at nginx.us (loganbest) Date: Sun, 04 Sep 2011 16:24:00 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: <83b7a11505d9b23a1afd7deff640edf1.NginxMailingListEnglish@forum.nginx.org> References: <83b7a11505d9b23a1afd7deff640edf1.NginxMailingListEnglish@forum.nginx.org> Message-ID: Somehow, between purging all php configs and packages and reinstalling them and altering the php location definition in the nginx.conf it now works as it did before.... I"m confused but I'm not going to touch it now. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214754#msg-214754 From nginx-forum at nginx.us Sun Sep 4 21:14:27 2011 From: nginx-forum at nginx.us (loganbest) Date: Sun, 04 Sep 2011 17:14:27 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: References: Message-ID: <369c4c70e6b9f1a77e70a62ea93d8aa0.NginxMailingListEnglish@forum.nginx.org> I take that back.... it started again. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214756#msg-214756 From ggarron at alketech.com Sun Sep 4 21:19:03 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Sun, 4 Sep 2011 17:19:03 -0400 Subject: Can't fix "No input file specified." with php-fastcgi Message-ID: <2a1a1ceedd33352155268607634ce01f@mail.gmail.com> What aplication are you using? I mean with php? ------Original Message------ From: loganbest To: nginx at nginx.org ReplyTo: nginx at nginx.org Subject: Re: Can't fix "No input file specified." with php-fastcgi Sent: Sep 4, 2011 4:24 PM Somehow, between purging all php configs and packages and reinstalling them and altering the php location definition in the nginx.conf it now works as it did before.... I"m confused but I'm not going to touch it now. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214754#msg-214754 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Sun Sep 4 21:21:21 2011 From: nginx-forum at nginx.us (loganbest) Date: Sun, 04 Sep 2011 17:21:21 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: <2a1a1ceedd33352155268607634ce01f@mail.gmail.com> References: <2a1a1ceedd33352155268607634ce01f@mail.gmail.com> Message-ID: <110b6d83f8fc0d1ab9b8cd761506b946.NginxMailingListEnglish@forum.nginx.org> I only have 2 php files at this time because the rest of the server is using ruby. It's just standard php and not even very much php. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214758#msg-214758 From mdounin at mdounin.ru Sun Sep 4 22:01:25 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Sep 2011 02:01:25 +0400 Subject: http_auth_request_module Instructions? In-Reply-To: References: <20110903222515.GP1137@mdounin.ru> <20110904180042.GV1137@mdounin.ru> Message-ID: <20110904220125.GX1137@mdounin.ru> Hello! On Sun, Sep 04, 2011 at 10:08:30PM +0300, Nginx User wrote: [...] > Last query on this. > > The information on the "satisfy" directive in the wiki states that: > > * all - Both Access *and* Auth Basic directives must grant access to the > context > * any - Either Access *or* Auth Basic directives grant access to the context > Is this miss leading? Should it be something like: > > * all - All access phase handlers must grant access to the context > * any - Any access phase handler can grant access to the context Both versions are right, though first one implicitly assumes you are using only standard access modules. Maxim Dounin From nginx at nginxuser.net Sun Sep 4 22:36:09 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 5 Sep 2011 01:36:09 +0300 Subject: http_auth_request_module Instructions? In-Reply-To: <20110904220125.GX1137@mdounin.ru> References: <20110903222515.GP1137@mdounin.ru> <20110904180042.GV1137@mdounin.ru> <20110904220125.GX1137@mdounin.ru> Message-ID: On Mon, Sep 5, 2011 at 1:01 AM, Maxim Dounin wrote: > Hello! > > On Sun, Sep 04, 2011 at 10:08:30PM +0300, Nginx User wrote: > > [...] > > > Last query on this. > > > > The information on the "satisfy" directive in the wiki states that: > > > > * all - Both Access *and* Auth Basic directives must grant access to the > > context > > * any - Either Access *or* Auth Basic directives grant access to the > context > > Is this miss leading? Should it be something like: > > > > * all - All access phase handlers must grant access to the context > > * any - Any access phase handler can grant access to the context > > Both versions are right, though first one implicitly assumes you > are using only standard access modules. I'll say the first set is technically wrong as it *implies* the directive only applies to those two modules. The key is in the use of the words "both" and "either" which imply a sum total of two possibilities. I edited the wiki to read: Access policy if directives from multiple access phase handlers, such as the Access and Auth Basic modules, are defined in a context: * all - All access phase handlers must grant access to the context * any - Any access phase handler can grant access to the context Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Sep 4 22:46:18 2011 From: nginx-forum at nginx.us (Mickie D) Date: Sun, 04 Sep 2011 18:46:18 -0400 Subject: Help with rewrite Message-ID: <461adae45a9d3ba0d9d4ed211a89df13.NginxMailingListEnglish@forum.nginx.org> Hi everyone, I am using a plugin for my site called VBSEO They use the following code: -------------------------------------------------------- if ($request_filename ~ "\.php$" ) { rewrite ^/(.*)$ /vbseo.php break; } if (!-e $request_filename) { rewrite ^/(.*)$ /vbseo.php break; } -------------------------------------------------------- I read the article about IF IS EVIL and thought it would be better to make this code better. Could someone who knows about the rewrites and nginx coding please help me. I will post the results (if it's possible of course) to VBSEO so they can update there rules. Kind Regards Mick Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214761,214761#msg-214761 From ianevans at digitalhit.com Sun Sep 4 23:46:56 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sun, 04 Sep 2011 19:46:56 -0400 Subject: PositiveSSL certificate keeps giving the untrusted issuer warnings in browser Message-ID: <4E640DF0.1020000@digitalhit.com> Since I'm working on a Facebook app, the self-signed certificate I created for SSL access to my admin area is no longer useful. I grabbed a PositiveSSL cert from Comodo, but after following the instructions here ( http://kbeezie.com/view/free-ssl-with-nginx/2/ ) but still get the untrusted or self-signed warnings. This page (http://www.digicert.com/ssl-certificate-installation-nginx.htm) seems to suggest I have to concatenate several crt files together. This is what Comodo sent me: AddTrustExternalCARoot.crt PositiveSSLCA.crt UTNAddTrustServerCA.crt and www_example_com.crt Do I need to concatenate all of these? Also, just curious why do some example sites I've seen say Ngix needs a pem file and others say a crt? Thanks! From ianevans at digitalhit.com Mon Sep 5 00:04:30 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sun, 04 Sep 2011 20:04:30 -0400 Subject: PositiveSSL certificate keeps giving the untrusted issuer warnings in browser In-Reply-To: <4E640DF0.1020000@digitalhit.com> References: <4E640DF0.1020000@digitalhit.com> Message-ID: <4E64120E.3090304@digitalhit.com> On 04/09/2011 7:46 PM, Ian Evans wrote: > Since I'm working on a Facebook app, the self-signed certificate I > created for SSL access to my admin area is no longer useful. > > I grabbed a PositiveSSL cert from Comodo, but after following the > instructions here ( http://kbeezie.com/view/free-ssl-with-nginx/2/ ) but > still get the untrusted or self-signed warnings. Upon further testing I see that it's still using the old cert despite issuing a kill -HUP. How do I get nginx to start using the new cert? From quan.nexthop at gmail.com Mon Sep 5 00:35:58 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Mon, 5 Sep 2011 08:35:58 +0800 Subject: =?UTF-8?Q?Re=3A_upstream_configuration_is_changed=EF=BC=9FThe_keyword_=28w?= =?UTF-8?Q?eight/max=5Ffail/fail=5Ftimeout=29_is_not_supported=3F?= In-Reply-To: <20110904171748.GU1137@mdounin.ru> References: <20110904171748.GU1137@mdounin.ru> Message-ID: Thanks Max, it works now. George On Mon, Sep 5, 2011 at 1:17 AM, Maxim Dounin wrote: > Hello! > > On Sun, Sep 04, 2011 at 11:51:31PM +0800, Geoge.Q wrote: > > > Hi All? > > > > I met a configuation issue. the configuration is as following:?NGINX is > > V0.7.68) and upstream is enabled when compiled. > > I also test it in V1.0.5, the issue happens again. > > > > > ---------------------------------------------------------------------------------------------------------------------------------------------- > > server { > > listen 80; > > server_name aaa.com; > > server_name 192.168.2.140; > > location / { > > proxy_pass http://haha; > > proxy_redirect off; > > proxy_buffering off; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For > > $proxy_add_x_forwarded_for; > > client_max_body_size 1000m; > > client_body_buffer_size 256k; > > proxy_connect_timeout 600; > > proxy_temp_file_write_size 64k; > > } > > } > > upstream haha { > > server 1.1.1.2 max_fails=3 fail_timeout=30s; > > <---------max_fails/fail_timeouts/weight is not support ? > > server 1.1.1.1 weight=10; > > } > > > ---------------------------------------------------------------------------------------------------------------------------------------------- > > > > When I run nginx, the error message print out as following: > > ./nginx > > > > Root# /etc/init.d/nginx restart > > [emerg]: invalid parameter "max_fails=3" in > > /var/log/nginx/conf/nginx.conf:19 > > The problem is that you've tried to define upstream after it was > already implicitly created by proxy_pass directive. Move upstream > definition before it's first use. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ianevans at digitalhit.com Mon Sep 5 01:06:07 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Sun, 04 Sep 2011 21:06:07 -0400 Subject: PositiveSSL certificate keeps giving the untrusted issuer warnings in browser In-Reply-To: <4E64120E.3090304@digitalhit.com> References: <4E640DF0.1020000@digitalhit.com> <4E64120E.3090304@digitalhit.com> Message-ID: <4E64207F.6040101@digitalhit.com> On 04/09/2011 8:04 PM, Ian Evans wrote: > Upon further testing I see that it's still using the old cert despite > issuing a kill -HUP. Sigh...okay, never mind. Seems I had one typo in the conf change so the kill -HUP was still using the old conf. So it's working okay now. Still curious why some examples use pem and others use crt. Also any best usage additions I should add to the ssl section? From sy.meteor at msn.com Mon Sep 5 02:41:45 2011 From: sy.meteor at msn.com (LiuXin) Date: Mon, 5 Sep 2011 10:41:45 +0800 Subject: php-fpm is very very slow... Message-ID: Hi all, After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very slow. Even I tried to roll back to php 5.3.6, it still doen't work. And there are lots of errors in php-fpm.log, [04-Sep-2011 12:28:27] WARNING: [pool www] child 18793, script '/web/www/forum.php' (request: "GET /forum.php") executing too slow (60.073197 sec), logging [04-Sep-2011 12:28:27] WARNING: [pool www] child 18784, script '/web/www/forum.php' (request: "GET /forum.php") executing too slow (60.080807 sec), logging [04-Sep-2011 12:28:27] NOTICE: child 18793 stopped for tracing [04-Sep-2011 12:28:27] NOTICE: about to trace 18793 [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) [04-Sep-2011 12:28:27] NOTICE: finished trace of 18793 [04-Sep-2011 12:28:27] NOTICE: child 18784 stopped for tracing [04-Sep-2011 12:28:27] NOTICE: about to trace 18784 [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) [04-Sep-2011 12:28:27] NOTICE: finished trace of 18784 And in php-fpm.slow [04-Sep-2011 12:27:30] [pool www] pid 18622 script_filename = /web/www/forum.php [0x000000080455aaa8] mysql_query() /web/www/source/class/class_core.php:815 [0x000000080455a958] query() /web/www/source/class/class_core.php:1003 [0x000000080455a858] _execute() /web/www/source/class/class_core.php:977 [0x00000008045591a0] query() /web/www/source/module/forum/forum_viewthread.php:514 [0x0000000804559058] +++ dump failed And one can help me about this issue? My server is running Freebsd 8.1 + nginx + php 5.3.8 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mat999 at gmail.com Mon Sep 5 02:55:53 2011 From: mat999 at gmail.com (SplitIce) Date: Mon, 5 Sep 2011 12:55:53 +1000 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: a) not nginx related b) not even php-fpm related its a slow mysql query. 2011/9/5 LiuXin > Hi all, > After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very slow. > Even I tried to roll back to php 5.3.6, it still doen't work. > And there are lots of errors in php-fpm.log, > > [04-Sep-2011 12:28:27] WARNING: [pool www] child 18793, script > '/web/www/forum.php' (request: "GET /forum.php") executing too slow > (60.073197 sec), logging > [04-Sep-2011 12:28:27] WARNING: [pool www] child 18784, script > '/web/www/forum.php' (request: "GET /forum.php") executing too slow > (60.080807 sec), logging > [04-Sep-2011 12:28:27] NOTICE: child 18793 stopped for tracing > [04-Sep-2011 12:28:27] NOTICE: about to trace 18793 > [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) > [04-Sep-2011 12:28:27] NOTICE: finished trace of 18793 > [04-Sep-2011 12:28:27] NOTICE: child 18784 stopped for tracing > [04-Sep-2011 12:28:27] NOTICE: about to trace 18784 > [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) > [04-Sep-2011 12:28:27] NOTICE: finished trace of 18784 > > And in php-fpm.slow > > [04-Sep-2011 12:27:30] [pool www] pid 18622 > script_filename = /web/www/forum.php > [0x000000080455aaa8] mysql_query() /web/www/source/class/class_core.php:815 > [0x000000080455a958] query() /web/www/source/class/class_core.php:1003 > [0x000000080455a858] _execute() /web/www/source/class/class_core.php:977 > [0x00000008045591a0] query() > /web/www/source/module/forum/forum_viewthread.php:514 > [0x0000000804559058] +++ dump failed > > And one can help me about this issue? > My server is running Freebsd 8.1 + nginx + php 5.3.8 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sy.meteor at msn.com Mon Sep 5 03:52:02 2011 From: sy.meteor at msn.com (LiuXin) Date: Mon, 5 Sep 2011 11:52:02 +0800 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: Hi SplitIce, Do you mean this problem is casued by mysql? Thanks [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) From: SplitIce Sent: Monday, September 05, 2011 10:55 AM To: nginx at nginx.org Subject: Re: php-fpm is very very slow... a) not nginx related b) not even php-fpm related its a slow mysql query. 2011/9/5 LiuXin Hi all, After upgrade from php 5.3.6 to php 5.3.8, now php-fpm is very very slow. Even I tried to roll back to php 5.3.6, it still doen't work. And there are lots of errors in php-fpm.log, [04-Sep-2011 12:28:27] WARNING: [pool www] child 18793, script '/web/www/forum.php' (request: "GET /forum.php") executing too slow (60.073197 sec), logging [04-Sep-2011 12:28:27] WARNING: [pool www] child 18784, script '/web/www/forum.php' (request: "GET /forum.php") executing too slow (60.080807 sec), logging [04-Sep-2011 12:28:27] NOTICE: child 18793 stopped for tracing [04-Sep-2011 12:28:27] NOTICE: about to trace 18793 [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) [04-Sep-2011 12:28:27] NOTICE: finished trace of 18793 [04-Sep-2011 12:28:27] NOTICE: child 18784 stopped for tracing [04-Sep-2011 12:28:27] NOTICE: about to trace 18784 [04-Sep-2011 12:28:27] ERROR: ptrace(PT_IO) failed: Bad address (14) [04-Sep-2011 12:28:27] NOTICE: finished trace of 18784 And in php-fpm.slow [04-Sep-2011 12:27:30] [pool www] pid 18622 script_filename = /web/www/forum.php [0x000000080455aaa8] mysql_query() /web/www/source/class/class_core.php:815 [0x000000080455a958] query() /web/www/source/class/class_core.php:1003 [0x000000080455a858] _execute() /web/www/source/class/class_core.php:977 [0x00000008045591a0] query() /web/www/source/module/forum/forum_viewthread.php:514 [0x0000000804559058] +++ dump failed And one can help me about this issue? My server is running Freebsd 8.1 + nginx + php 5.3.8 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx -------------------------------------------------------------------------------- _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From edho at myconan.net Mon Sep 5 03:57:55 2011 From: edho at myconan.net (Edho P Arief) Date: Mon, 5 Sep 2011 10:57:55 +0700 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: On Mon, Sep 5, 2011 at 10:52 AM, LiuXin wrote: > Hi SplitIce, > > Do you mean this problem is casued by mysql? Thanks > [04-Sep-2011 12:27:30] [pool www] pid 18622 script_filename = /web/www/forum.php [0x000000080455aaa8] mysql_query() /web/www/source/class/class_core.php:815 [0x000000080455a958] query() /web/www/source/class/class_core.php:1003 [0x000000080455a858] _execute() /web/www/source/class/class_core.php:977 [0x00000008045591a0] query() /web/www/source/module/forum/forum_viewthread.php:514 From igor at sysoev.ru Mon Sep 5 04:55:16 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 5 Sep 2011 08:55:16 +0400 Subject: PositiveSSL certificate keeps giving the untrusted issuer warnings in browser In-Reply-To: <4E64207F.6040101@digitalhit.com> References: <4E640DF0.1020000@digitalhit.com> <4E64120E.3090304@digitalhit.com> <4E64207F.6040101@digitalhit.com> Message-ID: <20110905045516.GA25408@nginx.com> On Sun, Sep 04, 2011 at 09:06:07PM -0400, Ian Evans wrote: > On 04/09/2011 8:04 PM, Ian Evans wrote: > > Upon further testing I see that it's still using the old cert despite > > issuing a kill -HUP. > > Sigh...okay, never mind. Seems I had one typo in the conf change so the > kill -HUP was still using the old conf. So it's working okay now. > > Still curious why some examples use pem and others use crt. This is just a file extention. Both use the same PEM formay inside. > Also any best usage additions I should add to the ssl section? Please read this: http://nginx.org/en/docs/http/configuring_https_servers.html -- Igor Sysoev From dewanggaba at gmail.com Mon Sep 5 04:59:35 2011 From: dewanggaba at gmail.com (antituhan) Date: Sun, 4 Sep 2011 21:59:35 -0700 (PDT) Subject: Wordpress Setup (Nginx + Apache) In-Reply-To: <4E5F562F.90407@contactlab.com> References: <1314803185467-6746900.post@n2.nabble.com> <4E5F562F.90407@contactlab.com> Message-ID: <1315198775336-6759814.post@n2.nabble.com> Simone fumagalli wrote: > > On 08/31/2011 05:06 PM, antituhan wrote: >> Hello fellas, I've been setup wordpress blog using NginX as front end >> and Apache as a backend. > > If you are using this setup you might be interested in this plugin > http://wordpress.org/extend/plugins/nginx-manager/ > In this way you can serve directly with Nginx static version of your pages > and offload Apache > > Ciao > > -- > Simone Fumagalli > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > Ok, I'll try it ;) ----- [daemon at antituhan.com ~]# -- View this message in context: http://nginx.2469901.n2.nabble.com/Wordpress-Setup-Nginx-Apache-tp6746900p6759814.html Sent from the nginx mailing list archive at Nabble.com. From nginx-forum at nginx.us Mon Sep 5 05:33:41 2011 From: nginx-forum at nginx.us (magicbear) Date: Mon, 05 Sep 2011 01:33:41 -0400 Subject: php-fpm is very very slow... In-Reply-To: References: Message-ID: You can check iowait, Discuz when have many of data, suggest you using MySQL Cluster to process. MagicBear Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214766,214773#msg-214773 From nginx-forum at nginx.us Mon Sep 5 05:40:22 2011 From: nginx-forum at nginx.us (jeff14) Date: Mon, 05 Sep 2011 01:40:22 -0400 Subject: can i pass $time_local to backend server? Message-ID: <42a94fd4a531ed9786ef1c5ee73f1a87.NginxMailingListEnglish@forum.nginx.org> hi, i want set the variable $time_local in log to the header , and then the backend server can got it like: proxy_set_header MY_TIME $time_local but i got error : unknown "time_local" variable if i can set a variable about time to the header? many thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214774,214774#msg-214774 From toplek at polok.pl Mon Sep 5 06:28:22 2011 From: toplek at polok.pl (Piotr Polok) Date: Mon, 05 Sep 2011 08:28:22 +0200 Subject: upload file problem (500 Internal Server Error) In-Reply-To: References: <87bd7ee8ed3c1a8bc0f33206b4db4a37@polok.pl> Message-ID: <5fb9f62c9818d7337af57460493714f4@polok.pl> On Thu, 01 Sep 2011 19:17:06 -0400, magicbear wrote: > you can try to add such line to /etc/security/limits.conf > nginx soft nofile 131072 > nginx hard nofile 1048576 > > > and fastcgi_pass to run PHP > you need to set SCRIPT_FILENAME, you may first include fastcgi_params > at > /etc/nginx (if you install nginx with binary), and then add such line > before fastcgi_pass: fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; HI, Thanks, this is also not solving the problem. I will start from the beginning in new thread. -- best regards Piotr Polok --------------------------- POLOK WELDING 44-121 Gliwice ul. Sowi?skiego 3 NIP: 631-112-45-46 tel: (32) 725 77 77 fax: (32) 444 64 50 http://www.polok.pl From toplek at polok.pl Mon Sep 5 06:59:58 2011 From: toplek at polok.pl (Piotr Polok) Date: Mon, 05 Sep 2011 08:59:58 +0200 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway Message-ID: <8d3997b08745b16189742395b9544d85@polok.pl> HI, I have compiled newest version of nginx (nginx/1.1.1) with nginx upload module (v 2.2.0), also the example config (nginx.conf) was copied from https://github.com/vkholodkov/nginx-upload-module into nginx direcoty. The html form is also copied from this location. So the installation and configuration is oryginal now without any changes. I'm getting some errors while uploading the file; The html form: '502 Bad Gateway'; The nginx error.log (/usr/local/nginx/logs/error.log): ------ 2011/09/05 08:35:15 [error] 21161#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.165, server: , request: "POST /upload HTTP/1.1", upstream: "http://127.0.0.1:8080/upload", host: "192.168.0.127", referrer: "http://192.168.0.127/http/upload.html" ------ Maybe it's a problem of my wrong understanding how does it works, I do not understand why in this example config the proxy_pass is going through local 8080 port but the server in this configuration is not listening on such port. Please help. -- best regards Piotr Polok From mdounin at mdounin.ru Mon Sep 5 07:08:13 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Sep 2011 11:08:13 +0400 Subject: upstream keepalive - call for testing In-Reply-To: References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> Message-ID: <20110905070813.GY1137@mdounin.ru> Hello! On Mon, Sep 05, 2011 at 02:31:54AM +0800, MagicBear wrote: > (gdb) fr 0 > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) > at src/http/ngx_http_upstream.c:915 > 915 ctx->current_request = r; > (gdb) p *ev > $1 = {data = 0x7fc4576aa750, write = 1, accept = 0, instance = 1, active = > 1, > disabled = 0, ready = 1, oneshot = 0, complete = 0, eof = 0, error = 0, > timedout = 1, timer_set = 0, delayed = 0, read_discarded = 0, > unexpected_eof = 0, deferred_accept = 0, pending_eof = 0, posted_ready = > 0, > available = 0, handler = 0x43bf9c , > index = 3503345872, log = 0x21f1770, timer = {key = 0, left = 0x0, > right = 0x0, parent = 0x0, color = 0 '\000', data = 0 '\000'}, > closed = 0, channel = 0, resolver = 0, next = 0x0, prev = 0x0} > (gdb) p *((ngx_connection_t *) ev->data) > $2 = {data = 0x22a2780, read = 0x7fc4575008a8, write = 0x7fc45735f8a8, > fd = 66, recv = 0x41cc50 , send = 0x41cf08 > , > recv_chain = 0x41cd00 , > send_chain = 0x421050 , listening = 0x0, > sent = 0, log = 0x21f1770, pool = 0x237ff70, sockaddr = 0x0, socklen = 0, > addr_text = {len = 0, data = 0x0}, ssl = 0x0, local_sockaddr = 0x0, > buffer = 0x0, queue = {prev = 0x0, next = 0x0}, number = 63713716, > requests = 0, buffered = 0, log_error = 1, single_connection = 0, > unexpected_eof = 0, timedout = 0, error = 0, destroyed = 0, idle = 0, > reusable = 0, close = 0, sendfile = 1, sndlowat = 0, tcp_nodelay = 0, > tcp_nopush = 0} Could you please also show the following (in the same frame, i.e. after "fr 0"): p ngx_cycle->log p *r p *r->connection Maxim Dounin > > > 2011/9/5 Maxim Dounin > > > Hello! > > > > On Sun, Sep 04, 2011 at 01:33:59PM -0400, magicbear wrote: > > > > > Hello , when run for 5 days, today have 2 segment failure. > > > > > > 2011/09/04 12:00:47 [alert] 32147#0: worker process 8496 exited on > > > signal 11 (core dumped) > > > 2011/09/04 12:17:32 [alert] 8497#0: ignore long locked inactive cache > > > entry 57c7c6c612a651727b880a1c9a2c7d2d, count:1 > > > 2011/09/04 12:21:31 [alert] 32147#0: worker process 19185 exited on > > > signal 11 (core dumped) > > > > > > > > > > > > > > > Core was generated by `nginx:'. > > > Program terminated with signal 11, Segmentation fault. > > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > > src/http/ngx_http_upstream.c:915 > > > 915 ctx->current_request = r; > > > (gdb) bt > > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > > src/http/ngx_http_upstream.c:915 > > > #1 0x0000000000419e95 in ngx_event_expire_timers () at > > > src/event/ngx_event_timer.c:149 > > > #2 0x0000000000419ac7 in ngx_process_events_and_timers > > > (cycle=0x21f1990) at src/event/ngx_event.c:261 > > > > Hm, this looks identical to one you've reported previously. Do > > you have patch from > > > > http://mailman.nginx.org/pipermail/nginx/2011-August/028809.html > > > > applied? > > > > > #3 0x000000000041f76e in ngx_worker_process_cycle (cycle=0x21f1990, > > > data=) at src/os/unix/ngx_process_cycle.c:800 > > > #4 0x000000000041e16b in ngx_spawn_process (cycle=0x21f1990, > > > proc=0x41f69d , data=0x0, name=0x463f3d > > > "worker process", respawn=7) at src/os/unix/ngx_process.c:196 > > > #5 0x000000000042008d in ngx_reap_children (cycle=0x21f1990) at > > > src/os/unix/ngx_process_cycle.c:617 > > > #6 ngx_master_process_cycle (cycle=0x21f1990) at > > > src/os/unix/ngx_process_cycle.c:180 > > > #7 0x0000000000406061 in main (argc=, argv= > > optimized out>) at src/core/nginx.c:405 > > > > > > > > > (gdb) bt full > > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > > src/http/ngx_http_upstream.c:915 > > > c = 0x23b4160 > > > r = 0x22a2780 > > > ctx = > > address 0x20)> > > > u = 0x0 > > > > Could you please show results of the following gdb commands: > > > > fr 0 > > p *ev > > p *((ngx_connection_t *) ev->data) > > > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From agentzh at gmail.com Mon Sep 5 07:09:44 2011 From: agentzh at gmail.com (agentzh) Date: Mon, 5 Sep 2011 15:09:44 +0800 Subject: OpenResty Queries In-Reply-To: References: Message-ID: On Mon, Sep 5, 2011 at 1:38 AM, Nginx User wrote: > Some quick queries about some things missing from available documentation > about OpenResty > 1. Notice current version is bundled with Nginx 1.0.4. Is it possible for an > end user to upgrade Nginx? I.E. can I download OpenResty and slip in Nginx > 1.0.6? The current stable version of OpenResty is 1.0.5.1, which bundles the 1.0.5 Nginx core. The current devel release of OpenResty is 1.0.6.0rc2, which bundles the 1.0.6 core. Check out http://openresty.org/#Download Manually replacing the nginx core is possible, just replace the directory of OpenResty's bundle/nginx-1.0.5/ with your own, say, nginx-1.1.1/. OpenResty's configure script should be smart enough to pick up the new version of the Nginx core. But be careful with self replacing the Nginx core in OpenResty because forward compatibility is not guaranteed. A new untested Nginx core can break things, and that's all the point of bundling the Nginx core in the OpenResty bundle to ensure that it works well with *all* of the bundled components. > 2. The bundled modules are awesome but what is the process wants an > extra?third?party module? All of the nginx's configure options are inherited by OpenResty's configure script, so you can still add extra 3rd-party modules like this: ./configure --add-module=/path/to/your/other/module Regards, -agentzh From ggarron at alketech.com Mon Sep 5 08:04:48 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Mon, 5 Sep 2011 04:04:48 -0400 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway Message-ID: Bad gateway is a proxy problem I have not used upload module. But try having something listen to that port, or modify the proxy directive to point to the right port. Guillermo ------Original Message------ From: Piotr Polok To: Nginx ReplyTo: nginx at nginx.org Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway Sent: Sep 5, 2011 2:59 AM HI, I have compiled newest version of nginx (nginx/1.1.1) with nginx upload module (v 2.2.0), also the example config (nginx.conf) was copied from https://github.com/vkholodkov/nginx-upload-module into nginx direcoty. The html form is also copied from this location. So the installation and configuration is oryginal now without any changes. I'm getting some errors while uploading the file; The html form: '502 Bad Gateway'; The nginx error.log (/usr/local/nginx/logs/error.log): ------ 2011/09/05 08:35:15 [error] 21161#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.165, server: , request: "POST /upload HTTP/1.1", upstream: "http://127.0.0.1:8080/upload", host: "192.168.0.127", referrer: "http://192.168.0.127/http/upload.html" ------ Maybe it's a problem of my wrong understanding how does it works, I do not understand why in this example config the proxy_pass is going through local 8080 port but the server in this configuration is not listening on such port. Please help. -- best regards Piotr Polok _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From toplek at polok.pl Mon Sep 5 08:16:14 2011 From: toplek at polok.pl (Piotr Polok) Date: Mon, 05 Sep 2011 10:16:14 +0200 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway In-Reply-To: References: Message-ID: <881e6fdbefb126e2e272aeff53a4f205@polok.pl> On Mon, 5 Sep 2011 04:04:48 -0400, Guillermo Garron wrote: > Bad gateway is a proxy problem > I have not used upload module. But try having something listen to > that > port, or modify the proxy directive to point to the right port. HI, I do not use proxy. -- pozdrawiam Piotr Polok --------------------------- POLOK WELDING 44-121 Gliwice ul. Sowi?skiego 3 NIP: 631-112-45-46 tel: (32) 725 77 77 fax: (32) 444 64 50 http://www.polok.pl From ggarron at alketech.com Mon Sep 5 08:38:20 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Mon, 5 Sep 2011 04:38:20 -0400 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway Message-ID: Your problem is that in your conf file /test location is going to some no existent back end Either deal with it inside nginx or have some back end listening to 8080. That is the directive causing the problem Guillermo Ps sorry for top posting (bb issue) ------Original Message------ From: Piotr Polok To: Nginx ReplyTo: nginx at nginx.org Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway Sent: Sep 5, 2011 2:59 AM HI, I have compiled newest version of nginx (nginx/1.1.1) with nginx upload module (v 2.2.0), also the example config (nginx.conf) was copied from https://github.com/vkholodkov/nginx-upload-module into nginx direcoty. The html form is also copied from this location. So the installation and configuration is oryginal now without any changes. I'm getting some errors while uploading the file; The html form: '502 Bad Gateway'; The nginx error.log (/usr/local/nginx/logs/error.log): ------ 2011/09/05 08:35:15 [error] 21161#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.165, server: , request: "POST /upload HTTP/1.1", upstream: "http://127.0.0.1:8080/upload", host: "192.168.0.127", referrer: "http://192.168.0.127/http/upload.html" ------ Maybe it's a problem of my wrong understanding how does it works, I do not understand why in this example config the proxy_pass is going through local 8080 port but the server in this configuration is not listening on such port. Please help. -- best regards Piotr Polok _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From toplek at polok.pl Mon Sep 5 08:54:12 2011 From: toplek at polok.pl (Piotr Polok) Date: Mon, 05 Sep 2011 10:54:12 +0200 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway In-Reply-To: References: Message-ID: <36cedc1c4584f3d39d3b4899232b7e9b@polok.pl> > Your problem is that in your conf file /test location is going to > some no > existent back end > > Either deal with it inside nginx or have some back end listening to > 8080. > > That is the directive causing the problem xserver:/usr/local/nginx/conf# tshark -i lo port 8080 Running as user "root" and group "root". This could be dangerous. Capturing on lo 0.000000 127.0.0.1 -> 127.0.0.1 TCP 50768 > http-alt [SYN] Seq=0 Win=32792 Len=0 MSS=16396 TSV=340033941 TSER=0 WS=7 0.000039 127.0.0.1 -> 127.0.0.1 TCP http-alt > 50768 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0 There is no any service on this port. I'm not getting the idea what should happend on 'location @test'. Maybe in this place the file should be saved in the specyfic location? If yes, how this should be configured? -- best regards Piotr Polok From varia at e-healthexpert.org Mon Sep 5 09:11:17 2011 From: varia at e-healthexpert.org (Mark Alan) Date: Mon, 5 Sep 2011 10:11:17 +0100 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway In-Reply-To: <8d3997b08745b16189742395b9544d85@polok.pl> References: <8d3997b08745b16189742395b9544d85@polok.pl> Message-ID: <20110905101117.05d2416a@e-healthexpert.org> On Mon, 05 Sep 2011 08:59:58 +0200, Piotr Polok wrote: > I'm getting some errors while uploading the file; > The html form: '502 Bad Gateway'; > The nginx error.log (/usr/local/nginx/logs/error.log): > ------ > 2011/09/05 08:35:15 [error] 21161#0: *6 connect() failed (111: > Connection refused) while connecting to upstream, client: > 192.168.0.165, server: , request: "POST /upload HTTP/1.1", upstream: > "http://127.0.0.1:8080/upload", host: "192.168.0.127", referrer: > "http://192.168.0.127/http/upload.html" > ------ Your setup includes: client_max_body_size 100m; Do you also your php.ini configured to accommodate 100m files? Check: memory_limit (should be something able to cope with 100M files) post_max_size (should be >= 110M) file_uploads (should be On) upload_max_filesize (should be >= 100M) Regards, M. From toplek at polok.pl Mon Sep 5 09:33:26 2011 From: toplek at polok.pl (Piotr Polok) Date: Mon, 05 Sep 2011 11:33:26 +0200 Subject: Nginx upload module (v 2.2.0) :: 502 Bad Gateway In-Reply-To: <20110905101117.05d2416a@e-healthexpert.org> References: <8d3997b08745b16189742395b9544d85@polok.pl> <20110905101117.05d2416a@e-healthexpert.org> Message-ID: <95e66db4b6c311ca3b0987a55e9c2b30@polok.pl> > Your setup includes: > client_max_body_size 100m; > > Do you also your php.ini configured to accommodate 100m files? > Check: > memory_limit (should be something able to cope with 100M files) > post_max_size (should be >= 110M) > file_uploads (should be On) > upload_max_filesize (should be >= 100M) Thank you all for help! I found the solution on this thread: http://www.ruby-forum.com/topic/1432037 The problem was that I did not wrote the form handler script. This is my working configuration of nginx: /usr/local/nginx/conf/nginx.conf: ---- worker_processes 20; error_log logs/error.log notice; working_directory /usr/local/nginx/html; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; server { listen 80; client_max_body_size 100m; # Upload form should be submitted to this location location /upload { # Pass altered request body to this location upload_pass /my-form-handler; # Store files to this directory # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist upload_store /tmp 1; # Allow uploaded files to be read only by user upload_store_access user:r; # Set specified fields in request body upload_set_form_field "${upload_field_name}_name" $upload_file_name; upload_set_form_field "${upload_field_name}_content_type" $upload_content_type; upload_set_form_field "${upload_field_name}_path" $upload_tmp_path; # Inform backend about hash and size of a file upload_aggregate_form_field "${upload_field_name}_md5" $upload_file_md5; upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size; upload_pass_form_field "^submit$|^description$"; } include fastcgi.conf; location = /my-form-handler { fastcgi_pass 127.0.0.1:9000; } } } ---- /usr/local/nginx/html/my-form-handler ---- ---- -- best regards Piotr Polok From nginx-forum at nginx.us Mon Sep 5 10:58:56 2011 From: nginx-forum at nginx.us (locojohn) Date: Mon, 05 Sep 2011 06:58:56 -0400 Subject: URL decode rewrite handling: + vs. %20 In-Reply-To: <5e2ad7736ec3f420b7f1992a428e6969.NginxMailingListEnglish@forum.nginx.org> References: <5e2ad7736ec3f420b7f1992a428e6969.NginxMailingListEnglish@forum.nginx.org> Message-ID: You can also use PCRE capturing inside virtual host configuration, to capture both SCRIPT_FILENAME and PATH_INFO without URL encoding: location ~ ^(?.+\.php)$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$SCRIPT_FILENAME; fastcgi_pass ...; } location ~ ^(?.+\.php)(?.+)$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$SCRIPT_FILENAME; fastcgi_param PATH_INFO $PATH_INFO; fastcgi_param PATH_TRANSLATED $document_root$PATH_INFO; fastcgi_pass phpfarm; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214668,214792#msg-214792 From igor at sysoev.ru Mon Sep 5 13:19:50 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 5 Sep 2011 17:19:50 +0400 Subject: nginx-1.1.2 Message-ID: <20110905131950.GG34606@nginx.com> Changes with nginx 1.1.2 05 Sep 2011 *) Change: now if total size of all ranges is greater than source response size, then nginx disables ranges and returns just the source response. *) Feature: the "max_ranges" directive. *) Bugfix: the "ssl_verify_client", "ssl_verify_depth", and "ssl_prefer_server_ciphers" directives might work incorrectly if SNI was used. *) Bugfix: in the "proxy/fastcgi/scgi/uwsgi_ignore_client_abort" directives. -- Igor Sysoev From wendal1985 at gmail.com Mon Sep 5 13:32:46 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Mon, 5 Sep 2011 21:32:46 +0800 Subject: nginx-1.1.2 In-Reply-To: <20110905131950.GG34606@nginx.com> References: <20110905131950.GG34606@nginx.com> Message-ID: Great!! 2011/9/5 Igor Sysoev > Changes with nginx 1.1.2 05 Sep > 2011 > > *) Change: now if total size of all ranges is greater than source > response size, then nginx disables ranges and returns just the source > response. > > *) Feature: the "max_ranges" directive. > > *) Bugfix: the "ssl_verify_client", "ssl_verify_depth", and > "ssl_prefer_server_ciphers" directives might work incorrectly if SNI > was used. > > *) Bugfix: in the "proxy/fastcgi/scgi/uwsgi_ignore_client_abort" > directives. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Sep 5 15:16:18 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Sep 2011 19:16:18 +0400 Subject: openssl-1.0.0d & proxy_buffering In-Reply-To: <4E64DDF0.4040202@bestmx.ru> References: <4E64B9AA.9050302@bestmx.ru> <20110905121224.GA34606@nginx.com> <4E64BFEE.6030502@bestmx.ru> <20110905122936.GC34606@nginx.com> <4E64C36B.6080701@bestmx.ru> <20110905140432.GC1137@mdounin.ru> <4E64DDF0.4040202@bestmx.ru> Message-ID: <20110905151618.GE1137@mdounin.ru> Hello! On Mon, Sep 05, 2011 at 06:34:24PM +0400, Andrey N. Oktyabrski wrote: > On 05.09.11 18:04, Maxim Dounin wrote: > >>>????? ?? ? > >>?? ?????????? ??????? dragonfly x86_64 (???? ???? ?????? ??? > >>?????????????), ?? ????????????? - centos-5.2 i386 ?? vps. > > > >? ?????: > > > >1. ????? ./configure ?????????. > >2. Debug log. > ??????? ? ????? ??? ??? ????? ? ?????? ??????. ???? ?? debug log'?, ?????? ?? ????????? ?????????? ????? ???????? ??????. ? ?????????? nginx ????????? ?????????? ?? ????????, ? ??? ?? ???????????? ??????? ?????? (if any) - ????????????. ????????? ??? ???? ?????? - ????????? ????? ?????????? ?????? ?? [1], ??? ?????? ?????????? Content-Length. ??? ??? ?????????? ???????? ??? SSL ?/??? ?? ?????? ??????? - ??? ???? ???????, ?????? ??? ?????? ????? ???? ?? ???????. [1] http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001129.html Maxim Dounin From mdounin at mdounin.ru Mon Sep 5 15:18:06 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Sep 2011 19:18:06 +0400 Subject: openssl-1.0.0d & proxy_buffering In-Reply-To: <20110905151618.GE1137@mdounin.ru> References: <4E64B9AA.9050302@bestmx.ru> <20110905121224.GA34606@nginx.com> <4E64BFEE.6030502@bestmx.ru> <20110905122936.GC34606@nginx.com> <4E64C36B.6080701@bestmx.ru> <20110905140432.GC1137@mdounin.ru> <4E64DDF0.4040202@bestmx.ru> <20110905151618.GE1137@mdounin.ru> Message-ID: <20110905151806.GF1137@mdounin.ru> Hello! On Mon, Sep 05, 2011 at 07:16:18PM +0400, Maxim Dounin wrote: > Hello! > > On Mon, Sep 05, 2011 at 06:34:24PM +0400, Andrey N. Oktyabrski wrote: > > > On 05.09.11 18:04, Maxim Dounin wrote: > > >>>????? ?? ? > > >>?? ?????????? ??????? dragonfly x86_64 (???? ???? ?????? ??? > > >>?????????????), ?? ????????????? - centos-5.2 i386 ?? vps. > > > > > >? ?????: > > > > > >1. ????? ./configure ?????????. > > >2. Debug log. > > ??????? ? ????? ??? ??? ????? ? ?????? ??????. > > ???? ?? debug log'?, ?????? ?? ????????? ?????????? ????? ???????? > ??????. ? ?????????? nginx ????????? ?????????? ?? ????????, ? > ??? ?? ???????????? ??????? ?????? (if any) - ????????????. > > ????????? ??? ???? ?????? - ????????? ????? ?????????? ?????? ?? > [1], ??? ?????? ?????????? Content-Length. ??? ??? ?????????? > ???????? ??? SSL ?/??? ?? ?????? ??????? - ??? ???? ???????, > ?????? ??? ?????? ????? ???? ?? ???????. > > [1] http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001129.html Ooops, sorry, this was for nginx-ru at . Maxim Dounin From orz at loli.my Mon Sep 5 15:42:31 2011 From: orz at loli.my (=?UTF-8?B?44OT44Oq44OT44Oq4oWk?=) Date: Mon, 5 Sep 2011 23:42:31 +0800 Subject: upstream keepalive - call for testing In-Reply-To: <20110905070813.GY1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> <20110905070813.GY1137@mdounin.ru> Message-ID: (gdb) fr 0 #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at src/http/ngx_http_upstream.c:915 915 ctx->current_request = r; (gdb) p ngx_cycle->log $1 = (ngx_log_t *) 0x21f19a8 (gdb) p *r $2 = {signature = 51686928, connection = 0x23b4160, ctx = 0x0, main_conf = 0x0, srv_conf = 0x23e6dc8, loc_conf = 0x2216d58, read_event_handler = 0x42d5dd , write_event_handler = 0x42d2a6 , cache = 0x0, upstream = 0x0, upstream_states = 0x0, pool = 0x23e92d0, header_in = 0x2309ea0, headers_in = {headers = {last = 0x22a27f0, part = { elts = 0x23e9ae8, nelts = 5, next = 0x0}, size = 48, nalloc = 20, pool = 0x23e92d0}, host = 0x23e9b78, connection = 0x0, if_modified_since = 0x0, if_unmodified_since = 0x0, user_agent = 0x23e9b48, referer = 0x0, content_length = 0x0, content_type = 0x0, range = 0x0, if_range = 0x0, transfer_encoding = 0x0, expect = 0x0, accept_encoding = 0x0, via = 0x0, authorization = 0x0, keep_alive = 0x0, x_forwarded_for = 0x0, user = {len = 0, data = 0x0}, passwd = {len = 0, data = 0x0}, cookies = {elts = 0x23e9ea8, nelts = 0, size = 8, nalloc = 2, pool = 0x23e92d0}, server = {len = 14, data = 0x23e9edb "static.loli.myconnectioner-ag\360\324,\002"}, content_length_n = -1, keep_alive_n = -1, connection_type = 1, msie = 1, msie6 = 1, opera = 0, gecko = 0, chrome = 0, safari = 0, konqueror = 0}, headers_out = {headers = {last = 0x22a2920, part = {elts = 0x23e9320, nelts = 4, next = 0x0}, size = 48, nalloc = 20, pool = 0x23e92d0}, status = 200, status_line = {len = 0, data = 0x0}, server = 0x0, date = 0x0, content_length = 0x0, content_encoding = 0x0, location = 0x0, refresh = 0x0, last_modified = 0x0, content_range = 0x0, ---Type to continue, or q to quit--- accept_ranges = 0x23e93b0, www_authenticate = 0x0, expires = 0x23e9320, etag = 0x0, override_charset = 0x0, content_type_len = 24, content_type = { len = 24, data = 0x23e5bf0 "application/x-javascript"}, charset = { len = 0, data = 0x0}, content_type_lowcase = 0x23ea1e8 "application/x-javascripts\016>\002", content_type_hash = 15285649345721276481, cache_control = { elts = 0x23ea188, nelts = 1, size = 8, nalloc = 1, pool = 0x23e92d0}, content_length_n = 19773, date_time = 0, last_modified_time = 1313998502}, request_body = 0x0, lingering_time = 1315110106, start_sec = 1315110076, start_msec = 683, method = 2, http_version = 1001, request_line = {len = 0, data = 0x314ae20 "\360\f>\002"}, uri = {len = 15, data = 0x314ae24 ""}, args = {len = 0, data = 0x0}, exten = {len = 2, data = 0x314ae31 ""}, unparsed_uri = {len = 15, data = 0x314ae24 ""}, method_name = {len = 3, data = 0x314ae20 "\360\f>\002"}, http_protocol = {len = 8, data = 0x314ae34 ""}, out = 0x0, main = 0x22a2780, parent = 0x0, postponed = 0x0, post_subrequest = 0x0, posted_requests = 0x0, virtual_names = 0x2465c20, phase_handler = 11, content_handler = 0, access_code = 0, variables = 0x23e9808, ncaptures = 4, captures = 0x23e9ff0, captures_data = 0x314ae24 "", limit_rate = 0, header_size = 339, request_length = 183, err_status = 0, http_connection = 0x23b4228, log_handler = 0x42da14 , cleanup = 0x0, subrequests = 51, count = 0, blocked = 0, aio = 0, http_state = 2, complex_uri = 0, quoted_uri = 0, plus_in_uri = 0, space_in_uri = 0, ---Type to continue, or q to quit--- invalid_header = 0, add_uri_to_alias = 0, valid_location = 1, valid_unparsed_uri = 1, uri_changed = 0, uri_changes = 11, request_body_in_single_buf = 0, request_body_in_file_only = 0, request_body_in_persistent_file = 0, request_body_in_clean_file = 0, request_body_file_group_access = 0, request_body_file_log_level = 5, subrequest_in_memory = 0, waited = 0, cached = 0, gzip_tested = 1, gzip_ok = 0, gzip_vary = 1, proxy = 0, bypass_cache = 0, no_cache = 0, limit_zone_set = 0, limit_req_set = 0, pipeline = 0, plain_http = 0, chunked = 0, header_only = 0, keepalive = 0, lingering_close = 0, discard_body = 0, internal = 0, error_page = 0, ignore_content_encoding = 0, filter_finalize = 0, post_action = 0, request_complete = 1, request_output = 1, header_sent = 1, expect_tested = 0, root_tested = 1, done = 1, logged = 0, buffered = 0, main_filter_need_in_memory = 0, filter_need_in_memory = 0, filter_need_temporary = 0, allow_ranges = 1, stat_reading = 0, stat_writing = 1, state = 0, header_hash = 2715320498552542, lowcase_index = 10, lowcase_header = "connectionguage", '\000' , header_name_start = 0x314aed5 "\r\nible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MALN; InfoPath.1; Media Center PC 6.0; Tablet PC 2.0; .NET4.0C; .NET4.0E)", header_name_end = 0x314aecc "", header_start = 0x314aece "close", header_end = 0x314aed5 "\r\nible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MALN; Info---Type to continue, or q to quit--- Path.1; Media Center PC 6.0; Tablet PC 2.0; .NET4.0C; .NET4.0E)", uri_start = 0x314ae24 "", uri_end = 0x314ae33 "", uri_ext = 0x314ae31 "", args_start = 0x0, request_start = 0x314ae20 "\360\f>\002", request_end = 0x314ae3c "", method_end = 0x314ae22 ">\002", schema_start = 0x0, schema_end = 0x0, host_start = 0x0, host_end = 0x0, port_start = 0x0, port_end = 0x0, http_minor = 1264, http_major = 0} (gdb) p *r->connection $3 = {data = 0x30, read = 0x111, write = 0x22a2770, fd = 36740720, recv = 0x2309e80, send = 0, recv_chain = 0xb0, send_chain = 0x23b4170, listening = 0x0, sent = 36740848, log = 0x0, pool = 0x23b41d0, sockaddr = 0xf088e714b9a0002, socklen = 0, addr_text = {len = 4, data = 0x21f1c18 "S"}, ssl = 0x3cc35a0, local_sockaddr = 0x42d957, buffer = 0x23b4210, queue = {prev = 0x465bfc, next = 0x2e3234312e333131}, number = 3256446919138946616, requests = 140481256921360, buffered = 0, log_error = 0, single_connection = 0, unexpected_eof = 0, timedout = 0, error = 0, destroyed = 0, idle = 0, reusable = 0, close = 0, sendfile = 0, sndlowat = 0, tcp_nodelay = 0, tcp_nopush = 0} 2011/9/5 Maxim Dounin > Hello! > > On Mon, Sep 05, 2011 at 02:31:54AM +0800, MagicBear wrote: > > > (gdb) fr 0 > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) > > at src/http/ngx_http_upstream.c:915 > > 915 ctx->current_request = r; > > (gdb) p *ev > > $1 = {data = 0x7fc4576aa750, write = 1, accept = 0, instance = 1, active > = > > 1, > > disabled = 0, ready = 1, oneshot = 0, complete = 0, eof = 0, error = 0, > > timedout = 1, timer_set = 0, delayed = 0, read_discarded = 0, > > unexpected_eof = 0, deferred_accept = 0, pending_eof = 0, posted_ready > = > > 0, > > available = 0, handler = 0x43bf9c , > > index = 3503345872, log = 0x21f1770, timer = {key = 0, left = 0x0, > > right = 0x0, parent = 0x0, color = 0 '\000', data = 0 '\000'}, > > closed = 0, channel = 0, resolver = 0, next = 0x0, prev = 0x0} > > (gdb) p *((ngx_connection_t *) ev->data) > > $2 = {data = 0x22a2780, read = 0x7fc4575008a8, write = 0x7fc45735f8a8, > > fd = 66, recv = 0x41cc50 , send = 0x41cf08 > > , > > recv_chain = 0x41cd00 , > > send_chain = 0x421050 , listening = 0x0, > > sent = 0, log = 0x21f1770, pool = 0x237ff70, sockaddr = 0x0, socklen = > 0, > > addr_text = {len = 0, data = 0x0}, ssl = 0x0, local_sockaddr = 0x0, > > buffer = 0x0, queue = {prev = 0x0, next = 0x0}, number = 63713716, > > requests = 0, buffered = 0, log_error = 1, single_connection = 0, > > unexpected_eof = 0, timedout = 0, error = 0, destroyed = 0, idle = 0, > > reusable = 0, close = 0, sendfile = 1, sndlowat = 0, tcp_nodelay = 0, > > tcp_nopush = 0} > > Could you please also show the following (in the same frame, i.e. > after "fr 0"): > > p ngx_cycle->log > p *r > p *r->connection > > Maxim Dounin > > > > > > > 2011/9/5 Maxim Dounin > > > > > Hello! > > > > > > On Sun, Sep 04, 2011 at 01:33:59PM -0400, magicbear wrote: > > > > > > > Hello , when run for 5 days, today have 2 segment failure. > > > > > > > > 2011/09/04 12:00:47 [alert] 32147#0: worker process 8496 exited on > > > > signal 11 (core dumped) > > > > 2011/09/04 12:17:32 [alert] 8497#0: ignore long locked inactive cache > > > > entry 57c7c6c612a651727b880a1c9a2c7d2d, count:1 > > > > 2011/09/04 12:21:31 [alert] 32147#0: worker process 19185 exited on > > > > signal 11 (core dumped) > > > > > > > > > > > > > > > > > > > > Core was generated by `nginx:'. > > > > Program terminated with signal 11, Segmentation fault. > > > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > > > src/http/ngx_http_upstream.c:915 > > > > 915 ctx->current_request = r; > > > > (gdb) bt > > > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > > > src/http/ngx_http_upstream.c:915 > > > > #1 0x0000000000419e95 in ngx_event_expire_timers () at > > > > src/event/ngx_event_timer.c:149 > > > > #2 0x0000000000419ac7 in ngx_process_events_and_timers > > > > (cycle=0x21f1990) at src/event/ngx_event.c:261 > > > > > > Hm, this looks identical to one you've reported previously. Do > > > you have patch from > > > > > > http://mailman.nginx.org/pipermail/nginx/2011-August/028809.html > > > > > > applied? > > > > > > > #3 0x000000000041f76e in ngx_worker_process_cycle (cycle=0x21f1990, > > > > data=) at src/os/unix/ngx_process_cycle.c:800 > > > > #4 0x000000000041e16b in ngx_spawn_process (cycle=0x21f1990, > > > > proc=0x41f69d , data=0x0, name=0x463f3d > > > > "worker process", respawn=7) at src/os/unix/ngx_process.c:196 > > > > #5 0x000000000042008d in ngx_reap_children (cycle=0x21f1990) at > > > > src/os/unix/ngx_process_cycle.c:617 > > > > #6 ngx_master_process_cycle (cycle=0x21f1990) at > > > > src/os/unix/ngx_process_cycle.c:180 > > > > #7 0x0000000000406061 in main (argc=, > argv= > > > optimized out>) at src/core/nginx.c:405 > > > > > > > > > > > > (gdb) bt full > > > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) at > > > > src/http/ngx_http_upstream.c:915 > > > > c = 0x23b4160 > > > > r = 0x22a2780 > > > > ctx = > > > address 0x20)> > > > > u = 0x0 > > > > > > Could you please show results of the following gdb commands: > > > > > > fr 0 > > > p *ev > > > p *((ngx_connection_t *) ev->data) > > > > > > > > > Maxim Dounin > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdr.xp at gmail.com Mon Sep 5 16:16:19 2011 From: drdr.xp at gmail.com (dr-dr xp) Date: Tue, 6 Sep 2011 00:16:19 +0800 Subject: nginx 1.0.2 AIO problem with open_file_cache In-Reply-To: <20110904163413.GR1137@mdounin.ru> References: <20110903100335.GO1137@mdounin.ru> <20110904163413.GR1137@mdounin.ru> Message-ID: Thank you very much Dounin. With the patch it works fine now. On Mon, Sep 5, 2011 at 12:34 AM, Maxim Dounin wrote: > Hello! > > On Sat, Sep 03, 2011 at 11:06:24PM +0800, dr-dr xp wrote: > > > The attachment is the error.log with only the failed request. And stat > > output of this file: > > > > stat > > > //data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235 > > File: > > > `//data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235' > > Size: 51163499 Blocks: 100048 IO Block: 4096 regular file > > Device: 821h/2081d Inode: 464404482 Links: 1 > > Access: (0664/-rw-rw-r--) Uid: ( 1003/ www) Gid: ( 1003/ > www) > > Access: 2011-09-03 22:31:22.000000000 +0800 > > Modify: 2011-07-30 01:45:56.000000000 +0800 > > Change: 2011-07-30 01:45:56.000000000 +0800 > > > > > > Such error occurs randomly on random file. The only relavent thing seems > > like to be open_file_cache directive. > > File sizes are almost 5M to 20M. > > Files had not been changed. I checked the modify time of the files > involved > > in these errors. At first I had thought it was caused by a file change > too. > > But not. > > > > In my cluster there are also some other similar nodes running with the > same > > open_file_cache parameters but without aio enabled(sendfile is used). > They > > have no such issue. > > Please try the attached patch. > > Maxim Dounin > > > > > > > > > > > On Sat, Sep 3, 2011 at 6:03 PM, Maxim Dounin wrote: > > > > > Hello! > > > > > > On Sat, Sep 03, 2011 at 05:46:39PM +0800, dr-dr xp wrote: > > > > > > > Hello everybody. I recently have had some problem with AIO support > and > > > need > > > > some help or advice on it. > > > > > > > > With AIO on, everything was OK. But when I enabled open_file_cache, > nginx > > > > frequently closed client connection directly without sending back any > > > data. > > > > > > > > > > > > My platform is linux 2.6.30. CentOS 5.4; > > > > > > > > The nginx server that has this issue serves static file at backend. > > > Another > > > > nginx serves as proxy in front of it. > > > > Backend nginx config is like this: > > > > ... > > > > aio on; > > > > > > > > > > > > directio 512; > > > > > > > > > > > > output_buffers 1 128k; > > > > ... > > > > location /files { > > > > > > > > > > > > > > > > internal; > > > > > > > > > > > > alias /; > > > > open_file_cache max=50000 inactive=20s; > > > > > > > > > > > > open_file_cache_valid 30s; > > > > > > > > > > > > open_file_cache_min_uses 1; > > > > > > > > > > > > open_file_cache_errors on; > > > > > > > > > > > > With this config, on the frontend proxy server there are error logs > like > > > > this: > > > > > > > > 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely > > > closed > > > > connection while reading response header from upstream*, client: > > > > 221.193.212.77, server: , request: "GET .......... HTTP/1.1", > upstream: > > > > "http:// > > > > **/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", > > > > host..... > > > > > > > > > > > > And I saw in tcpdump output the connection was closed very quickly by > > > > backend nginx: > > > > > > > > 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S > > > > 1788188296:1788188296(0) win 5840 666482608 > > > > 0,nop,wscale 7> > > > > 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S > > > > 350810413:350810413(0) ack 1788188297 win 5792 1460,sackOK,timestamp > > > > 1948226601 66< > > > > 22:02:22.895695 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: . ack 1 > win > > > 46 > > > > > > > > 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P > > > 1:181(180) > > > > ack 1 win 46 > > > > 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack > 181 > > > win > > > > 54 > > > > 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F > 1:1(0) > > > ack > > > > 181 win 54 > > > > 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F > > > 181:181(0) > > > > ack 2 win 46 > > > > 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack > 182 > > > win > > > > 54 > > > > > > > > > > > > On the backend nginx, strace shows that io_getevents got an error > *"-22" > > > > EINVAL*. > > > > > > > > [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN > > > (Resource > > > > temporarily unavailable) > > > > [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, > > > > u64=139850875540289}}}, 512, 5672) = 1 > > > > [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved > > > Perman"..., > > > > 4096, 0, NULL, NULL) = 256 > > > > [pid 5275] close(201) = 0 > > > > [pid 5275] > > > > > > > > stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", > > > > {st_mode=S_IFREG|0600, st_size=122507, ...< > > > > [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, > 40}}) = > > > 1 > > > > > > > > > > > > [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, > 512, > > > > 5671) = 1 > > > > > > > > [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 > > > > [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, > 0xf436d8, > > > > -22, 0}}, {0, 0}) = 1* > > > > [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) > = > > > 338 > > > > [pid 5275] close(48) > > > > > > > > And access.log shows that response length is ZERO: > > > > > > > > [03/Sep/2011:06:28:48 +0800] "GET > > > > > > > > /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 > > > > HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- > > > > > > > > > > > > After I removed those *open_file_cache* directives, No such error > > > occurred. > > > > > > > > And the shorter *inactive* is, the more often I get such errors. > > > > > > > > > > > > Anybody has idea about avoiding this or fixing it? > > > > > > Could you please provide debug log? See > > > http://wiki.nginx.org/Debugging for more information. > > > > > > Additionally, some more info about file requested might be > > > helpful: how big it is? whether it changed on backend during > > > requests? if yes, is it changed atomically? > > > > > > Maxim Dounin > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > -- > > ???????????????? > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- ???????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Sep 5 16:38:07 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Sep 2011 20:38:07 +0400 Subject: nginx 1.0.2 AIO problem with open_file_cache In-Reply-To: References: <20110903100335.GO1137@mdounin.ru> <20110904163413.GR1137@mdounin.ru> Message-ID: <20110905163807.GI1137@mdounin.ru> Hello! On Tue, Sep 06, 2011 at 12:16:19AM +0800, dr-dr xp wrote: > Thank you very much Dounin. With the patch it works fine now. Thanks for testing, the patch was committed and will be included in next release. Maxim Dounin > > > > > On Mon, Sep 5, 2011 at 12:34 AM, Maxim Dounin wrote: > > > Hello! > > > > On Sat, Sep 03, 2011 at 11:06:24PM +0800, dr-dr xp wrote: > > > > > The attachment is the error.log with only the failed request. And stat > > > output of this file: > > > > > > stat > > > > > //data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235 > > > File: > > > > > `//data2/0d97e01d7fbc48e498897492f0863929/g260674/257/26fd3732cd9f92f2413d10206cd8b0c9-5157235' > > > Size: 51163499 Blocks: 100048 IO Block: 4096 regular file > > > Device: 821h/2081d Inode: 464404482 Links: 1 > > > Access: (0664/-rw-rw-r--) Uid: ( 1003/ www) Gid: ( 1003/ > > www) > > > Access: 2011-09-03 22:31:22.000000000 +0800 > > > Modify: 2011-07-30 01:45:56.000000000 +0800 > > > Change: 2011-07-30 01:45:56.000000000 +0800 > > > > > > > > > Such error occurs randomly on random file. The only relavent thing seems > > > like to be open_file_cache directive. > > > File sizes are almost 5M to 20M. > > > Files had not been changed. I checked the modify time of the files > > involved > > > in these errors. At first I had thought it was caused by a file change > > too. > > > But not. > > > > > > In my cluster there are also some other similar nodes running with the > > same > > > open_file_cache parameters but without aio enabled(sendfile is used). > > They > > > have no such issue. > > > > Please try the attached patch. > > > > Maxim Dounin > > > > > > > > > > > > > > > > > On Sat, Sep 3, 2011 at 6:03 PM, Maxim Dounin wrote: > > > > > > > Hello! > > > > > > > > On Sat, Sep 03, 2011 at 05:46:39PM +0800, dr-dr xp wrote: > > > > > > > > > Hello everybody. I recently have had some problem with AIO support > > and > > > > need > > > > > some help or advice on it. > > > > > > > > > > With AIO on, everything was OK. But when I enabled open_file_cache, > > nginx > > > > > frequently closed client connection directly without sending back any > > > > data. > > > > > > > > > > > > > > > My platform is linux 2.6.30. CentOS 5.4; > > > > > > > > > > The nginx server that has this issue serves static file at backend. > > > > Another > > > > > nginx serves as proxy in front of it. > > > > > Backend nginx config is like this: > > > > > ... > > > > > aio on; > > > > > > > > > > > > > > > directio 512; > > > > > > > > > > > > > > > output_buffers 1 128k; > > > > > ... > > > > > location /files { > > > > > > > > > > > > > > > > > > > > internal; > > > > > > > > > > > > > > > alias /; > > > > > open_file_cache max=50000 inactive=20s; > > > > > > > > > > > > > > > open_file_cache_valid 30s; > > > > > > > > > > > > > > > open_file_cache_min_uses 1; > > > > > > > > > > > > > > > open_file_cache_errors on; > > > > > > > > > > > > > > > With this config, on the frontend proxy server there are error logs > > like > > > > > this: > > > > > > > > > > 2011/09/03 17:01:19 [error] 12498#0: *78679759 *upstream prematurely > > > > closed > > > > > connection while reading response header from upstream*, client: > > > > > 221.193.212.77, server: , request: "GET .......... HTTP/1.1", > > upstream: > > > > > "http:// > > > > > > **/file/871586e763bf4417bf8d475858deee2b/260110/0b47fc7f4d84e4bcb01a6d6d1fcacc94-3581749", > > > > > host..... > > > > > > > > > > > > > > > And I saw in tcpdump output the connection was closed very quickly by > > > > > backend nginx: > > > > > > > > > > 22:02:22.892327 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: S > > > > > 1788188296:1788188296(0) win 5840 > 666482608 > > > > > 0,nop,wscale 7> > > > > > 22:02:22.895683 IP 172.16.228.63.irdmi > 172.16.113.32.58271: S > > > > > 350810413:350810413(0) ack 1788188297 win 5792 > 1460,sackOK,timestamp > > > > > 1948226601 66< > > > > > 22:02:22.895695 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: . ack 1 > > win > > > > 46 > > > > > > > > > > 22:02:22.895703 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: P > > > > 1:181(180) > > > > > ack 1 win 46 > > > > > 22:02:22.897680 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack > > 181 > > > > win > > > > > 54 > > > > > 22:02:22.898348 IP 172.16.228.63.irdmi > 172.16.113.32.58271: F > > 1:1(0) > > > > ack > > > > > 181 win 54 > > > > > 22:02:22.898473 IP 172.16.113.32.58271 > 172.16.228.63.irdmi: F > > > > 181:181(0) > > > > > ack 2 win 46 > > > > > 22:02:22.899804 IP 172.16.228.63.irdmi > 172.16.113.32.58271: . ack > > 182 > > > > win > > > > > 54 > > > > > > > > > > > > > > > On the backend nginx, strace shows that io_getevents got an error > > *"-22" > > > > > EINVAL*. > > > > > > > > > > [pid 5275] recvfrom(48, 0x7fffe4400ae7, 1, 2, 0, 0) = -1 EAGAIN > > > > (Resource > > > > > temporarily unavailable) > > > > > [pid 5275] epoll_wait(6, {{EPOLLIN|EPOLLOUT, {u32=2445415233, > > > > > u64=139850875540289}}}, 512, 5672) = 1 > > > > > [pid 5275] recvfrom(201, "\1\6\0\1\0\337\1\0Status: 301 Moved > > > > Perman"..., > > > > > 4096, 0, NULL, NULL) = 256 > > > > > [pid 5275] close(201) = 0 > > > > > [pid 5275] > > > > > > > > > > > stat("//data1/871586e763bf4417bf8d475858deee2b/g268315/252/995f20f76d0d3871fdb5d71bbc92956c-27769564", > > > > > {st_mode=S_IFREG|0600, st_size=122507, ...< > > > > > [pid 5275] io_submit(139850942226432, 1, {{0xf43718, 0, 0, 0, > > 40}}) = > > > > 1 > > > > > > > > > > > > > > > [pid 5275] epoll_wait(6, {{EPOLLIN, {u32=7173248, u64=7173248}}}, > > 512, > > > > > 5671) = 1 > > > > > > > > > > [pid 5275] read(7, "\1\0\0\0\0\0\0\0", 8) = 8 > > > > > [pid 5275] *io_getevents(139850942226432, 1, 64, {{0xf43718, > > 0xf436d8, > > > > > -22, 0}}, {0, 0}) = 1* > > > > > [pid 5275] write(24, "172.16.164.30 - - 172.16.228.63:"..., 338) > > = > > > > 338 > > > > > [pid 5275] close(48) > > > > > > > > > > And access.log shows that response length is ZERO: > > > > > > > > > > [03/Sep/2011:06:28:48 +0800] "GET > > > > > > > > > > > /file/871586e763bf4417bf8d475858deee2b/260284/ed31933859d27e33b8398deaea1d2ade-3969549 > > > > > HTTP/1.0" 206 0 0.001 "-" "-" "-" Range:bytes=27459105- > > > > > > > > > > > > > > > After I removed those *open_file_cache* directives, No such error > > > > occurred. > > > > > > > > > > And the shorter *inactive* is, the more often I get such errors. > > > > > > > > > > > > > > > Anybody has idea about avoiding this or fixing it? > > > > > > > > Could you please provide debug log? See > > > > http://wiki.nginx.org/Debugging for more information. > > > > > > > > Additionally, some more info about file requested might be > > > > helpful: how big it is? whether it changed on backend during > > > > requests? if yes, is it changed atomically? > > > > > > > > Maxim Dounin > > > > > > > > _______________________________________________ > > > > nginx mailing list > > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > > > > > > -- > > > ???????????????? > > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > -- > ???????????????? > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Mon Sep 5 18:02:10 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Sep 2011 22:02:10 +0400 Subject: upstream keepalive - call for testing In-Reply-To: References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> <20110905070813.GY1137@mdounin.ru> Message-ID: <20110905180210.GL1137@mdounin.ru> Hello! On Mon, Sep 05, 2011 at 11:42:31PM +0800, ????? wrote: > (gdb) fr 0 > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) > at src/http/ngx_http_upstream.c:915 > 915 ctx->current_request = r; > (gdb) p ngx_cycle->log > $1 = (ngx_log_t *) 0x21f19a8 > (gdb) p *r > $2 = {signature = 51686928, connection = 0x23b4160, ctx = 0x0, [...] This looks like memory corruption, but unfortunately I don't see any traces of the real cause. My best quess is improper handling of proxy_ignore_client_abort as fixed in 1.1.2. Please try 1.1.2 with patches from http://nginx.org/patches/patch-nginx-keepalive-full-5.txt It already includes upstream keepalive module, as well as all other upstream-keepalive related fixes. See here for details: http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001147.html Maxim Dounin From nginx-forum at nginx.us Mon Sep 5 18:13:03 2011 From: nginx-forum at nginx.us (locojohn) Date: Mon, 05 Sep 2011 14:13:03 -0400 Subject: Help with rewrite In-Reply-To: <461adae45a9d3ba0d9d4ed211a89df13.NginxMailingListEnglish@forum.nginx.org> References: <461adae45a9d3ba0d9d4ed211a89df13.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2daf92f694ebb063350c5d57b27c59a1.NginxMailingListEnglish@forum.nginx.org> the first "if" can be replaced with the following: location ^.+\.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/vbseo.php; fastcgi_pass ....; # your fastcgi handler } not sure that the second "if" is needed, unless they meant to handle all non-existing files (404 errors) with vbseo.php. this can be done with the following: location / { error_page 404 = /vbseo.php; } Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214761,214833#msg-214833 From nginx-forum at nginx.us Mon Sep 5 18:17:25 2011 From: nginx-forum at nginx.us (locojohn) Date: Mon, 05 Sep 2011 14:17:25 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: <110b6d83f8fc0d1ab9b8cd761506b946.NginxMailingListEnglish@forum.nginx.org> References: <2a1a1ceedd33352155268607634ce01f@mail.gmail.com> <110b6d83f8fc0d1ab9b8cd761506b946.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4a7c97edb72696de67eabdbd166f82b1.NginxMailingListEnglish@forum.nginx.org> Please post your nginx.conf here, because the error can be in the nginx configuration. Also make sure to have cgi.fix_pathinfo=1 in your php.ini. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214834#msg-214834 From nginx-forum at nginx.us Mon Sep 5 18:21:09 2011 From: nginx-forum at nginx.us (loganbest) Date: Mon, 05 Sep 2011 14:21:09 -0400 Subject: Can't fix "No input file specified." with php-fastcgi In-Reply-To: <4a7c97edb72696de67eabdbd166f82b1.NginxMailingListEnglish@forum.nginx.org> References: <2a1a1ceedd33352155268607634ce01f@mail.gmail.com> <110b6d83f8fc0d1ab9b8cd761506b946.NginxMailingListEnglish@forum.nginx.org> <4a7c97edb72696de67eabdbd166f82b1.NginxMailingListEnglish@forum.nginx.org> Message-ID: cgi.fix is already set in php.ini #user nobody; worker_processes 3; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8; passenger_ruby /usr/local/bin/ruby; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /var/www/contest; index index.php index.html index.htm; } location /staging { root /var/www/FreeFallHighScoreWebStuff/current/public; passenger_enabled on; passenger_min_instances 3; } location /staging_assets { root /var/www/FreeFallHighScoreWebStuff/current/public; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location /gitphp { root /var/www; index index.php index.html index.htm; } ## Parse all .php file in the /var/www directory location ~ .php$ { root /var/www; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass backend; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } location ~ /\.ht { deny all; } } upstream backend { server 127.0.0.1:9000; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214746,214835#msg-214835 From kworthington at gmail.com Mon Sep 5 20:44:25 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Mon, 5 Sep 2011 16:44:25 -0400 Subject: nginx-1.0.6 In-Reply-To: References: <20110829144251.GE21595@nginx.com> Message-ID: Hello! Now available for free download: Nginx 1.0.6 For Windows http://goo.gl/3H1cJ These builds were built using Cygwin in order to support legacy users. Official native Windows builds are available at nginx.org Thanks, Kevin -- Kevin Worthington kworthington (AT} gmail (DoT] com http://www.kevinworthington.com/ On Mon, Aug 29, 2011 at 11:26 AM, Joe wrote: > Thanks Igor. > > > Regards, > Joe > > > On Mon, Aug 29, 2011 at 9:42 PM, Igor Sysoev wrote: >> >> Changes with nginx 1.0.6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 29 Aug >> 2011 >> >> ? ?*) Feature: cache loader run time decrease. >> >> ? ?*) Feature: loading time decrease of configuration with large number of >> ? ? ? HTTPS sites. >> >> ? ?*) Feature: now nginx supports ECDHE key exchange ciphers. >> ? ? ? Thanks to Adrian Kotelba. >> >> ? ?*) Feature: the "lingering_close" directive. >> >> ? ?*) Feature: now shared zones and caches use POSIX semaphores on >> Solaris. >> ? ? ? Thanks to Den Ivanov. >> >> ? ?*) Bugfix: nginx could not be built on Linux 3.0. >> >> ? ?*) Bugfix: a segmentation fault might occur in a worker process if >> ? ? ? "fastcgi/scgi/uwsgi_param" directives were used with values starting >> ? ? ? with "HTTP_"; the bug had appeared in 0.8.40. >> >> ? ?*) Bugfix: in closing connection for pipelined requests. >> >> ? ?*) Bugfix: nginx did not disable gzipping if client sent "gzip;q=0" in >> ? ? ? "Accept-Encoding" request header line. >> >> ? ?*) Bugfix: in timeout in unbuffered proxied mode. >> >> ? ?*) Bugfix: memory leaks when a "proxy_pass" directive contains >> variables >> ? ? ? and proxies to an HTTPS backend. >> >> ? ?*) Bugfix: in parameter validaiton of a "proxy_pass" directive with >> ? ? ? variables. >> ? ? ? Thanks to Lanshun Zhou. >> >> ? ?*) Bugfix: SSL did not work on QNX. >> >> ? ?*) Bugfix: SSL modules could not be built by gcc 4.6 without >> ? ? ? --with-debug option. >> >> -- >> Igor Sysoev >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > From hagaia at qwilt.com Mon Sep 5 22:21:00 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Tue, 6 Sep 2011 01:21:00 +0300 Subject: Help with AIO Message-ID: Hi I configured Nginx with *aio *mode *on *and 1 *worker process* In benchmarking I saw limit of 1024 concurrent sessions even configured to 4096 *worker connections* When I looked in the source code I could see that io_setup is called with fix value of 1024 max events can anyone please explain me the hard coded limit Is it OK to change it or it is derived from other limit I am not aware of any help will be appreciated thanks Hagai -- *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lsd at wootangent.net Tue Sep 6 02:45:46 2011 From: lsd at wootangent.net (Leigh Dyer) Date: Tue, 06 Sep 2011 12:45:46 +1000 Subject: Issue with If-Range header and X-Accel-Redirect requests with upstream Last-Modified header Message-ID: <4E65895A.4020506@wootangent.net> Hi, I have nginx 1.0.5 set up as a proxy in front of a Ruby/Ramaze application, using X-Accel-Redirect to efficiently handle sending large binary files by handing those transfers over to nginx. Range requests against this setup work just fine, but "If-Range" headers from the client are ignored -- the server always returns the requested range, even when the If-Range date doesn't match the file's Last-Modified date. The problem seems to be due to this line in our config: add_header Last-Modified $upstream_http_last_modified; This sets the Last-Modified date on file sent to the client to the value sent to nginx from Ruby. With this line in the config, I get the If-Range issue described above. If I comment this out, Last-Modified is taken from the file's mtime instead, but If-Range works. Is there any chance of getting this fixed? Thanks Leigh From amoiz.shine at gmail.com Tue Sep 6 02:54:32 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Tue, 06 Sep 2011 10:54:32 +0800 Subject: nginx-1.0.6 In-Reply-To: References: <20110829144251.GE21595@nginx.com> Message-ID: <1315277672.1958.3.camel@sharl-desktop> ? 2011-09-05?? 16:44 -0400?Kevin Worthington??? > Hello! > > Now available for free download: Nginx 1.0.6 For Windows http://goo.gl/3H1cJ > > These builds were built using Cygwin in order to support legacy users. > Official native Windows builds are available at nginx.org > > Thanks, > Kevin > -- > Kevin Worthington > kworthington (AT} gmail (DoT] com > http://www.kevinworthington.com/ > > > > On Mon, Aug 29, 2011 at 11:26 AM, Joe wrote: > > Thanks Igor. > > > > > > Regards, > > Joe > > > > > > On Mon, Aug 29, 2011 at 9:42 PM, Igor Sysoev wrote: > >> > >> Changes with nginx 1.0.6 29 Aug > >> 2011 > >> > >> *) Feature: cache loader run time decrease. > >> > >> *) Feature: loading time decrease of configuration with large number of > >> HTTPS sites. > >> > >> *) Feature: now nginx supports ECDHE key exchange ciphers. > >> Thanks to Adrian Kotelba. > >> > >> *) Feature: the "lingering_close" directive. > >> > >> *) Feature: now shared zones and caches use POSIX semaphores on > >> Solaris. > >> Thanks to Den Ivanov. > >> > >> *) Bugfix: nginx could not be built on Linux 3.0. > >> > >> *) Bugfix: a segmentation fault might occur in a worker process if > >> "fastcgi/scgi/uwsgi_param" directives were used with values starting > >> with "HTTP_"; the bug had appeared in 0.8.40. > >> > >> *) Bugfix: in closing connection for pipelined requests. > >> > >> *) Bugfix: nginx did not disable gzipping if client sent "gzip;q=0" in > >> "Accept-Encoding" request header line. > >> > >> *) Bugfix: in timeout in unbuffered proxied mode. > >> > >> *) Bugfix: memory leaks when a "proxy_pass" directive contains > >> variables > >> and proxies to an HTTPS backend. > >> > >> *) Bugfix: in parameter validaiton of a "proxy_pass" directive with > >> variables. > >> Thanks to Lanshun Zhou. > >> > >> *) Bugfix: SSL did not work on QNX. > >> > >> *) Bugfix: SSL modules could not be built by gcc 4.6 without > >> --with-debug option. > >> > >> -- > >> Igor Sysoev > >> > >> _______________________________________________ > >> nginx mailing list > >> nginx at nginx.org > >> http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx thanks for your work! -- Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) Using Gmail? Please read this important notice: http://www.fsf.org/campaigns/jstrap/gmail?10073. From nginx-forum at nginx.us Tue Sep 6 06:39:41 2011 From: nginx-forum at nginx.us (magicbear) Date: Tue, 06 Sep 2011 02:39:41 -0400 Subject: upstream keepalive - call for testing In-Reply-To: <20110905180210.GL1137@mdounin.ru> References: <20110905180210.GL1137@mdounin.ru> Message-ID: <870c8a757b4e464870698eefa90f49d0.NginxMailingListEnglish@forum.nginx.org> ok, I will try that at another dedicated server, thanks for your Helps. MagicBear Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Mon, Sep 05, 2011 at 11:42:31PM +0800, > ????? wrote: > > > (gdb) fr 0 > > #0 ngx_http_upstream_handler > (ev=0x7fc45735f8a8) > > at src/http/ngx_http_upstream.c:915 > > 915 ctx->current_request = r; > > (gdb) p ngx_cycle->log > > $1 = (ngx_log_t *) 0x21f19a8 > > (gdb) p *r > > $2 = {signature = 51686928, connection = > 0x23b4160, ctx = 0x0, > > [...] > > This looks like memory corruption, but > unfortunately I don't see > any traces of the real cause. My best quess is > improper handling > of proxy_ignore_client_abort as fixed in 1.1.2. > Please try 1.1.2 > with patches from > > http://nginx.org/patches/patch-nginx-keepalive-ful > l-5.txt > > It already includes upstream keepalive module, as > well as all > other upstream-keepalive related fixes. See here > for details: > > http://mailman.nginx.org/pipermail/nginx-devel/201 > 1-September/001147.html > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,214853#msg-214853 From mdounin at mdounin.ru Tue Sep 6 06:50:18 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Sep 2011 10:50:18 +0400 Subject: Issue with If-Range header and X-Accel-Redirect requests with upstream Last-Modified header In-Reply-To: <4E65895A.4020506@wootangent.net> References: <4E65895A.4020506@wootangent.net> Message-ID: <20110906065018.GQ1137@mdounin.ru> Hello! On Tue, Sep 06, 2011 at 12:45:46PM +1000, Leigh Dyer wrote: > Hi, > > I have nginx 1.0.5 set up as a proxy in front of a Ruby/Ramaze > application, using X-Accel-Redirect to efficiently handle sending > large binary files by handing those transfers over to nginx. Range > requests against this setup work just fine, but "If-Range" headers > from the client are ignored -- the server always returns the > requested range, even when the If-Range date doesn't match the > file's Last-Modified date. > > The problem seems to be due to this line in our config: > > add_header Last-Modified $upstream_http_last_modified; > > This sets the Last-Modified date on file sent to the client to the > value sent to nginx from Ruby. With this line in the config, I get > the If-Range issue described above. If I comment this out, > Last-Modified is taken from the file's mtime instead, but If-Range > works. > > Is there any chance of getting this fixed? Please try the attached patch. Maxim Dounin -------------- next part -------------- # HG changeset patch # User Maxim Dounin # Date 1315291748 -14400 # Node ID e51619385db9694030b9614c833a2b2504b377c9 # Parent 014764a85840606c90317e9f44f2b9fa139cbc8b Handling of If-Range with add_header Last-Modified. diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -369,7 +369,8 @@ ngx_http_set_last_modified(ngx_http_requ old = NULL; } - r->headers_out.last_modified_time = -1; + r->headers_out.last_modified_time = ngx_http_parse_time(value->data, + value->len); if (old == NULL || *old == NULL) { @@ -382,6 +383,8 @@ ngx_http_set_last_modified(ngx_http_requ return NGX_ERROR; } + *old = h; + } else { h = *old; diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c --- a/src/http/modules/ngx_http_range_filter_module.c +++ b/src/http/modules/ngx_http_range_filter_module.c @@ -173,7 +173,11 @@ ngx_http_range_header_filter(ngx_http_re goto next_filter; } - if (r->headers_in.if_range && r->headers_out.last_modified_time != -1) { + if (r->headers_in.if_range) { + + if (r->headers_out.last_modified_time == (time_t) -1) { + goto next_filter; + } if_range = ngx_http_parse_time(r->headers_in.if_range->value.data, r->headers_in.if_range->value.len); From lsd at wootangent.net Tue Sep 6 06:52:41 2011 From: lsd at wootangent.net (Leigh Dyer) Date: Tue, 06 Sep 2011 16:52:41 +1000 Subject: Issue with If-Range header and X-Accel-Redirect requests with upstream Last-Modified header In-Reply-To: <4E65895A.4020506@wootangent.net> References: <4E65895A.4020506@wootangent.net> Message-ID: <4E65C339.8090801@wootangent.net> On 6/09/11 12:45 PM, Leigh Dyer wrote: > Hi, > > I have nginx 1.0.5 set up as a proxy in front of a Ruby/Ramaze > application, using X-Accel-Redirect to efficiently handle sending large > binary files by handing those transfers over to nginx. Range requests > against this setup work just fine, but "If-Range" headers from the > client are ignored -- the server always returns the requested range, > even when the If-Range date doesn't match the file's Last-Modified date. Hi again, I spent some time looking in to this and created a patch that seems to fix the problem for me. The issue was in "ngx_http_set_last_modified" in http/modules/ngx_http_headers_filter_module.c -- last_modified_time gets set to -1 and is then never updated with the new value. I have no idea how correct this patch is, so I'd greatly appreciate it if someone could review this for me. Thanks Leigh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: nginx-1.0.5-ifrange-add_header-lastmodified-fix.patch URL: From lsd at wootangent.net Tue Sep 6 07:00:47 2011 From: lsd at wootangent.net (Leigh Dyer) Date: Tue, 06 Sep 2011 17:00:47 +1000 Subject: Issue with If-Range header and X-Accel-Redirect requests with upstream Last-Modified header In-Reply-To: <20110906065018.GQ1137@mdounin.ru> References: <4E65895A.4020506@wootangent.net> <20110906065018.GQ1137@mdounin.ru> Message-ID: <4E65C51F.4090900@wootangent.net> On 6/09/11 4:50 PM, Maxim Dounin wrote: > Hello! > > Please try the attached patch. Thanks Maxim -- your patch has fixed the problem for me. I feel a little silly for spending the time to come up with my own patch, but at least I know more about nginx now than I did this morning :) Thanks Leigh > > Maxim Dounin > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From andrew at nginx.com Tue Sep 6 07:02:39 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Tue, 6 Sep 2011 11:02:39 +0400 Subject: Issue with If-Range header and X-Accel-Redirect requests with upstream Last-Modified header In-Reply-To: <4E65C51F.4090900@wootangent.net> References: <4E65895A.4020506@wootangent.net> <20110906065018.GQ1137@mdounin.ru> <4E65C51F.4090900@wootangent.net> Message-ID: <46444432-D6C1-49FE-A1E0-98ED91544375@nginx.com> Leigh, You don't need to be silly at all. Thanks a lot for spotting this one. -- Andrew Alexeev w. http://nginx.org On Sep 6, 2011, at 11:00 AM, Leigh Dyer wrote: > On 6/09/11 4:50 PM, Maxim Dounin wrote: >> Hello! >> >> Please try the attached patch. > > Thanks Maxim -- your patch has fixed the problem for me. I feel a little silly for spending the time to come up with my own patch, but at least I know more about nginx now than I did this morning :) > > Thanks > Leigh > >> >> Maxim Dounin >> >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From mdounin at mdounin.ru Tue Sep 6 07:33:52 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Sep 2011 11:33:52 +0400 Subject: Help with AIO In-Reply-To: References: Message-ID: <20110906073352.GR1137@mdounin.ru> Hello! On Tue, Sep 06, 2011 at 01:21:00AM +0300, Hagai Avrahami wrote: > Hi > > I configured Nginx with *aio *mode *on *and 1 *worker process* > In benchmarking I saw limit of 1024 concurrent sessions even configured to > 4096 *worker connections* Sure it's not limitation of the benchmarking tool you use? Most tools out there use select() and hence limited to 1024 concurrent connections. > When I looked in the source code I could see that io_setup is called with > fix value of 1024 max events > can anyone please explain me the hard coded limit > Is it OK to change it or it is derived from other limit I am not aware of > any help will be appreciated io_setup() maxevents is a limit on number of aio requests allowed to be submitted simulteneously; if nginx hits this limit, it will fallback to normal blocking read. If you are going to change it, make sure to keep total for all processes lower than /proc/sys/fs/aio-max-nr. Maxim Dounin From hagaia at qwilt.com Tue Sep 6 07:46:56 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Tue, 6 Sep 2011 09:46:56 +0200 Subject: Help with AIO In-Reply-To: <20110906073352.GR1137@mdounin.ru> References: <20110906073352.GR1137@mdounin.ru> Message-ID: Thanks a lot I will try it On Tue, Sep 6, 2011 at 9:33 AM, Maxim Dounin wrote: > Hello! > > On Tue, Sep 06, 2011 at 01:21:00AM +0300, Hagai Avrahami wrote: > > > Hi > > > > I configured Nginx with *aio *mode *on *and 1 *worker process* > > In benchmarking I saw limit of 1024 concurrent sessions even configured > to > > 4096 *worker connections* > > Sure it's not limitation of the benchmarking tool you use? Most > tools out there use select() and hence limited to 1024 > concurrent connections. > > > When I looked in the source code I could see that io_setup is called > with > > fix value of 1024 max events > > can anyone please explain me the hard coded limit > > Is it OK to change it or it is derived from other limit I am not aware of > > any help will be appreciated > > io_setup() maxevents is a limit on number of aio requests allowed > to be submitted simulteneously; if nginx hits this limit, it will > fallback to normal blocking read. > > If you are going to change it, make sure to keep total for all > processes lower than /proc/sys/fs/aio-max-nr. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Sep 6 13:12:32 2011 From: nginx-forum at nginx.us (djeyewater) Date: Tue, 06 Sep 2011 09:12:32 -0400 Subject: nginx not gzipping php output Message-ID: Nginx isn't gzipping php pages, but I don't know why? I'm using the Audits tab in Google Chrome Developer tools to determine that the pages aren't being gzipped. My config: nginx version: nginx/0.8.52 built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) configure arguments: --prefix=/home/djeyewater/apps/nginx --with-pcre=/home/djeyewater/tarballs/pcre-8.10 --without-http_autoindex_module --without-http_charset_module --without-http_empty_gif_module --without-http_geo_module --without-http_ssi_module --with-http_gzip_static_module --with-http_realip_module --with-http_geoip_module --with-cc-opt='-I /home/djeyewater/apps/GeoIP/include' --with-ld-opt='-Wl,-R,/home/djeyewater/apps/GeoIP/lib -L /home/djeyewater/apps/GeoIP/lib' And http section from the .conf file: http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; sendfile on; keepalive_timeout 10 10; port_in_redirect off; #Fix IP address set_real_ip_from 127.0.0.1; real_ip_header X-Forwarded-For; gzip on; gzip_comp_level 3; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xhtml+xml application/xml+rss text/javascript; gzip_disable "MSIE [1-6]\."; geoip_country /home/djeyewater/apps/GeoIP/share/GeoIP/GeoIP.dat; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent"'; include sites/*; } Thanks Dave Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214879,214879#msg-214879 From nginx-forum at nginx.us Tue Sep 6 13:33:49 2011 From: nginx-forum at nginx.us (magicbear) Date: Tue, 06 Sep 2011 09:33:49 -0400 Subject: nginx not gzipping php output In-Reply-To: References: Message-ID: Check your PHP output header for "Content-Type", if it is not text/html and one of the gzip_types, it won't be compress. Your config I have tested on my server, it will compress normally. MagicBear Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214879,214881#msg-214881 From david at digitalronin.com Tue Sep 6 13:45:28 2011 From: david at digitalronin.com (David Salgado) Date: Tue, 6 Sep 2011 14:45:28 +0100 Subject: Old versions of Nginx Message-ID: Hi there I'm trying to work with some third-party modules, and it seems they need very specific point releases of nginx in order to work correctly. e.g. the handlersocket module here; https://github.com/akalend/ngx_http_handlersocket_json_module ...apparently works with nginx 0.8.64. But, that version is not available on the download page here; http://nginx.org/en/download.html I can't even find it in the SVN repository. trac.nginx.org/nginx/browser#nginx/tags Is there a place to get old releases of the nginx source tarballs? Thanks David From nginx-forum at nginx.us Tue Sep 6 13:55:23 2011 From: nginx-forum at nginx.us (djeyewater) Date: Tue, 06 Sep 2011 09:55:23 -0400 Subject: nginx not gzipping php output In-Reply-To: References: Message-ID: Thanks for testing it MagicBear. Google Chrome reports content type header as: Content-Type:text/html; charset=UTF-8 So still not sure why it is not working. I checked nginx changelog and couldn't see anything that looked to be pointing out that this was an issue in older versions of nginx. Still, I will try latest stable version and see if that makes any difference. Dave Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214879,214885#msg-214885 From mdounin at mdounin.ru Tue Sep 6 14:01:23 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Sep 2011 18:01:23 +0400 Subject: Old versions of Nginx In-Reply-To: References: Message-ID: <20110906140123.GX1137@mdounin.ru> Hello! On Tue, Sep 06, 2011 at 02:45:28PM +0100, David Salgado wrote: > Hi there > > I'm trying to work with some third-party modules, and it seems they > need very specific point releases of nginx in order to work correctly. > > e.g. the handlersocket module here; > > https://github.com/akalend/ngx_http_handlersocket_json_module > > ...apparently works with nginx 0.8.64. > > But, that version is not available on the download page here; > > http://nginx.org/en/download.html > > I can't even find it in the SVN repository. > > trac.nginx.org/nginx/browser#nginx/tags This is because there was no such version. The last one in 0.8.* branch is 0.8.55. > Is there a place to get old releases of the nginx source tarballs? The http://nginx.org/download/ should be a proper one. Currently it only contains tarballs since 2007, probably older tarballs should be placed there too, just for history. Maxim Dounin From lists at ruby-forum.com Tue Sep 6 14:04:21 2011 From: lists at ruby-forum.com (Matthias R. W.) Date: Tue, 06 Sep 2011 16:04:21 +0200 Subject: Content-Length header missing after proxying In-Reply-To: <4E53F504.2020402@cloud9.co.uk> References: <4E53F504.2020402@cloud9.co.uk> Message-ID: <767401579bb79c93e252e939b9285059@ruby-forum.com> Hello outside there, I'm working on a corresponding issue To get cloud9 at node.js through an ssl-offload proxy I've set the following nginx configuration: upstream nodejs3001 { server 127.0.0.1:3001; } server { listen 127.0.0.1:84; server_name portal.domain.tld; access_log /var/log/nginx/customlogfile.log; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://nodejs3001; proxy_redirect off; } } this is the last log-entry: 192.168.1.123 - admin [06/Sep/2011:15:28:37 +0200] "GET /socket.io/1/xhr-polling/1502126590706860217?t1315315712123 HTTP/1.1" 200 0 "http://127.0.0.1:84/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" and this is the content of the header regarding to get this last step: Request URL:http://127.0.01:84/socket.io/1/xhr-polling/1603386210380646057?t1315315788760 Request Headersview source Referer:http://127.0.0.1:84/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1 Query String Parametersview URL encoded I think we'll have the most success here: https://github.com/ajaxorg/cloud9/issues/267 Tell me... Are you trying to do the same? ?atthias -- Posted via http://www.ruby-forum.com/. From david at digitalronin.com Tue Sep 6 14:05:40 2011 From: david at digitalronin.com (David Salgado) Date: Tue, 6 Sep 2011 15:05:40 +0100 Subject: Old versions of Nginx In-Reply-To: <20110906140123.GX1137@mdounin.ru> References: <20110906140123.GX1137@mdounin.ru> Message-ID: > This is because there was no such version. ?The last one in 0.8.* > branch is 0.8.55. Ah, that would explain it! The module's author must have gotten confused. Many thanks David From orz at loli.my Tue Sep 6 14:26:57 2011 From: orz at loli.my (=?UTF-8?B?44OT44Oq44OT44Oq4oWk?=) Date: Tue, 6 Sep 2011 22:26:57 +0800 Subject: nginx not gzipping php output In-Reply-To: References: Message-ID: In fact, you can try to open php internal gzip compress function, you may find it at php.ini, change this to On zlib.output_compression = Off and php will compress it auto before send to nginx. MagicBear 2011/9/6 djeyewater > Thanks for testing it MagicBear. > > Google Chrome reports content type header as: > Content-Type:text/html; charset=UTF-8 > > So still not sure why it is not working. > > I checked nginx changelog and couldn't see anything that looked to be > pointing out that this was an issue in older versions of nginx. Still, I > will try latest stable version and see if that makes any difference. > > Dave > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,214879,214885#msg-214885 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Sep 6 14:31:14 2011 From: nginx-forum at nginx.us (djeyewater) Date: Tue, 06 Sep 2011 10:31:14 -0400 Subject: nginx not gzipping php output In-Reply-To: References: Message-ID: Hmm.. well I installed the latest version and found that actually nothing is being zipped. Was probably the same thing before, but most of the static files have gzip versions and so were included by gzip_static, making it look like only PHP wasn't being zipped. Any ideas? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214879,214890#msg-214890 From chinix at gmail.com Tue Sep 6 14:39:56 2011 From: chinix at gmail.com (chinix) Date: Tue, 06 Sep 2011 22:39:56 +0800 Subject: proxy with header If-Modified-Since Message-ID: <4e6630c1.8e42e70a.1b59.4caa@mx.google.com> hi all, I find that when the cache is expired,nginx request completely to backend for fresh cache even the file wasn't modified.Could nginx request to backend with header "If-Modified-Since" when the cache is expired? If this,backend will response with code 304, nginx should deal with the 304 response. 2011-09-06 chinix -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Tue Sep 6 15:27:09 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Sep 2011 19:27:09 +0400 Subject: proxy with header If-Modified-Since In-Reply-To: <4e6630c1.8e42e70a.1b59.4caa@mx.google.com> References: <4e6630c1.8e42e70a.1b59.4caa@mx.google.com> Message-ID: <20110906152709.GB1137@mdounin.ru> Hello! On Tue, Sep 06, 2011 at 10:39:56PM +0800, chinix wrote: > hi all, > > I find that when the cache is expired,nginx request completely > to backend for fresh cache even the file wasn't modified.Could > nginx request to backend with header "If-Modified-Since" when > the cache is expired? If this,backend will response with code > 304, nginx should deal with the 304 response. This is not currently supported. Maxim Dounin From lists at ruby-forum.com Tue Sep 6 17:06:57 2011 From: lists at ruby-forum.com (Ed Tiller) Date: Tue, 06 Sep 2011 19:06:57 +0200 Subject: nginx-1.1.2 In-Reply-To: <20110905131950.GG34606@nginx.com> References: <20110905131950.GG34606@nginx.com> Message-ID: <829a8decd69485ea5f7095cfd62a60f1@ruby-forum.com> Thank you Igor!!! Congrats on the growth of Nginx marketshare on the net. http://news.netcraft.com/archives/2011/09/06/september-2011-web-server-survey.html -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Tue Sep 6 17:49:02 2011 From: nginx-forum at nginx.us (aries) Date: Tue, 06 Sep 2011 13:49:02 -0400 Subject: 400 bad request errors - Firefox and Chrome Message-ID: <577bf662b4e1bf80057dbe1c58731896.NginxMailingListEnglish@forum.nginx.org> Hello. The access.log, have multiples lines similar to: [06/Sep/2011:11:05:32 +0500] "-" 400 0 "-" "-" "-" These are only created when browsing with Firefox or Chrome, do not register these errors if you use IExplorer. The error only shows in access.log, the page loads properly without showing any error. I think that it is not a problem of cookies because these errors are logged even if disabling the use of cookies on your browser. "error_log /var/log/nginx/error.log info;" not show me any data about this error. I noticed that error is recorded between 3 to 7 seconds after that the apache access.log recorded the entry with 200 code for this visit. I also tried using: client_header_buffer_size 256k; large_client_header_buffers 4 256; As additional data indicate that I'm using: The Apache keepalive is disabled. The nginx.conf user nobody; worker_processes 1; error_log /var/log/nginx/error.log info; worker_rlimit_nofile 20480; events { worker_connections 5120; # increase for busier servers use epoll; # you should use epoll here for Linux kernels 2.6.x } http { server_name_in_redirect off; server_names_hash_max_size 10240; server_names_hash_bucket_size 1024; include mime.types; default_type application/octet-stream; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 5; gzip on; gzip_vary on; gzip_disable "MSIE [1-6]\."; gzip_proxied any; gzip_http_version 1.1; gzip_min_length 1000; gzip_comp_level 6; gzip_buffers 16 8k; gzip_types text/plain text/xml text/css application/x-javascript application/xml application/xml+rss text/javascript application/atom+xml; ignore_invalid_headers on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; reset_timedout_connection on; connection_pool_size 256; client_header_buffer_size 128k; large_client_header_buffers 8 32k; client_max_body_size 2M; client_body_buffer_size 256k; request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; include "/etc/nginx/vhosts/*"; } Any suggestions how to fix these errors?. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214924,214924#msg-214924 From mdounin at mdounin.ru Tue Sep 6 18:12:58 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Sep 2011 22:12:58 +0400 Subject: 400 bad request errors - Firefox and Chrome In-Reply-To: <577bf662b4e1bf80057dbe1c58731896.NginxMailingListEnglish@forum.nginx.org> References: <577bf662b4e1bf80057dbe1c58731896.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110906181258.GC1137@mdounin.ru> Hello! On Tue, Sep 06, 2011 at 01:49:02PM -0400, aries wrote: > Hello. > The access.log, have multiples lines similar to: > [06/Sep/2011:11:05:32 +0500] "-" 400 0 "-" "-" "-" > > These are only created when browsing with Firefox or Chrome, do not > register these errors if you use IExplorer. > The error only shows in access.log, the page loads properly without > showing any error. > I think that it is not a problem of cookies because these errors are > logged even if disabling the use of cookies on your browser. > "error_log /var/log/nginx/error.log info;" not show me any data about > this error. > I noticed that error is recorded between 3 to 7 seconds after that the > apache access.log recorded the entry with 200 code for this visit. With Chrome it's caused by Chrome's behaviour: it opens 2 connections to requested host, and may close one of them without sending any single request though it (if one connection was enough). There is no real problem here, just a sign that connection was opened but not used. No idea about Firefox, but likely it does something similar. Maxim Dounin From sheng.zheng at etimestech.jp Wed Sep 7 01:03:56 2011 From: sheng.zheng at etimestech.jp (Sheng.Zheng) Date: Wed, 07 Sep 2011 10:03:56 +0900 Subject: add header on custom error page Message-ID: <4E66C2FC.6020405@etimestech.jp> Hi, i'm trying to add a 'X-ua-compatible' header on a custom 444 error page like below. but this does not work. do you have any suggestions on how to do this? Any advise will be appreciated. Thanks. error_page 444 = @err_444; location = /xxx { return 444; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location @err_444 { add_header X-ua-compatible 'IE=EmulateIE8'; rewrite ^ /index.php?url=err/444?; } From nginx-forum at nginx.us Wed Sep 7 02:07:45 2011 From: nginx-forum at nginx.us (speedfirst) Date: Tue, 06 Sep 2011 22:07:45 -0400 Subject: add header on custom error page In-Reply-To: <4E66C2FC.6020405@etimestech.jp> References: <4E66C2FC.6020405@etimestech.jp> Message-ID: add_header is effective only when the response code is equal to 200, 204, 301, 302 or 304. You should try headers_more module. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214931,214932#msg-214932 From nginx-forum at nginx.us Wed Sep 7 14:41:31 2011 From: nginx-forum at nginx.us (arleybls) Date: Wed, 07 Sep 2011 10:41:31 -0400 Subject: block ip/subnet at socket lvl Message-ID: <8103f75d46a866ec34f9bc64bec9ab13.NginxMailingListEnglish@forum.nginx.org> Currently Nginx can block IP on application level and thus send a 403 forbidden message back to the client. I wonder if there's a way to block any request at the socket level, preferably not even sending a FIN message to the client but simply dropping the packet. Right now i'm using iptables but i'm really looking to have such feature on nginx itself, and if not supported right on current build, how could I have a hook to the socket and control it on a home made server module/handler? Cheers, __Jr Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214948,214948#msg-214948 From nginx-forum at nginx.us Wed Sep 7 20:56:22 2011 From: nginx-forum at nginx.us (pvsw1) Date: Wed, 07 Sep 2011 16:56:22 -0400 Subject: Problem with updated nginx In-Reply-To: <20110829004530.GS1137@mdounin.ru> References: <20110829004530.GS1137@mdounin.ru> Message-ID: Hi Maxim, Thanks for the reply. That fixed my problem Regards, Paul Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214407,214958#msg-214958 From matthieu.tourne at gmail.com Wed Sep 7 23:33:38 2011 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Wed, 7 Sep 2011 16:33:38 -0700 Subject: upstream keepalive - call for testing In-Reply-To: <20110905180210.GL1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> <20110905070813.GY1137@mdounin.ru> <20110905180210.GL1137@mdounin.ru> Message-ID: Thanks for the all-included patch from 1.1.2 It seems that keepalive connections aren't working in combination with proxy_buffering off; (c->read->ready is set to 1) It worked before this last update, is this the intended behavior ? Thank you, Matthieu. On Mon, Sep 5, 2011 at 11:02 AM, Maxim Dounin wrote: > Hello! > > On Mon, Sep 05, 2011 at 11:42:31PM +0800, $B%S%j%S%j-9(B wrote: > > > (gdb) fr 0 > > #0 ngx_http_upstream_handler (ev=0x7fc45735f8a8) > > at src/http/ngx_http_upstream.c:915 > > 915 ctx->current_request = r; > > (gdb) p ngx_cycle->log > > $1 = (ngx_log_t *) 0x21f19a8 > > (gdb) p *r > > $2 = {signature = 51686928, connection = 0x23b4160, ctx = 0x0, > > [...] > > This looks like memory corruption, but unfortunately I don't see > any traces of the real cause. My best quess is improper handling > of proxy_ignore_client_abort as fixed in 1.1.2. Please try 1.1.2 > with patches from > > http://nginx.org/patches/patch-nginx-keepalive-full-5.txt > > It already includes upstream keepalive module, as well as all > other upstream-keepalive related fixes. See here for details: > > http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001147.html > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Sep 8 09:27:34 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 8 Sep 2011 13:27:34 +0400 Subject: upstream keepalive - call for testing In-Reply-To: References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> <20110905070813.GY1137@mdounin.ru> <20110905180210.GL1137@mdounin.ru> Message-ID: <20110908092733.GG1137@mdounin.ru> Hello! On Wed, Sep 07, 2011 at 04:33:38PM -0700, Matthieu Tourne wrote: > Thanks for the all-included patch from 1.1.2 > > It seems that keepalive connections aren't working in combination with > proxy_buffering off; (c->read->ready is set to 1) > It worked before this last update, is this the intended behavior ? Linux with epoll, right? Please try the following patch: diff --git a/src/http/modules/ngx_http_upstream_keepalive_module.c b/src/http/modules/ngx_http_upstream_keepalive_module.c --- a/src/http/modules/ngx_http_upstream_keepalive_module.c +++ b/src/http/modules/ngx_http_upstream_keepalive_module.c @@ -321,7 +321,6 @@ ngx_http_upstream_free_keepalive_peer(ng if (kp->failed || c == NULL || c->read->eof - || c->read->ready || c->read->error || c->read->timedout || c->write->error @@ -382,6 +381,10 @@ ngx_http_upstream_free_keepalive_peer(ng item->socklen = pc->socklen; ngx_memcpy(&item->sockaddr, pc->sockaddr, pc->socklen); + if (c->read->ready) { + ngx_http_upstream_keepalive_close_handler(c->read); + } + invalid: kp->original_free_peer(pc, kp->data, state); diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2142,7 +2142,7 @@ ngx_http_upstream_send_response(ngx_http return; } - if (u->peer.connection->read->ready) { + if (u->peer.connection->read->ready || u->length == 0) { ngx_http_upstream_process_non_buffered_upstream(r, u); } } Second part fixes one more problem with handling of responses with empty body over keepalive connections, found during testing with various event methods. Maxim Dounin From nginx-forum at nginx.us Thu Sep 8 11:06:10 2011 From: nginx-forum at nginx.us (liushaobo) Date: Thu, 08 Sep 2011 07:06:10 -0400 Subject: closed keepalive connection Message-ID: hi all nginx debug log the following problems,please help me # nginx config user www www; worker_processes 8; worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000; worker_rlimit_nofile 65535; #error_log /var/log/nginx_error.log crit; error_log /var/log/nginx_error.log debug; pid /var/run/nginx.pid; events { worker_connections 65535; use epoll; } http { include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay on; server_tokens off; charset utf8; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 150m; gzip on; gzip_comp_level 2; gzip_min_length 1024; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; proxy_intercept_errors on; proxy_ignore_client_abort on; fastcgi_intercept_errors on; keepalive_timeout 120; limit_zone one $binary_remote_addr 10m; include /etc/nginx/conf.d/*.conf; error_log /var/log/nginx_error.log debug; # tail -f /var/log/nginx_error.log 2011/09/08 15:38:10 [info] 19178#0: *5713577 client 112.64.188.183 closed keepalive connection (104: Connection reset by peer) 2011/09/08 15:39:42 [info] 19175#0: *5729670 client 112.64.188.183 closed keepalive connection (104: Connection reset by peer) 2011/09/08 15:44:10 [info] 19257#0: *1382 client closed prematurely connection while sending response to client, client: 112.64.188.183, server: static.test.com, request: "GET /apk/48/48598/com.dolphin.browser.cn.apk HTTP/1.1", host: "static.test.com" 2011/09/08 15:45:06 [info] 19261#0: *2100 client 112.64.188.183 closed keepalive connection (104: Connection reset by peer) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214974,214974#msg-214974 From mdounin at mdounin.ru Thu Sep 8 11:34:57 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 8 Sep 2011 15:34:57 +0400 Subject: closed keepalive connection In-Reply-To: References: Message-ID: <20110908113457.GJ1137@mdounin.ru> Hello! On Thu, Sep 08, 2011 at 07:06:10AM -0400, liushaobo wrote: > hi all > nginx debug log the following problems,please help me [...] > # tail -f /var/log/nginx_error.log > > 2011/09/08 15:38:10 [info] 19178#0: *5713577 client 112.64.188.183 > closed keepalive connection (104: Connection reset by peer) > 2011/09/08 15:39:42 [info] 19175#0: *5729670 client 112.64.188.183 > closed keepalive connection (104: Connection reset by peer) It's info message reporting that client closed keepalive connection, nothing more. This may and will happen under normal use. > 2011/09/08 15:44:10 [info] 19257#0: *1382 client closed prematurely > connection while sending response to client, client: 112.64.188.183, > server: static.test.com, request: "GET > /apk/48/48598/com.dolphin.browser.cn.apk HTTP/1.1", host: > "static.test.com" This is another info message, reporting that client closed connection before nginx was able to send full response to it. This is normal as well and may happen e.g. if browser is closed or user navigated to another page. If you don't see such mesages - just tune your error_log logging level to something less verbose. Something like "notice" or "error" is usually a good choice for production. Maxim Dounin From nginx-forum at nginx.us Thu Sep 8 12:01:12 2011 From: nginx-forum at nginx.us (liushaobo) Date: Thu, 08 Sep 2011 08:01:12 -0400 Subject: closed keepalive connection In-Reply-To: <05e801c9cb43$68a23cc0$39e6b640$@forum.nginx.org> References: <05e801c9cb43$68a23cc0$39e6b640$@forum.nginx.org> Message-ID: <43ff5f44f752e7163ef9638d8edf84fb.NginxMailingListEnglish@forum.nginx.org> hi all Modify nginx.conf error_log /data0/logs/nginx_error.log notice; #error_log /data0/logs/nginx_error.log debug; log are as follows web download normal wifi download normal mobile 3G (WCDMA) download frequently interrupted 2011/09/08 19:54:49 [info] 20098#0: *1137837 client closed prematurely connection while reading client request line, client: 59.108.246.154, server: static.nduoa.com 2011/09/08 19:54:49 [info] 20098#0: *1137838 client closed prematurely connection while reading client request line, client: 59.108.246.154, server: static.nduoa.com 2011/09/08 19:54:49 [info] 20099#0: *1130906 client closed prematurely connection while sending response to client, client: 120.196.170.2, server: static.nduoa.com, request: "GET /apk/22/22881/com.popcap.pvz.apk HTTP/1.1", host: "static.nduoa.com" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1680,214977#msg-214977 From nginx-forum at nginx.us Thu Sep 8 14:20:44 2011 From: nginx-forum at nginx.us (Giang) Date: Thu, 08 Sep 2011 10:20:44 -0400 Subject: Please help me Message-ID: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> Hi guys, I'm new to nginx. Just knew how to use it few months ago. I got a QuickSSL SSL, but I would like to install it only on mybb admin folder only (http://myforum.com/admin will rewrite to https://myforum.com/admin) and keep the rest of the site uses http. Only http://myforum.com/admin will redirect to https://myforum.com/admin. It didn't work with any existing file inside admin (for example: admin/index.php). Here is my current nginx config: server { listen 80; server_name domain.com www.domain.com; root /var/www/domain.com; include /etc/nginx/fastcgi_php; index index.php index.html; location / { } } location /admin { rewrite ^/ https://$http_host$request_uri permanent; } } server { listen 443 ssl; ssl_certificate /etc/nginx/ssl/csr.csr; ssl_certificate_key /etc/nginx/ssl/csr.key; keepalive_timeout 60; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; server_name domain.com www.domain.com; root /var/www/domain.com; include /etc/nginx/fastcgi_php; index index.php index.html; location / { rewrite ^ http://$http_host$request_uri permanent; } location /admin { } } I don't know how to fix it, please help. Thank in advanced, Giang Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214981,214981#msg-214981 From nginx-forum at nginx.us Thu Sep 8 14:41:34 2011 From: nginx-forum at nginx.us (ynasser) Date: Thu, 08 Sep 2011 10:41:34 -0400 Subject: Beginner questions about proxy configuration and white space Message-ID: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> Hello, I have installed nginx on my personal computer and would like to use it as a proxy to force authentication via modified http headers in various browsers. There's an add-on in firefox to do this, but none for Chrome, which is why I am using nginx. I've edited configuration file to include something like this under the http section: server { listen some_port; location http://some_ip { add_header X-h1 h1; add_header X-h2 h2 h2; add_header X-h3 h3; add_header X-h4 h4; add_header X-h5 h5; add_header X-h6 h6 h6; add_header X-h7 h7; } } I figured that out from reading many examples and the wiki. Now, I do not know how exactly to configure nginx to act as a proxy. I've read through part of the wiki on the HttpProxy module, but I don't have much experience with web servers or proxies. Could someone point me in the right direction? Also, when editing the configuration file using the http headers module (this: http://wiki.nginx.org/HttpHeadersModule), can values have spaces in them? Or should I put quotations around the whole thing? I read here: http://library.linode.com/web-servers/nginx/configuration/basic that whitespace doesn't matter, but I just thought to double check, since I saw no examples where values had spaces in them. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214982,214982#msg-214982 From mdounin at mdounin.ru Thu Sep 8 15:42:15 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 8 Sep 2011 19:42:15 +0400 Subject: upstream keepalive - call for testing In-Reply-To: <20110908092733.GG1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> <20110905070813.GY1137@mdounin.ru> <20110905180210.GL1137@mdounin.ru> <20110908092733.GG1137@mdounin.ru> Message-ID: <20110908154215.GM1137@mdounin.ru> Hello! On Thu, Sep 08, 2011 at 01:27:34PM +0400, Maxim Dounin wrote: > Hello! > > On Wed, Sep 07, 2011 at 04:33:38PM -0700, Matthieu Tourne wrote: > > > Thanks for the all-included patch from 1.1.2 > > > > It seems that keepalive connections aren't working in combination with > > proxy_buffering off; (c->read->ready is set to 1) > > It worked before this last update, is this the intended behavior ? > > Linux with epoll, right? Please try the following patch: Updated full patch may be grabbed here: http://nginx.org/patches/patch-nginx-keepalive-full-6.txt Maxim Dounin From nginx-forum at nginx.us Thu Sep 8 17:28:12 2011 From: nginx-forum at nginx.us (magicbear) Date: Thu, 08 Sep 2011 13:28:12 -0400 Subject: Beginner questions about proxy configuration and white space In-Reply-To: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> References: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> proxy: server { listen some_ip:some_port default; location / { add_header X-h1 h1; add_header X-h2 "h2 h2"; add_header X-h3 h3; add_header X-h4 h4; add_header X-h5 h5; add_header X-h6 "h6 h6"; add_header X-h7 h7; proxy_pass http://backend; } } space: add a double quotes add_header X-h2 "h2 h2"; MagicBear Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214982,214984#msg-214984 From nginx-forum at nginx.us Thu Sep 8 17:36:09 2011 From: nginx-forum at nginx.us (magicbear) Date: Thu, 08 Sep 2011 13:36:09 -0400 Subject: Please help me In-Reply-To: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> References: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6e854cb19c7c2550cde5346387005244.NginxMailingListEnglish@forum.nginx.org> server { listen 80; server_name domain.com www.domain.com; root /var/www/domain.com; include /etc/nginx/fastcgi_php; index index.php index.html; rewrite ^/admin https://$http_host$request_uri permanent; } server { listen 443 ssl; ssl_certificate /etc/nginx/ssl/csr.csr; ssl_certificate_key /etc/nginx/ssl/csr.key; keepalive_timeout 60; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; server_name domain.com www.domain.com; root /var/www/domain.com; include /etc/nginx/fastcgi_php; index index.php index.html; location / { rewrite ^/ http://$http_host$request_uri permanent; } location ~ ^/admin { break; } } MagicBear Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214981,214985#msg-214985 From nginx-forum at nginx.us Thu Sep 8 17:42:17 2011 From: nginx-forum at nginx.us (ynasser) Date: Thu, 08 Sep 2011 13:42:17 -0400 Subject: Beginner questions about proxy configuration and white space In-Reply-To: <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> References: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> Message-ID: I'll try that out. Thank you! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214982,214986#msg-214986 From matthieu.tourne at gmail.com Thu Sep 8 22:05:01 2011 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Thu, 8 Sep 2011 15:05:01 -0700 Subject: upstream keepalive - call for testing In-Reply-To: <20110908092733.GG1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> <0d5cc130a417bb62098701656fd44e42.NginxMailingListEnglish@forum.nginx.org> <20110904182137.GW1137@mdounin.ru> <20110905070813.GY1137@mdounin.ru> <20110905180210.GL1137@mdounin.ru> <20110908092733.GG1137@mdounin.ru> Message-ID: On Thu, Sep 8, 2011 at 2:27 AM, Maxim Dounin wrote: > Hello! > > On Wed, Sep 07, 2011 at 04:33:38PM -0700, Matthieu Tourne wrote: > > > Thanks for the all-included patch from 1.1.2 > > > > It seems that keepalive connections aren't working in combination with > > proxy_buffering off; (c->read->ready is set to 1) > > It worked before this last update, is this the intended behavior ? > > Linux with epoll, right? Please try the following patch: > Yes, Linux with epoll. The patch below seems to fix the issue. Thank you Maxim! > > diff --git a/src/http/modules/ngx_http_upstream_keepalive_module.c > b/src/http/modules/ngx_http_upstream_keepalive_module.c > --- a/src/http/modules/ngx_http_upstream_keepalive_module.c > +++ b/src/http/modules/ngx_http_upstream_keepalive_module.c > @@ -321,7 +321,6 @@ ngx_http_upstream_free_keepalive_peer(ng > if (kp->failed > || c == NULL > || c->read->eof > - || c->read->ready > || c->read->error > || c->read->timedout > || c->write->error > @@ -382,6 +381,10 @@ ngx_http_upstream_free_keepalive_peer(ng > item->socklen = pc->socklen; > ngx_memcpy(&item->sockaddr, pc->sockaddr, pc->socklen); > > + if (c->read->ready) { > + ngx_http_upstream_keepalive_close_handler(c->read); > + } > + > invalid: > > kp->original_free_peer(pc, kp->data, state); > diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c > --- a/src/http/ngx_http_upstream.c > +++ b/src/http/ngx_http_upstream.c > @@ -2142,7 +2142,7 @@ ngx_http_upstream_send_response(ngx_http > return; > } > > - if (u->peer.connection->read->ready) { > + if (u->peer.connection->read->ready || u->length == 0) { > ngx_http_upstream_process_non_buffered_upstream(r, u); > } > } > > Second part fixes one more problem with handling of responses with > empty body over keepalive connections, found during testing with > various event methods. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Sep 9 09:05:43 2011 From: nginx-forum at nginx.us (jkriesten) Date: Fri, 09 Sep 2011 05:05:43 -0400 Subject: seg fault with 1.0.6 Message-ID: Hi, yesterday evening both servers with nginx 1.0.6 set faulted within 10 minutes, i suspect a modified header or something. Sep 8 21:33:37 andromeda-1 kernel: [1223057.855838] nginx[28406]: segfault at 8 ip 000000000041a423 sp 00007ffffb5b0778 error 4 in nginx[400000+99000] Sep 8 21:41:14 andromeda-2 kernel: [1220501.571265] nginx[3195]: segfault at 8 ip 000000000041a423 sp 00007fff8f6b7a48 error 4 in nginx[400000+99000] nginx: nginx version: nginx/1.0.6 nginx: TLS SNI support enabled nginx: configure arguments: --prefix=/usr/local/www --conf-path=/usr/local/www/cfg/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/usr/local/www/log/error.log --http-log-path=/usr/local/www/log/transfer.log --lock-path=/var/lock/nginx.lock --with-http_flv_module --with-http_ssl_module --with-http_perl_module --with-http_gzip_static_module --with-http_stub_status_module --without-http_scgi_module --without-http_uwsgi_module --add-module=/home/kriesten/translate/src/memc-nginx-module --add-module=/home/kriesten/translate/src/srcache-nginx-module --add-module=/home/kriesten/translate/src/ngx_http_upstream_keepalive-0.6 --http-client-body-temp-path=/usr/local/www/tmp/client --http-proxy-temp-path=/usr/local/www/proxy/tmp --http-fastcgi-temp-path=/usr/local/www/tmp/fcgi I'm going to enable debugging to have something to work with when it occurs again. Anyone else seen this? Best regards, --- Jan. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215000,215000#msg-215000 From Pekka.Panula at sofor.fi Fri Sep 9 10:32:31 2011 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Fri, 9 Sep 2011 13:32:31 +0300 Subject: nginx SSO service for different backend web servers/apps Message-ID: Hi We have a couple different services running in different machines, web servers/wep applications. We would like to have a Single Sign-On (SSO) in front of these servers, now they have their own accounts + passwords, eg. login pages. So i am asking is there any good SSO modules for nginx to use for or any help how we can make it happen? Pekka Panula | Jatkuvat palvelut | Sofor Oy | www.sofor.fi Takakaarre 3 | PL 51 |FIN-62201 KAUHAVA | tel. +358 6 432 3111 | fax. +358 6 432 3555 Mob. + 358 50 384 3232 | pekka.panula at sofor.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Fri Sep 9 11:51:07 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 9 Sep 2011 15:51:07 +0400 Subject: mp4 module Message-ID: <20110909115107.GH97288@nginx.com> I've commit ngx_http_mp4_module in trunk branch. The patch for 1.0 and last 0.8 is also available: http://nginx.org/patches/patch.mp4.txt The module was tested against JW Player. The module is not built by default, it should be enabled with --with-http_mp4_module If you use 3rd-party mp4 module, it should be removed. Configuration: location /mp4/ { mp4; mp4_buffer_size 1m; # default 512k mp4_max_moov_size 10m; # default 5m } mp4_buffer_size - initial size of buffer to read mp4 file. This buffer is also used to keep whole meta data of mp4 file (so called "moov" atom). Maximum size of moov atom which nginx is capable to read is set by mp4_max_moov_size. -- Igor Sysoev From Richard.Kearsley at m247.com Fri Sep 9 12:16:35 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Fri, 9 Sep 2011 12:16:35 +0000 Subject: mp4 module In-Reply-To: <20110909115107.GH97288@nginx.com> References: <20110909115107.GH97288@nginx.com> Message-ID: That's a good feature Can you confirm if it's compatible with proxy cache? On 9 Sep 2011, at 12:51, "Igor Sysoev" wrote: > I've commit ngx_http_mp4_module in trunk branch. > The patch for 1.0 and last 0.8 is also available: > http://nginx.org/patches/patch.mp4.txt > > The module was tested against JW Player. > > The module is not built by default, it should be enabled with > --with-http_mp4_module > If you use 3rd-party mp4 module, it should be removed. > Configuration: > > location /mp4/ { > mp4; > mp4_buffer_size 1m; # default 512k > mp4_max_moov_size 10m; # default 5m > } > > mp4_buffer_size - initial size of buffer to read mp4 file. > This buffer is also used to keep whole meta data of mp4 file (so > called "moov" atom). Maximum size of moov atom which nginx is capable > to read is set by mp4_max_moov_size. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From lists at ruby-forum.com Fri Sep 9 12:34:41 2011 From: lists at ruby-forum.com (Jan Bujk) Date: Fri, 09 Sep 2011 14:34:41 +0200 Subject: Optimizing worker_processes, worker_connections & PHP_FCGI_CHILDREN - Any Good Tutorial? In-Reply-To: References: Message-ID: Hi, what would you guys recommend to set for a website loaded heavily with PHP and some Ajax features and around 2000 users online at the same time ? Currently I have settings like: PHP_FCGI_CHILDREN=10 PHP_FCGI_MAX_REQUESTS=1000 worker_connections 20392; multi_accept off; use epoll; client_body_timeout 200; client_header_timeout 100;. client_max_body_size 40M; client_body_buffer_size 1280k; send_timeout 100; limit_zone limit_per_ip $binary_remote_addr 180m; limit_conn limit_per_ip 150; limit_rate 2200k; keepalive_timeout 15; Using nginx/0.7.67 and php 5.2.17. I cannot migrate to php 5.3.3, so I cannot use native php-fpm. Should I try to tweak fast-cgi better or try to get PHP-FPM working ? Would nginx upgrade help with performance ? Website works but with many users it gets veryyyyyyyyy slow with responses. Thanks guys ! -- Posted via http://www.ruby-forum.com/. From igor at sysoev.ru Fri Sep 9 13:08:12 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 9 Sep 2011 17:08:12 +0400 Subject: mp4 module In-Reply-To: References: <20110909115107.GH97288@nginx.com> Message-ID: <20110909130812.GI97288@nginx.com> On Fri, Sep 09, 2011 at 12:16:35PM +0000, Richard Kearsley wrote: > That's a good feature > Can you confirm if it's compatible with proxy cache? No, currently it can work only with static files. -- Igor Sysoev From r at roze.lv Fri Sep 9 13:37:52 2011 From: r at roze.lv (Reinis Rozitis) Date: Fri, 9 Sep 2011 16:37:52 +0300 Subject: Optimizing worker_processes, worker_connections & PHP_FCGI_CHILDREN - Any Good Tutorial? In-Reply-To: References: Message-ID: <14CFA31DBC9D45B1914C2396711DF8EF@DD21> > I cannot migrate to php 5.3.3, so I cannot use native php-fpm. > Should I try to tweak fast-cgi better or try to get PHP-FPM working ? You can apply FPM patches (it was a quite a long time before it got into core) also to 5.2.x tree and for 5.2.17 ( http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz ). The dynamic manager will let you adjust best process numbers and will show the slow scripts. rr From francois.beausoleil at gmail.com Fri Sep 9 14:47:10 2011 From: francois.beausoleil at gmail.com (=?utf-8?Q?Fran=C3=A7ois_Beausoleil?=) Date: Fri, 9 Sep 2011 10:47:10 -0400 Subject: Encoded slashes in URL with proxy = trouble? Message-ID: <1B2B5635B15447D38C2EFC4E4536FEFE@gmail.com> Hi! Nginx is in front of the RabbitMQ management extension. Some of the URLs the extension generates contain en embedded slash character (%2F): http://somehost/#/queues/%2F/events The encoded slash represents the vhost I want to get information about. I found an older ServerFault question with no answer[1], and was wondering if any of you had a way to let Nginx pass through the encoded slash? Thanks! Fran?ois [1] http://serverfault.com/questions/289188/nginx-passenger-encoded-slash From igor at sysoev.ru Fri Sep 9 15:06:57 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 9 Sep 2011 19:06:57 +0400 Subject: Encoded slashes in URL with proxy = trouble? In-Reply-To: <1B2B5635B15447D38C2EFC4E4536FEFE@gmail.com> References: <1B2B5635B15447D38C2EFC4E4536FEFE@gmail.com> Message-ID: <20110909150657.GL97288@nginx.com> On Fri, Sep 09, 2011 at 10:47:10AM -0400, Fran?ois Beausoleil wrote: > Hi! > > Nginx is in front of the RabbitMQ management extension. Some of the URLs the extension generates contain en embedded slash character (%2F): > > http://somehost/#/queues/%2F/events > > The encoded slash represents the vhost I want to get information about. I found an older ServerFault question with no answer[1], and was wondering if any of you had a way to let Nginx pass through the encoded slash? > > Thanks! > Fran?ois > > [1] http://serverfault.com/questions/289188/nginx-passenger-encoded-slash First, I'm not sure that browser sends to a server anything after hash character "#", since hash mean fragment on page. As to enconded slash, nginx normalizes URI, it decodes all characters so "/queues/%2F/events" becames "/queues///events" and then it merges all slashes, "/./", and "/../" to test URI against locations. Otherwise, anyone can request something like "/%2E%2E%2E../../etc/passwd" to get files out of server control. Or to get source text of the script files instead of executing then. If you want to pass unchanged request to backend, you can use just backend name without slash in proxy_pass: location /queues/ { proxy_pass http://backend; } i.e., - proxy_pass http://backend/; + proxy_pass http://backend; -- Igor Sysoev From nginx-forum at nginx.us Fri Sep 9 15:18:17 2011 From: nginx-forum at nginx.us (ynasser) Date: Fri, 09 Sep 2011 11:18:17 -0400 Subject: "48: Address already in use" error Message-ID: This is the error message I get when I try to run nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] still could not bind() I have disabled apache, so it's not that. Previous to this, I uninstalled nginx (using mac osx snow leopard), but 0.0.0.0 and 127.0.0.1 were still displaying "Welcome to nginx". I then re-installed nginx and I have been trying to run it, but I am getting these errors. I've tried checking what is on port 80 with this: $ sudo lsof -i:80 but nothing is returned. 0.0.0.0:80 displays: "404 Not Found nginx/1.0.6" Output of "ps ax -o pid,ppid,%cpu,vsz,wchan,command|egrep '(nginx|PID)'" > PID PPID %CPU VSZ WCHAN COMMAND >35198 1 0.0 2435856 - nginx: master process nginx >35199 35198 0.0 2436044 - nginx: worker process >41669 32470 0.0 2425524 - egrep (nginx|PID) nginx.conf can be found here: http://pastebin.com/Rq8vKHXn Would anyone happen to know how to resolve this? Thank you in advance. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215031,215031#msg-215031 From mauro.stettler at gmail.com Fri Sep 9 15:21:26 2011 From: mauro.stettler at gmail.com (Mauro Stettler) Date: Fri, 9 Sep 2011 23:21:26 +0800 Subject: "48: Address already in use" error In-Reply-To: References: Message-ID: you probably still have an nginx running and listening on localhost port 80. what do you mean with install/uninstall, how did you do that? after uninstalling did you make sure the running process is also dead? try to "sudo killall nginx" and then try to run it again. On Fri, Sep 9, 2011 at 23:18, ynasser wrote: > This is the error message I get when I try to run nginx: > > > nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) > nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) > nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) > nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) > nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) > nginx: [emerg] still could not bind() > > > I have disabled apache, so it's not that. Previous to this, I > uninstalled nginx (using mac osx snow leopard), but 0.0.0.0 and > 127.0.0.1 were still displaying "Welcome to nginx". I then re-installed > nginx and I have been trying to run it, but I am getting these errors. > > I've tried checking what is on port 80 with this: > $ sudo lsof -i:80 > but nothing is returned. > > 0.0.0.0:80 displays: "404 Not Found nginx/1.0.6" > > Output of "ps ax -o pid,ppid,%cpu,vsz,wchan,command|egrep > '(nginx|PID)'" > >> ?PID ?PPID ?%CPU ? ? ?VSZ WCHAN ?COMMAND >>35198 ? ? 1 ? 0.0 ?2435856 - ? ? ?nginx: master process nginx >>35199 35198 ? 0.0 ?2436044 - ? ? ?nginx: worker process >>41669 32470 ? 0.0 ?2425524 - ? ? ?egrep (nginx|PID) > > nginx.conf can be found here: http://pastebin.com/Rq8vKHXn > > Would anyone happen to know how to resolve this? > > Thank you in advance. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215031,215031#msg-215031 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Fri Sep 9 15:26:24 2011 From: nginx-forum at nginx.us (ynasser) Date: Fri, 09 Sep 2011 11:26:24 -0400 Subject: "48: Address already in use" error In-Reply-To: References: Message-ID: <8faaad58bd61dcef2765fdc0795a7699.NginxMailingListEnglish@forum.nginx.org> $ sudo killall nginx Password: No matching processes were found When I try to run it, the same error occurs. To uninstall it, since there was no "easy" way to remove it, I just removed every file or folder which contained any nginx in its title or anywhere in the contents. There didn't seem to be any other way to remove it. The first time I installed it, I did a manual install. The second time I used: "sudo port install nginx". Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215031,215033#msg-215033 From lists at ruby-forum.com Fri Sep 9 17:35:20 2011 From: lists at ruby-forum.com (dhaval d.) Date: Fri, 09 Sep 2011 19:35:20 +0200 Subject: nginx uid decoding using Base64.decode64 Message-ID: Hi, I was facing a problem while decoding a nginx generated uid using ruby. The uid which I get from nginx cookie is "CqCx7E5qMNUxrmAUAwMJAg==" and when I try to decode this using Base64.decode64("CqCx7E5qMNUxrmAUAwMJAg==") , it gives me "\n\xA0\xB1\xECNj0\xD51\xAE`\x14\x03\x03\t\x02" instead of "ECB1A00AD5306A4E1460AE3102090303" which I see in my access logs($uid_got value). can any one give some suggestions on this issue? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Sep 9 17:40:07 2011 From: lists at ruby-forum.com (dhaval d.) Date: Fri, 09 Sep 2011 19:40:07 +0200 Subject: "48: Address already in use" error In-Reply-To: <8faaad58bd61dcef2765fdc0795a7699.NginxMailingListEnglish@forum.nginx.org> References: <8faaad58bd61dcef2765fdc0795a7699.NginxMailingListEnglish@forum.nginx.org> Message-ID: Did you check your process using ps -ef | grep nginx Does it list any of the nginx process running? If yes then kill each one of those and re-check it using above command. ynasser wrote in post #1020988: > $ sudo killall nginx > Password: > No matching processes were found > > When I try to run it, the same error occurs. > > To uninstall it, since there was no "easy" way to remove it, I just > removed every file or folder which contained any nginx in its title or > anywhere in the contents. There didn't seem to be any other way to > remove it. > > The first time I installed it, I did a manual install. The second time I > used: "sudo port install nginx". > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215031,215033#msg-215033 -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Sep 9 17:52:19 2011 From: nginx-forum at nginx.us (ynasser) Date: Fri, 09 Sep 2011 13:52:19 -0400 Subject: "48: Address already in use" error In-Reply-To: References: Message-ID: Thank you! It works now. It's a little weird that 'ps -A | grep nginx' wasn't catching the other processes though, since -e is identical to -A. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215031,215037#msg-215037 From mdounin at mdounin.ru Fri Sep 9 18:11:09 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 9 Sep 2011 22:11:09 +0400 Subject: nginx uid decoding using Base64.decode64 In-Reply-To: References: Message-ID: <20110909181109.GR1137@mdounin.ru> Hello! On Fri, Sep 09, 2011 at 07:35:20PM +0200, dhaval d. wrote: > Hi, > I was facing a problem while decoding a nginx generated uid using > ruby. > > The uid which I get from nginx cookie is "CqCx7E5qMNUxrmAUAwMJAg==" and > when I try to decode this using > Base64.decode64("CqCx7E5qMNUxrmAUAwMJAg==") , it gives me > "\n\xA0\xB1\xECNj0\xD51\xAE`\x14\x03\x03\t\x02" instead of > "ECB1A00AD5306A4E1460AE3102090303" which I see in my access > logs($uid_got value). > > can any one give some suggestions on this issue? Logged value is a hex representation of the data, using 4 host-order uint32_t values. I.e. "\n\xA0\xB1\xEC" matches "ECB1A00A" and so on. Maxim Dounin From lists at ruby-forum.com Fri Sep 9 19:29:20 2011 From: lists at ruby-forum.com (dhaval d.) Date: Fri, 09 Sep 2011 21:29:20 +0200 Subject: How to read http_userid's Base64 encoded userid from Ruby? In-Reply-To: <20100209122047.GB2382@oemcomputer.oerks.de> References: <20100209122047.GB2382@oemcomputer.oerks.de> Message-ID: <7acd1e5a1b852dc1f0c91b4b4593f88e@ruby-forum.com> Hello Sven, I came across the same problem. But the solution you mentioned does not work with my program. When I run this code cookie = CqCx7E5qMNUxrmAUAwMJAg== cc = cookie.unpack('m*').first; rr = cc.split("").map{|c| c[0].to_i}.inject([]) {|v,s| v.push sprintf("%02X", s); v; }.values_at(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12).join("") I get back the result as "00000000000000000000000100000000" but actually it should be ECB1A00AD5306A4E1460AE3102090303 Do you know what am i doing wrong? -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Sep 9 20:05:00 2011 From: nginx-forum at nginx.us (ynasser) Date: Fri, 09 Sep 2011 16:05:00 -0400 Subject: Beginner questions about proxy configuration and white space In-Reply-To: <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> References: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> Message-ID: I reinstalled nginx and re-added that directive to the new configutation file. Now this happens: >> sudo nginx >> nginx: [emerg] bind() to 10.0.1.187:2525 failed (49: Can't assign requested address) In regards to the example given above: server { listen some_ip:some_port default; location / { add_header X-h1 h1; add_header X-h2 "h2 h2"; add_header X-h3 h3; add_header X-h4 h4; add_header X-h5 h5; add_header X-h6 "h6 h6"; add_header X-h7 h7; proxy_pass http://backend; } } some_ip:some_port is the site that I'm trying to pass the headers to. For http://backend, I'm using "http://127.0.0.1" Any help would be appreciated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214982,215040#msg-215040 From magicbearmo at gmail.com Fri Sep 9 20:08:27 2011 From: magicbearmo at gmail.com (MagicBear) Date: Sat, 10 Sep 2011 04:08:27 +0800 Subject: Beginner questions about proxy configuration and white space In-Reply-To: References: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> Message-ID: if you are running nginx, you may use "nginx -s reload" to reload the config. or killall -9 nginx; nginx to restart nginx 2011/9/10 ynasser > I reinstalled nginx and re-added that directive to the new configutation > file. Now this happens: > > >> sudo nginx > >> nginx: [emerg] bind() to 10.0.1.187:2525 failed (49: Can't assign > requested address) > > In regards to the example given above: > > server { > listen some_ip:some_port default; > > location / { > add_header X-h1 h1; > add_header X-h2 "h2 h2"; > add_header X-h3 h3; > add_header X-h4 h4; > add_header X-h5 h5; > add_header X-h6 "h6 h6"; > add_header X-h7 h7; > proxy_pass http://backend; > } > } > > some_ip:some_port is the site that I'm trying to pass the headers to. > For http://backend, I'm using "http://127.0.0.1" > > Any help would be appreciated. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,214982,215040#msg-215040 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Sep 9 20:33:58 2011 From: lists at ruby-forum.com (dhaval d.) Date: Fri, 09 Sep 2011 22:33:58 +0200 Subject: nginx uid decoding using Base64.decode64 In-Reply-To: References: Message-ID: Hello Maxim, Thanks a lot for your reply. Because of which I was able to figure out the way to decode it. Here is the snippet for those who wants to know. cookie = "CqCx7E5qMNUxrmAUAwMJAg==" Base64.decode64(cookie).unpack("L*").collect{|num| num.to_s(16)}.join("").upcase -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Sep 9 21:00:39 2011 From: nginx-forum at nginx.us (ynasser) Date: Fri, 09 Sep 2011 17:00:39 -0400 Subject: Beginner questions about proxy configuration and white space In-Reply-To: References: Message-ID: I don't think it's a problem with reloading the configuration file, because I have been reloading it every time after I update and save it. What is happening is that when I run 'sudo nginx', it doesn't start and outputs this error: nginx: [emerg] bind() to some_ip:some_port failed (49: Can't assign requested address) I can access some_ip:some_port just fine from a browser and ssh-ing into it is not a problem. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214982,215044#msg-215044 From masterkorp at gmail.com Fri Sep 9 21:02:02 2011 From: masterkorp at gmail.com (Alfredo Palhares) Date: Fri, 9 Sep 2011 22:02:02 +0100 Subject: block ip/subnet at socket lvl Message-ID: Hello, I think that out of nginx scope. On 7 Sep 2011 14:42, "arleybls" wrote: > Currently Nginx can block IP on application level and thus send a 403 > forbidden message back to the client. > > I wonder if there's a way to block any request at the socket level, > preferably not even sending a FIN message to the client but simply > dropping the packet. Right now i'm using iptables but i'm really looking > to have such feature on nginx itself, and if not supported right on > current build, how could I have a hook to the socket and control it on a > home made server module/handler? > > Cheers, > __Jr > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214948,214948#msg-214948 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From caldcv at gmail.com Fri Sep 9 21:47:14 2011 From: caldcv at gmail.com (Chris) Date: Fri, 9 Sep 2011 17:47:14 -0400 Subject: block ip/subnet at socket lvl In-Reply-To: References: Message-ID: You're making it too complicated and just stick with iptables On Fri, Sep 9, 2011 at 5:02 PM, Alfredo Palhares wrote: > Hello, > > I think that out of nginx scope. > > On 7 Sep 2011 14:42, "arleybls" wrote: >> Currently Nginx can block IP on application level and thus send a 403 >> forbidden message back to the client. >> >> I wonder if there's a way to block any request at the socket level, >> preferably not even sending a FIN message to the client but simply >> dropping the packet. Right now i'm using iptables but i'm really looking >> to have such feature on nginx itself, and if not supported right on >> current build, how could I have a hook to the socket and control it on a >> home made server module/handler? >> >> Cheers, >> __Jr >> >> Posted at Nginx Forum: >> http://forum.nginx.org/read.php?2,214948,214948#msg-214948 >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- --C "The dumber people think you are, the more surprised they're going to be when you kill them." - Sir William Clayton From nginx-forum at nginx.us Sat Sep 10 00:21:59 2011 From: nginx-forum at nginx.us (pedroaxl) Date: Fri, 09 Sep 2011 20:21:59 -0400 Subject: Decode url in rewrite Message-ID: <94b42f69891b4faa8507abd58c54367a.NginxMailingListEnglish@forum.nginx.org> Hey guys, I am trying to solve a specific problem I have, but have not succeded. Users would access a link like this: http://mysite.com/24234234?key=3123&url=http%3A//mailee.me%3Fname%3Djohn%26code%3D123 This is a normal url with some integer params and a url encoded param. I want nginx to automatically redirect to the url in the parameters. So I used the following code in the nginx.conf location /go/click { set $new_url $arg_url; set $args ''; rewrite ^.*$ $new_url redirect; } It works beautifully. The problem is that if the encoded url also have params, the client will receive the params encoded and it may not work in their system. I try to use perl code to decode the url before redirecting, but it didnt work. This is the code inside http context: perl_modules perl/lib; perl_require mailee.pm; This is the code inside location context: location /go/click { perl mailee::decode; set $new_url $arg_url; #set $args ''; rewrite ^.*$ $args redirect; } And the code in mailee.pm: package mailee; use nginx; sub decode { my $r = shift; $r->args =~ s/\%3D/=/g; $r->args =~ s/\%26/&/g; $r->args =~ s/\%3F/?/g; $r->args =~ s/\%3A/:/g; return OK; } 1; __END__ But it didnt work too, because I was not able to modify $args inside the perl function. I am not sure if this is the best way to do it and if I am doing it right. Do you have any other solutions? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215047,215047#msg-215047 From nginx-forum at nginx.us Sat Sep 10 01:08:08 2011 From: nginx-forum at nginx.us (frostbyte) Date: Fri, 09 Sep 2011 21:08:08 -0400 Subject: nginx 1.0.6 perl module build failure Message-ID: Snow Leopard 10.6.7, Xcode 4.0.1: $ cd nginx-1.0.6 $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/run/nginx/nginx.lock --http-client-body-temp-path=/var/run/nginx/client_body_temp --http-proxy-temp-path=/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module --with-http_flv_module --with-mail --with-http_ssl_module --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 --with-http_perl_module --with-perl=/usr/bin/perl --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_gzip_static_module $ make ... gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g -I/usr/local/include -O2 -Wno-deprecated-declarations -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -I src/core -I src/event -I src/event/modules -I src/os/unix -I /opt/local/include -I objs -I src/http -I src/http/modules -I src/http/modules/perl \ -o objs/src/http/modules/perl/ngx_http_perl_module.o \ src/http/modules/perl/ngx_http_perl_module.c In file included from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE/perl.h:3240: error: expected specifier-qualifier-list before ?bool? ... Seems to be a know issue in other contexts. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215048,215048#msg-215048 From orz at loli.my Sat Sep 10 05:22:44 2011 From: orz at loli.my (=?UTF-8?B?44OT44Oq44OT44Oq4oWk?=) Date: Sat, 10 Sep 2011 13:22:44 +0800 Subject: Beginner questions about proxy configuration and white space In-Reply-To: References: Message-ID: If you only using one ip, you can use listen 80 default; The some_ip:some_port is using on my product server, it shows no problem. 2011/9/10 ynasser > I don't think it's a problem with reloading the configuration file, > because I have been reloading it every time after I update and save it. > > What is happening is that when I run 'sudo nginx', it doesn't start and > outputs this error: > > nginx: [emerg] bind() to some_ip:some_port failed (49: Can't assign > requested address) > > I can access some_ip:some_port just fine from a browser and ssh-ing into > it is not a problem. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,214982,215044#msg-215044 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sat Sep 10 11:17:24 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 10 Sep 2011 15:17:24 +0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: References: Message-ID: <20110910111724.GU1137@mdounin.ru> Hello! On Fri, Sep 09, 2011 at 09:08:08PM -0400, frostbyte wrote: > Snow Leopard 10.6.7, Xcode 4.0.1: > > $ cd nginx-1.0.6 > $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include > -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" > --conf-path=/etc/nginx/nginx.conf > --error-log-path=/var/log/nginx/error.log > --http-log-path=/var/log/nginx/access.log > --pid-path=/var/run/nginx/nginx.pid > --lock-path=/var/run/nginx/nginx.lock > --http-client-body-temp-path=/var/run/nginx/client_body_temp > --http-proxy-temp-path=/var/run/nginx/proxy_temp > --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp > --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module > --with-http_flv_module --with-mail --with-http_ssl_module > --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 > --with-http_perl_module --with-perl=/usr/bin/perl > --with-http_realip_module --with-http_addition_module > --with-http_sub_module --with-http_gzip_static_module > > $ make > ... > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter > -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g > -I/usr/local/include -O2 -Wno-deprecated-declarations -arch x86_64 -arch > i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing > -I/usr/local/include > -I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -I > src/core -I src/event -I src/event/modules -I src/os/unix -I > /opt/local/include -I objs -I src/http -I src/http/modules -I > src/http/modules/perl \ > -o objs/src/http/modules/perl/ngx_http_perl_module.o \ > src/http/modules/perl/ngx_http_perl_module.c > In file included from src/http/modules/perl/ngx_http_perl_module.h:17, > from src/http/modules/perl/ngx_http_perl_module.c:10: > /System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE/perl.h:3240: > error: expected specifier-qualifier-list before ?bool? > ... > > Seems to be a know issue in other contexts. Looks like problem with perl in your environment. You may try building basic samples from perlembed manpage to see what goes wrong, most likely either ccopts as returned by "perl -MExtUtils::Embed -e ccopts" are incorrect, or they correspond to other C compiler (check "perl -V" output). Maxim Dounin From nginx-forum at nginx.us Sat Sep 10 11:40:31 2011 From: nginx-forum at nginx.us (carrierdetect) Date: Sat, 10 Sep 2011 07:40:31 -0400 Subject: "port_in_redirect off" not working. Message-ID: Hello, I'm running nginx/1.0.5 behing Varnish and serving up static html. Whenever I visit a URL which is a directory but without a trailing slash, e.g. /blah, it redirects to the non-80 port which nginx is running on, e.g. server:5000/blah/. The config is as follows: http { include mime.types; default_type application/octet-stream; sendfile on; server { listen 5000; server_name server.com; root /path/html; location / { index index.html index.htm; port_in_redirect off; } } } I've tried moving "port_in_redirect off" to http and server contexts, and setting "server_name_in_redirect off", to no avail. The Varnish configuration is as simple as can be and just looks for the request hostname and forwards to the nginx backend. Regards, Andrew Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215059,215059#msg-215059 From igor at sysoev.ru Sat Sep 10 11:46:26 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 10 Sep 2011 15:46:26 +0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <20110910111724.GU1137@mdounin.ru> References: <20110910111724.GU1137@mdounin.ru> Message-ID: <20110910114625.GB18804@nginx.com> On Sat, Sep 10, 2011 at 03:17:24PM +0400, Maxim Dounin wrote: > Hello! > > On Fri, Sep 09, 2011 at 09:08:08PM -0400, frostbyte wrote: > > > Snow Leopard 10.6.7, Xcode 4.0.1: > > > > $ cd nginx-1.0.6 > > $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include > > -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" > > --conf-path=/etc/nginx/nginx.conf > > --error-log-path=/var/log/nginx/error.log > > --http-log-path=/var/log/nginx/access.log > > --pid-path=/var/run/nginx/nginx.pid > > --lock-path=/var/run/nginx/nginx.lock > > --http-client-body-temp-path=/var/run/nginx/client_body_temp > > --http-proxy-temp-path=/var/run/nginx/proxy_temp > > --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp > > --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module > > --with-http_flv_module --with-mail --with-http_ssl_module > > --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 > > --with-http_perl_module --with-perl=/usr/bin/perl > > --with-http_realip_module --with-http_addition_module > > --with-http_sub_module --with-http_gzip_static_module > > > > $ make > > ... > > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter > > -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g > > -I/usr/local/include -O2 -Wno-deprecated-declarations -arch x86_64 -arch > > i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing > > -I/usr/local/include > > -I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -I > > src/core -I src/event -I src/event/modules -I src/os/unix -I > > /opt/local/include -I objs -I src/http -I src/http/modules -I > > src/http/modules/perl \ > > -o objs/src/http/modules/perl/ngx_http_perl_module.o \ > > src/http/modules/perl/ngx_http_perl_module.c > > In file included from src/http/modules/perl/ngx_http_perl_module.h:17, > > from src/http/modules/perl/ngx_http_perl_module.c:10: > > /System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE/perl.h:3240: > > error: expected specifier-qualifier-list before ?bool? > > ... > > > > Seems to be a know issue in other contexts. > > Looks like problem with perl in your environment. > > You may try building basic samples from perlembed manpage to see > what goes wrong, most likely either ccopts as returned by "perl > -MExtUtils::Embed -e ccopts" are incorrect, or they correspond to > other C compiler (check "perl -V" output). No, this is known issue with MacOSX system perl. This is conflict between "bool" definition included via libkern/OSAtomic.h and perl's CORE/handy.h. I do not personaly encounter this since I have perl from macports :) -- Igor Sysoev From mdounin at mdounin.ru Sat Sep 10 12:08:26 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 10 Sep 2011 16:08:26 +0400 Subject: "port_in_redirect off" not working. In-Reply-To: References: Message-ID: <20110910120826.GV1137@mdounin.ru> Hello! On Sat, Sep 10, 2011 at 07:40:31AM -0400, carrierdetect wrote: > Hello, > > I'm running nginx/1.0.5 behing Varnish and serving up static html. > Whenever I visit a URL which is a directory but without a trailing > slash, e.g. /blah, it redirects to the non-80 port which nginx is > running on, e.g. server:5000/blah/. The config is as follows: > > http { > include mime.types; > default_type application/octet-stream; > sendfile on; > > server { > listen 5000; > server_name server.com; > root /path/html; > > location / { > index index.html index.htm; > port_in_redirect off; > } > } > } Works ok here. > I've tried moving "port_in_redirect off" to http and server contexts, > and setting "server_name_in_redirect off", to no avail. The Varnish > configuration is as simple as can be and just looks for the request > hostname and forwards to the nginx backend. Try connecting nginx directly or looking though tcpdump to see what actually nginx returns. I suspect it's actually caching issue, either Varnish cached the redirect from your previous nginx config without "port_in_redirect off;" or your browser did. Maxim Dounin From nginx-forum at nginx.us Sat Sep 10 13:12:13 2011 From: nginx-forum at nginx.us (carrierdetect) Date: Sat, 10 Sep 2011 09:12:13 -0400 Subject: "port_in_redirect off" not working. In-Reply-To: <20110910120826.GV1137@mdounin.ru> References: <20110910120826.GV1137@mdounin.ru> Message-ID: Hi Maxim, Maxim Dounin Wrote: ------------------------------------------------------- > I suspect it's actually caching issue, either > Varnish cached the > redirect from your previous nginx config without > "port_in_redirect > off;" or your browser did. Ah, so it appears that my browser had cached the redirect (and I feel silly for not having checked this). Many thanks for your help! Regards, Andrew Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215059,215066#msg-215066 From mdounin at mdounin.ru Sat Sep 10 13:24:04 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 10 Sep 2011 17:24:04 +0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <20110910114625.GB18804@nginx.com> References: <20110910111724.GU1137@mdounin.ru> <20110910114625.GB18804@nginx.com> Message-ID: <20110910132404.GW1137@mdounin.ru> Hello! On Sat, Sep 10, 2011 at 03:46:26PM +0400, Igor Sysoev wrote: > On Sat, Sep 10, 2011 at 03:17:24PM +0400, Maxim Dounin wrote: > > Hello! > > > > On Fri, Sep 09, 2011 at 09:08:08PM -0400, frostbyte wrote: > > > > > Snow Leopard 10.6.7, Xcode 4.0.1: > > > > > > $ cd nginx-1.0.6 > > > $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include > > > -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" > > > --conf-path=/etc/nginx/nginx.conf > > > --error-log-path=/var/log/nginx/error.log > > > --http-log-path=/var/log/nginx/access.log > > > --pid-path=/var/run/nginx/nginx.pid > > > --lock-path=/var/run/nginx/nginx.lock > > > --http-client-body-temp-path=/var/run/nginx/client_body_temp > > > --http-proxy-temp-path=/var/run/nginx/proxy_temp > > > --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp > > > --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module > > > --with-http_flv_module --with-mail --with-http_ssl_module > > > --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 > > > --with-http_perl_module --with-perl=/usr/bin/perl > > > --with-http_realip_module --with-http_addition_module > > > --with-http_sub_module --with-http_gzip_static_module > > > > > > $ make > > > ... > > > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter > > > -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g > > > -I/usr/local/include -O2 -Wno-deprecated-declarations -arch x86_64 -arch > > > i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing > > > -I/usr/local/include > > > -I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -I > > > src/core -I src/event -I src/event/modules -I src/os/unix -I > > > /opt/local/include -I objs -I src/http -I src/http/modules -I > > > src/http/modules/perl \ > > > -o objs/src/http/modules/perl/ngx_http_perl_module.o \ > > > src/http/modules/perl/ngx_http_perl_module.c > > > In file included from src/http/modules/perl/ngx_http_perl_module.h:17, > > > from src/http/modules/perl/ngx_http_perl_module.c:10: > > > /System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE/perl.h:3240: > > > error: expected specifier-qualifier-list before ?bool? > > > ... > > > > > > Seems to be a know issue in other contexts. > > > > Looks like problem with perl in your environment. > > > > You may try building basic samples from perlembed manpage to see > > what goes wrong, most likely either ccopts as returned by "perl > > -MExtUtils::Embed -e ccopts" are incorrect, or they correspond to > > other C compiler (check "perl -V" output). > > No, this is known issue with MacOSX system perl. > This is conflict between "bool" definition included via > libkern/OSAtomic.h and perl's CORE/handy.h. > I do not personaly encounter this since I have perl from macports :) Error message suggests that "bool" is not defined. And looking though [1] I don't see bool defined via libkern/OSAtomic.h. OSTypes.h defines "Boolean", but not "bool". While I feel perl's handy.h is utterly wrong in it's aproach to "bool" (it's 2011 now, more than 10 years since C99 defined stdbool.h!), I still doesn't see what happens here. Additionally, I see Apple hacks handy.h on it's system perl to include stdbool.h[2], and this makes me wonder even more. Could you please confirm that perlembed sample does actually compiles fine with Mac OS X system perl without extra includes used? [1] http://www.opensource.apple.com/source/xnu/xnu-1699.22.81/libkern/libkern/OSAtomic.h [2] http://www.opensource.apple.com/source/perl/perl-73/5.10/fix/handy.h.ed Maxim Dounin From igor at sysoev.ru Sat Sep 10 14:09:46 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 10 Sep 2011 18:09:46 +0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <20110910132404.GW1137@mdounin.ru> References: <20110910111724.GU1137@mdounin.ru> <20110910114625.GB18804@nginx.com> <20110910132404.GW1137@mdounin.ru> Message-ID: <20110910140946.GC18804@nginx.com> On Sat, Sep 10, 2011 at 05:24:04PM +0400, Maxim Dounin wrote: > Hello! > > On Sat, Sep 10, 2011 at 03:46:26PM +0400, Igor Sysoev wrote: > > > On Sat, Sep 10, 2011 at 03:17:24PM +0400, Maxim Dounin wrote: > > > Hello! > > > > > > On Fri, Sep 09, 2011 at 09:08:08PM -0400, frostbyte wrote: > > > > > > > Snow Leopard 10.6.7, Xcode 4.0.1: > > > > > > > > $ cd nginx-1.0.6 > > > > $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include > > > > -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" > > > > --conf-path=/etc/nginx/nginx.conf > > > > --error-log-path=/var/log/nginx/error.log > > > > --http-log-path=/var/log/nginx/access.log > > > > --pid-path=/var/run/nginx/nginx.pid > > > > --lock-path=/var/run/nginx/nginx.lock > > > > --http-client-body-temp-path=/var/run/nginx/client_body_temp > > > > --http-proxy-temp-path=/var/run/nginx/proxy_temp > > > > --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp > > > > --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module > > > > --with-http_flv_module --with-mail --with-http_ssl_module > > > > --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 > > > > --with-http_perl_module --with-perl=/usr/bin/perl > > > > --with-http_realip_module --with-http_addition_module > > > > --with-http_sub_module --with-http_gzip_static_module > > > > > > > > $ make > > > > ... > > > > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter > > > > -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g > > > > -I/usr/local/include -O2 -Wno-deprecated-declarations -arch x86_64 -arch > > > > i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing > > > > -I/usr/local/include > > > > -I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -I > > > > src/core -I src/event -I src/event/modules -I src/os/unix -I > > > > /opt/local/include -I objs -I src/http -I src/http/modules -I > > > > src/http/modules/perl \ > > > > -o objs/src/http/modules/perl/ngx_http_perl_module.o \ > > > > src/http/modules/perl/ngx_http_perl_module.c > > > > In file included from src/http/modules/perl/ngx_http_perl_module.h:17, > > > > from src/http/modules/perl/ngx_http_perl_module.c:10: > > > > /System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE/perl.h:3240: > > > > error: expected specifier-qualifier-list before ?bool? > > > > ... > > > > > > > > Seems to be a know issue in other contexts. > > > > > > Looks like problem with perl in your environment. > > > > > > You may try building basic samples from perlembed manpage to see > > > what goes wrong, most likely either ccopts as returned by "perl > > > -MExtUtils::Embed -e ccopts" are incorrect, or they correspond to > > > other C compiler (check "perl -V" output). > > > > No, this is known issue with MacOSX system perl. > > This is conflict between "bool" definition included via > > libkern/OSAtomic.h and perl's CORE/handy.h. > > I do not personaly encounter this since I have perl from macports :) > > Error message suggests that "bool" is not defined. And looking > though [1] I don't see bool defined via libkern/OSAtomic.h. > OSTypes.h defines "Boolean", but not "bool". > > While I feel perl's handy.h is utterly wrong in it's aproach to > "bool" (it's 2011 now, more than 10 years since C99 defined > stdbool.h!), I still doesn't see what happens here. Additionally, > I see Apple hacks handy.h on it's system perl to include > stdbool.h[2], and this makes me wonder even more. > > Could you please confirm that perlembed sample does actually > compiles fine with Mac OS X system perl without extra includes > used? > > [1] http://www.opensource.apple.com/source/xnu/xnu-1699.22.81/libkern/libkern/OSAtomic.h > [2] http://www.opensource.apple.com/source/perl/perl-73/5.10/fix/handy.h.ed It seems last time when I tried to build nginx with MacOSX system perl it was Leopard 10.5.x. On Snow Leopard 10.6.8 "#undef bool" in src/os/unix/ngx_atomic is not required, but perl -MExtUtils::Embed -e ldopts issues settings which do not allow to link nginx: -arch x86_64 -arch i386 -arch ppc -L/usr/local/lib -L/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -lperl -ldl -lm -lutil -lc ld: warning: in objs.gcc/src/core/nginx.o, file was built for unsupported file format which is not the architecture being linked (i386) -- Igor Sysoev From katmai at keptprivate.com Sun Sep 11 08:28:06 2011 From: katmai at keptprivate.com (Stefanita Rares Dumitrescu) Date: Sun, 11 Sep 2011 10:28:06 +0200 Subject: memory leaks on nginx / php-fpm Message-ID: <4E6C7116.50307@keptprivate.com> hi guys, i have a serious problem that i can't make nor heads nor tails of. i am using nginx 1.0.6 with php 5.2.17 + fpm. i run a gallery2 image gallery, pretty busy, and when i redirected some traffic from the old server today to the new one, i got a bunch of memory leaks messages in the php-fpm log. they are going like crazy filling up the log. can you please give me some advice? thanks in advance. Sep 11 01:24:29.948540 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "/usr/ports/lang/php52/work/php-5.2.17/Zend/zend_variables.c(131) : Actual location (location was relayed)" Sep 11 01:24:29.948583 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "Last leak repeated 2 times" Sep 11 01:24:29.948591 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "[Sun Sep 11 01:24:29 2011] Script: '/home/cityv3/public_html/gallery/main.php'" Sep 11 01:24:29.948597 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "/usr/ports/lang/php52/work/php-5.2.17/Zend/zend_variables.c(132) : Freeing 0x80C269680 (512 bytes), script=/home/cityv3/public_html/gallery/main.php" Sep 11 01:24:29.948603 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "/usr/ports/lang/php52/work/php-5.2.17/Zend/zend_alloc.c(2391) : Actual location (location was relayed)" Sep 11 01:24:29.948637 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "Last leak repeated 2 times" Sep 11 01:24:29.948644 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "[Sun Sep 11 01:24:29 2011] Script: '/home/cityv3/public_html/gallery/main.php'" Sep 11 01:24:29.948650 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "/usr/ports/lang/php52/work/php-5.2.17/Zend/zend_vm_execute.h(7535) : Freeing 0x80C26CF78 (24 bytes), script=/home/cityv3/public_html/gallery/main.php" Sep 11 01:24:29.948693 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "[Sun Sep 11 01:24:29 2011] Script: '/home/cityv3/public_html/gallery/main.php'" Sep 11 01:24:29.948699 [WARNING] fpm_stdio_child_said(), line 167: child 22682 (pool default) said into stderr: "/usr/ports/lang/php52/work/php-5.2.17/ext/standard/string.c(756) : Freeing 0x80C26D270 (6 bytes), script=/home/cityv3/public_html/gallery/main.php" From nginx-forum at nginx.us Sun Sep 11 11:19:48 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Sun, 11 Sep 2011 07:19:48 -0400 Subject: memory leaks on nginx / php-fpm In-Reply-To: <4E6C7116.50307@keptprivate.com> References: <4E6C7116.50307@keptprivate.com> Message-ID: You will want to bring this up to the PHP people as there is no link between Nginx and PHP-FPM. There is a fastcgi abstraction layer between them. That said, they have deprecated PHP 5.2.x and PHP-FPM for 5.2.x is a patch so I honestly think you'll be told to upgrade first and then see what happens, so you might want to do that first. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215080,215085#msg-215085 From katmai at keptprivate.com Sun Sep 11 13:42:13 2011 From: katmai at keptprivate.com (Stefanita Rares Dumitrescu) Date: Sun, 11 Sep 2011 15:42:13 +0200 Subject: memory leaks on nginx / php-fpm In-Reply-To: References: <4E6C7116.50307@keptprivate.com> Message-ID: <4E6CBAB5.3000709@keptprivate.com> fixed by disabling the apc extension. i have no clue how that got installed as i did not build it. it was conflicting with the installed eaccelerator. weird stuff. On 9/11/2011 1:19 PM, Ensiferous wrote: > You will want to bring this up to the PHP people as there is no link > between Nginx and PHP-FPM. There is a fastcgi abstraction layer between > them. That said, they have deprecated PHP 5.2.x and PHP-FPM for 5.2.x is > a patch so I honestly think you'll be told to upgrade first and then see > what happens, so you might want to do that first. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215080,215085#msg-215085 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Sun Sep 11 16:47:53 2011 From: nginx-forum at nginx.us (Sylvia) Date: Sun, 11 Sep 2011 12:47:53 -0400 Subject: memory leaks on nginx / php-fpm In-Reply-To: <4E6CBAB5.3000709@keptprivate.com> References: <4E6CBAB5.3000709@keptprivate.com> Message-ID: <0ededa716762ad41b13602c078dc58d1.NginxMailingListEnglish@forum.nginx.org> FYI: last version of APC (3.1.9) fixed some memory leaks with FastCGI, I have no issues with php-fpm 5.3.8 and APC 3.1.9 another recomendation - switch to PHP 5.3 if you can, 5.2 branch is not supported anymore, and php-fpm SAPI is now bundled into main PHP (5.3), works fine, just pay attention that config file is not XML anymore. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215080,215091#msg-215091 From gelonida at gmail.com Sun Sep 11 18:13:32 2011 From: gelonida at gmail.com (Gelonida N) Date: Sun, 11 Sep 2011 20:13:32 +0200 Subject: problems with mediawiki behind nginx / apache (redirects to wrong url) Message-ID: Hi, I'm having a little trouble to get Mediawiki working in my nginx setup. The problem is very probably the configuration of Mediawiki, but the Help pages about Mediawiki don't mention nginx. So I thought I ask here. My Problem: - I setup nginx with https such, that it handles all files, except php files, which fill be proxied to apache/mod_php at port 8081 - I installed a new Mediawiki - the installation via the web worked fine and was confirmed with a success message - then I moved config/LocalSedttings.php to the wiki directory Now I access https:/servername/wiki2/ and get redirected to http://servername:8081/wiki2/index.php/Main_Page Below my nginx configuration: # ============== nginx configuration ======== server { listen 443 ssl; ssl_session_timeout 10m; ssl_session_cache shared:SSL:10m; location ~ \.(php)$ { include proxy.conf; proxy_pass http://127.0.0.1:8081; } # nginx shall serve all files except the php ones location / { root /my/doc/root; index index.html index.htm index.php; } # ==================== proxy.conf ============== proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; Thanks in advance for any pointers. From gelonida at gmail.com Sun Sep 11 18:44:58 2011 From: gelonida at gmail.com (Gelonida N) Date: Sun, 11 Sep 2011 20:44:58 +0200 Subject: problems with mediawiki behind nginx / apache (redirects to wrong url) In-Reply-To: References: Message-ID: I have now a working (perhaps not optimized) solution. 1.) Add following variable to Mediawiki's LocalSettings.php: $wgServer = 'https://servername'; I found this tip finally at http://www.cyberciti.biz/faq/mediawiki-fix-internal-server-host-names-redirect-using-wgserver/ though they specify the entire server url with the path to the wiki, whereas I specify just the protocol and the server 2,) As Mediawiki urls look like: https://servername/wiki/index.php/blablabla I have to be sure, that all these urls get redirected to apache this I changed my setup to: location ~ \.(php)$ { include proxy.conf; proxy_pass http://127.0.0.1:8081; } location /wiki/index.php { include proxy.conf; proxy_pass http://127.0.0.1:8081; } location / { root /home/noma/web/nomassl; index index.html index.htm index.php; } Perhaps this post can help somebdoy else. I was searching for quite some time and was already close to giving up. On 09/11/2011 08:13 PM, Gelonida N wrote: > Hi,Well I have finally a (non optimized) setting, which is working. On 09/11/2011 08:13 PM, Gelonida N wrote: > Hi, > > I'm having a little trouble to get Mediawiki working in my nginx setup. > > The problem is very probably the configuration of Mediawiki, but the > Help pages about Mediawiki don't mention nginx. > So I thought I ask here. > > > My Problem: > - I setup nginx with https such, that it handles all files, except php > files, which fill be proxied to apache/mod_php at port 8081 > > - I installed a new Mediawiki > > - the installation via the web worked fine and was confirmed > with a success message > > - then I moved config/LocalSedttings.php to the wiki directory > > Now I access https:/servername/wiki2/ > and get redirected to http://servername:8081/wiki2/index.php/Main_Page > > > Below my nginx configuration: > > > # ============== nginx configuration ======== > server { > listen 443 ssl; > ssl_session_timeout 10m; > ssl_session_cache shared:SSL:10m; > > location ~ \.(php)$ { > include proxy.conf; > proxy_pass http://127.0.0.1:8081; > } > > # nginx shall serve all files except the php ones > location / { > root /my/doc/root; > index index.html index.htm index.php; > } > > # ==================== proxy.conf ============== > proxy_redirect off; > > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > client_max_body_size 10m; > client_body_buffer_size 128k; > > proxy_connect_timeout 90; > proxy_send_timeout 90; > proxy_read_timeout 90; > > proxy_buffer_size 4k; > proxy_buffers 4 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > > > Thanks in advance for any pointers. > > I'm having a little trouble to get Mediawiki working in my nginx setup. > > The problem is very probably the configuration of Mediawiki, but the > Help pages about Mediawiki don't mention nginx. > So I thought I ask here. > > > My Problem: > - I setup nginx with https such, that it handles all files, except php > files, which fill be proxied to apache/mod_php at port 8081 > > - I installed a new Mediawiki > > - the installation via the web worked fine and was confirmed > with a success message > > - then I moved config/LocalSedttings.php to the wiki directory > > Now I access https:/servername/wiki2/ > and get redirected to http://servername:8081/wiki2/index.php/Main_Page > > > Below my nginx configuration: > > > # ============== nginx configuration ======== > server { > listen 443 ssl; > ssl_session_timeout 10m; > ssl_session_cache shared:SSL:10m; > > location ~ \.(php)$ { > include proxy.conf; > proxy_pass http://127.0.0.1:8081; > } > > # nginx shall serve all files except the php ones > location / { > root /my/doc/root; > index index.html index.htm index.php; > } > > # ==================== proxy.conf ============== > proxy_redirect off; > > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > client_max_body_size 10m; > client_body_buffer_size 128k; > > proxy_connect_timeout 90; > proxy_send_timeout 90; > proxy_read_timeout 90; > > proxy_buffer_size 4k; > proxy_buffers 4 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > > > Thanks in advance for any pointers. From nginx-forum at nginx.us Mon Sep 12 00:30:15 2011 From: nginx-forum at nginx.us (frostbyte) Date: Sun, 11 Sep 2011 20:30:15 -0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <20110910114625.GB18804@nginx.com> References: <20110910114625.GB18804@nginx.com> Message-ID: Same error using perl 5.12 from MacPorts: $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/run/nginx/nginx.lock --http-client-body-temp-path=/var/run/nginx/client_body_temp --http-proxy-temp-path=/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module --with-http_flv_module --with-mail --with-http_ssl_module --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 --with-http_perl_module --with-perl=/usr/bin/perl --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_gzip_static_module --with-perl=/opt/local/bin/perl . . . checking for perl + perl version: This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-multi-2level + perl interpreter multiplicity found . . . $ make . . . gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g -I/usr/local/include -O2 -Wno-deprecated-declarations -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include -I/opt/local/lib/perl5/5.12.3/darwin-multi-2level/CORE -I src/core -I src/event -I src/event/modules -I src/os/unix -I /opt/local/include -I objs -I src/http -I src/http/modules -I src/http/modules/perl \ -o objs/src/http/modules/perl/ngx_http_perl_module.o \ src/http/modules/perl/ngx_http_perl_module.c In file included from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /opt/local/lib/perl5/5.12.3/darwin-multi-2level/CORE/perl.h:3336: error: expected specifier-qualifier-list before ?bool? . . . Actually I started with the MacPorts nginx 1.0.6 install and then tried the tarball (getting the same result). Frosty Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215048,215096#msg-215096 From nginx-forum at nginx.us Mon Sep 12 00:32:04 2011 From: nginx-forum at nginx.us (frostbyte) Date: Sun, 11 Sep 2011 20:32:04 -0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: References: <20110910114625.GB18804@nginx.com> Message-ID: <2fa3cc7ba9e0e80774ea82240e53fde3.NginxMailingListEnglish@forum.nginx.org> perl5.12 via MacPorts: $ perl -MExtUtils::Embed -e ldopts -L/opt/local/lib -arch x86_64 -fstack-protector -L/opt/local/lib/perl5/5.12.3/darwin-multi-2level/CORE -lperl -ldl -lm -lutil -lc $ perl -V Summary of my perl5 (revision 5 version 12 subversion 3) configuration: Platform: osname=darwin, osvers=10.8.0, archname=darwin-multi-2level uname='darwin beta.macosforge.org 10.8.0 darwin kernel version 10.8.0: tue jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386 i386 ' config_args='-D inc_version_list=5.12.2/darwin-multi-2level 5.12.2 5.12.1/darwin-multi-2level 5.12.1 5.12.0/darwin-multi-2level 5.12.0 -des -Dprefix=/opt/local -Dscriptdir=/opt/local/bin -Dcppflags=-I/opt/local/include -Dccflags=-pipe -O2 -arch x86_64 -Dldflags=-L/opt/local/lib -arch x86_64 -Dvendorprefix=/opt/local -Dusemultiplicity=y -D cc=/usr/bin/gcc-4.2 -D ld=/usr/bin/gcc-4.2 -D man1ext=1pm -D man3ext=3pm -D man1dir=/opt/local/share/man/man1p -D man3dir=/opt/local/share/man/man3p -D siteman1dir=/opt/local/share/man/man1 -D siteman3dir=/opt/local/share/man/man3 -D vendorman1dir=/opt/local/share/man/man1 -D vendorman3dir=/opt/local/share/man/man3 -D pager=/usr/bin/less -sR' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/usr/bin/gcc-4.2', ccflags ='-pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include', optimize='-O3', cppflags='-I/opt/local/include -no-cpp-precomp -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include' ccversion='', gccversion='4.2.1 (Apple Inc. build 5666) (dot 3)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.6 /usr/bin/gcc-4.2', ldflags ='-L/opt/local/lib -arch x86_64 -fstack-protector' libpth=/opt/local/lib /usr/lib libs=-lgdbm -ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-L/opt/local/lib -arch x86_64 -bundle -undefined dynamic_lookup -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under darwin Compiled at Aug 29 2011 07:18:38 @INC: /opt/local/lib/perl5/site_perl/5.12.3/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.12.3 /opt/local/lib/perl5/vendor_perl/5.12.3/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.12.3 /opt/local/lib/perl5/5.12.3/darwin-multi-2level /opt/local/lib/perl5/5.12.3 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215048,215097#msg-215097 From mdounin at mdounin.ru Mon Sep 12 08:39:02 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 12 Sep 2011 12:39:02 +0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: References: <20110910114625.GB18804@nginx.com> Message-ID: <20110912083902.GA1137@mdounin.ru> Hello! On Sun, Sep 11, 2011 at 08:30:15PM -0400, frostbyte wrote: > Same error using perl 5.12 from MacPorts: > > $ ./configure --prefix=/usr/local --with-cc-opt="-I/usr/local/include > -O2 -Wno-deprecated-declarations" --with-ld-opt="-L/usr/local/lib" > --conf-path=/etc/nginx/nginx.conf > --error-log-path=/var/log/nginx/error.log > --http-log-path=/var/log/nginx/access.log > --pid-path=/var/run/nginx/nginx.pid > --lock-path=/var/run/nginx/nginx.lock > --http-client-body-temp-path=/var/run/nginx/client_body_temp > --http-proxy-temp-path=/var/run/nginx/proxy_temp > --http-fastcgi-temp-path=/var/run/nginx/fastcgi_temp > --http-uwsgi-temp-path=/var/run/nginx/uwsgi_temp --with-http_dav_module > --with-http_flv_module --with-mail --with-http_ssl_module > --with-mail_ssl_module --with-http_stub_status_module --with-ipv6 > --with-http_perl_module --with-perl=/usr/bin/perl > --with-http_realip_module --with-http_addition_module > --with-http_sub_module --with-http_gzip_static_module > --with-perl=/opt/local/bin/perl > . . . > checking for perl > + perl version: This is perl 5, version 12, subversion 3 (v5.12.3) > built for darwin-multi-2level > + perl interpreter multiplicity found > . . . > > $ make > . . . > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter > -Wunused-function -Wunused-variable -Wno-unused-value -Werror -g > -I/usr/local/include -O2 -Wno-deprecated-declarations -pipe -O2 -arch > x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp > -fno-strict-aliasing -fstack-protector -I/opt/local/include > -I/opt/local/lib/perl5/5.12.3/darwin-multi-2level/CORE -I src/core -I > src/event -I src/event/modules -I src/os/unix -I /opt/local/include -I > objs -I src/http -I src/http/modules -I src/http/modules/perl \ > -o objs/src/http/modules/perl/ngx_http_perl_module.o \ > src/http/modules/perl/ngx_http_perl_module.c > In file included from src/http/modules/perl/ngx_http_perl_module.h:17, > from src/http/modules/perl/ngx_http_perl_module.c:10: > /opt/local/lib/perl5/5.12.3/darwin-multi-2level/CORE/perl.h:3336: error: > expected specifier-qualifier-list before ?bool? > . . . > > Actually I started with the MacPorts nginx 1.0.6 install and then tried > the tarball (getting the same result). It looks like macports also patch handy.h in perl 5.12 and perl 5.14 to use stdbool.h [1][2] since about 3 months. (The perl 5.8 from macports still uses perl's native handy.h.) Please try the following patch: diff --git a/src/os/unix/ngx_atomic.h b/src/os/unix/ngx_atomic.h --- a/src/os/unix/ngx_atomic.h +++ b/src/os/unix/ngx_atomic.h @@ -46,9 +46,6 @@ typedef volatile ngx_atomic_uint_t ngx_ #include -/* "bool" conflicts with perl's CORE/handy.h */ -#undef bool - #define NGX_HAVE_ATOMIC_OPS 1 [1] https://trac.macports.org/browser/trunk/dports/lang/perl5.12/files/patch-handy.h.stdbool.diff [2] https://trac.macports.org/browser/trunk/dports/lang/perl5.14/files/patch-handy.h.stdbool.diff Maxim Dounin From nginx-forum at nginx.us Mon Sep 12 11:16:19 2011 From: nginx-forum at nginx.us (frostbyte) Date: Mon, 12 Sep 2011 07:16:19 -0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <2fa3cc7ba9e0e80774ea82240e53fde3.NginxMailingListEnglish@forum.nginx.org> References: <20110910114625.GB18804@nginx.com> <2fa3cc7ba9e0e80774ea82240e53fde3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <301b3dfe2d6e0ed1ad4bc5ca953cda63.NginxMailingListEnglish@forum.nginx.org> Perfect. Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215048,215107#msg-215107 From nginx-forum at nginx.us Mon Sep 12 14:11:18 2011 From: nginx-forum at nginx.us (advegav) Date: Mon, 12 Sep 2011 10:11:18 -0400 Subject: too many open files In-Reply-To: <77432c470909100810s78c3ee1dhc7e0ab1a17d942f0@mail.gmail.com> References: <77432c470909100810s78c3ee1dhc7e0ab1a17d942f0@mail.gmail.com> Message-ID: I found the solution for the same problem on my environment, ( Solaris 10 ) here: http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ Quoting: .... "Then open the nginx configuration file (default: /etc/nginx/nginx.conf) and the following line right after the ?worker_processes? entry line worker_rlimit_nofile 20480; Once both changes are made, run the Nginx lint to make sure no errors have been introduced: # nginx -t 2010/11/01 17:07:46 [info] 9520#0: the configuration file /etc/nginx/nginx.conf syntax is ok 2010/11/01 17:07:46 [info] 9520#0: the configuration file /etc/nginx/nginx.conf was tested successfully and then restart Nginx" Thank to them I solved my problem :-) hope this helps... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,6300,215117#msg-215117 From nginx-forum at nginx.us Mon Sep 12 14:22:25 2011 From: nginx-forum at nginx.us (vejpuste) Date: Mon, 12 Sep 2011 10:22:25 -0400 Subject: Double free or corruption Message-ID: <379f8d1bec5578f7a40400b736285b84.NginxMailingListEnglish@forum.nginx.org> Hello, after start nginx error.log contains : *** glibc detected *** nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf: double free or corruption (out): 0x09f24128 *** ======= Backtrace: ========= /lib/libc.so.6[0x5f46c5] /lib/libc.so.6(cfree+0x59)[0x5f4b09] nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf[0x80cfdc7] [0x9f17ec0] ======= Memory map: ======== 002d9000-002da000 r-xp 002d9000 00:00 0 [vdso] 00352000-00353000 rwxp 00352000 00:00 0 00539000-00554000 r-xp 00000000 fd:00 950349 /lib/ld-2.5.so 00554000-00555000 r-xp 0001a000 fd:00 950349 /lib/ld-2.5.so 00555000-00556000 rwxp 0001b000 fd:00 950349 /lib/ld-2.5.so 00583000-00586000 r-xp 00000000 fd:00 953074 /lib/libdl-2.5.so 00586000-00587000 r-xp 00002000 fd:00 953074 /lib/libdl-2.5.so 00587000-00588000 rwxp 00003000 fd:00 953074 /lib/libdl-2.5.so 0058b000-006de000 r-xp 00000000 fd:00 950482 /lib/libc-2.5.so 006de000-006e0000 r-xp 00153000 fd:00 950482 /lib/libc-2.5.so 006e0000-006e1000 rwxp 00155000 fd:00 950482 /lib/libc-2.5.so 006e1000-006e4000 rwxp 006e1000 00:00 0 006e6000-006fb000 r-xp 00000000 fd:00 953068 /lib/libpthread-2.5.so 006fb000-006fc000 r-xp 00015000 fd:00 953068 /lib/libpthread-2.5.so 006fc000-006fd000 rwxp 00016000 fd:00 953068 /lib/libpthread-2.5.so 006fd000-006ff000 rwxp 006fd000 00:00 0 00701000-00713000 r-xp 00000000 fd:00 498522 /usr/lib/libz.so.1.2.3 00713000-00714000 rwxp 00011000 fd:00 498522 /usr/lib/libz.so.1.2.3 0075c000-0077b000 r-xp 00000000 fd:00 950493 /lib/libpcre.so.0.0.1 0077b000-0077c000 rwxp 0001e000 fd:00 950493 /lib/libpcre.so.0.0.1 00888000-00889000 rwxp 00888000 00:00 0 009a8000-009a9000 rwxp 009a8000 00:00 0 00b24000-00b2e000 r-xp 00000000 fd:00 951090 /lib/libnss_files-2.5.so 00b2e000-00b2f000 r-xp 00009000 fd:00 951090 /lib/libnss_files-2.5.so 00b2f000-00b30000 rwxp 0000a000 fd:00 951090 /lib/libnss_files-2.5.so 00bb9000-00bba000 rwxs 00000000 00:09 17874 /dev/zero (deleted) 03248000-03253000 r-xp 00000000 fd:00 951429 /lib/libgcc_s-4.1.2-20080825.so.1 03253000-03254000 rwxp 0000a000 fd:00 951429 /lib/libgcc_s-4.1.2-20080825.so.1 035fd000-03606000 r-xp 00000000 fd:00 953152 /lib/libcrypt-2.5.so 03606000-03607000 r-xp 00008000 fd:00 953152 /lib/libcrypt-2.5.so 03607000-03608000 rwxp 00009000 fd:00 953152 /lib/libcrypt-2.5.so 03608000-0362f000 rwxp 03608000 00:00 0 08048000-081ee000 r-xp 00000000 fd:00 527526 /usr/local/nginx/sbin/nginx 081ee000-081ff000 rwxp 001a5000 fd:00 527526 /usr/local/nginx/sbin/nginx 081ff000-0820d000 rwxp 081ff000 00:00 0 09f14000-09f58000 rwxp 09f14000 00:00 0 [heap] bfebc000-bfed1000 rwxp bffe9000 00:00 0 [stack] nginx working. CentOS 5.6 x86_64 kernel 2.6.18-238.19.1.el5PAE, /usr/local/nginx/sbin/nginx -V nginx: nginx version: nginx/1.0.6 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) nginx: TLS SNI support enabled nginx: configure arguments: --with-http_stub_status_module --with-http_ssl_module --with-openssl=/root/src/Apache/Apache2/openssl-1.0.0d Thanks, Libor Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215119,215119#msg-215119 From nginx-forum at nginx.us Mon Sep 12 17:22:09 2011 From: nginx-forum at nginx.us (ynasser) Date: Mon, 12 Sep 2011 13:22:09 -0400 Subject: Beginner questions about proxy configuration and white space In-Reply-To: <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> References: <72ca536398bcc048cbca71aa39cb728e.NginxMailingListEnglish@forum.nginx.org> <17696a632c172de23cb235a2b6fd33c4.NginxMailingListEnglish@forum.nginx.org> Message-ID: <05b6d159ad4a279388a76b7ca2d302b2.NginxMailingListEnglish@forum.nginx.org> It works now. My configuration looks like this: server { listen 80 default; location / { proxy_pass http://some_ip:some_port; proxy_set_header X-h1 h1; proxy_set_header X-h2 h2; proxy_set_header X-h3 "h3 h3"; } } I hope this help anyone else with this problem. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214982,215126#msg-215126 From nginx-forum at nginx.us Mon Sep 12 19:20:28 2011 From: nginx-forum at nginx.us (meto) Date: Mon, 12 Sep 2011 15:20:28 -0400 Subject: mp4 module In-Reply-To: <20110909130812.GI97288@nginx.com> References: <20110909130812.GI97288@nginx.com> Message-ID: Can't wait to see that feature in mainline (dev or stable). It's one that was bugging me about the license used by current one (commercial use). Are you planning to include it in your repo packages? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215011,215129#msg-215129 From nginx-forum at nginx.us Mon Sep 12 19:23:18 2011 From: nginx-forum at nginx.us (pedroaxl) Date: Mon, 12 Sep 2011 15:23:18 -0400 Subject: Decode url in rewrite In-Reply-To: <94b42f69891b4faa8507abd58c54367a.NginxMailingListEnglish@forum.nginx.org> References: <94b42f69891b4faa8507abd58c54367a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <58240b4a4fa26ef240d523994d15c043.NginxMailingListEnglish@forum.nginx.org> Hi guys, I solved my problem with set-misc module, now I use the set_unescape_uri to do it. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215047,215130#msg-215130 From andrew at andrewloe.com Mon Sep 12 23:58:17 2011 From: andrew at andrewloe.com (W. Andrew Loe III) Date: Mon, 12 Sep 2011 16:58:17 -0700 Subject: Verify Peer of SSL request in Proxy Module Message-ID: When reverse proxying over SSL, I would like to be able to set the context to VERIFY_PEER and to provide my own CA file. Right now nginx uses the OpenSSL default of VERIFY_NONE. There appears to be some code around this in ngx_ssl_client_certificate in ngx_event_openssl.c, but this is for validating client certificates, not nginx acting as a client. I am working on a patch, but if Igor or someone more experienced already has this working, I would prefer to use that. From nginx-forum at nginx.us Tue Sep 13 00:31:04 2011 From: nginx-forum at nginx.us (redonisc) Date: Mon, 12 Sep 2011 20:31:04 -0400 Subject: Reverse proxy for multiple apps, tomcat Message-ID: <9515650c3c82727df6bb502886bf3556.NginxMailingListEnglish@forum.nginx.org> Hi, I'm setting up a reverse proxy to be used by different applications working on a tomcat server. The configuration, is using proxy_pass directive but it's not working, have searched but I've been able to figure it out. The scenario is like this: |---------------------------| | (NginX) | -----------------------|-------------------------------------------------|-------------------------------------------------| |---------------------------| _____________|____________________________|____________________________| _____________________(http://www.app1.com) _________ (http://www.app2.com) ________(http://www.app3.com) ______________________________|____________________________|____________________________| ______________________________|____________________________|____________________________| -----------------------________________\|/____________________________|____________________________| |_____________| ------> http://tomcat1:8080/app1__________________\|/___________________________| | Tomcat 1_____| --------------------------------------------------------> http://tomcat1:8080/app2__________________\|/ | (192.168.0.1) _| ------------------------------------------------------------------------------------------------------> http://tomcat1:8080/app3 ----------------------- If anyone can help with this questions: 1.- Do I need to set different IP for each app on the tomcat server? currently my apps are on: http://Tomcat:8080/app1, http://Tomcat:8080/app2, http://Tomcat:8080/app3 all on the same IP. 2.- Currently I've a config but it seems to have problems with the fact that I need to publish the application as a root let's say http://www.app1.com but this should point to my tomcat on http://tomcat1:8080/app1. Thanks for your help, Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215134,215134#msg-215134 From nginx-forum at nginx.us Tue Sep 13 02:10:42 2011 From: nginx-forum at nginx.us (doughboy) Date: Mon, 12 Sep 2011 22:10:42 -0400 Subject: Enabeling SSL causes Redirect Loop errors ??? Message-ID: I am new to Nginx but learning every day. I have the server setup nicely and the regular webpages serve up fine. I have multiple IP's on the server (less than 20) and I am trying to enable SSL for 3 different sites (each on a different IP). I have read for hours looking at examples and trying many different things to see if I can get the SSL pages to serve up and no luck. I am hoping someone can help me. Running debian lenny, nginx 1.0.6, php 5.3.8, php-fpm, I am only wanting to run one domain SSL per IP, (Bogus domain name has been inserted below) ------------------------------------------------- nginx.conf user www-user; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 60 60; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; gzip_vary on; # gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } ----------------------------------------------------------- > include /etc/nginx/conf.d/*.conf; There NO conf files located in the above folder. I have not set up any site specific conf files yet. ------------------------------------------------------------ vhost entry (one try) server { listen 80; listen 206.201.217.7:443 ssl; server_name www.luvinlife.com luvinlife.com; ssl_certificate /usr/nginx/certs/luvinlife.pem; ssl_certificate_key /usr/nginx/certs/luvinlife.key; client_max_body_size 5m; root /var/www/luvinlife.com/public_html; try_files $uri $uri/ /index.php?$args; index index.html index.php; location ~ \.php$ { #fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } ------------------------------------------------- version check : nginx: nginx version: nginx/1.0.6 nginx: TLS SNI support enabled nginx: configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/usr/src/nginx/source/nginx-1.0.6/debian/modules/nginx-echo --add-module=/usr/src/nginx/source/nginx-1.0.6/debian/modules/nginx-upstream-fair ---------------------------------------------- SSL Page Error message: The webpage at https://www.luvinlife.com/index.php/customer/account/ has resulted in too many redirects. Clearing ...... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215136,215136#msg-215136 From Richard.Kearsley at m247.com Tue Sep 13 10:29:21 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Tue, 13 Sep 2011 10:29:21 +0000 Subject: nginx & Range header & proxy cache Message-ID: Hi If a Range request is sent to nginx proxy (e.g. header "Range: bytes=50-") and the file isn't in cache yet (cache MISS), the range is ignored and full file sent When the file has been cached (cache HIT), Range request works as expected Is this the intended behaviour? Please consider the following example # /usr/local/nginx/sbin/nginx -V nginx: nginx version: nginx/1.0.6 nginx: built by gcc 4.4.5 (Debian 4.4.5-8) nginx: configure arguments: error_log logs/error-small.log; worker_processes 2; events { use epoll; worker_connections 16384; } http { include mime.types; default_type application/octet-stream; keepalive_timeout 65; proxy_cache_path /var/cache/nginx levels=2:2:2 keys_zone=small:512m inactive=24h max_size=128G; resolver 8.8.8.8; server { listen 80; server_name _; location / { proxy_pass http://$http_X_Backend:$http_X_Backend_Port; proxy_cache small; proxy_cache_valid 200 302 10y; proxy_cache_valid 404 10m; proxy_cache_key $uri; proxy_cache_min_uses 10; proxy_cache_use_stale updating; add_header X-Cached $upstream_cache_status; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } # wget -SO /dev/null --header="X-Backend: download.thinkbroadband.com" --header="X-Backend-Port: 80" --header="Range: bytes=50-" localhost/5MB.zip --2011-09-13 11:33:45-- http://localhost/5MB.zip Resolving localhost... ::1, 127.0.0.1 Connecting to localhost|127.0.0.1|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Server: nginx/1.0.6 Date: Tue, 13 Sep 2011 10:33:45 GMT Content-Type: application/zip Connection: keep-alive Last-Modified: Mon, 02 Jun 2008 15:30:42 GMT ETag: "11f000b-500000-44eb0adaf4c80" Accept-Ranges: bytes Content-Length: 5242880 X-Cached: MISS Length: 5242880 (5.0M) [application/zip] Saving to: `/dev/null' (try 9 more times to get it cached) # wget -SO /dev/null --header="X-Backend: download.thinkbroadband.com" --header="X-Backend-Port: 80" --header="Range: bytes=50-" localhost/5MB.zip --2011-09-13 11:33:11-- http://localhost/5MB.zip Resolving localhost... ::1, 127.0.0.1 Connecting to localhost|127.0.0.1|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 206 Partial Content Server: nginx/1.0.6 Date: Tue, 13 Sep 2011 10:33:11 GMT Content-Type: application/zip Content-Length: 5242830 Connection: keep-alive Last-Modified: Mon, 02 Jun 2008 15:30:42 GMT ETag: "11f000b-500000-44eb0adaf4c80" X-Cached: HIT Content-Range: bytes 50-5242879/5242880 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Tue Sep 13 10:30:23 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 13 Sep 2011 14:30:23 +0400 Subject: nginx & Range header & proxy cache In-Reply-To: References: Message-ID: <20110913103023.GH1137@mdounin.ru> Hello! On Tue, Sep 13, 2011 at 10:29:21AM +0000, Richard Kearsley wrote: > Hi > If a Range request is sent to nginx proxy (e.g. header "Range: bytes=50-") and the file isn't in cache yet (cache MISS), the range is ignored and full file sent > When the file has been cached (cache HIT), Range request works as expected > > Is this the intended behaviour? Yes. Maxim Dounin From nginx-forum at nginx.us Tue Sep 13 11:32:06 2011 From: nginx-forum at nginx.us (liushaobo) Date: Tue, 13 Sep 2011 07:32:06 -0400 Subject: Detects that the server is redirecting the address request cycle Message-ID: hi all add " if ($http_referer ~* "www.test.com") { rewrite ^/(.*)$ http://www.xxx.com permanent; }" open browser ?? ? This redirect page is incorrect Detects that the server is redirecting the address request cycle? remove " if ($http_referer ~* "www.test.com") { rewrite ^/(.*)$ http://www.xxx.com permanent; }" are normal nginx server config server { listen 80; server_name www.xxx.com; index index.htm index.html index.php; root /www/xxx; log_format wwwlogs '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; access_log /data0/logs/wwwlogs.log; location ^~ /index.php/mo { rewrite ^/(.*)$ http://mo.xxx.com permanent; } if ($http_referer ~* "www.test.com") { rewrite ^/(.*)$ http://www.xxx.com permanent; } location ~* \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; fastcgi_param REQUEST_URI $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; } location ~* \.(jpg|png|jpeg|bmp|gif|swf|js|css) { expires 7d; } location ~* \.apk$ { limit_rate 80k; } rewrite ^/web/soft/index/category/(\d+)/?$ /category/$1 permanent; rewrite ^/web/allSoft/soft/category/(\d+)/?$ /apk/list/$1 permanent; rewrite ^/web/allSoft/soft/category/(\d+)/order/download_count/?$ /apk/list/$1?order=download_count permanent; rewrite ^/web/allSoft/soft/category/(\d+)/order/release_time/?$ /apk/list/$1?order=release_time permanent; rewrite ^/web/soft/show/id/(\d+)/?$ /apk/detail/$1 permanent; rewrite ^/web/default/apk/id/(\d+)/?$ /apk/download/$1 permanent; rewrite ^/web/allSoft/rec/?$ /apk/recommended permanent; rewrite ^/web/search/all/q/(.*)/?$ /search?q=$1 permanent; rewrite ^/web/rom/index/brand/(\d+)/?$ /rom/brand/$1 permanent; rewrite ^/web/rom/index/?$ /rom permanent; rewrite ^/web/rom/device/id/(\d+)/?/$ /rom/device/$1 permanent; rewrite ^/web/rom/list/category/(.*)/device/(\d+)/?$ /rom/list/$1/$2 permanent; rewrite ^/web/rom/show/id/(\d+)/?$ /rom/detail/$1 permanent; rewrite ^/web/rom/api/level/(.*)/?$ /rom/level/$1 permanent; rewrite ^/web/rom/download/id/(\d+)/?$ /rom/download/$1 permanent; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215139,215139#msg-215139 From mdounin at mdounin.ru Tue Sep 13 11:35:58 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 13 Sep 2011 15:35:58 +0400 Subject: Detects that the server is redirecting the address request cycle In-Reply-To: References: Message-ID: <20110913113557.GI1137@mdounin.ru> Hello! On Tue, Sep 13, 2011 at 07:32:06AM -0400, liushaobo wrote: > hi all > > add " if ($http_referer ~* "www.test.com") { > rewrite ^/(.*)$ http://www.xxx.com permanent; > }" > > open browser ?? ? > This redirect page is incorrect > Detects that the server is redirecting the address request cycle? > > remove " if ($http_referer ~* "www.test.com") { > rewrite ^/(.*)$ http://www.xxx.com permanent; > }" > are normal You've asked nginx to do infinite redirect, and you've got it. It's not clear what you are asking about. Maxim Dounin From Richard.Kearsley at m247.com Tue Sep 13 11:57:12 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Tue, 13 Sep 2011 11:57:12 +0000 Subject: nginx & Range header & proxy cache In-Reply-To: <20110913103023.GH1137@mdounin.ru> References: <20110913103023.GH1137@mdounin.ru> Message-ID: > Is this the intended behaviour? >Yes. Can your ngx_http_bytes_filter_module be used to get around this problem? From amoiz.shine at gmail.com Tue Sep 13 11:58:14 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Tue, 13 Sep 2011 19:58:14 +0800 Subject: Detects that the server is redirecting the address request cycle In-Reply-To: <20110913113557.GI1137@mdounin.ru> References: <20110913113557.GI1137@mdounin.ru> Message-ID: <1315915094.2012.6.camel@sharl-desktop> ? 2011-09-13?? 15:35 +0400?Maxim Dounin??? > Hello! > > On Tue, Sep 13, 2011 at 07:32:06AM -0400, liushaobo wrote: > > > hi all > > > > add " if ($http_referer ~* "www.test.com") { > > rewrite ^/(.*)$ http://www.xxx.com permanent; > > }" > > > > open browser ?? ? > > This redirect page is incorrect > > Detects that the server is redirecting the address request cycle? > > > > remove " if ($http_referer ~* "www.test.com") { > > rewrite ^/(.*)$ http://www.xxx.com permanent; > > }" > > are normal > > You've asked nginx to do infinite redirect, and you've got it. > It's not clear what you are asking about. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx well,the OP make nginx into DEAD-CYCLE while $Http_Refer equals the site rewrite/redirect to. i guess that the OP should do something on regex of $Http_refer. -- Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) Using Gmail? Please read this important notice: http://www.fsf.org/campaigns/jstrap/gmail?10073. From nginx-forum at nginx.us Tue Sep 13 12:48:30 2011 From: nginx-forum at nginx.us (MaLo) Date: Tue, 13 Sep 2011 08:48:30 -0400 Subject: Using Nginx Proxy Pss IPv4 to IPv6 Problem In-Reply-To: <20101206121231.GH72777@mdounin.ru> References: <20101206121231.GH72777@mdounin.ru> Message-ID: <1db6f1a2d0f4995f98baf7b3a218d723.NginxMailingListEnglish@forum.nginx.org> Hello, has anything changed at this topic? Is IPv6 now available for the proxy module? I need this feature too, and, if not available, i'm wondering why, i think it would be very useful. Best regards Matthias Posted at Nginx Forum: http://forum.nginx.org/read.php?2,155900,215154#msg-215154 From savages at mozapps.com Tue Sep 13 16:01:40 2011 From: savages at mozapps.com (Shaun savage) Date: Wed, 14 Sep 2011 00:01:40 +0800 Subject: search headers_in Message-ID: <4E6F7E64.5070503@mozapps.com> I am starting to write a new module that uses a header token. I have searched google for the answer about "how to seach in headers for a name. I want to search for "X-session-token". I am surprised that there is not a library function that just does the search, As I understand it now every module that wants to search for a header writes it own search function? Is there a "library search function"? once I have the session token I use memcached in the PREACCESS phase to load the session info, then in the ACCESS phase check the access permission. From Richard.Kearsley at m247.com Tue Sep 13 16:04:44 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Tue, 13 Sep 2011 16:04:44 +0000 Subject: nginx & Range header & proxy cache In-Reply-To: References: <20110913103023.GH1137@mdounin.ru> Message-ID: In relation to this, If the file is incomplete on cache (for some reason nginx kept a failed cache attempt?) . When range is inside the content-length but more than the size of the (incomplete) cached file, it returns 502 I actually posted about it before here but forgot about it http://forum.nginx.org/read.php?2,190276,190276 Is there any possible fix for this? From lists at ruby-forum.com Wed Sep 14 06:57:28 2011 From: lists at ruby-forum.com (JAZZ F.) Date: Wed, 14 Sep 2011 08:57:28 +0200 Subject: Nginx proxy truncates large file downloads to 1.1G In-Reply-To: References: <4CFC3A80.7090709@rattyshack.ca> Message-ID: Even i am facing the same problem but i m yet to figure out the exact cause of it.....The disk space seems to be fine.....In my case when downloading a file larger than 1G(1.2 GB) it will truncate to 1 GB... -- Posted via http://www.ruby-forum.com/. From cliff at develix.com Wed Sep 14 07:40:38 2011 From: cliff at develix.com (Cliff Wells) Date: Wed, 14 Sep 2011 00:40:38 -0700 Subject: Nginx proxy truncates large file downloads to 1.1G In-Reply-To: <4CFC3A80.7090709@rattyshack.ca> References: <4CFC3A80.7090709@rattyshack.ca> Message-ID: <1315986038.3331.0.camel@portable-evil> On Sun, 2010-12-05 at 20:21 -0500, Duane Mulder wrote: > So nginx so far has been running great. Today however I discovered that > when downloading a file larger than 1G (ie 1.5G) it will always fail > leaving the client with a file of 1.1G and an incomplete download. Try disabling gzip and see if that helps. If so, tuning the gzip settings might be in order. Cliff From mdounin at mdounin.ru Wed Sep 14 07:53:20 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 14 Sep 2011 11:53:20 +0400 Subject: Nginx proxy truncates large file downloads to 1.1G In-Reply-To: References: <4CFC3A80.7090709@rattyshack.ca> Message-ID: <20110914075320.GP1137@mdounin.ru> Hello! On Wed, Sep 14, 2011 at 08:57:28AM +0200, JAZZ F. wrote: > Even i am facing the same problem but i m yet to figure out the exact > cause of it.....The disk space seems to be fine.....In my case when > downloading a file larger than 1G(1.2 GB) it will truncate to 1 GB... proxy_max_temp_file_size, when reached, causes relative long delay in reading from upstream server; this may cause timeout on upstream server, seen as "truncation". There are 3 possible workarounds: 1. Use smaller proxy_max_temp_file_size to reduce delay in reading. 2. Use larger proxy_max_temp_file_size to avoid hitting it. 3. Use larger timeout on upstream server. Maxim Dounin From agentzh at gmail.com Wed Sep 14 08:49:43 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 14 Sep 2011 16:49:43 +0800 Subject: Rewriting the domain part of Set-Cookie in a proxy_pass In-Reply-To: References: Message-ID: On Wed, Jun 8, 2011 at 9:16 PM, tobia wrote: > Does nginx (or a module) provide functionality equivalent to httpd's > ProxyPassReverseCookieDomain? > > Long explanation: I have a simple nginx reverse proxy > > server { > ?server_name external.domain.com; > ?location / { > ? ?proxy_pass http://backend.int/; > ?} > } > > The problem is that Set-Cookie response headers contain > ";Domain=backend.int", because the backend does not know it is being > reverse proxied. Therefore the users' browsers dutifully reject such bad > cookies. > > How can I rewrite the content of the Set-Cookie response headers, > replacing ";Domain=backend.int" with ";Domain=external.domain.com"? > Now with the latest ngx_lua v0.3.1rc3, we can implement this with a little inlined Lua in nginx.conf: server_name external.domain.com; location / { proxy_pass http://backend.int/; header_filter_by_lua ' local cookies = ngx.header.set_cookie if not cookies then return end local newcookies = {} for i, val in ipairs(cookies) do local newval = string.gsub(val, "([dD]omain)=[%w_-\\\\.]+", "%1=external.domain.com") table.insert(newcookies, newval) end ngx.header.set_cookie = newcookies '; } We can surely make this more portable by avoiding hard-coding the "external.domain.com" literal in our Lua code and reference ngx.var.server_name (i.e., the nginx variable $server_name) instead ;) See the ngx_lua documentation for more details: http://wiki.nginx.org/HttpLuaModule The most relevant sections are http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua and http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER Have fun! -agentzh From agentzh at gmail.com Wed Sep 14 09:24:16 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 14 Sep 2011 17:24:16 +0800 Subject: Rewriting the domain part of Set-Cookie in a proxy_pass In-Reply-To: References: Message-ID: On Wed, Sep 14, 2011 at 4:49 PM, agentzh wrote: > ? ?server_name external.domain.com; > > ? ?location / { > ? ? ? ?proxy_pass http://backend.int/; > > ? ? ? ?header_filter_by_lua ' > ? ? ? ? ? ?local cookies = ngx.header.set_cookie > ? ? ? ? ? ?if not cookies then return end Sorry, one line of Lua should be inserted right here for the case of a single Set-Cookie response header: if type(cookies) ~= "table" then cookies = {cookies} end that is, ngx.header.set_cookie will just return a single Lua string instead of a Lua table if there's only one Set-Cookie header. Regards, -agentzh From nginx-forum at nginx.us Wed Sep 14 10:48:25 2011 From: nginx-forum at nginx.us (coviex) Date: Wed, 14 Sep 2011 06:48:25 -0400 Subject: 400 Bad request Message-ID: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> Hi, Having problems with urls containing percent sign. Most of them return 400 and don't even appear neither in error.log nor in access.log. GET /download-%27.07%%27.html?frame=1 HTTP/1.1 Host: www.my.eu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0 FirePHP/0.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: keep-alive x-insight: activate HTTP/1.1 400 Bad Request Server: nginx/1.0.5 Date: Wed, 14 Sep 2011 10:36:24 GMT Content-Type: text/html Content-Length: 172 Connection: close What's wrong with them? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215184,215184#msg-215184 From mdounin at mdounin.ru Wed Sep 14 11:11:58 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 14 Sep 2011 15:11:58 +0400 Subject: 400 Bad request In-Reply-To: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> References: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110914111158.GS1137@mdounin.ru> Hello! On Wed, Sep 14, 2011 at 06:48:25AM -0400, coviex wrote: > Hi, > > Having problems with urls containing percent sign. Most of them return > 400 and don't even appear neither in error.log nor in access.log. > > GET /download-%27.07%%27.html?frame=1 HTTP/1.1 > Host: www.my.eu > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 > Firefox/6.0 FirePHP/0.6 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip, deflate > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Connection: keep-alive > x-insight: activate > > HTTP/1.1 400 Bad Request > Server: nginx/1.0.5 > Date: Wed, 14 Sep 2011 10:36:24 GMT > Content-Type: text/html > Content-Length: 172 > Connection: close > > > What's wrong with them? They aren't valid. http://tools.ietf.org/html/rfc3986#section-2.4 Because the percent ("%") character serves as the indicator for percent-encoded octets, it must be percent-encoded as "%25" for that octet to be used as data within a URI. Maxim Dounin From francis at daoine.org Wed Sep 14 11:13:15 2011 From: francis at daoine.org (Francis Daly) Date: Wed, 14 Sep 2011 12:13:15 +0100 Subject: 400 Bad request In-Reply-To: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> References: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110914111315.GB12179@craic.sysops.org> On Wed, Sep 14, 2011 at 06:48:25AM -0400, coviex wrote: Hi there, > Having problems with urls containing percent sign. Most of them return > 400 and don't even appear neither in error.log nor in access.log. % is an escape character within a url. It must be followed by exactly two hex-characters, or the url is invalid and the request is bad. > GET /download-%27.07%%27.html?frame=1 HTTP/1.1 The first one there is %27 and decodes to '. The second one is %%2 and is invalid. > What's wrong with them? They're broken. Whatever is generating that url should be fixed so that it is properly encoded/escaped. If the filename is download-'.07%'.html, it should appear in the url as download-%27.07%25%27.html All the best, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Wed Sep 14 11:26:12 2011 From: nginx-forum at nginx.us (tm1978) Date: Wed, 14 Sep 2011 07:26:12 -0400 Subject: Nginx + Tomcat7 for single webapp and multiple alias domain Message-ID: <3a1f887cd0dc159f1671f69825a3dd72.NginxMailingListEnglish@forum.nginx.org> I am thinking about using NGINX instead of Apache to deliver a Tomcat7 webapp on Port :80 to the enduser. I have the following requirements: 1. There is a single web-app in the root with any urls (its own internal urlrewriting). It has various URLs pointing to it for several languages (and partially other content) 2. Another admin-webapp exists My questions are: (a) would it be a good idea to use NGINX a without Apache Http server, just with Apache Tomcat7 ? (b) how can I set this up so that the Tomcat App always know the domain name the user was using when calling the page? (c) will the tomcat app still be able to know the IPs of every user? Thanks! Tobias Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215189,215189#msg-215189 From Richard.Kearsley at m247.com Wed Sep 14 13:50:39 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Wed, 14 Sep 2011 13:50:39 +0000 Subject: $request_uri without args Message-ID: Hi Is it possible to access the $request_uri without the args at the end? I know I can use $uri - but this returns the url-decoded uri. I need the url-encoded (I.e. unchanged from original request) but with the args stripped -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andrew.Hester at mouser.com Wed Sep 14 13:55:07 2011 From: Andrew.Hester at mouser.com (Andrew Hester) Date: Wed, 14 Sep 2011 08:55:07 -0500 Subject: load balance and re-encrypt ssl Message-ID: <01799974966632498879A6D3F9CB343201CDBAD7E293@EXCL01.mouser.lan> Hi all, I have been looking through the docs and have found that nginx will load balance ssl if the cert is setup correctly. Is there an option to have it re-encrypt before sending to the web servers? What have others done to encrypt the traffic to their webservers (if not through nginx)? I will be load balancing in front of IIS. Decrypting and sending to the webservers in plain text is not an option in my mind. Thanks in advance. -Andy This communication, its contents and any file attachments transmitted with it are intended solely for the addressee(s) and may contain confidential proprietary information. Access by any other party without the express written permission of the sender is STRICTLY PROHIBITED. If you have received this communication in error you may not copy, distribute or use the contents, attachments or information in any way. Please destroy it and contact the sender. From mdounin at mdounin.ru Wed Sep 14 14:12:36 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 14 Sep 2011 18:12:36 +0400 Subject: load balance and re-encrypt ssl In-Reply-To: <01799974966632498879A6D3F9CB343201CDBAD7E293@EXCL01.mouser.lan> References: <01799974966632498879A6D3F9CB343201CDBAD7E293@EXCL01.mouser.lan> Message-ID: <20110914141236.GW1137@mdounin.ru> Hello! On Wed, Sep 14, 2011 at 08:55:07AM -0500, Andrew Hester wrote: > I have been looking through the docs and have found that nginx > will load balance ssl if the cert is setup correctly. Is there > an option to have it re-encrypt before sending to the web > servers? What have others done to encrypt the traffic to their > webservers (if not through nginx)? I will be load balancing in > front of IIS. > > > Decrypting and sending to the webservers in plain text is not an > option in my mind. proxy_pass https://... Maxim Dounin From agentzh at gmail.com Wed Sep 14 14:14:12 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 14 Sep 2011 22:14:12 +0800 Subject: $request_uri without args In-Reply-To: References: Message-ID: On Wed, Sep 14, 2011 at 9:50 PM, Richard Kearsley wrote: > Hi > > Is it possible to access the $request_uri without the args at the end? > > I know I can use $uri ? but this returns the url-decoded uri. > > I need the url-encoded (I.e. unchanged from original request) but with the > args stripped > Why not strip $request_uri yourself? You can use "if" + pcre regex or more preferably, set_by_lua/rewrite_by_lua provided by ngx_lua, to process what in $request_uri :) Regards, -agentzh From Andrew.Hester at mouser.com Wed Sep 14 14:21:12 2011 From: Andrew.Hester at mouser.com (Andrew Hester) Date: Wed, 14 Sep 2011 09:21:12 -0500 Subject: load balance and re-encrypt ssl In-Reply-To: <20110914141236.GW1137@mdounin.ru> References: <01799974966632498879A6D3F9CB343201CDBAD7E293@EXCL01.mouser.lan> <20110914141236.GW1137@mdounin.ru> Message-ID: <01799974966632498879A6D3F9CB343201CDBAD7E2AE@EXCL01.mouser.lan> I guess I assumed that this would just pass this through at the tcp level. Thanks for the help! -Andy -----Original Message----- From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of Maxim Dounin Sent: Wednesday, September 14, 2011 9:13 AM To: nginx at nginx.org Subject: Re: load balance and re-encrypt ssl Hello! On Wed, Sep 14, 2011 at 08:55:07AM -0500, Andrew Hester wrote: > I have been looking through the docs and have found that nginx will > load balance ssl if the cert is setup correctly. Is there an option > to have it re-encrypt before sending to the web servers? What have > others done to encrypt the traffic to their > webservers (if not through nginx)? I will be load balancing in > front of IIS. > > > Decrypting and sending to the webservers in plain text is not an > option in my mind. proxy_pass https://... Maxim Dounin _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx This communication, its contents and any file attachments transmitted with it are intended solely for the addressee(s) and may contain confidential proprietary information. Access by any other party without the express written permission of the sender is STRICTLY PROHIBITED. If you have received this communication in error you may not copy, distribute or use the contents, attachments or information in any way. Please destroy it and contact the sender. From Richard.Kearsley at m247.com Wed Sep 14 14:30:26 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Wed, 14 Sep 2011 14:30:26 +0000 Subject: $request_uri without args In-Reply-To: References: Message-ID: Agentzh, I'm glad you replied :) I am trying to find out why something is happening - a bug in nginx or lua module (currently finding it hard to reproduce) I'm using: location /proxy { proxy_pass http://backend; } access_by_lua ' local res = ngx.location.capture("/proxy" .. ngx.var.request_uri, { args = { country = ngx.var.geoip_country_code, host = ngx.var.host } } ) if ngx.var.request_url contains args like this: /something/blah.jpg?34567 It gives 404 But like this: /something/blah.jps?anything=34567 Works and gets processed ok I don't need args at backend - but I DO need the url still encoded Backend when accessed directly with curl/wget with "/something/blah.jpg?34567" returns ok Any ideas? -----Original Message----- From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of agentzh Sent: 14 September 2011 15:14 To: nginx at nginx.org Subject: Re: $request_uri without args On Wed, Sep 14, 2011 at 9:50 PM, Richard Kearsley wrote: > Hi > > Is it possible to access the $request_uri without the args at the end? > > I know I can use $uri - but this returns the url-decoded uri. > > I need the url-encoded (I.e. unchanged from original request) but with > the args stripped > Why not strip $request_uri yourself? You can use "if" + pcre regex or more preferably, set_by_lua/rewrite_by_lua provided by ngx_lua, to process what in $request_uri :) Regards, -agentzh _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed Sep 14 15:19:05 2011 From: nginx-forum at nginx.us (dullnicker) Date: Wed, 14 Sep 2011 11:19:05 -0400 Subject: Problem with Hotlink Protection Message-ID: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> Dear all, I am having a problem getting hotlinking protection to work. I run an image gallery on a nginx webserver and would like to achieve that hotlinking to the images on the website is impossible to save bandwidth. I have the following code in my location block: <-- SNIP ---> location ~* \.(png|gif|jpg|jpeg)$ { valid_referers server_names; if ($invalid_referer) { return 403; } } <-- SNAP --> That works fine so far. But the problem is that the gallery script creates image links that look like this: <-- SNIP ---> http://www.mydomain.com/image.php?twg_album=album-05900-05999&twg_show=image-05995.jpg <-- SNAP --> These do not trigger the hotlink protection. I am totally lost and have no idea how I might be able to protect those image links from hotlinking. Any help would be highly appreciated! Thank you all in advance! Kind regards -Amitz Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215198,215198#msg-215198 From igor at sysoev.ru Wed Sep 14 15:19:25 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 14 Sep 2011 19:19:25 +0400 Subject: nginx-1.1.3 Message-ID: <20110914151925.GG49199@nginx.com> Changes with nginx 1.1.3 14 Sep 2011 *) Feature: the module ngx_http_mp4_module. *) Bugfix: in Linux AIO combined with open_file_cache. *) Bugfix: open_file_cache did not update file info on retest if file was not atomically changed. *) Bugfix: nginx could not be built on MacOSX 10.7. -- Igor Sysoev From nginx-forum at nginx.us Wed Sep 14 15:25:24 2011 From: nginx-forum at nginx.us (coviex) Date: Wed, 14 Sep 2011 11:25:24 -0400 Subject: 400 Bad request In-Reply-To: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> References: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5f17e081023105312ec1153d0e3ab89b.NginxMailingListEnglish@forum.nginx.org> This query string results in 400 on all nginx servers/sites I know of. Say, http://nginx.org/download-%27.07%%27.html?frame=1. Any suggestions? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215184,215203#msg-215203 From igor at sysoev.ru Wed Sep 14 15:30:37 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 14 Sep 2011 19:30:37 +0400 Subject: 400 Bad request In-Reply-To: <5f17e081023105312ec1153d0e3ab89b.NginxMailingListEnglish@forum.nginx.org> References: <9ba035044ed2b01344ed15e1c61b3e46.NginxMailingListEnglish@forum.nginx.org> <5f17e081023105312ec1153d0e3ab89b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110914153037.GI49199@nginx.com> On Wed, Sep 14, 2011 at 11:25:24AM -0400, coviex wrote: > This query string results in 400 on all nginx servers/sites I know of. > Say, http://nginx.org/download-%27.07%%27.html?frame=1. Not only nginx. Apache does (correctly) the same: $nc apache.org 80 GET /download-%27.07%%27.html HTTP/1.0 HTTP/1.1 400 Bad Request Date: Wed, 14 Sep 2011 15:29:31 GMT Server: Apache/2.3.15-dev (Unix) mod_ssl/2.3.15-dev OpenSSL/1.0.0c Content-Length: 342 Connection: close Content-Type: text/html; charset=iso-8859-1 [...] > Any suggestions? -http://nginx.org/download-%27.07%%27.html?frame=1 +http://nginx.org/download-%27.07%25%27.html?frame=1 -- Igor Sysoev From agentzh at gmail.com Wed Sep 14 15:39:01 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 14 Sep 2011 23:39:01 +0800 Subject: $request_uri without args In-Reply-To: References: Message-ID: On Wed, Sep 14, 2011 at 10:30 PM, Richard Kearsley wrote: > > I don't need args at backend - but I DO need the url still encoded > Use the following line of Lua to strip the query args part (if any) from ngx.var.request (i.e., the nginx variable $request_uri): local uri = string.gsub(ngx.var.request_uri, "?.*", "") and then you can feed the resulting uri variable into your subrequest call instead of ngx.var.request_uri: local res = ngx.location.capture("/proxy" .. uri, { args = { country = ngx.var.geoip_country_code, host = ngx.var.host } } ) Hope it works for you :) Regards, -agentzh From francis at daoine.org Wed Sep 14 15:52:32 2011 From: francis at daoine.org (Francis Daly) Date: Wed, 14 Sep 2011 16:52:32 +0100 Subject: Problem with Hotlink Protection In-Reply-To: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110914155232.GC12179@craic.sysops.org> On Wed, Sep 14, 2011 at 11:19:05AM -0400, dullnicker wrote: Hi there, > I am having a problem getting hotlinking protection to work. > I have the following code in my location block: > location ~* \.(png|gif|jpg|jpeg)$ { > valid_referers server_names; > if ($invalid_referer) { > return 403; > } > } That applies to locations that end in one of those four words. > http://www.mydomain.com/image.php?twg_album=album-05900-05999&twg_show=image-05995.jpg That location ends in ".php", since things after the ? don't count for location matching. And so the above config doesn't apply, as you saw. > These do not trigger the hotlink protection. I am totally lost and have > no idea how I might be able to protect those image links from > hotlinking. The two simplest (to me) ways of approaching it would be (a) if /image.php counts as "an image link", then configure it like one -- wherever in your configuration you match this location, add the "invalid_referer" check. (If you have something like "location ~* \.php$", and you don't want all matching urls to have this configuration, then copy the content to a new "location = /image.php" and add the extra bit there); or (b) if image.php is your modifiable script, and it has access to HTTP_REFERER, code the protection in there yourself. If neither of those applies, then you can probably try mucking around with $arg_twg_show; but that feels wrong to me. All the best, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Wed Sep 14 16:22:30 2011 From: nginx-forum at nginx.us (dullnicker) Date: Wed, 14 Sep 2011 12:22:30 -0400 Subject: Problem with Hotlink Protection In-Reply-To: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> Message-ID: <694ad8f49315e7d8acba3180d8e80c61.NginxMailingListEnglish@forum.nginx.org> Dear Francis, thank you very much indeed for taking the time to help me out. It seems that - with your help - I made it! :-) I inserted the "invalid_referrer" check within the "location ~* \.php$" block like you suggested and it works like a charm now! It looks like this: <-- SNIP --> location ~ \.php(.*)$ { valid_referers server_names; if ($invalid_referer) { return 403; } include fastcgi_params; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri =404; fastcgi_pass 127.0.0.1:9000; error_page 404 /404page.html; #makes nginx return it's default 404 # page instead of a blank page } <--SNAP--> Again, thank you for your fantastic help! Kind regards -Amitz Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215198,215207#msg-215207 From Richard.Kearsley at m247.com Wed Sep 14 16:33:38 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Wed, 14 Sep 2011 16:33:38 +0000 Subject: $request_uri without args In-Reply-To: References: Message-ID: Many thanks, this fixed the problem (or got around it at least :) - so not sure where the bug is but I suspect it's the mixture of ?3456 and ?val=3456 in the query string after the lua pass to backend (I wasn't reading "host" at backend properly, hence 404) > local uri = string.gsub(ngx.var.request_uri, "?.*", "") > local res = ngx.location.capture("/proxy" .. uri, > { args = > { country = ngx.var.geoip_country_code, host = ngx.var.host } > } ) From nginx-forum at nginx.us Wed Sep 14 17:45:15 2011 From: nginx-forum at nginx.us (coviex) Date: Wed, 14 Sep 2011 13:45:15 -0400 Subject: 400 Bad request In-Reply-To: <20110914153037.GI49199@nginx.com> References: <20110914153037.GI49199@nginx.com> Message-ID: Funny thing is there are two sibling threads on the forum named identically and answers to my question wind up here. http://forum.nginx.org/read.php?2,2757 http://forum.nginx.org/read.php?2,215184 And I didn't know about that so sorry for asking twice. I get that requests with %% are invalid. But why they don't appear in logs? Can I show pretty 404 page for those 400? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2757,215210#msg-215210 From igor at sysoev.ru Wed Sep 14 18:03:40 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 14 Sep 2011 22:03:40 +0400 Subject: 400 Bad request In-Reply-To: References: <20110914153037.GI49199@nginx.com> Message-ID: <20110914180340.GA63007@nginx.com> On Wed, Sep 14, 2011 at 01:45:15PM -0400, coviex wrote: > Funny thing is there are two sibling threads on the forum named > identically and answers to my question wind up here. > http://forum.nginx.org/read.php?2,2757 > http://forum.nginx.org/read.php?2,215184 > And I didn't know about that so sorry for asking twice. > > I get that requests with %% are invalid. > But why they don't appear in logs? > Can I show pretty 404 page for those 400? nginx logs this on "info" level: "client sent invalid request while reading client request line" The default error_log level is "error". -- Igor Sysoev From igor at sysoev.ru Wed Sep 14 18:41:50 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 14 Sep 2011 22:41:50 +0400 Subject: mp4 module In-Reply-To: References: <20110909130812.GI97288@nginx.com> Message-ID: <20110914184150.GC63007@nginx.com> On Mon, Sep 12, 2011 at 03:20:28PM -0400, meto wrote: > Can't wait to see that feature in mainline (dev or stable). It's one > that was bugging me about the license used by current one (commercial > use). Changes with nginx 1.1.3 14 Sep 2011 *) Feature: the module ngx_http_mp4_module. Or you can use the following patch with nginx-1.0: http://nginx.org/patches/patch.mp4.3.txt Documentation is here: http://nginx.org/en/docs/http/ngx_http_mp4_module.html > Are you planning to include it in your repo packages? Yes. -- Igor Sysoev From francis at daoine.org Wed Sep 14 18:51:20 2011 From: francis at daoine.org (Francis Daly) Date: Wed, 14 Sep 2011 19:51:20 +0100 Subject: Problem with Hotlink Protection In-Reply-To: <694ad8f49315e7d8acba3180d8e80c61.NginxMailingListEnglish@forum.nginx.org> References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> <694ad8f49315e7d8acba3180d8e80c61.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110914185120.GD12179@craic.sysops.org> On Wed, Sep 14, 2011 at 12:22:30PM -0400, dullnicker wrote: Hi there, > thank you very much indeed for taking the time to help me out. It seems > that - with your help - I made it! :-) You're welcome; and congratulations :-) > I inserted the "invalid_referrer" check within the "location ~* \.php$" > block like you suggested and it works like a charm now! Good stuff. > location ~ \.php(.*)$ { Note that this config applies to all urls that include the four characters ".php"; that certainly includes your /image.php script, but possibly also includes more. If you're happy that all of those have this invalid_referer check, then it's fine. If not, you'll want to adjust the config again. All the best, f -- Francis Daly francis at daoine.org From appa at perusio.net Wed Sep 14 19:56:45 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 14 Sep 2011 20:56:45 +0100 Subject: Problem with Hotlink Protection In-Reply-To: <694ad8f49315e7d8acba3180d8e80c61.NginxMailingListEnglish@forum.nginx.org> References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> <694ad8f49315e7d8acba3180d8e80c61.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87ty8eyk1u.wl%appa@perusio.net> On 14 Set 2011 17h22 WEST, nginx-forum at nginx.us wrote: > Dear Francis, > > thank you very much indeed for taking the time to help me out. It > seems that - with your help - I made it! :-) I inserted the > "invalid_referrer" check within the "location ~* \.php$" block like > you suggested and it works like a charm now! > > It looks like this: > <-- SNIP --> > location ~ \.php(.*)$ { > valid_referers server_names; > if ($invalid_referer) { > return 403; > } > > include fastcgi_params; > fastcgi_intercept_errors on; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > try_files $uri =404; > fastcgi_pass 127.0.0.1:9000; > error_page 404 /404page.html; #makes nginx return it's default 404 > # page instead of a blank page > I think that Francis suggestion is one that you should consider. Restrict the referer checking to the image.php script only. location = /image.php { valid_referers server_names; if ($invalid_referer) { return 403; } include fastcgi_params; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; error_page 404 /404page.html; # makes nginx return it's default 404 # page instead of a blank page } HTH, --- appa From nginx-forum at nginx.us Wed Sep 14 22:54:24 2011 From: nginx-forum at nginx.us (magicbear) Date: Wed, 14 Sep 2011 18:54:24 -0400 Subject: upstream keepalive - call for testing In-Reply-To: <20110905180210.GL1137@mdounin.ru> References: <20110905180210.GL1137@mdounin.ru> Message-ID: <051a01adad30a88a5d6d428e8fbaaafc.NginxMailingListEnglish@forum.nginx.org> I have run the nginx 1.1.2 via this patch for 7 days, except for one days have a large DDoS so I restart nginx for several seconds, it was very stable to work. Handle about 70million request without problem happen, I think the last problem may be have a memory corruption, you are right. I will check that server when have times. Thanks for your hard work. MagicBear Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Mon, Sep 05, 2011 at 11:42:31PM +0800, > ????? wrote: > > > (gdb) fr 0 > > #0 ngx_http_upstream_handler > (ev=0x7fc45735f8a8) > > at src/http/ngx_http_upstream.c:915 > > 915 ctx->current_request = r; > > (gdb) p ngx_cycle->log > > $1 = (ngx_log_t *) 0x21f19a8 > > (gdb) p *r > > $2 = {signature = 51686928, connection = > 0x23b4160, ctx = 0x0, > > [...] > > This looks like memory corruption, but > unfortunately I don't see > any traces of the real cause. My best quess is > improper handling > of proxy_ignore_client_abort as fixed in 1.1.2. > Please try 1.1.2 > with patches from > > http://nginx.org/patches/patch-nginx-keepalive-ful > l-5.txt > > It already includes upstream keepalive module, as > well as all > other upstream-keepalive related fixes. See here > for details: > > http://mailman.nginx.org/pipermail/nginx-devel/201 > 1-September/001147.html > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,215217#msg-215217 From agentzh at gmail.com Thu Sep 15 00:22:26 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 15 Sep 2011 08:22:26 +0800 Subject: $request_uri without args In-Reply-To: References: Message-ID: On Thu, Sep 15, 2011 at 12:33 AM, Richard Kearsley wrote: > Many thanks, this fixed the problem (or got around it at least :) - so not sure where the bug is but I suspect it's the mixture of ?3456 and ?val=3456 in the query string after the lua pass to backend (I wasn't reading "host" at backend properly, hence 404) > I believe it's not a bug because it's wrong to pass the query args part as the URI argument to ngx.location.capture. The behavior is unspecified. So please avoid that in the first place. Regards, -agentzh From clanherb at gmail.com Thu Sep 15 03:05:59 2011 From: clanherb at gmail.com (=?UTF-8?B?5p2o6ZWt?=) Date: Thu, 15 Sep 2011 11:05:59 +0800 Subject: nginx-1.1.3 In-Reply-To: <20110914151925.GG49199@nginx.com> References: <20110914151925.GG49199@nginx.com> Message-ID: Cool?people who upgrade to Lion can use nginx again Bugfix: nginx could not be built on MacOSX 10.7. On Wed, Sep 14, 2011 at 11:19 PM, Igor Sysoev wrote: > Changes with nginx 1.1.3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 14 Sep 2011 > > ? ?*) Feature: the module ngx_http_mp4_module. > > ? ?*) Bugfix: in Linux AIO combined with open_file_cache. > > ? ?*) Bugfix: open_file_cache did not update file info on retest if file > ? ? ? was not atomically changed. > > ? ?*) Bugfix: nginx could not be built on MacOSX 10.7. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- lei yang From webwindy at gmail.com Thu Sep 15 03:25:36 2011 From: webwindy at gmail.com (C.F) Date: Thu, 15 Sep 2011 11:25:36 +0800 Subject: mp4 module In-Reply-To: <20110914184150.GC63007@nginx.com> References: <20110909130812.GI97288@nginx.com> <20110914184150.GC63007@nginx.com> Message-ID: 2011/09/15 11:22:44 [error] 29330#0: *6 no mp4 stco atoms were found in "/usr/local/opt/nginx_new/html/video/v.mp4", client: 10.10.50.130, server: localhost, request: "GET /video/v.mp4?start=43.4 HTTP/1.1" 2011/9/15 Igor Sysoev > On Mon, Sep 12, 2011 at 03:20:28PM -0400, meto wrote: > > Can't wait to see that feature in mainline (dev or stable). It's one > > that was bugging me about the license used by current one (commercial > > use). > > Changes with nginx 1.1.3 14 Sep > 2011 > > *) Feature: the module ngx_http_mp4_module. > > Or you can use the following patch with nginx-1.0: > http://nginx.org/patches/patch.mp4.3.txt > > Documentation is here: > http://nginx.org/en/docs/http/ngx_http_mp4_module.html > > > Are you planning to include it in your repo packages? > > Yes. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Sep 15 03:46:53 2011 From: nginx-forum at nginx.us (cfsego) Date: Wed, 14 Sep 2011 23:46:53 -0400 Subject: Nginx + Tomcat7 for single webapp and multiple alias domain In-Reply-To: <3a1f887cd0dc159f1671f69825a3dd72.NginxMailingListEnglish@forum.nginx.org> References: <3a1f887cd0dc159f1671f69825a3dd72.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8cec3ba96c769fc5cd3cf088ee04b45a.NginxMailingListEnglish@forum.nginx.org> Yes, It is good for you to NGINX in front of your application server, for that you will gain extra features, ie. load-control and DoS tolerance for your stability. And it is simple for you to configure NGINX to use tomcat as backend. When your tomcat listens localhost:8080, the nginx configuration may be like this: >>> location / { >>> proxy_pass 127.0.0.1:8080; >>> proxy_set_header Host $host; >>> proxy_set_header X-Real-IP $remote_addr; >>> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; >>> } so you will get the clients' real IP from the HTTP header "X-Real-IP" hope this helps Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215189,215225#msg-215225 From igor at sysoev.ru Thu Sep 15 04:25:11 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 15 Sep 2011 08:25:11 +0400 Subject: mp4 module In-Reply-To: References: <20110909130812.GI97288@nginx.com> <20110914184150.GC63007@nginx.com> Message-ID: <20110915042511.GB73767@nginx.com> On Thu, Sep 15, 2011 at 11:25:36AM +0800, C.F wrote: > 2011/09/15 11:22:44 [error] 29330#0: *6 no mp4 stco atoms were found in > "/usr/local/opt/nginx_new/html/video/v.mp4", client: 10.10.50.130, server: > localhost, request: "GET /video/v.mp4?start=43.4 HTTP/1.1" Could you create debug log of the request ? http://nginx.org/en/docs/debugging_log.html Is this file larger than 4G ? -- Igor Sysoev From webwindy at gmail.com Thu Sep 15 04:39:49 2011 From: webwindy at gmail.com (C.F) Date: Thu, 15 Sep 2011 12:39:49 +0800 Subject: mp4 module In-Reply-To: <20110915042511.GB73767@nginx.com> References: <20110909130812.GI97288@nginx.com> <20110914184150.GC63007@nginx.com> <20110915042511.GB73767@nginx.com> Message-ID: -rw-r--r-- 1 root root 39493113 09-15 11:20 v.mp4 debug_log 2011/09/15 12:36:58 [debug] 31923#0: *2 http mp4 filename: "/usr/local/opt/nginx_n1/html/video/v.mp4" 2011/09/15 12:36:58 [debug] 31923#0: *2 add cleanup: 000000001D7A10E0 2011/09/15 12:36:58 [debug] 31923#0: *2 malloc: 000000001D799D00:5752 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 start:21700 2011/09/15 12:36:58 [debug] 31923#0: *2 malloc: 000000001D7EC230:1048576 2011/09/15 12:36:58 [debug] 31923#0: *2 read: 10, 000000001D7EC230, 1048576, 0 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: ftyp @0:24 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 ftyp atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: moov @24:31577 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 moov atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: mvhd @32:108 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 mvhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mvhd timescale:1000, duration:104977, time:104.977s 2011/09/15 12:36:58 [debug] 31923#0: *2 mvhd new duration:83277, time:83.277s 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: trak @140:19371 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 trak atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: tkhd @148:92 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 tkhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 tkhd duration:104977, time:104.977s 2011/09/15 12:36:58 [debug] 31923#0: *2 tkhd new duration:83277, time:83.277s 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: mdia @240:19271 2011/09/15 12:36:58 [debug] 31923#0: *2 process mdia atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: mdhd @248:32 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 mdhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mdhd timescale:44100, duration:4629504, time:104.977s 2011/09/15 12:36:58 [debug] 31923#0: *2 mdhd new duration:3672534, time:83.277s 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: hdlr @280:44 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 hdlr atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: minf @324:19187 2011/09/15 12:36:58 [debug] 31923#0: *2 process minf atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: smhd @332:16 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 smhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: dinf @348:36 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 dinf atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stbl @384:19127 2011/09/15 12:36:58 [debug] 31923#0: *2 process stbl atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stsd @392:91 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 stsd entries:1, media:mp4a 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stts @483:32 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stts atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 time-to-sample entries:2 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stsz @515:18104 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsz atom 2011/09/15 12:36:58 [debug] 31923#0: *2 sample uniform size:0, entries:4521 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stsc @18619:52 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsc atom 2011/09/15 12:36:58 [debug] 31923#0: *2 sample-to-chunk entries:3 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: co64 @18671:840 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 trak atom: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: trak @19511:12090 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 trak atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: tkhd @19519:92 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 tkhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 tkhd duration:104692, time:104.692s 2011/09/15 12:36:58 [debug] 31923#0: *2 tkhd new duration:82992, time:82.992s 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: edts @19611:48 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: mdia @19659:11942 2011/09/15 12:36:58 [debug] 31923#0: *2 process mdia atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: mdhd @19667:32 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 mdhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mdhd timescale:90000, duration:9422237, time:104.692s 2011/09/15 12:36:58 [debug] 31923#0: *2 mdhd new duration:7469237, time:82.992s 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: hdlr @19699:44 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 hdlr atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: minf @19743:11858 2011/09/15 12:36:58 [debug] 31923#0: *2 process minf atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: vmhd @19751:20 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 vmhd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: dinf @19771:36 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 dinf atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stbl @19807:11794 2011/09/15 12:36:58 [debug] 31923#0: *2 process stbl atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stsd @19815:150 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsd atom 2011/09/15 12:36:58 [debug] 31923#0: *2 stsd entries:1, media:avc1 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stts @19965:6416 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stts atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 time-to-sample entries:800 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stss @26381:152 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stss atom 2011/09/15 12:36:58 [debug] 31923#0: *2 sync sample entries:34 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stsz @26533:4208 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsz atom 2011/09/15 12:36:58 [debug] 31923#0: *2 sample uniform size:0, entries:1047 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: stsc @30741:76 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsc atom 2011/09/15 12:36:58 [debug] 31923#0: *2 sample-to-chunk entries:5 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: co64 @30817:784 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 trak atom: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 moov atom done 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: free @31601:778423 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: mdat @810024:38683089 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 mdat atom 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stts atom update 2011/09/15 12:36:58 [debug] 31923#0: *2 time-to-sample start_time:956970 2011/09/15 12:36:58 [debug] 31923#0: *2 count:1, duration:1024 2011/09/15 12:36:58 [debug] 31923#0: *2 count:4520, duration:1024 2011/09/15 12:36:58 [debug] 31923#0: *2 start_sample:934, new count:3586 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stss atom update 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 ctts atom update 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsc atom update 2011/09/15 12:36:58 [debug] 31923#0: *2 start_sample:934, chunk:1, chunks:1, samples:46, id:1 2011/09/15 12:36:58 [debug] 31923#0: *2 start_sample:888, chunk:2, chunks:101, samples:44, id:1 2011/09/15 12:36:58 [debug] 31923#0: *2 start chunk:21, samples:8 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stsz atom update 2011/09/15 12:36:58 [debug] 31923#0: *2 chunk samples sizes:1489 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 stco atom update 2011/09/15 12:36:58 [error] 31923#0: *2 no mp4 stco atoms were found in "/usr/local/opt/nginx_n1/html/video/v.mp4", client: 10.10.50.130, server: localhost, request: "GET /video/v.mp4?start=21.7 HTTP/1.1", host: " 192.168.51.31:3080" 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D7EC230 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D799D00 2011/09/15 12:36:58 [debug] 31923#0: *2 http finalize request: 500, "/video/v.mp4?start=21.7" a:1, c:1 2011/09/15 12:36:58 [debug] 31923#0: *2 http special response: 500, "/video/v.mp4?start=21.7" 2011/09/15 12:36:58 [debug] 31923#0: *2 internal redirect: "/50x.html?" 2011/09/15 12:36:58 [debug] 31923#0: *2 rewrite phase: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 test location: "/" 2011/09/15 12:36:58 [debug] 31923#0: *2 test location: "video/" 2011/09/15 12:36:58 [debug] 31923#0: *2 test location: "50x.html" 2011/09/15 12:36:58 [debug] 31923#0: *2 using configuration "=/50x.html" 2011/09/15 12:36:58 [debug] 31923#0: *2 http cl:-1 max:1048576 2011/09/15 12:36:58 [debug] 31923#0: *2 rewrite phase: 2 2011/09/15 12:36:58 [debug] 31923#0: *2 post rewrite phase: 3 2011/09/15 12:36:58 [debug] 31923#0: *2 generic phase: 4 2011/09/15 12:36:58 [debug] 31923#0: *2 generic phase: 5 2011/09/15 12:36:58 [debug] 31923#0: *2 access phase: 6 2011/09/15 12:36:58 [debug] 31923#0: *2 access phase: 7 2011/09/15 12:36:58 [debug] 31923#0: *2 post access phase: 8 2011/09/15 12:36:58 [debug] 31923#0: *2 content phase: 9 2011/09/15 12:36:58 [debug] 31923#0: *2 content phase: 10 2011/09/15 12:36:58 [debug] 31923#0: *2 content phase: 11 2011/09/15 12:36:58 [debug] 31923#0: *2 http filename: "/usr/local/opt/nginx_n1/html/50x.html" 2011/09/15 12:36:58 [debug] 31923#0: *2 add cleanup: 000000001D7A1170 2011/09/15 12:36:58 [debug] 31923#0: *2 http static fd: 11 2011/09/15 12:36:58 [debug] 31923#0: *2 http set discard body 2011/09/15 12:36:58 [debug] 31923#0: *2 HTTP/1.1 500 Internal Server Error Server: nginx/1.1.3 Date: Thu, 15 Sep 2011 04:36:58 GMT Content-Type: text/html Content-Length: 383 Connection: close 2011/09/15 12:36:58 [debug] 31923#0: *2 write new buf t:1 f:0 000000001D7A1308, pos 000000001D7A1308, size: 161 file: 0, size: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 http write filter: l:0 f:0 s:161 2011/09/15 12:36:58 [debug] 31923#0: *2 http output filter "/50x.html?" 2011/09/15 12:36:58 [debug] 31923#0: *2 http copy filter: "/50x.html?" 2011/09/15 12:36:58 [debug] 31923#0: *2 http postpone filter "/50x.html?" 00007FFF6568DA30 2011/09/15 12:36:58 [debug] 31923#0: *2 write old buf t:1 f:0 000000001D7A1308, pos 000000001D7A1308, size: 161 file: 0, size: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 write new buf t:0 f:1 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 383 2011/09/15 12:36:58 [debug] 31923#0: *2 http write filter: l:1 f:0 s:544 2011/09/15 12:36:58 [debug] 31923#0: *2 http write filter limit 0 2011/09/15 12:36:58 [debug] 31923#0: *2 writev: 161 2011/09/15 12:36:58 [debug] 31923#0: *2 sendfile: @0 383 2011/09/15 12:36:58 [debug] 31923#0: *2 sendfile: 383, @0 383:383 2011/09/15 12:36:58 [debug] 31923#0: *2 http write filter 0000000000000000 2011/09/15 12:36:58 [debug] 31923#0: *2 http copy filter: 0 "/50x.html?" 2011/09/15 12:36:58 [debug] 31923#0: *2 http finalize request: 0, "/50x.html?" a:1, c:2 2011/09/15 12:36:58 [debug] 31923#0: *2 http request count:2 blk:0 2011/09/15 12:36:58 [debug] 31923#0: *2 http finalize request: -4, "/50x.html?" a:1, c:1 2011/09/15 12:36:58 [debug] 31923#0: *2 event timer add: 3: 5000:1316061423751 2011/09/15 12:36:58 [debug] 31923#0: *2 http lingering close handler 2011/09/15 12:36:58 [debug] 31923#0: *2 recv: fd:3 -1 of 4096 2011/09/15 12:36:58 [debug] 31923#0: *2 recv() not ready (11: Resource temporarily unavailable) 2011/09/15 12:36:58 [debug] 31923#0: *2 lingering read: -2 2011/09/15 12:36:58 [debug] 31923#0: *2 event timer: 3, old: 1316061423751, new: 1316061423751 2011/09/15 12:36:58 [debug] 31923#0: *2 http lingering close handler 2011/09/15 12:36:58 [debug] 31923#0: *2 recv: fd:3 0 of 4096 2011/09/15 12:36:58 [debug] 31923#0: *2 lingering read: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 http request count:1 blk:0 2011/09/15 12:36:58 [debug] 31923#0: *2 http close request 2011/09/15 12:36:58 [debug] 31923#0: *2 http log handler 2011/09/15 12:36:58 [debug] 31923#0: *2 run cleanup: 000000001D7A1170 2011/09/15 12:36:58 [debug] 31923#0: *2 file cleanup: fd:11 2011/09/15 12:36:58 [debug] 31923#0: *2 run cleanup: 000000001D7A10E0 2011/09/15 12:36:58 [debug] 31923#0: *2 file cleanup: fd:10 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 0000000000000000 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 0000000000000000 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D7A06E0, unused: 480 2011/09/15 12:36:58 [debug] 31923#0: *2 close http connection: 3 2011/09/15 12:36:58 [debug] 31923#0: *2 event timer del: 3: 1316061423751 2011/09/15 12:36:58 [debug] 31923#0: *2 reusable connection: 0 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D7A02D0 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D79FDE0 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D7AA640, unused: 8 2011/09/15 12:36:58 [debug] 31923#0: *2 free: 000000001D795390, unused: 128 -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Thu Sep 15 04:53:54 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 15 Sep 2011 08:53:54 +0400 Subject: mp4 module In-Reply-To: References: <20110909130812.GI97288@nginx.com> <20110914184150.GC63007@nginx.com> <20110915042511.GB73767@nginx.com> Message-ID: <20110915045354.GD73767@nginx.com> On Thu, Sep 15, 2011 at 12:39:49PM +0800, C.F wrote: > -rw-r--r-- 1 root root 39493113 09-15 11:20 v.mp4 > 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: co64 @30817:784 Thank you. As I supposed it has 64-bit co64 atom, however, it's strange that this atom was used for so small size file - 39M. I will make patch today. -- Igor Sysoev From igor at sysoev.ru Thu Sep 15 05:26:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 15 Sep 2011 09:26:02 +0400 Subject: mp4 module In-Reply-To: <20110915045354.GD73767@nginx.com> References: <20110909130812.GI97288@nginx.com> <20110914184150.GC63007@nginx.com> <20110915042511.GB73767@nginx.com> <20110915045354.GD73767@nginx.com> Message-ID: <20110915052602.GE73767@nginx.com> On Thu, Sep 15, 2011 at 08:53:54AM +0400, Igor Sysoev wrote: > On Thu, Sep 15, 2011 at 12:39:49PM +0800, C.F wrote: > > -rw-r--r-- 1 root root 39493113 09-15 11:20 v.mp4 > > > 2011/09/15 12:36:58 [debug] 31923#0: *2 mp4 atom: co64 @30817:784 > > Thank you. As I supposed it has 64-bit co64 atom, however, it's strange > that this atom was used for so small size file - 39M. > I will make patch today. Patch for nginx-1.1.3. -- Igor Sysoev -------------- next part -------------- Index: src/http/modules/ngx_http_mp4_module.c =================================================================== --- src/http/modules/ngx_http_mp4_module.c (revision 4105) +++ src/http/modules/ngx_http_mp4_module.c (working copy) @@ -32,8 +32,10 @@ #define NGX_HTTP_MP4_STSZ_DATA 21 #define NGX_HTTP_MP4_STCO_ATOM 22 #define NGX_HTTP_MP4_STCO_DATA 23 +#define NGX_HTTP_MP4_CO64_ATOM 24 +#define NGX_HTTP_MP4_CO64_DATA 25 -#define NGX_HTTP_MP4_LAST_ATOM NGX_HTTP_MP4_STCO_DATA +#define NGX_HTTP_MP4_LAST_ATOM NGX_HTTP_MP4_CO64_DATA typedef struct { @@ -61,7 +63,7 @@ ngx_uint_t start_sample; ngx_uint_t start_chunk; ngx_uint_t chunk_samples; - ngx_uint_t chunk_samples_size; + uint64_t chunk_samples_size; off_t start_offset; size_t tkhd_size; @@ -96,8 +98,10 @@ ngx_buf_t stsc_data_buf; ngx_buf_t stsz_atom_buf; ngx_buf_t stsz_data_buf; - ngx_buf_t tsco_atom_buf; - ngx_buf_t tsco_data_buf; + ngx_buf_t stco_atom_buf; + ngx_buf_t stco_data_buf; + ngx_buf_t co64_atom_buf; + ngx_buf_t co64_data_buf; ngx_mp4_stsc_entry_t stsc_chunk_entry; } ngx_http_mp4_trak_t; @@ -268,6 +272,12 @@ ngx_http_mp4_trak_t *trak); static void ngx_http_mp4_adjust_stco_atom(ngx_http_mp4_file_t *mp4, ngx_http_mp4_trak_t *trak, int32_t adjustment); +static ngx_int_t ngx_http_mp4_read_co64_atom(ngx_http_mp4_file_t *mp4, + uint64_t atom_data_size); +static ngx_int_t ngx_http_mp4_update_co64_atom(ngx_http_mp4_file_t *mp4, + ngx_http_mp4_trak_t *trak); +static void ngx_http_mp4_adjust_co64_atom(ngx_http_mp4_file_t *mp4, + ngx_http_mp4_trak_t *trak, off_t adjustment); static char *ngx_http_mp4(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static void *ngx_http_mp4_create_conf(ngx_conf_t *cf); static char *ngx_http_mp4_merge_conf(ngx_conf_t *cf, void *parent, void *child); @@ -373,6 +383,7 @@ { "stsc", ngx_http_mp4_read_stsc_atom }, { "stsz", ngx_http_mp4_read_stsz_atom }, { "stco", ngx_http_mp4_read_stco_atom }, + { "co64", ngx_http_mp4_read_co64_atom }, { NULL, NULL } }; @@ -676,8 +687,15 @@ ngx_http_mp4_update_stsz_atom(mp4, &trak[i]); - if (ngx_http_mp4_update_stco_atom(mp4, &trak[i]) != NGX_OK) { - return NGX_ERROR; + if (trak[i].out[NGX_HTTP_MP4_CO64_DATA].buf) { + if (ngx_http_mp4_update_co64_atom(mp4, &trak[i]) != NGX_OK) { + return NGX_ERROR; + } + + } else { + if (ngx_http_mp4_update_stco_atom(mp4, &trak[i]) != NGX_OK) { + return NGX_ERROR; + } } ngx_http_mp4_update_stbl_atom(mp4, &trak[i]); @@ -721,7 +739,11 @@ "mp4 adjustment:%D", adjustment); for (i = 0; i < mp4->trak.nelts; i++) { - ngx_http_mp4_adjust_stco_atom(mp4, &trak[i], (int32_t) adjustment); + if (trak[i].out[NGX_HTTP_MP4_CO64_DATA].buf) { + ngx_http_mp4_adjust_co64_atom(mp4, &trak[i], adjustment); + } else { + ngx_http_mp4_adjust_stco_atom(mp4, &trak[i], (int32_t) adjustment); + } } return NGX_OK; @@ -1702,7 +1724,6 @@ { u_char *atom_header, *atom_table; size_t atom_size; - uint32_t entries; ngx_buf_t *atom; ngx_mp4_stsd_atom_t *stsd_atom; ngx_http_mp4_trak_t *trak; @@ -1718,10 +1739,9 @@ ngx_mp4_set_32value(stsd_atom->size, atom_size); ngx_mp4_set_atom_name(stsd_atom, 's', 't', 's', 'd'); - entries = ngx_mp4_get_32value(stsd_atom->entries); - if ((uint64_t) (sizeof(ngx_mp4_stsd_atom_t) - sizeof(ngx_mp4_atom_header_t)) - > atom_data_size) { + > atom_data_size) + { ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0, "\"%s\" mp4 stsd atom too large", mp4->file.name.data); @@ -2497,7 +2517,7 @@ } ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, - "chunk samples sizes:%uD", trak->chunk_samples_size); + "chunk samples sizes:%uL", trak->chunk_samples_size); atom_size = sizeof(ngx_mp4_stsz_atom_t) + (data->last - data->pos); trak->size += atom_size; @@ -2554,12 +2574,12 @@ trak = ngx_mp4_last_trak(mp4); trak->chunks = entries; - atom = &trak->tsco_atom_buf; + atom = &trak->stco_atom_buf; atom->temporary = 1; atom->pos = atom_header; atom->last = atom_table; - data = &trak->tsco_data_buf; + data = &trak->stco_data_buf; data->temporary = 1; data->pos = atom_table; data->last = atom_end; @@ -2648,6 +2668,142 @@ } +typedef struct { + u_char size[4]; + u_char name[4]; + u_char version[1]; + u_char flags[3]; + u_char entries[4]; +} ngx_mp4_co64_atom_t; + + +static ngx_int_t +ngx_http_mp4_read_co64_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size) +{ + u_char *atom_header, *atom_table, *atom_end; + uint32_t entries; + ngx_buf_t *atom, *data; + ngx_mp4_co64_atom_t *co64_atom; + ngx_http_mp4_trak_t *trak; + + /* chunk offsets atom */ + + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 co64 atom"); + + atom_header = ngx_mp4_atom_header(mp4); + co64_atom = (ngx_mp4_co64_atom_t *) atom_header; + ngx_mp4_set_atom_name(co64_atom, 'c', 'o', '6', '4'); + + entries = ngx_mp4_get_32value(co64_atom->entries); + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "chunks:%uD", entries); + + atom_table = atom_header + sizeof(ngx_mp4_co64_atom_t); + atom_end = atom_table + entries * sizeof(uint64_t); + + if ((uint64_t) (atom_end - co64_atom->version) > atom_data_size) { + ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0, + "\"%s\" mp4 co64 atom too large", mp4->file.name.data); + return NGX_ERROR; + } + + trak = ngx_mp4_last_trak(mp4); + trak->chunks = entries; + + atom = &trak->co64_atom_buf; + atom->temporary = 1; + atom->pos = atom_header; + atom->last = atom_table; + + data = &trak->co64_data_buf; + data->temporary = 1; + data->pos = atom_table; + data->last = atom_end; + + trak->out[NGX_HTTP_MP4_CO64_ATOM].buf = atom; + trak->out[NGX_HTTP_MP4_CO64_DATA].buf = data; + + ngx_mp4_atom_next(mp4, atom_data_size); + + return NGX_OK; +} + + +static ngx_int_t +ngx_http_mp4_update_co64_atom(ngx_http_mp4_file_t *mp4, + ngx_http_mp4_trak_t *trak) +{ + size_t atom_size; + ngx_buf_t *atom, *data; + ngx_mp4_co64_atom_t *co64_atom; + + /* + * mdia.minf.stbl.co64 updating requires trak->start_chunk + * from mdia.minf.stbl.stsc which depends on value from mdia.mdhd + * atom which may reside after mdia.minf + */ + + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, + "mp4 co64 atom update"); + + data = trak->out[NGX_HTTP_MP4_CO64_DATA].buf; + + if (data == NULL) { + ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0, + "no mp4 co64 atoms were found in \"%s\"", + mp4->file.name.data); + return NGX_ERROR; + } + + data->pos += trak->start_chunk * sizeof(uint64_t); + atom_size = sizeof(ngx_mp4_co64_atom_t) + (data->last - data->pos); + trak->size += atom_size; + + trak->start_offset = ngx_mp4_get_64value(data->pos); + trak->start_offset += trak->chunk_samples_size; + ngx_mp4_set_64value(data->pos, trak->start_offset); + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, + "start chunk offset:%uL", trak->start_offset); + + atom = trak->out[NGX_HTTP_MP4_CO64_ATOM].buf; + co64_atom = (ngx_mp4_co64_atom_t *) atom->pos; + + ngx_mp4_set_32value(co64_atom->size, atom_size); + ngx_mp4_set_32value(co64_atom->entries, trak->chunks - trak->start_chunk); + + return NGX_OK; +} + + +static void +ngx_http_mp4_adjust_co64_atom(ngx_http_mp4_file_t *mp4, + ngx_http_mp4_trak_t *trak, off_t adjustment) +{ + uint64_t offset, *entry, *end; + ngx_buf_t *data; + + /* + * moov.trak.mdia.minf.stbl.co64 adjustment requires + * minimal start offset of all traks and new moov atom size + */ + + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, + "mp4 co64 atom adjustment"); + + data = trak->out[NGX_HTTP_MP4_CO64_DATA].buf; + entry = (uint64_t *) data->pos; + end = (uint64_t *) data->last; + + while (entry < end) { + offset = ngx_mp4_get_64value(entry); + offset += adjustment; + ngx_mp4_set_64value(entry, offset); + entry++; + } +} + + static char * ngx_http_mp4(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { From nginx-forum at nginx.us Thu Sep 15 05:43:38 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 01:43:38 -0400 Subject: How to force nginx to cache HTTP POST response for few seconds Message-ID: <2df58b853f7760988237ee14c8d662ef.NginxMailingListEnglish@forum.nginx.org> Hi everybody, I'm a newbie with nginx and would like to ask your help. On potentially very high loaded site I would like to cache response to the HTTP POST for the few seconds. Works perfectly for GETs, but... nginx version: nginx/0.8.54 Please see below my config: proxy_cache_path /tmp/nginx levels=2:2:2 keys_zone=small:1m inactive=1m max_size=10m; server { log_format main '$remote_addr $host $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$gzip_ratio"'; access_log /var/log/nginx/test_server.access.log main buffer=32k; error_log /var/log/nginx/test_server.error.log info; listen 80; root /var/www/html/nginx; index index.html index.htm; location / { try_files $uri @apache_backend; } ### location ~ \.php$ { ### proxy_pass http://127.0.0.1:88; ### } location @apache_backend { proxy_pass http://127.0.0.1:88; proxy_cache small; proxy_cache_valid 5s; proxy_cache_key $uri; proxy_cache_use_stale updating; add_header X-Cached $upstream_cache_status; } } Any help/advices will be appreciated. Thanks --->>> qzpmwo <<<--- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215231,215231#msg-215231 From igor at sysoev.ru Thu Sep 15 05:49:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 15 Sep 2011 09:49:56 +0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <2df58b853f7760988237ee14c8d662ef.NginxMailingListEnglish@forum.nginx.org> References: <2df58b853f7760988237ee14c8d662ef.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110915054956.GF73767@nginx.com> On Thu, Sep 15, 2011 at 01:43:38AM -0400, qzpmwo wrote: > Hi everybody, > > I'm a newbie with nginx and would like to ask your help. On potentially > very high loaded site I would like to cache response to the HTTP POST > for the few seconds. Works perfectly for GETs, but... > > nginx version: nginx/0.8.54 > > Please see below my config: > > proxy_cache_path /tmp/nginx levels=2:2:2 keys_zone=small:1m inactive=1m > max_size=10m; > > server { > > log_format main '$remote_addr $host $remote_user [$time_local] > "$request" $status $body_bytes_sent "$http_referer" > "$http_user_agent" "$gzip_ratio"'; > > access_log /var/log/nginx/test_server.access.log main buffer=32k; > error_log /var/log/nginx/test_server.error.log info; > > > listen 80; > > root /var/www/html/nginx; > index index.html index.htm; > > location / { > try_files $uri @apache_backend; > } > > ### location ~ \.php$ { > ### proxy_pass http://127.0.0.1:88; > ### } > > location @apache_backend { > proxy_pass http://127.0.0.1:88; > proxy_cache small; > proxy_cache_valid 5s; > proxy_cache_key $uri; > proxy_cache_use_stale updating; > add_header X-Cached $upstream_cache_status; > } > } > > > Any help/advices will be appreciated. You should upgrade to at least 0.8.55. If POST request body is small enough, then you can use: location @apache_backend { ... proxy_cache_methods POST; proxy_cache_key "$uri|$request_body"; client_max_body_size 1k; } -- Igor Sysoev From nginx-forum at nginx.us Thu Sep 15 05:52:05 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 01:52:05 -0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <2df58b853f7760988237ee14c8d662ef.NginxMailingListEnglish@forum.nginx.org> References: <2df58b853f7760988237ee14c8d662ef.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8931a2474c800d8c46b7d511d52d353c.NginxMailingListEnglish@forum.nginx.org> Hi everybody, Sorry for not reading documentation properly. proxy_cache_methods is a saver! Thanks a lot, case closed :) --->>> qzpmwo <<< --- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215231,215235#msg-215235 From nginx-forum at nginx.us Thu Sep 15 07:09:48 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 03:09:48 -0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <20110915054956.GF73767@nginx.com> References: <20110915054956.GF73767@nginx.com> Message-ID: <3058acfdb341f2753dc5b23c0f12d8e0.NginxMailingListEnglish@forum.nginx.org> Hi Igor, Thanks a lot for so fast answer and for so wonderful product! I will try to use your trick with request_body, though in my case it is an AMF binary. I updated to 1.0.5 and have weird problem now (from error log): http: file cache: /tmp/nginx-cache 0.000M, bsize: 4096 signal 17 (SIGCHLD) recieved cache loader process 11737 exited with code 0 signal 29 (SIGIO) recieved :( Any advices of how to figure out why is it happening? Thanks again --->>> qzpmwo <<<--- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215231,215236#msg-215236 From igor at sysoev.ru Thu Sep 15 09:28:33 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 15 Sep 2011 13:28:33 +0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <3058acfdb341f2753dc5b23c0f12d8e0.NginxMailingListEnglish@forum.nginx.org> References: <20110915054956.GF73767@nginx.com> <3058acfdb341f2753dc5b23c0f12d8e0.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110915092833.GA80146@nginx.com> On Thu, Sep 15, 2011 at 03:09:48AM -0400, qzpmwo wrote: > Hi Igor, > > Thanks a lot for so fast answer and for so wonderful product! I will try > to use your trick with request_body, though in my case it is an AMF > binary. How large these binaries ? > I updated to 1.0.5 and have weird problem now (from error log): > > http: file cache: /tmp/nginx-cache 0.000M, bsize: 4096 > signal 17 (SIGCHLD) recieved > cache loader process 11737 exited with code 0 > signal 29 (SIGIO) recieved > > :( > > Any advices of how to figure out why is it happening? This is non-erroneous messages logged at "notice" level. -- Igor Sysoev From ash2kk at gmail.com Thu Sep 15 09:30:28 2011 From: ash2kk at gmail.com (Mikhail Mazursky) Date: Thu, 15 Sep 2011 15:30:28 +0600 Subject: Nginx + Tomcat7 for single webapp and multiple alias domain In-Reply-To: <3a1f887cd0dc159f1671f69825a3dd72.NginxMailingListEnglish@forum.nginx.org> References: <3a1f887cd0dc159f1671f69825a3dd72.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2011/9/14 tm1978 : > I am thinking about using NGINX instead of Apache to deliver a Tomcat7 > webapp on Port :80 to the enduser. > > I have the following requirements: > > 1. There is a single ?web-app in the root with any urls (its own > internal urlrewriting). It has various URLs pointing to it for several > languages (and partially other content) > > 2. Another admin-webapp exists > > > My questions are: > > (a) would it be a good idea to use NGINX a without ?Apache Http server, > just with Apache Tomcat7 ? > (b) how can I set this up so that the Tomcat App always know the domain > name the user was using when calling the page? > (c) will the tomcat app still be able to know the IPs of every user? For this you will have to setup a RemoveIpValve [1] in your context.xml/server.xml/context.xml.default like this: In nginx you may use configuration provided by cfsego but don't forget to add X-Forwarded-Proto if you use https on nginx. Also you may remove X-Real-IP header because it's not used in this setup: >>> location / { >>> proxy_pass 127.0.0.1:8080; >>> proxy_set_header Host $host; >>> proxy_set_header $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; >>> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; >>> } This way Tomcat will be aware of https and will use secure cookies for sessions. [1]: https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Remote_IP_Valve > Thanks! > > Tobias From nginx-forum at nginx.us Thu Sep 15 09:33:08 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 05:33:08 -0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <20110915092833.GA80146@nginx.com> References: <20110915092833.GA80146@nginx.com> Message-ID: <1ef7fdb8e7d77fa9a9d5f3934aa586bf.NginxMailingListEnglish@forum.nginx.org> Hi Igor, Payload size is small around 120 bytes according to my data. Response is empty. May be that is why? Tomorrow I will try to recompile nginx with debug enabled and may be get more data. Thanks a lot for support. --->>> qzpmwo <<<--- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215231,215244#msg-215244 From nginx-forum at nginx.us Thu Sep 15 09:44:27 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 05:44:27 -0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <1ef7fdb8e7d77fa9a9d5f3934aa586bf.NginxMailingListEnglish@forum.nginx.org> References: <20110915092833.GA80146@nginx.com> <1ef7fdb8e7d77fa9a9d5f3934aa586bf.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4cd892cb0ebd639ee05f69162a2d098b.NginxMailingListEnglish@forum.nginx.org> Actually I was wrong. Response "Content-Length" header says 66 bytes, so response is not empty. If I disable caching of that request, application works. If it is enabled it stops after first cache HIT. As I mentioned in previous mail I will try to get more data (tcpdump and nginx with debug) tomorrow. Thanks --->>> qzpmwo <<<--- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215231,215246#msg-215246 From kworthington at gmail.com Thu Sep 15 10:22:10 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Thu, 15 Sep 2011 06:22:10 -0400 Subject: nginx-1.1.3 In-Reply-To: References: <20110914151925.GG49199@nginx.com> Message-ID: Hello Nginxers, I just released Nginx 1.1.3 For Windows http://goo.gl/u9O1a (32-bit and 64-bit) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Official Windows binaries are at nginx.org Thanks, Kevin -- Kevin Worthington kworthington (at] gmail {dot) com On Wed, Sep 14, 2011 at 11:05 PM, ?? wrote: > Cool?people who upgrade to Lion can use nginx again > > Bugfix: nginx could not be built on MacOSX 10.7. > > On Wed, Sep 14, 2011 at 11:19 PM, Igor Sysoev wrote: > > Changes with nginx 1.1.3 14 Sep > 2011 > > > > *) Feature: the module ngx_http_mp4_module. > > > > *) Bugfix: in Linux AIO combined with open_file_cache. > > > > *) Bugfix: open_file_cache did not update file info on retest if file > > was not atomically changed. > > > > *) Bugfix: nginx could not be built on MacOSX 10.7. > > > > > > -- > > Igor Sysoev > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > -- > lei yang > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hagaia at qwilt.com Thu Sep 15 14:21:44 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Thu, 15 Sep 2011 16:21:44 +0200 Subject: Help with AIO In-Reply-To: <20110906073352.GR1137@mdounin.ru> References: <20110906073352.GR1137@mdounin.ru> Message-ID: Hi When benchmarking AIO read, I reached more than 1024 concurrent Async IO - 1. I saw a weird error log 2. Nginx did not fallback to regular blocking read I looked on the source code -- src/os/unix/ngx_linux_aio_read.c line:105 and I think there is a problem in errno handling // Current Code //---------------------------------------------------------------------------- *n = io_submit(ngx_aio_ctx, 1, piocb); if (n == 1) { ev->active = 1; ev->ready = 0; ev->complete = 0; return NGX_AGAIN; } n = -n; <---------------------------------------------------------?? if (n == NGX_EAGAIN) { return ngx_read_file(file, buf, size, offset); } ngx_log_error(NGX_LOG_CRIT, file->log, n, "io_submit(\"%V\") failed", &file->name); if (n == NGX_ENOSYS) { ngx_file_aio = 0; return ngx_read_file(file, buf, size, offset); } return NGX_ERROR;* // I think it should be //---------------------------------------------------------------------------- *n = io_submit(ngx_aio_ctx, 1, piocb); if (n == 1) { ev->active = 1; ev->ready = 0; ev->complete = 0; return NGX_AGAIN; } if (n == 0) { ngx_log_error(NGX_LOG_CRIT, file->log, 0, "io_submit(\"%V\") failed - 0 - I/O request blocks", &file->name); return NGX_ERROR; } else { n = errno; } * * if (n== NGX_EAGAIN) { return ngx_read_file(file, buf, size, offset); } ngx_log_error(NGX_LOG_CRIT, file->log, n, "io_submit(\"%V\") failed", &file->name); if (n== NGX_ENOSYS) { ngx_file_aio = 0; return ngx_read_file(file, buf, size, offset); } return NGX_ERROR;* //---------------------------------------------------------------------------- your help will be appreciated Thanks Hagai On Tue, Sep 6, 2011 at 9:33 AM, Maxim Dounin wrote: > Hello! > > On Tue, Sep 06, 2011 at 01:21:00AM +0300, Hagai Avrahami wrote: > > > Hi > > > > I configured Nginx with *aio *mode *on *and 1 *worker process* > > In benchmarking I saw limit of 1024 concurrent sessions even configured > to > > 4096 *worker connections* > > Sure it's not limitation of the benchmarking tool you use? Most > tools out there use select() and hence limited to 1024 > concurrent connections. > > > When I looked in the source code I could see that io_setup is called > with > > fix value of 1024 max events > > can anyone please explain me the hard coded limit > > Is it OK to change it or it is derived from other limit I am not aware of > > any help will be appreciated > > io_setup() maxevents is a limit on number of aio requests allowed > to be submitted simulteneously; if nginx hits this limit, it will > fallback to normal blocking read. > > If you are going to change it, make sure to keep total for all > processes lower than /proc/sys/fs/aio-max-nr. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From quan.nexthop at gmail.com Thu Sep 15 15:02:57 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Thu, 15 Sep 2011 08:02:57 -0700 Subject: nginx and tproxy Message-ID: Hi all: Can we let both work together? Anyone can share his experience with us if we want to integrate them? thanks in advance george -------------- next part -------------- An HTML attachment was scrubbed... URL: From r at roze.lv Thu Sep 15 15:19:48 2011 From: r at roze.lv (Reinis Rozitis) Date: Thu, 15 Sep 2011 18:19:48 +0300 Subject: nginx and tproxy In-Reply-To: References: Message-ID: <241A0BDFBDDA489996B455F7135B0651@DD21> By tproxy you mean transparent proxying as in doing proxy requests from nginx while using clients IP? It is far more simple to use the Real IP module http://wiki.nginx.org/HttpRealIpModule ( pretty much all webservers (apache - mod_rpaf / lighttpd - mod_extforward etc) have such modules in one or another form ) rather than trying to achieve it on TCP level. And it is also straight forward to implement it in any other backend application. rr From: Geoge.Q Sent: Thursday, September 15, 2011 6:02 PM To: nginx at nginx.org Subject: nginx and tproxy Hi all: Can we let both work together? Anyone can share his experience with us if we want to integrate them? thanks in advance george _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From quan.nexthop at gmail.com Thu Sep 15 16:21:56 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Thu, 15 Sep 2011 09:21:56 -0700 Subject: nginx and tproxy In-Reply-To: <241A0BDFBDDA489996B455F7135B0651@DD21> References: <241A0BDFBDDA489996B455F7135B0651@DD21> Message-ID: thanks your feedback. Yes, we want to get the source-ip directly. However, if we want to get real client ip from L7 layer, we need modify the backend configuration, in some case, we have no permission to modify the configuration of Web-server. Is there other way to get client IP other than x-forward-for/x-real-ip? thanks George On Thu, Sep 15, 2011 at 8:19 AM, Reinis Rozitis wrote: > By tproxy you mean transparent proxying as in doing proxy requests from > nginx while using clients IP? > > It is far more simple to use the Real IP module http://wiki.nginx.org/** > HttpRealIpModule ( pretty much > all webservers (apache - mod_rpaf / lighttpd - mod_extforward etc) have > such modules in one or another form ) rather than trying to achieve it on > TCP level. > > And it is also straight forward to implement it in any other backend > application. > > rr > > > From: Geoge.Q > Sent: Thursday, September 15, 2011 6:02 PM > To: nginx at nginx.org > Subject: nginx and tproxy > > > Hi all: > > > Can we let both work together? Anyone can share his experience with us if > we want to integrate them? > > thanks in advance > > george > > > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From magicbearmo at gmail.com Thu Sep 15 17:51:25 2011 From: magicbearmo at gmail.com (MagicBear) Date: Fri, 16 Sep 2011 01:51:25 +0800 Subject: upstream keepalive - call for testing In-Reply-To: <051a01adad30a88a5d6d428e8fbaaafc.NginxMailingListEnglish@forum.nginx.org> References: <20110905180210.GL1137@mdounin.ru> <051a01adad30a88a5d6d428e8fbaaafc.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hello, I have wrote a module to make nginx support 304 to decrease bandwidth usage. note: I have a newbie for nginx module development, so the above module may have some problem. Welcome to test it and feedback another problem with me. You can download full patch file from here: http://m-b.cc/share/proxy_304.txt # User MagicBear Upstream: add $upstream_last_modified variant. add handler for 304 Unmodified. Proxy: change to send If-Modified-Since header. TODO: change write TO not block IO. diff -ruN a/http/modules/ngx_http_proxy_module.c b/http/modules/ngx_http_proxy_module.c --- a/http/modules/ngx_http_proxy_module.c 2011-09-15 22:23:03.284431407 +0800 +++ b/http/modules/ngx_http_proxy_module.c 2011-09-16 01:41:44.654428632 +0800 @@ -543,7 +543,7 @@ { ngx_string("Connection"), ngx_string("close") }, { ngx_string("Keep-Alive"), ngx_string("") }, { ngx_string("Expect"), ngx_string("") }, - { ngx_string("If-Modified-Since"), ngx_string("") }, + { ngx_string("If-Modified-Since"), ngx_string("$upstream_last_modified") }, { ngx_string("If-Unmodified-Since"), ngx_string("") }, { ngx_string("If-None-Match"), ngx_string("") }, { ngx_string("If-Match"), ngx_string("") }, diff -ruN a/http/ngx_http_upstream.c b/http/ngx_http_upstream.c --- a/http/ngx_http_upstream.c 2011-09-15 22:23:03.284431407 +0800 +++ b/http/ngx_http_upstream.c 2011-09-16 01:41:44.654428632 +0800 @@ -16,6 +16,8 @@ ngx_http_upstream_t *u); static ngx_int_t ngx_http_upstream_cache_status(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data); +static ngx_int_t ngx_http_upstream_last_modified(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data); #endif static void ngx_http_upstream_init_request(ngx_http_request_t *r); @@ -342,6 +344,10 @@ ngx_http_upstream_cache_status, 0, NGX_HTTP_VAR_NOCACHEABLE, 0 }, + { ngx_string("upstream_last_modified"), NULL, + ngx_http_upstream_last_modified, 0, + NGX_HTTP_VAR_NOCACHEABLE, 0 }, + #endif { ngx_null_string, NULL, NULL, 0, 0, 0 } @@ -1618,6 +1624,80 @@ u->buffer.last = u->buffer.pos; } +#if (NGX_HTTP_CACHE) + + if (u->cache_status == NGX_HTTP_CACHE_EXPIRED && + u->headers_in.status_n == NGX_HTTP_NOT_MODIFIED && + ngx_http_file_cache_valid(u->conf->cache_valid, u->headers_in.status_n)) + { + ngx_int_t rc; + + rc = u->reinit_request(r); + + if (rc == NGX_OK) { + u->cache_status = NGX_HTTP_CACHE_BYPASS; + rc = ngx_http_upstream_cache_send(r, u); + + time_t now, valid; + + now = ngx_time(); + + valid = r->cache->valid_sec; + + if (valid == 0) { + valid = ngx_http_file_cache_valid(u->conf->cache_valid, + u->headers_in.status_n); + if (valid) { + r->cache->valid_sec = now + valid; + } + } + + if (valid) { + r->cache->last_modified = r->headers_out.last_modified_time; + r->cache->date = now; + r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start); + + // update Header + ngx_http_file_cache_set_header(r, u->buffer.start); + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "update cache \"%s\" header to new expired." , r->cache->file.name.data); + + // Reopen file via RW + ngx_fd_t fd = ngx_open_file(r->cache->file.name.data, NGX_FILE_RDWR, NGX_FILE_OPEN, 0); + + if (fd == NGX_INVALID_FILE) { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, + ngx_open_file_n " \"%s\" failed", r->cache->file.name.data); + return; + } + + // Write cache + if (write(fd, u->buffer.start, sizeof(ngx_http_file_cache_header_t)) < 0) + { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, + "write proxy_cache \"%s\" failed", r->cache->file.name.data); + return; + } + + if (ngx_close_file(fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno, + ngx_close_file_n " \"%s\" failed", r->cache->file.name.data); + } + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "update cache \"%s\" header to new expired done." , r->cache->file.name.data); + } else { + u->cacheable = 0; + r->headers_out.last_modified_time = -1; + } + } + + ngx_http_upstream_finalize_request(r, u, rc); + return; + } + +#endif + if (ngx_http_upstream_test_next(r, u) == NGX_OK) { return; } @@ -4006,6 +4086,32 @@ return NGX_OK; } + +ngx_int_t +ngx_http_upstream_last_modified(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) +{ + u_char *u; + + if (r->upstream == NULL || r->upstream->cache_status == 0 || r->cache==NULL || r->cache->last_modified <= 0) { + v->not_found = 1; + return NGX_OK; + } + + v->valid = 1; + v->no_cacheable = 0; + v->not_found = 0; + u = ngx_pcalloc(r->pool, 30); + if (u == NULL) { + return NGX_ERROR; + } + + v->len = 29; + ngx_http_time(u, r->cache->last_modified); + v->data = u; + + return NGX_OK; +} #endif MagicBear 2011/9/15 magicbear > I have run the nginx 1.1.2 via this patch for 7 days, except for one > days have a large DDoS so I restart nginx for several seconds, it was > very stable to work. > Handle about 70million request without problem happen, I think the last > problem may be have a memory corruption, you are right. > I will check that server when have times. > Thanks for your hard work. > > MagicBear > > Maxim Dounin Wrote: > ------------------------------------------------------- > > Hello! > > > > On Mon, Sep 05, 2011 at 11:42:31PM +0800, > > ????? wrote: > > > > > (gdb) fr 0 > > > #0 ngx_http_upstream_handler > > (ev=0x7fc45735f8a8) > > > at src/http/ngx_http_upstream.c:915 > > > 915 ctx->current_request = r; > > > (gdb) p ngx_cycle->log > > > $1 = (ngx_log_t *) 0x21f19a8 > > > (gdb) p *r > > > $2 = {signature = 51686928, connection = > > 0x23b4160, ctx = 0x0, > > > > [...] > > > > This looks like memory corruption, but > > unfortunately I don't see > > any traces of the real cause. My best quess is > > improper handling > > of proxy_ignore_client_abort as fixed in 1.1.2. > > Please try 1.1.2 > > with patches from > > > > http://nginx.org/patches/patch-nginx-keepalive-ful > > l-5.txt > > > > It already includes upstream keepalive module, as > > well as all > > other upstream-keepalive related fixes. See here > > for details: > > > > http://mailman.nginx.org/pipermail/nginx-devel/201 > > 1-September/001147.html > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,213207,215217#msg-215217 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- # User MagicBear Upstream: add $upstream_last_modified variant. add handler for 304 Unmodified. Proxy: change to send If-Modified-Since header. TODO: change write TO not block IO. diff -ruN a/http/modules/ngx_http_proxy_module.c b/http/modules/ngx_http_proxy_module.c --- a/http/modules/ngx_http_proxy_module.c 2011-09-15 22:23:03.284431407 +0800 +++ b/http/modules/ngx_http_proxy_module.c 2011-09-16 01:41:44.654428632 +0800 @@ -543,7 +543,7 @@ { ngx_string("Connection"), ngx_string("close") }, { ngx_string("Keep-Alive"), ngx_string("") }, { ngx_string("Expect"), ngx_string("") }, - { ngx_string("If-Modified-Since"), ngx_string("") }, + { ngx_string("If-Modified-Since"), ngx_string("$upstream_last_modified") }, { ngx_string("If-Unmodified-Since"), ngx_string("") }, { ngx_string("If-None-Match"), ngx_string("") }, { ngx_string("If-Match"), ngx_string("") }, diff -ruN a/http/ngx_http_upstream.c b/http/ngx_http_upstream.c --- a/http/ngx_http_upstream.c 2011-09-15 22:23:03.284431407 +0800 +++ b/http/ngx_http_upstream.c 2011-09-16 01:41:44.654428632 +0800 @@ -16,6 +16,8 @@ ngx_http_upstream_t *u); static ngx_int_t ngx_http_upstream_cache_status(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data); +static ngx_int_t ngx_http_upstream_last_modified(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data); #endif static void ngx_http_upstream_init_request(ngx_http_request_t *r); @@ -342,6 +344,10 @@ ngx_http_upstream_cache_status, 0, NGX_HTTP_VAR_NOCACHEABLE, 0 }, + { ngx_string("upstream_last_modified"), NULL, + ngx_http_upstream_last_modified, 0, + NGX_HTTP_VAR_NOCACHEABLE, 0 }, + #endif { ngx_null_string, NULL, NULL, 0, 0, 0 } @@ -1618,6 +1624,80 @@ u->buffer.last = u->buffer.pos; } +#if (NGX_HTTP_CACHE) + + if (u->cache_status == NGX_HTTP_CACHE_EXPIRED && + u->headers_in.status_n == NGX_HTTP_NOT_MODIFIED && + ngx_http_file_cache_valid(u->conf->cache_valid, u->headers_in.status_n)) + { + ngx_int_t rc; + + rc = u->reinit_request(r); + + if (rc == NGX_OK) { + u->cache_status = NGX_HTTP_CACHE_BYPASS; + rc = ngx_http_upstream_cache_send(r, u); + + time_t now, valid; + + now = ngx_time(); + + valid = r->cache->valid_sec; + + if (valid == 0) { + valid = ngx_http_file_cache_valid(u->conf->cache_valid, + u->headers_in.status_n); + if (valid) { + r->cache->valid_sec = now + valid; + } + } + + if (valid) { + r->cache->last_modified = r->headers_out.last_modified_time; + r->cache->date = now; + r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start); + + // update Header + ngx_http_file_cache_set_header(r, u->buffer.start); + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "update cache \"%s\" header to new expired." , r->cache->file.name.data); + + // Reopen file via RW + ngx_fd_t fd = ngx_open_file(r->cache->file.name.data, NGX_FILE_RDWR, NGX_FILE_OPEN, 0); + + if (fd == NGX_INVALID_FILE) { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, + ngx_open_file_n " \"%s\" failed", r->cache->file.name.data); + return; + } + + // Write cache + if (write(fd, u->buffer.start, sizeof(ngx_http_file_cache_header_t)) < 0) + { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, + "write proxy_cache \"%s\" failed", r->cache->file.name.data); + return; + } + + if (ngx_close_file(fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno, + ngx_close_file_n " \"%s\" failed", r->cache->file.name.data); + } + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "update cache \"%s\" header to new expired done." , r->cache->file.name.data); + } else { + u->cacheable = 0; + r->headers_out.last_modified_time = -1; + } + } + + ngx_http_upstream_finalize_request(r, u, rc); + return; + } + +#endif + if (ngx_http_upstream_test_next(r, u) == NGX_OK) { return; } @@ -4006,6 +4086,32 @@ return NGX_OK; } + +ngx_int_t +ngx_http_upstream_last_modified(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) +{ + u_char *u; + + if (r->upstream == NULL || r->upstream->cache_status == 0 || r->cache==NULL || r->cache->last_modified <= 0) { + v->not_found = 1; + return NGX_OK; + } + + v->valid = 1; + v->no_cacheable = 0; + v->not_found = 0; + u = ngx_pcalloc(r->pool, 30); + if (u == NULL) { + return NGX_ERROR; + } + + v->len = 29; + ngx_http_time(u, r->cache->last_modified); + v->data = u; + + return NGX_OK; +} #endif From nginx-forum at nginx.us Thu Sep 15 21:03:41 2011 From: nginx-forum at nginx.us (caoxingk) Date: Thu, 15 Sep 2011 17:03:41 -0400 Subject: How to reference OS Environment Variales in nginx.conf Message-ID: Hi there, After set a variable by `set $name value`, i can reference it like `$name`, but when i export a OS Environment Variale by `env name_from_env`, like http://wiki.nginx.org/CoreModule#env said, and i am sure the name_from_env is valid which defined form nginx's parent process. But, my friends, how to reference it ? $name_from_env or ${name_from_env} or %name_from_env% didn't work what i've tried before. Thanks a lot. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215269,215269#msg-215269 From nginx-forum at nginx.us Thu Sep 15 23:22:00 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 19:22:00 -0400 Subject: How to force nginx to cache HTTP POST response for few seconds In-Reply-To: <4cd892cb0ebd639ee05f69162a2d098b.NginxMailingListEnglish@forum.nginx.org> References: <20110915092833.GA80146@nginx.com> <1ef7fdb8e7d77fa9a9d5f3934aa586bf.NginxMailingListEnglish@forum.nginx.org> <4cd892cb0ebd639ee05f69162a2d098b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4e7738edd4de5780202699e00467e70c.NginxMailingListEnglish@forum.nginx.org> Hi Igor, Thanks a lot for your help. Problem was with the request body. Now everything is working as expected. Sincerely --->>> qzpmwo <<<--- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215231,215274#msg-215274 From mat999 at gmail.com Fri Sep 16 01:42:25 2011 From: mat999 at gmail.com (SplitIce) Date: Fri, 16 Sep 2011 11:42:25 +1000 Subject: upstream keepalive - call for testing In-Reply-To: References: <20110905180210.GL1137@mdounin.ru> <051a01adad30a88a5d6d428e8fbaaafc.NginxMailingListEnglish@forum.nginx.org> Message-ID: wow, this + last-modified and etags would really cut into the reason people use varnish in their nginx + varnish setup. On Fri, Sep 16, 2011 at 3:51 AM, MagicBear wrote: > Hello, > I have wrote a module to make nginx support 304 to decrease bandwidth > usage. > note: I have a newbie for nginx module development, so the above module may > have some problem. Welcome to test it and feedback another problem with me. > > You can download full patch file from here: > http://m-b.cc/share/proxy_304.txt > > # User MagicBear > Upstream: > add $upstream_last_modified variant. > add handler for 304 Unmodified. > Proxy: > change to send If-Modified-Since header. > > TODO: > change write TO not block IO. > > diff -ruN a/http/modules/ngx_http_proxy_module.c > b/http/modules/ngx_http_proxy_module.c > --- a/http/modules/ngx_http_proxy_module.c 2011-09-15 > 22:23:03.284431407 +0800 > +++ b/http/modules/ngx_http_proxy_module.c 2011-09-16 > 01:41:44.654428632 +0800 > @@ -543,7 +543,7 @@ > { ngx_string("Connection"), ngx_string("close") }, > { ngx_string("Keep-Alive"), ngx_string("") }, > { ngx_string("Expect"), ngx_string("") }, > - { ngx_string("If-Modified-Since"), ngx_string("") }, > + { ngx_string("If-Modified-Since"), > ngx_string("$upstream_last_modified") }, > { ngx_string("If-Unmodified-Since"), ngx_string("") }, > { ngx_string("If-None-Match"), ngx_string("") }, > { ngx_string("If-Match"), ngx_string("") }, > diff -ruN a/http/ngx_http_upstream.c b/http/ngx_http_upstream.c > --- a/http/ngx_http_upstream.c 2011-09-15 22:23:03.284431407 +0800 > +++ b/http/ngx_http_upstream.c 2011-09-16 01:41:44.654428632 +0800 > @@ -16,6 +16,8 @@ > ngx_http_upstream_t *u); > static ngx_int_t ngx_http_upstream_cache_status(ngx_http_request_t *r, > ngx_http_variable_value_t *v, uintptr_t data); > +static ngx_int_t ngx_http_upstream_last_modified(ngx_http_request_t *r, > + ngx_http_variable_value_t *v, uintptr_t data); > #endif > > static void ngx_http_upstream_init_request(ngx_http_request_t *r); > @@ -342,6 +344,10 @@ > ngx_http_upstream_cache_status, 0, > NGX_HTTP_VAR_NOCACHEABLE, 0 }, > > + { ngx_string("upstream_last_modified"), NULL, > + ngx_http_upstream_last_modified, 0, > + NGX_HTTP_VAR_NOCACHEABLE, 0 }, > + > #endif > > { ngx_null_string, NULL, NULL, 0, 0, 0 } > @@ -1618,6 +1624,80 @@ > u->buffer.last = u->buffer.pos; > } > > +#if (NGX_HTTP_CACHE) > + > + if (u->cache_status == NGX_HTTP_CACHE_EXPIRED && > + u->headers_in.status_n == NGX_HTTP_NOT_MODIFIED && > + ngx_http_file_cache_valid(u->conf->cache_valid, > u->headers_in.status_n)) > + { > + ngx_int_t rc; > + > + rc = u->reinit_request(r); > + > + if (rc == NGX_OK) { > + u->cache_status = NGX_HTTP_CACHE_BYPASS; > + rc = ngx_http_upstream_cache_send(r, u); > + > + time_t now, valid; > + > + now = ngx_time(); > + > + valid = r->cache->valid_sec; > + > + if (valid == 0) { > + valid = > ngx_http_file_cache_valid(u->conf->cache_valid, > + > u->headers_in.status_n); > + if (valid) { > + r->cache->valid_sec = now + > valid; > + } > + } > + > + if (valid) { > + r->cache->last_modified = > r->headers_out.last_modified_time; > + r->cache->date = now; > + r->cache->body_start = (u_short) > (u->buffer.pos - u->buffer.start); > + > + // update Header > + ngx_http_file_cache_set_header(r, > u->buffer.start); > + > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, > r->connection->log, 0, > + > "update cache \"%s\" header to new expired." , r->cache->file.name.data); > + > + // Reopen file via RW > + ngx_fd_t fd = > ngx_open_file(r->cache->file.name.data, NGX_FILE_RDWR, NGX_FILE_OPEN, 0); > + > + if (fd == NGX_INVALID_FILE) { > + ngx_log_error(NGX_LOG_CRIT, > r->connection->log, ngx_errno, > + > ngx_open_file_n " \"%s\" failed", r->cache->file.name.data); > + return; > + } > + > + // Write cache > + if (write(fd, u->buffer.start, > sizeof(ngx_http_file_cache_header_t)) < 0) > + { > + ngx_log_error(NGX_LOG_CRIT, > r->connection->log, ngx_errno, > + > "write proxy_cache \"%s\" failed", r->cache->file.name.data); > + return; > + } > + > + if (ngx_close_file(fd) == > NGX_FILE_ERROR) { > + > ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno, > + > ngx_close_file_n " \"%s\" failed", r->cache->file.name.data); > + } > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, > r->connection->log, 0, > + > "update cache \"%s\" header to new expired done." , > r->cache->file.name.data); > + } else { > + u->cacheable = 0; > + r->headers_out.last_modified_time = > -1; > + } > + } > + > + ngx_http_upstream_finalize_request(r, u, rc); > + return; > + } > + > +#endif > + > if (ngx_http_upstream_test_next(r, u) == NGX_OK) { > return; > } > @@ -4006,6 +4086,32 @@ > > return NGX_OK; > } > + > +ngx_int_t > +ngx_http_upstream_last_modified(ngx_http_request_t *r, > + ngx_http_variable_value_t *v, uintptr_t data) > +{ > + u_char *u; > + > + if (r->upstream == NULL || r->upstream->cache_status == 0 || > r->cache==NULL || r->cache->last_modified <= 0) { > + v->not_found = 1; > + return NGX_OK; > + } > + > + v->valid = 1; > + v->no_cacheable = 0; > + v->not_found = 0; > + u = ngx_pcalloc(r->pool, 30); > + if (u == NULL) { > + return NGX_ERROR; > + } > + > + v->len = 29; > + ngx_http_time(u, r->cache->last_modified); > + v->data = u; > + > + return NGX_OK; > +} > > #endif > > > MagicBear > > 2011/9/15 magicbear > >> I have run the nginx 1.1.2 via this patch for 7 days, except for one >> days have a large DDoS so I restart nginx for several seconds, it was >> very stable to work. >> Handle about 70million request without problem happen, I think the last >> problem may be have a memory corruption, you are right. >> I will check that server when have times. >> Thanks for your hard work. >> >> MagicBear >> >> Maxim Dounin Wrote: >> ------------------------------------------------------- >> > Hello! >> > >> > On Mon, Sep 05, 2011 at 11:42:31PM +0800, >> > ????? wrote: >> > >> > > (gdb) fr 0 >> > > #0 ngx_http_upstream_handler >> > (ev=0x7fc45735f8a8) >> > > at src/http/ngx_http_upstream.c:915 >> > > 915 ctx->current_request = r; >> > > (gdb) p ngx_cycle->log >> > > $1 = (ngx_log_t *) 0x21f19a8 >> > > (gdb) p *r >> > > $2 = {signature = 51686928, connection = >> > 0x23b4160, ctx = 0x0, >> > >> > [...] >> > >> > This looks like memory corruption, but >> > unfortunately I don't see >> > any traces of the real cause. My best quess is >> > improper handling >> > of proxy_ignore_client_abort as fixed in 1.1.2. >> > Please try 1.1.2 >> > with patches from >> > >> > http://nginx.org/patches/patch-nginx-keepalive-ful >> > l-5.txt >> > >> > It already includes upstream keepalive module, as >> > well as all >> > other upstream-keepalive related fixes. See here >> > for details: >> > >> > http://mailman.nginx.org/pipermail/nginx-devel/201 >> > 1-September/001147.html >> > >> > Maxim Dounin >> > >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> Posted at Nginx Forum: >> http://forum.nginx.org/read.php?2,213207,215217#msg-215217 >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Sep 16 02:41:20 2011 From: nginx-forum at nginx.us (damnlinux) Date: Thu, 15 Sep 2011 22:41:20 -0400 Subject: Making Wordpress Plugins Work With Nginx Message-ID: I'm new to Nginx (Moving from Apache). I'm having a problem where the majority of Wordpress plugin are not working. I'm using Nginx 1.1.3. Here are my configuration if it can help figuring out the problem #####nginx.conf user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } ####sites-available/mydomain.com server { listen 80; server_name mydomain.com; access_log /var/log/nginx/mydomain.com.access.log; root /var/www/mydomain; index index.php; location / { try_files $uri $uri/ @wordpress; } location @wordpress { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /var/www/mydomain/index.php; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_NAME /index.php; } location ~ \.php$ { try_files $uri @wordpress; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/mydomain$fastcgi_script_name; include fastcgi_params; Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215277,215277#msg-215277 From nginx-forum at nginx.us Fri Sep 16 02:50:45 2011 From: nginx-forum at nginx.us (caoxingk) Date: Thu, 15 Sep 2011 22:50:45 -0400 Subject: How to reference OS Environment Variales in nginx.conf In-Reply-To: References: Message-ID: 2ed version is here: http://stackoverflow.com/questions/7439515/how-to-reference-os-environment-variables-in-nginx-conf Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215269,215278#msg-215278 From nginx-forum at nginx.us Fri Sep 16 03:09:15 2011 From: nginx-forum at nginx.us (qzpmwo) Date: Thu, 15 Sep 2011 23:09:15 -0400 Subject: How to check that $request_body has some string and use it like a caching key? Message-ID: <3118d31cde1d2d5fe00750552a676846.NginxMailingListEnglish@forum.nginx.org> Hi everybody, I have the following situation: Incoming request with method POST has binary body. I would like to extract piece(s) from the payload to use it like a caching key. Something like: if ( $request_body ~* (action.*) ) { set $key $1; } ... proxy_cache_key $uri|$key Unfortunately it does not work for me even if I specified (like Igor advised): client_max_body_size 1k; I also tried client_body_buffer_size 1k; but it did not help either. In the error.log with debug on I can see that $request_body has value, but it never matches my condition, so $key is always empty. Just in case I'm repeating, that request_body is binary. It has 0x00 as well as everything else. It is AMF data. Any advices? Thanks --->>> qzpmwo <<<--- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215279,215279#msg-215279 From agentzh at gmail.com Fri Sep 16 04:06:23 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 16 Sep 2011 12:06:23 +0800 Subject: How to reference OS Environment Variales in nginx.conf In-Reply-To: References: Message-ID: On Fri, Sep 16, 2011 at 5:03 AM, caoxingk wrote: > After set a variable by `set $name value`, i can reference it like > `$name`, > but when i export a OS Environment Variale by `env name_from_env`, like > http://wiki.nginx.org/CoreModule#env said, > and i am sure the name_from_env is valid which defined form nginx's > parent process. > > But, my friends, how to reference it ? You can read system environment variables with ngx_lua enabled in your nginx build: http://wiki.nginx.org/HttpLuaModule env PATH; http { ... server { location /path { set_by_lua $path 'return os.getenv("PATH")'; ... } } BTW, to use the set_by_lua directive, you also need to enable the ngx_devel_kit module here: https://github.com/simpl/ngx_devel_kit (it'll be easier if you use the ngx_openresty bundle). Regards, -agentzh From nginx-forum at nginx.us Fri Sep 16 04:53:28 2011 From: nginx-forum at nginx.us (skyshade) Date: Fri, 16 Sep 2011 00:53:28 -0400 Subject: nginx-1.1.3 In-Reply-To: <20110914151925.GG49199@nginx.com> References: <20110914151925.GG49199@nginx.com> Message-ID: <48a8cbc475ca42c28ec91d441278940d.NginxMailingListEnglish@forum.nginx.org> Igor I test 1.1.3 develop version with the new ngx_http_mp4_module, but its dont work with HttpProxyModule. 1. This is spectated? 2. If yes. There is any plan to add HttpProxyModule + ngx_http_mp4_module support? Will be aweason to have this working on Nginx. Thanks for you amazing work on nginx. Sky Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215200,215280#msg-215280 From igor at sysoev.ru Fri Sep 16 05:47:32 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 16 Sep 2011 09:47:32 +0400 Subject: nginx-1.1.3 In-Reply-To: <48a8cbc475ca42c28ec91d441278940d.NginxMailingListEnglish@forum.nginx.org> References: <20110914151925.GG49199@nginx.com> <48a8cbc475ca42c28ec91d441278940d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110916054732.GB8567@nginx.com> On Fri, Sep 16, 2011 at 12:53:28AM -0400, skyshade wrote: > Igor > > I test 1.1.3 develop version with the new ngx_http_mp4_module, but its > dont work with HttpProxyModule. > 1. This is spectated? > 2. If yes. There is any plan to add HttpProxyModule + > ngx_http_mp4_module support? > > Will be aweason to have this working on Nginx. Currently ngx_http_mp4_module is not a filter module, so it can work only with static files. There are plans to implement it as filter. -- Igor Sysoev From patcito at gmail.com Fri Sep 16 06:32:10 2011 From: patcito at gmail.com (Patrick Aljord) Date: Fri, 16 Sep 2011 01:32:10 -0500 Subject: can't get cache controle to set an expire date Message-ID: Hi, This is my nginx config file: http://pastebin.com/TZcfzipk The problem is that despite setting "expires max" cache sends no expire date so I must be doing something wrong. This is what appears as header: Cache-Control max-age=0 Any idea how I could fix this? Thanks in advance, Pat From lists at ruby-forum.com Fri Sep 16 09:49:34 2011 From: lists at ruby-forum.com (Mahalingam Mr) Date: Fri, 16 Sep 2011 11:49:34 +0200 Subject: can't get cache controle to set an expire date In-Reply-To: References: Message-ID: <1c65c6dd406143a6673d311145a09842@ruby-forum.com> # location /images/ { # # serve from disk and set expires # expires max; # } # # location /stylesheets/ { # expires max; # } # # location /javascripts/ { # expires max; # } Solution: Try this instead of giving the folders explicitly., location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { expires max; break; } TML -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Fri Sep 16 10:13:53 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 16 Sep 2011 14:13:53 +0400 Subject: can't get cache controle to set an expire date In-Reply-To: References: Message-ID: <20110916101353.GJ1137@mdounin.ru> Hello! On Fri, Sep 16, 2011 at 01:32:10AM -0500, Patrick Aljord wrote: > Hi, > > This is my nginx config file: http://pastebin.com/TZcfzipk > > The problem is that despite setting "expires max" cache sends no > expire date so I must be doing something wrong. > This is what appears as header: > > Cache-Control max-age=0 > > Any idea how I could fix this? Please show request and response. (And please make sure you actually see request in nginx logs, i.e. don't test your browser's cache.) If request actually hits nginx in question, I see two most likely reasons: 1) Your request is processed in location where you don't have "expires max;" set. I.e. request doesn't match /images/ etc. 2) Your request is processed in another server block. Maxim Dounin From mdounin at mdounin.ru Fri Sep 16 10:19:51 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 16 Sep 2011 14:19:51 +0400 Subject: can't get cache controle to set an expire date In-Reply-To: <1c65c6dd406143a6673d311145a09842@ruby-forum.com> References: <1c65c6dd406143a6673d311145a09842@ruby-forum.com> Message-ID: <20110916101951.GK1137@mdounin.ru> Hello! On Fri, Sep 16, 2011 at 11:49:34AM +0200, Mahalingam Mr wrote: > # location /images/ { > # # serve from disk and set expires > # expires max; > # } > # > # location /stylesheets/ { > # expires max; > # } > # > # location /javascripts/ { > # expires max; > # } > > > Solution: > > Try this instead of giving the folders explicitly., No, this is bad idea. Using regexp locations is bad as it makes configuration support much harder. Using separate prefixes for static files is much more scalable aproach. Additionally, this particular snippet is incorrect and misleading in serveral ways. > location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { Testing "\?..." is meaningless: query string isn't tested by "location" directives. > expires max; > break; Directive "break" here does nothing but wastes cpu cycles. > } Maxim Dounin From igor at sysoev.ru Fri Sep 16 10:39:07 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 16 Sep 2011 14:39:07 +0400 Subject: Help with AIO In-Reply-To: References: <20110906073352.GR1137@mdounin.ru> Message-ID: <20110916103907.GC14211@nginx.com> On Thu, Sep 15, 2011 at 04:21:44PM +0200, Hagai Avrahami wrote: > Hi > > When benchmarking AIO read, I reached more than 1024 concurrent Async IO - > 1. I saw a weird error log > 2. Nginx did not fallback to regular blocking read > > I looked on the source code -- src/os/unix/ngx_linux_aio_read.c line:105 > and I think there is a problem in errno handling > > // Current Code > //---------------------------------------------------------------------------- > *n = io_submit(ngx_aio_ctx, 1, piocb); > > if (n == 1) { > ev->active = 1; > ev->ready = 0; > ev->complete = 0; > > return NGX_AGAIN; > } > > n = -n; <---------------------------------------------------------?? Thank you, this is a bug. I confused this with _syscall(2). -- Igor Sysoev From lists at ruby-forum.com Fri Sep 16 11:13:32 2011 From: lists at ruby-forum.com (Philipp H.) Date: Fri, 16 Sep 2011 13:13:32 +0200 Subject: proxy_cache_path growing beyond max_size In-Reply-To: <242477381477ed3a267166929db03b12.NginxMailingListEnglish@forum.nginx.org> References: <242477381477ed3a267166929db03b12.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4d58339f158e7bd1ba41229ffff50691@ruby-forum.com> I have the same problem running nginx 1.0.6 from dotdeb.org 2011/09/16 13:08:50 [alert] 12610#0: epoll_ctl(1, 0) failed (1: Operation not permitted) 2011/09/16 13:08:50 [alert] 12610#0: failed to register channel handler while initializing push module worker (1: Operation not permitted) 2011/09/16 13:08:50 [alert] 12611#0: epoll_ctl(1, 0) failed (1: Operation not permitted) 2011/09/16 13:08:50 [alert] 12611#0: failed to register channel handler while initializing push module worker (1: Operation not permitted) 2011/09/16 13:08:50 [alert] 12608#0: cache manager process 12610 exited with fatal code 2 and can not be respawn There are several posts in the Internet concerning the same problem but there is no solution :/ https://github.com/slact/nginx_http_push_module/issues/33 http://forum.nginx.org/read.php?21,185003,185003#msg-185003 -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Sep 16 11:35:07 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Fri, 16 Sep 2011 07:35:07 -0400 Subject: Making Wordpress Plugins Work With Nginx In-Reply-To: References: Message-ID: Hi, Nginx does not embed PHP into its own process like Apache does, this mean that Nginx has no effect on the execution of PHP and if word press plugins do not work then it's either due to the plugins relying on Apache via mod_rewrite or because you have misconfigured PHP. If it's a mod_rewrite problem then we can potentially help, but we'll need to know what it expects from .htaccess, if it's the latter then this is probably the wrong mailing list. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215277,215295#msg-215295 From nginx-forum at nginx.us Fri Sep 16 11:37:18 2011 From: nginx-forum at nginx.us (philipp) Date: Fri, 16 Sep 2011 07:37:18 -0400 Subject: proxy_cache_path growing beyond max_size In-Reply-To: <20110825154418.GA1137@mdounin.ru> References: <20110825154418.GA1137@mdounin.ru> Message-ID: <734d026f7afc29036645027b8700618d.NginxMailingListEnglish@forum.nginx.org> I have the same problem here. How can we fix it? Is this problem known by the developers? Caching in general is working but without having a working cache manager I am afraid of running out of disk space... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214067,215296#msg-215296 From mdounin at mdounin.ru Fri Sep 16 12:03:37 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 16 Sep 2011 16:03:37 +0400 Subject: proxy_cache_path growing beyond max_size In-Reply-To: <734d026f7afc29036645027b8700618d.NginxMailingListEnglish@forum.nginx.org> References: <20110825154418.GA1137@mdounin.ru> <734d026f7afc29036645027b8700618d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110916120336.GN1137@mdounin.ru> Hello! On Fri, Sep 16, 2011 at 07:37:18AM -0400, philipp wrote: > I have the same problem here. How can we fix it? > > Is this problem known by the developers? > > Caching in general is working but without having a working cache manager > I am afraid of running out of disk space... Recompiling nginx without third party push module will solve it. If you want this to be fixed, you may want to CC push module author. Maxim Dounin From akunz at wishmedia.de Fri Sep 16 12:12:22 2011 From: akunz at wishmedia.de (Alexander Kunz) Date: Fri, 16 Sep 2011 14:12:22 +0200 Subject: proxy_cache_path growing beyond max_size In-Reply-To: <4d58339f158e7bd1ba41229ffff50691@ruby-forum.com> References: <242477381477ed3a267166929db03b12.NginxMailingListEnglish@forum.nginx.org> <4d58339f158e7bd1ba41229ffff50691@ruby-forum.com> Message-ID: <4E733D26.60700@wishmedia.de> Hello, Am 16.09.2011 13:13, schrieb Philipp H.: > I have the same problem running nginx 1.0.6 from dotdeb.org > > 2011/09/16 13:08:50 [alert] 12610#0: epoll_ctl(1, 0) failed (1: > Operation not permitted) > 2011/09/16 13:08:50 [alert] 12610#0: failed to register channel handler > while initializing push module worker (1: Operation not permitted) > 2011/09/16 13:08:50 [alert] 12611#0: epoll_ctl(1, 0) failed (1: > Operation not permitted) > 2011/09/16 13:08:50 [alert] 12611#0: failed to register channel handler > while initializing push module worker (1: Operation not permitted) > 2011/09/16 13:08:50 [alert] 12608#0: cache manager process 12610 exited > with fatal code 2 and can not be respawn > > There are several posts in the Internet concerning the same problem but > there is no solution :/ > > https://github.com/slact/nginx_http_push_module/issues/33 > http://forum.nginx.org/read.php?21,185003,185003#msg-185003 > if you cant fix this issue, take a look at the new http-push-stream-module https://github.com/wandenberg/nginx-push-stream-module since version 0.3.0 it also supports long-polling and polling. Alexander Kunz From igor at sysoev.ru Fri Sep 16 14:10:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 16 Sep 2011 18:10:02 +0400 Subject: Help with AIO In-Reply-To: <20110916103907.GC14211@nginx.com> References: <20110906073352.GR1137@mdounin.ru> <20110916103907.GC14211@nginx.com> Message-ID: <20110916141002.GH14211@nginx.com> On Fri, Sep 16, 2011 at 02:39:07PM +0400, Igor Sysoev wrote: > On Thu, Sep 15, 2011 at 04:21:44PM +0200, Hagai Avrahami wrote: > > Hi > > > > When benchmarking AIO read, I reached more than 1024 concurrent Async IO - > > 1. I saw a weird error log > > 2. Nginx did not fallback to regular blocking read > > > > I looked on the source code -- src/os/unix/ngx_linux_aio_read.c line:105 > > and I think there is a problem in errno handling > > > > // Current Code > > //---------------------------------------------------------------------------- > > *n = io_submit(ngx_aio_ctx, 1, piocb); > > > > if (n == 1) { > > ev->active = 1; > > ev->ready = 0; > > ev->complete = 0; > > > > return NGX_AGAIN; > > } > > > > n = -n; <---------------------------------------------------------?? > > Thank you, this is a bug. I confused this with _syscall(2). Linux AIO fixed in these two commits: http://trac.nginx.org/nginx/changeset/4130/nginx http://trac.nginx.org/nginx/changeset/4131/nginx Also I'm going to introduce the directive: events { worker_aio_events 100; } to set how much aio events worker may request to the kernel. I'm going to set default value to 32 events per worker. Currenly this value is hardcoded to 1024 and it seems it is too large, since default /proc/sys/fs/aio-max-nr value is 65536 and this means that you can run no more than 64 workers. -- Igor Sysoev From wendal1985 at gmail.com Fri Sep 16 14:34:59 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Fri, 16 Sep 2011 22:34:59 +0800 Subject: Segmentation fault in drizzle-nginx-module 0.1.0 Message-ID: Env: CentOS 5.6 nginx 0.8.54 rds-json-nginx-module-0.11 mysql 5.0 drizzle7-2011.08.25 nginx.conf location =/mysql_status { drizzle_status; } #Common SQL Query point location =/mysql_query { #internal; set_by_lua $sql "return ngx.unescape_uri(ngx.var.arg_sql)"; drizzle_query $sql; drizzle_pass mysqls; drizzle_module_header off; rds_json on; } =========================================================================================================== request path : localhost/mysql_query?sql=SELECT%201 print out by gdb: Program terminated with signal 11, Segmentation fault. #0 0x080c2551 in ngx_http_upstream_dbd_connect (r=0x8badcd0, u=0x8bae2d4) at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:604 604 r->connection->log->action = "connecting to upstream"; (gdb) bt #0 0x080c2551 in ngx_http_upstream_dbd_connect (r=0x8badcd0, u=0x8bae2d4) at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:604 #1 0x080c2539 in ngx_http_upstream_dbd_init_request (r=0x8badcd0) at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:593 #2 0x080c2066 in ngx_http_upstream_dbd_init (r=0x8badcd0) at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:390 #3 0x080be58e in ngx_http_drizzle_handler (r=0x8badcd0) at ../drizzle-nginx-module/src/ngx_http_drizzle_handler.c:164 #4 0x0807d610 in ngx_http_core_content_phase (r=0x8badcd0, ph=0x8bbb6d8) at src/http/ngx_http_core_module.c:1350 #5 0x0807c8a9 in ngx_http_core_run_phases (r=0x8badcd0) at src/http/ngx_http_core_module.c:852 #6 0x0807c844 in ngx_http_handler (r=0x8badcd0) at src/http/ngx_http_core_module.c:835 #7 0x08086a03 in ngx_http_run_posted_requests (c=0xb6a900b8) at src/http/ngx_http_request.c:1828 #8 0x080866b1 in ngx_http_process_request (r=0x8ba6368) at src/http/ngx_http_request.c:1643 #9 0x080855b9 in ngx_http_process_request_headers (rev=0xb657b070) at src/http/ngx_http_request.c:1084 #10 0x08084f4e in ngx_http_process_request_line (rev=0xb657b070) at src/http/ngx_http_request.c:889 #11 0x0808493b in ngx_http_init_request (rev=0xb657b070) at src/http/ngx_http_request.c:514 #12 0x0806f59f in ngx_event_process_posted (cycle=0x8ba6e98, posted=0x80df6cc) at src/event/ngx_event_posted.c:39 #13 0x0806ddf3 in ngx_process_events_and_timers (cycle=0x8ba6e98) at src/event/ngx_event.c:272 #14 0x08076c50 in ngx_worker_process_cycle (cycle=0x8ba6e98, data=0x0) at src/os/unix/ngx_process_cycle.c:795 #15 0x080746a2 in ngx_spawn_process (cycle=0x8ba6e98, proc=0x8076b3a , data=0x0, name=0x80cdc44 "worker process", respawn=-3) at src/os/unix/ngx_process.c:196 #16 0x080761b9 in ngx_start_worker_processes (cycle=0x8ba6e98, n=2, type=-3) at src/os/unix/ngx_process_cycle.c:355 #17 0x08075ac2 in ngx_master_process_cycle (cycle=0x8ba6e98) at src/os/unix/ngx_process_cycle.c:136 #18 0x08053faf in main (argc=1, argv=0xbfe971b4) at src/core/nginx.c:401 ============================================================================================================ request path : /mysql_status =========================================================================================================== #0 0x080bef9b in ngx_http_drizzle_status_handler (r=0x8ba6368) at ../drizzle-nginx-module/src/ngx_http_drizzle_handler.c:604 604 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, (gdb) bt #0 0x080bef9b in ngx_http_drizzle_status_handler (r=0x8ba6368) at ../drizzle-nginx-module/src/ngx_http_drizzle_handler.c:604 #1 0x0807d610 in ngx_http_core_content_phase (r=0x8ba6368, ph=0x8bbb6d8) at src/http/ngx_http_core_module.c:1350 #2 0x0807c8a9 in ngx_http_core_run_phases (r=0x8ba6368) at src/http/ngx_http_core_module.c:852 #3 0x0807c844 in ngx_http_handler (r=0x8ba6368) at src/http/ngx_http_core_module.c:835 #4 0x080866a6 in ngx_http_process_request (r=0x8ba6368) at src/http/ngx_http_request.c:1641 #5 0x080855b9 in ngx_http_process_request_headers (rev=0xb657b070) at src/http/ngx_http_request.c:1084 #6 0x08084f4e in ngx_http_process_request_line (rev=0xb657b070) at src/http/ngx_http_request.c:889 #7 0x0808493b in ngx_http_init_request (rev=0xb657b070) at src/http/ngx_http_request.c:514 #8 0x0806f59f in ngx_event_process_posted (cycle=0x8ba6e98, posted=0x80df6cc) at src/event/ngx_event_posted.c:39 #9 0x0806ddf3 in ngx_process_events_and_timers (cycle=0x8ba6e98) at src/event/ngx_event.c:272 #10 0x08076c50 in ngx_worker_process_cycle (cycle=0x8ba6e98, data=0x0) at src/os/unix/ngx_process_cycle.c:795 #11 0x080746a2 in ngx_spawn_process (cycle=0x8ba6e98, proc=0x8076b3a , data=0x0, name=0x80cdc44 "worker process", respawn=-3) at src/os/unix/ngx_process.c:196 #12 0x080761b9 in ngx_start_worker_processes (cycle=0x8ba6e98, n=2, type=-3) at src/os/unix/ngx_process_cycle.c:355 #13 0x08075ac2 in ngx_master_process_cycle (cycle=0x8ba6e98) at src/os/unix/ngx_process_cycle.c:136 #14 0x08053faf in main (argc=1, argv=0xbfe971b4) at src/core/nginx.c:401 =========================================================================================================== Thank any help !!! -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From wendal1985 at gmail.com Fri Sep 16 16:00:27 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Sat, 17 Sep 2011 00:00:27 +0800 Subject: Segmentation fault in drizzle-nginx-module 0.1.0 In-Reply-To: References: Message-ID: switch to: ngx_openresty-1.0.5.1 + drizzle7-2011.08.25 work find. 2011/9/16 Wendal Chen > Env: > CentOS 5.6 > nginx 0.8.54 > rds-json-nginx-module-0.11 > mysql 5.0 > drizzle7-2011.08.25 > > nginx.conf > > location =/mysql_status { > drizzle_status; > } > > #Common SQL Query point > location =/mysql_query { > #internal; > set_by_lua $sql "return ngx.unescape_uri(ngx.var.arg_sql)"; > drizzle_query $sql; > drizzle_pass mysqls; > drizzle_module_header off; > rds_json on; > } > > > =========================================================================================================== > > request path : localhost/mysql_query?sql=SELECT%201 > > print out by gdb: > > Program terminated with signal 11, Segmentation fault. > #0 0x080c2551 in ngx_http_upstream_dbd_connect (r=0x8badcd0, u=0x8bae2d4) > at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:604 > 604 r->connection->log->action = "connecting to upstream"; > (gdb) bt > #0 0x080c2551 in ngx_http_upstream_dbd_connect (r=0x8badcd0, u=0x8bae2d4) > at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:604 > #1 0x080c2539 in ngx_http_upstream_dbd_init_request (r=0x8badcd0) at > ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:593 > #2 0x080c2066 in ngx_http_upstream_dbd_init (r=0x8badcd0) at > ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:390 > #3 0x080be58e in ngx_http_drizzle_handler (r=0x8badcd0) at > ../drizzle-nginx-module/src/ngx_http_drizzle_handler.c:164 > #4 0x0807d610 in ngx_http_core_content_phase (r=0x8badcd0, ph=0x8bbb6d8) > at src/http/ngx_http_core_module.c:1350 > #5 0x0807c8a9 in ngx_http_core_run_phases (r=0x8badcd0) at > src/http/ngx_http_core_module.c:852 > #6 0x0807c844 in ngx_http_handler (r=0x8badcd0) at > src/http/ngx_http_core_module.c:835 > #7 0x08086a03 in ngx_http_run_posted_requests (c=0xb6a900b8) at > src/http/ngx_http_request.c:1828 > #8 0x080866b1 in ngx_http_process_request (r=0x8ba6368) at > src/http/ngx_http_request.c:1643 > #9 0x080855b9 in ngx_http_process_request_headers (rev=0xb657b070) at > src/http/ngx_http_request.c:1084 > #10 0x08084f4e in ngx_http_process_request_line (rev=0xb657b070) at > src/http/ngx_http_request.c:889 > #11 0x0808493b in ngx_http_init_request (rev=0xb657b070) at > src/http/ngx_http_request.c:514 > #12 0x0806f59f in ngx_event_process_posted (cycle=0x8ba6e98, > posted=0x80df6cc) at src/event/ngx_event_posted.c:39 > #13 0x0806ddf3 in ngx_process_events_and_timers (cycle=0x8ba6e98) at > src/event/ngx_event.c:272 > #14 0x08076c50 in ngx_worker_process_cycle (cycle=0x8ba6e98, data=0x0) at > src/os/unix/ngx_process_cycle.c:795 > #15 0x080746a2 in ngx_spawn_process (cycle=0x8ba6e98, proc=0x8076b3a > , data=0x0, name=0x80cdc44 "worker process", > respawn=-3) > at src/os/unix/ngx_process.c:196 > #16 0x080761b9 in ngx_start_worker_processes (cycle=0x8ba6e98, n=2, > type=-3) at src/os/unix/ngx_process_cycle.c:355 > #17 0x08075ac2 in ngx_master_process_cycle (cycle=0x8ba6e98) at > src/os/unix/ngx_process_cycle.c:136 > #18 0x08053faf in main (argc=1, argv=0xbfe971b4) at src/core/nginx.c:401 > > > ============================================================================================================ > > request path : /mysql_status > > > =========================================================================================================== > #0 0x080bef9b in ngx_http_drizzle_status_handler (r=0x8ba6368) at > ../drizzle-nginx-module/src/ngx_http_drizzle_handler.c:604 > 604 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, > (gdb) bt > #0 0x080bef9b in ngx_http_drizzle_status_handler (r=0x8ba6368) at > ../drizzle-nginx-module/src/ngx_http_drizzle_handler.c:604 > #1 0x0807d610 in ngx_http_core_content_phase (r=0x8ba6368, ph=0x8bbb6d8) > at src/http/ngx_http_core_module.c:1350 > #2 0x0807c8a9 in ngx_http_core_run_phases (r=0x8ba6368) at > src/http/ngx_http_core_module.c:852 > #3 0x0807c844 in ngx_http_handler (r=0x8ba6368) at > src/http/ngx_http_core_module.c:835 > #4 0x080866a6 in ngx_http_process_request (r=0x8ba6368) at > src/http/ngx_http_request.c:1641 > #5 0x080855b9 in ngx_http_process_request_headers (rev=0xb657b070) at > src/http/ngx_http_request.c:1084 > #6 0x08084f4e in ngx_http_process_request_line (rev=0xb657b070) at > src/http/ngx_http_request.c:889 > #7 0x0808493b in ngx_http_init_request (rev=0xb657b070) at > src/http/ngx_http_request.c:514 > #8 0x0806f59f in ngx_event_process_posted (cycle=0x8ba6e98, > posted=0x80df6cc) at src/event/ngx_event_posted.c:39 > #9 0x0806ddf3 in ngx_process_events_and_timers (cycle=0x8ba6e98) at > src/event/ngx_event.c:272 > #10 0x08076c50 in ngx_worker_process_cycle (cycle=0x8ba6e98, data=0x0) at > src/os/unix/ngx_process_cycle.c:795 > #11 0x080746a2 in ngx_spawn_process (cycle=0x8ba6e98, proc=0x8076b3a > , data=0x0, name=0x80cdc44 "worker process", > respawn=-3) > at src/os/unix/ngx_process.c:196 > #12 0x080761b9 in ngx_start_worker_processes (cycle=0x8ba6e98, n=2, > type=-3) at src/os/unix/ngx_process_cycle.c:355 > #13 0x08075ac2 in ngx_master_process_cycle (cycle=0x8ba6e98) at > src/os/unix/ngx_process_cycle.c:136 > #14 0x08053faf in main (argc=1, argv=0xbfe971b4) at src/core/nginx.c:401 > > > =========================================================================================================== > Thank any help !!! > > -- > Wendal Chen > > > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Sep 16 16:16:56 2011 From: nginx-forum at nginx.us (martijnsenden) Date: Fri, 16 Sep 2011 12:16:56 -0400 Subject: change nginx user in config >> 403 error index.html forbidden Message-ID: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> Hi All, I have just installed NGINX 1.1.2. I made my own configuration and makefile and installed the nginx server. When I set the config to: user root root; I get the hello world index.html file provided by the nginx installer (./html/index.html). When I set the config to: user nginx nginx; (which is what I want), I get a 403 message. The error.log says the index.html is forbidden. These are the file permissions I have set on the files in the ./html directory: total 16 -rw-r--r-- 1 someowner nginx 383 Sep 16 15:27 50x.html -rw-r--r-- 1 someowner nginx 151 Sep 16 15:27 index.html -rw-r--r-- 1 someowner nginx 6971 Sep 16 15:27 ngx_core_module.html The nginx user is a member of the nginx group (which has the required permission to view the index.html): $ groups nginx returns: nginx : nginx So, what should I do to give the worker processes of nginx access to these files? I'm at a loss here. I would greatly appreciate any help! Best regards, Martijn. ps this is the content of my nginx.conf: user root root; worker_processes 4; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 128; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215310,215310#msg-215310 From mdounin at mdounin.ru Fri Sep 16 16:24:35 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 16 Sep 2011 20:24:35 +0400 Subject: change nginx user in config >> 403 error index.html forbidden In-Reply-To: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> References: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110916162435.GT1137@mdounin.ru> Hello! On Fri, Sep 16, 2011 at 12:16:56PM -0400, martijnsenden wrote: > Hi All, > > I have just installed NGINX 1.1.2. I made my own configuration and > makefile and installed the nginx server. > When I set the config to: > user root root; > I get the hello world index.html file provided by the nginx installer > (./html/index.html). > > When I set the config to: > user nginx nginx; > (which is what I want), I get a 403 message. The error.log says the > index.html is forbidden. > > These are the file permissions I have set on the files in the ./html > directory: > total 16 > -rw-r--r-- 1 someowner nginx 383 Sep 16 15:27 50x.html > -rw-r--r-- 1 someowner nginx 151 Sep 16 15:27 index.html > -rw-r--r-- 1 someowner nginx 6971 Sep 16 15:27 ngx_core_module.html > > The nginx user is a member of the nginx group (which has the required > permission to view the index.html): > $ groups nginx > returns: > nginx : nginx > > So, what should I do to give the worker processes of nginx access to > these files? I'm at a loss here. Make sure nginx use have at least search permissions for all directories above document root. Maxim Dounin From lists at ruby-forum.com Fri Sep 16 16:25:58 2011 From: lists at ruby-forum.com (dhaval deshpande) Date: Fri, 16 Sep 2011 18:25:58 +0200 Subject: Passing variables from nginx to sinatra Message-ID: <39ffba646ba6d273ee6425b528fb6d0f@ruby-forum.com> Hello, I am trying to pass a uID($uid_got value) that has been generated by Nginx httpuseridmodule to my sinatra app. Basically I could have taken from the cookie but the cookie does not get set on the browser unless the response headers have been sent back. Can anyone give any suggestions regarding that? Thanks, Dhaval. -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Sep 16 18:47:49 2011 From: nginx-forum at nginx.us (dullnicker) Date: Fri, 16 Sep 2011 14:47:49 -0400 Subject: Problem with Hotlink Protection In-Reply-To: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thank you both! I totally agree with you, but as soon as I restrict referer checking to the image.php script only, there is a flaw appearing: image.php then gets downloaded by the browser instead of displaying it. Do you have any idea why this happens? It would be great if I could restrict the check only to this one .php file, but - as said - it does not work here... Thank you again for your kind help and support, Amitz Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215198,215316#msg-215316 From fud.theturtle at gmail.com Fri Sep 16 19:54:08 2011 From: fud.theturtle at gmail.com (Chris Zimmerman) Date: Fri, 16 Sep 2011 15:54:08 -0400 Subject: Problem with Hotlink Protection In-Reply-To: References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> Message-ID: Please post the config you are using when it does this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Sep 16 20:29:03 2011 From: lists at ruby-forum.com (dhaval deshpande) Date: Fri, 16 Sep 2011 22:29:03 +0200 Subject: Passing variables from nginx to sinatra In-Reply-To: <39ffba646ba6d273ee6425b528fb6d0f@ruby-forum.com> References: <39ffba646ba6d273ee6425b528fb6d0f@ruby-forum.com> Message-ID: <210b425c0fcd6df385284e7ba61b67ff@ruby-forum.com> ok never mind I figured out my self. Just in case if anyone wants to know here is how I did it. passenger_set_cgi_param Variable Value -- Posted via http://www.ruby-forum.com/. From patcito at gmail.com Fri Sep 16 20:29:23 2011 From: patcito at gmail.com (Patrick Aljord) Date: Fri, 16 Sep 2011 15:29:23 -0500 Subject: can't get cache controle to set an expire date In-Reply-To: <20110916101951.GK1137@mdounin.ru> References: <1c65c6dd406143a6673d311145a09842@ruby-forum.com> <20110916101951.GK1137@mdounin.ru> Message-ID: Hey Maxim, Ok so after investigation I realized that this one worked: /images/q-icon-medium.png But these two did not have expire cache: /packages/base.js /_files/groups/medium/4af798a119ce955bd1000001/0.png So I added this to the conf: ? ?location /packages/ {? ? ? ?expires max;? ?} location /_files/ { expires max; } This fixed the '/packages/base.js' cache but I started getting a 404 on the '/_files/groups/medium/4af798a119ce955bd1000001/0.png'. So I removed the "location /_files/" from the conf. The thing is that this file does not come from the hard drive. It comes from the web app (I'm using unicorn for rails + nginx). Any idea how I should set the expire headers for those assets that come from the app? Should I set them in the rails app? Thanks, Pat From mdounin at mdounin.ru Fri Sep 16 22:51:42 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 17 Sep 2011 02:51:42 +0400 Subject: can't get cache controle to set an expire date In-Reply-To: References: <1c65c6dd406143a6673d311145a09842@ruby-forum.com> <20110916101951.GK1137@mdounin.ru> Message-ID: <20110916225142.GU1137@mdounin.ru> Hello! On Fri, Sep 16, 2011 at 03:29:23PM -0500, Patrick Aljord wrote: > Hey Maxim, > > Ok so after investigation I realized that this one worked: > > /images/q-icon-medium.png > > But these two did not have expire cache: > > /packages/base.js > /_files/groups/medium/4af798a119ce955bd1000001/0.png > > So I added this to the conf: > > > ? ?location /packages/ {? ? ? ?expires max;? ?} > location /_files/ { > expires max; > } > > This fixed the '/packages/base.js' cache but I started getting a 404 > on the '/_files/groups/medium/4af798a119ce955bd1000001/0.png'. So I > removed the "location /_files/" from the conf. The thing is that this > file does not come from the hard drive. It comes from the web app (I'm > using unicorn for rails + nginx). Any idea how I should set the expire > headers for those assets that come from the app? Should I set them in > the rails app? Either set it from app, or pass to app while still setting expires. Something like this should work: location /_files/ { expires max; proxy_pass http://foo_app_server; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } If some data in /_files/ may be actually static files on disk, you may want to add try_files with named location, much like in "location /" + "location @app" in your config, but with expires set. I.e. something like this: location /_files/ { expires max; try_files ... @appstatic; } location @appstatic { expires max; proxy_pass http://foo_app_server; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } Maxim Dounin From patcito at gmail.com Sat Sep 17 00:09:32 2011 From: patcito at gmail.com (Patrick Aljord) Date: Fri, 16 Sep 2011 19:09:32 -0500 Subject: can't get cache controle to set an expire date In-Reply-To: <20110916225142.GU1137@mdounin.ru> References: <1c65c6dd406143a6673d311145a09842@ruby-forum.com> <20110916101951.GK1137@mdounin.ru> <20110916225142.GU1137@mdounin.ru> Message-ID: 2011/9/16 Maxim Dounin : > ? ?location /_files/ { > ? ? ? ?expires max; > ? ? ? ?proxy_pass http://foo_app_server; > ? ? ? ?proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > ? ? ? ?proxy_set_header Host $http_host; > ? ?} > Thanks! That worked great. From nginx-forum at nginx.us Sat Sep 17 00:25:01 2011 From: nginx-forum at nginx.us (damnlinux) Date: Fri, 16 Sep 2011 20:25:01 -0400 Subject: Making Wordpress Plugins Work With Nginx In-Reply-To: References: Message-ID: Thank you Ensiferous. I don't think it's a PHP issue because Wordpress itself works fine it is quite possible though that it's a mod_rewrite issue. I'm not familiar with Nginx access rewrite my .htaccess is really basic # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com/ [NC] RewriteCond %{HTTP_REFERER} ^http:// [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(jpe?g|gif|png)$ - [F] Thanks again for the help Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215277,215319#msg-215319 From nginx-forum at nginx.us Sat Sep 17 04:00:30 2011 From: nginx-forum at nginx.us (Sylvia) Date: Sat, 17 Sep 2011 00:00:30 -0400 Subject: Making Wordpress Plugins Work With Nginx In-Reply-To: References: Message-ID: <18010d6d655555324c6c51a637892311.NginxMailingListEnglish@forum.nginx.org> http://wordpress.org/extend/plugins/nginx-compatibility/ try installing this plugin when WP detects nginx and "not compilant" SAPI it assumes that rewrite is impossible and turns it off, this plugins works around that problem. (but do not use it with Apache if you move your WP somewhere else later) ~ cheers Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215277,215320#msg-215320 From yaniv at aknin.name Sat Sep 17 04:40:19 2011 From: yaniv at aknin.name (Yaniv Aknin) Date: Sat, 17 Sep 2011 07:40:19 +0300 Subject: daemon off in production Message-ID: Hi, The documentations says I should never run nginx with the daemon off setting in production. I would like to do so anyway so my Python/twisted based process manager will have an easier time knowing if nginx terminated or not (I know there are other ways to do it, but this seems like the easiest; if I'll be forced to, I'll use another way). I'm aware of SIGWINCH and nginx in general and especially after version 1.1.1, and I don't mind taking care of guaranteeing nginx will run without a controlling terminal (I will fork()/setsid() before exec()ing it), run in a sensible current working directory, etc. I just don't want it to do the daemonizing double fork. >From skimming the code, it appears to me that nothing bad should happen. What am I missing? Why is it so bad to run nginx in the foreground in production? Thanks, - Yaniv -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Sat Sep 17 04:42:56 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 17 Sep 2011 12:42:56 +0800 Subject: Segmentation fault in drizzle-nginx-module 0.1.0 In-Reply-To: References: Message-ID: On Fri, Sep 16, 2011 at 10:34 PM, Wendal Chen wrote: > > Program terminated with signal 11, Segmentation fault. > #0? 0x080c2551 in ngx_http_upstream_dbd_connect (r=0x8badcd0, u=0x8bae2d4) > at ../drizzle-nginx-module/src/ngx_http_drizzle_util.c:604 > 604???????? r->connection->log->action = "connecting to upstream"; > (gdb) bt This was a known issue in ngx_drizzle v0.1.0 and earlier on 32-bit systems and has already been fixed in ngx_drizzle v0.1.1rc3. I'll release ngx_drizzle v0.1.1 soon :) Regards, -agentzh From agentzh at gmail.com Sat Sep 17 04:44:48 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 17 Sep 2011 12:44:48 +0800 Subject: Segmentation fault in drizzle-nginx-module 0.1.0 In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 12:00 AM, Wendal Chen wrote: > > switch to: > > ngx_openresty-1.0.5.1 + drizzle7-2011.08.25 > > work find. > Cool :) The ngx_openresty 1.0.5.1 release bundles ngx_drizzle 0.1.1rc4, which already contains the fix for 32-bit systems. See http://openresty.org/#ChangeLog1000005 Regards, -agentzh From agentzh at gmail.com Sat Sep 17 05:14:14 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 17 Sep 2011 13:14:14 +0800 Subject: [ANN] ngx_drizzle v0.1.1: fixed segfaults on 32-bit systems In-Reply-To: References: Message-ID: Hi, folks! I'm happy to announce that ngx_drizzle v0.1.1 has been released. You can download the latest release tarball from ??? https://github.com/chaoslawful/drizzle-nginx-module/downloads This release fixed a long-standing segmentation fault on 32-bit systems, as well as some other issues. Here goes the complete change log: * fixed segmentation faults on 32-bit systems. thanks @??? and @stefanli for reporting this issue. * documented the $drizzle_thread_id variable. * added lots of debug outputs (enabled by the --with-debug option while building Nginx or OpenResty), inspired by github issue #10. * fixed issues regarding defining global variables in C header files: we should have defined rds_rough_col_type_t as a type rather than a global variable. thanks @???. * documented the python -> python3 pitfall while building libdrizzle 1.0 on at least ArchLinux. * fixed the automatic libdrizzle searching algorithm in the config file: now we should look under libdrizzle-1.0/ instead. thanks ??? (Calio) for reporting this issue. ngx_drizzle is an nginx upstream module integrating libdrizzle into Nginx in a non-blocking and streamming way. Essentially it provides a very efficient and flexible way for nginx internals to access MySQL, Drizzle, as well as other RDBMS's that support the Drizzle or MySQL wired protocol. Also it can serve as a direct REST interface to those RDBMS backends. This module does not generate human-readable outputs, rather, in a binary format called Resty-DBD-Stream (RDS) designed by ourselves. You usually need other components, like ngx_rds_json [1], ngx_rds_csv [2], or lua-rds-parser [3], to work with this module. See the RDS output format spec for more details: http://wiki.nginx.org/HttpDrizzleModule#Output_Format You can find the complete documentation for ngx_drizzle on Nginx Wiki: ??? http://wiki.nginx.org/HttpDrizzleModule and the latest source is on GitHub: ??? https://github.com/chaoslawful/drizzle-nginx-module This module is also bundled (though not enabled by default) by the ngx_openresty bundle: ??? http://openresty.org/ You can check out this wiki page to enable this component while building ngx_openresty: ??? http://openresty.org/#DrizzleNginxModule Have fun! -agentzh [1] https://github.com/agentzh/rds-json-nginx-module [2] https://github.com/agentzh/rds-csv-nginx-module [3] https://github.com/agentzh/lua-rds-parser From nginx at nginxuser.net Sat Sep 17 08:53:31 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 17 Sep 2011 11:53:31 +0300 Subject: Openresty downstream bundle maintenance requests Message-ID: Hi. A few things to consider with respect to downstream maintenance support. The configure script under the "for my $opt (@ARGV) {" loop covers a few typical items and any others cause the "die "Invalid option $opt\n";" line to be triggered. However, when in a Fedora/Enterprise Linux build environment, the "%configure" macro in the spec file adds several other switches (which work fine when building nginx directly). Can the upstream please consider modifying the configure script to allow for these? A possiblity is: for my $opt (@ARGV) { ... } elsif ($opt =~ /^--build=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--host=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--target=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--program-prefix=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--exec-prefix=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--bindir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--sbindir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--sysconfdir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--datadir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--includedir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--libexecdir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--localstatedir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--sharedstatedir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--mandir=(.*)/) { push @ngx_opts, $opt; } elsif ($opt =~ /^--infodir=(.*)/) { push @ngx_opts, $opt; } else { die "Invalid option $opt\n"; } } May be even merge all the "dir" ones into "} elsif ($opt =~ /^--(.*)dir=(.*)/) {" Also, can the upstream consider dropping version numbers from the folders in the "bundle" directory and record the version numbers in a README? Would save having to edit the spec file for every release. Finally, can the upstream consider allowing the with luajit option to be selected but not to try to build luajit? I.E. set openresty up to use luajit but have the luajit build done separately and not try to replace this by the standard lua. I suppose the same applies to the standard lua. Basically, third party applications should ideally be built separately and we would look into creating seperate rpms for those. Can foresee some potential knotty issues to overcome with this but if distributing an rpm, then there are issues anyway. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sat Sep 17 10:10:36 2011 From: lists at ruby-forum.com (Martijn Senden) Date: Sat, 17 Sep 2011 12:10:36 +0200 Subject: change nginx user in config >> 403 error index.html forbidden In-Reply-To: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> References: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> Message-ID: <82d209499b597d34e352b99a365f737e@ruby-forum.com> Thanks! I guess by search permissions you mean read permission, not write or execute? Regards, Martijn Senden. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Sep 17 10:16:13 2011 From: lists at ruby-forum.com (Martijn Senden) Date: Sat, 17 Sep 2011 12:16:13 +0200 Subject: change nginx user in config >> 403 error index.html forbidden In-Reply-To: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> References: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> Message-ID: Some googling told me search permission is often used as an alternate name for execute permission. Thanks, I'll try this! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Sep 17 10:27:40 2011 From: lists at ruby-forum.com (Martijn Senden) Date: Sat, 17 Sep 2011 12:27:40 +0200 Subject: change nginx user in config >> 403 error index.html forbidden In-Reply-To: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> References: <17e343cd5e06fc4d31ab27ccf4006c74.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8c5570cad3538b32e0c137d2dff3a112@ruby-forum.com> Thanks! With this I got it to work! I changed the group of the server folder and the nginx folder to nginx with the chown command and set the permissions to (at least) execute, and now I get the welcome page! Thank you very much! This was starting to give me headaches yesterday. ;-) -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Sat Sep 17 10:30:29 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 17 Sep 2011 14:30:29 +0400 Subject: daemon off in production In-Reply-To: References: Message-ID: <20110917103028.GV1137@mdounin.ru> Hello! On Sat, Sep 17, 2011 at 07:40:19AM +0300, Yaniv Aknin wrote: > Hi, > > The documentations says I should never run nginx with the daemon off setting > in production. I would like to do so anyway so my Python/twisted based > process manager will have an easier time knowing if nginx terminated or not > (I know there are other ways to do it, but this seems like the easiest; if > I'll be forced to, I'll use another way). > > I'm aware of SIGWINCH and nginx in general and especially after version > 1.1.1, and I don't mind taking care of guaranteeing nginx will run without a > controlling terminal (I will fork()/setsid() before exec()ing it), run in a > sensible current working directory, etc. I just don't want it to do the > daemonizing double fork. > > From skimming the code, it appears to me that nothing bad should happen. > What am I missing? Why is it so bad to run nginx in the foreground in > production? Documentation[1] says "daemon" is generally used for development, it doesn't say it shouldn't be used in production. It's safe to run with "daemon off;" if you use some controlling process manager. Note that you don't really need to setsid(), nginx will take care of this even with "daemon off;". Please don't confuse with "master_process off;". It's *unsafe* to run with "master_process off;" and it's *only* used for development. [1] http://sysoev.ru/nginx/docs/ngx_core_module.html#daemon Maxim Dounin From igor at sysoev.ru Sat Sep 17 10:49:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 17 Sep 2011 14:49:03 +0400 Subject: daemon off in production In-Reply-To: References: Message-ID: <20110917104903.GA50310@nginx.com> On Sat, Sep 17, 2011 at 07:40:19AM +0300, Yaniv Aknin wrote: > Hi, > > The documentations says I should never run nginx with the daemon off setting > in production. I would like to do so anyway so my Python/twisted based > process manager will have an easier time knowing if nginx terminated or not > (I know there are other ways to do it, but this seems like the easiest; if > I'll be forced to, I'll use another way). > > I'm aware of SIGWINCH and nginx in general and especially after version > 1.1.1, and I don't mind taking care of guaranteeing nginx will run without a > controlling terminal (I will fork()/setsid() before exec()ing it), run in a > sensible current working directory, etc. I just don't want it to do the > daemonizing double fork. > > From skimming the code, it appears to me that nothing bad should happen. > What am I missing? Why is it so bad to run nginx in the foreground in > production? There are two directives: "master_process on|off" and "daemon on|off". Both are used to simplify nginx development: while testing a bug/feature I usually run nginx in foreground without master process and simply press ^C to stop nginx. This is an analog of Apache's -X command line switch. I did not want to type it in commanf line, so these two directives have been introduced. There was thought to allow nginx to run in single process mode in production as many lightweight server do. So there is some incomplete code to support this fucntionality. But this code is incomplete, so you should never use "master_process off" in production. As to "daemon off", I did not intend to use it in production (and never did), but many people do it. I believe it is safe to use "daemon off" in prodcution. You can apply SIGWINCH fix using: http://trac.nginx.org/nginx/changeset/4020/nginx -- Igor Sysoev From igor at sysoev.ru Sat Sep 17 10:57:25 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 17 Sep 2011 14:57:25 +0400 Subject: daemon off in production In-Reply-To: <20110917104903.GA50310@nginx.com> References: <20110917104903.GA50310@nginx.com> Message-ID: <20110917105725.GB50310@nginx.com> On Sat, Sep 17, 2011 at 02:49:03PM +0400, Igor Sysoev wrote: > On Sat, Sep 17, 2011 at 07:40:19AM +0300, Yaniv Aknin wrote: > > Hi, > > > > The documentations says I should never run nginx with the daemon off setting > > in production. I would like to do so anyway so my Python/twisted based > > process manager will have an easier time knowing if nginx terminated or not > > (I know there are other ways to do it, but this seems like the easiest; if > > I'll be forced to, I'll use another way). > > > > I'm aware of SIGWINCH and nginx in general and especially after version > > 1.1.1, and I don't mind taking care of guaranteeing nginx will run without a > > controlling terminal (I will fork()/setsid() before exec()ing it), run in a > > sensible current working directory, etc. I just don't want it to do the > > daemonizing double fork. > > > > From skimming the code, it appears to me that nothing bad should happen. > > What am I missing? Why is it so bad to run nginx in the foreground in > > production? > > There are two directives: "master_process on|off" and "daemon on|off". > Both are used to simplify nginx development: while testing a bug/feature > I usually run nginx in foreground without master process and simply > press ^C to stop nginx. This is an analog of Apache's -X command line switch. > I did not want to type it in commanf line, so these two directives > have been introduced. > > There was thought to allow nginx to run in single process mode in production > as many lightweight server do. So there is some incomplete code to support > this fucntionality. But this code is incomplete, so you should never > use "master_process off" in production. > > As to "daemon off", I did not intend to use it in production (and never did), > but many people do it. I believe it is safe to use "daemon off" in > prodcution. You can apply SIGWINCH fix using: > > http://trac.nginx.org/nginx/changeset/4020/nginx The single option that is not available in "daemon off" mode is online upgrade, because after the upgrade you supervior can not control new nginx instance. -- Igor Sysoev From igor at sysoev.ru Sat Sep 17 10:59:01 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 17 Sep 2011 14:59:01 +0400 Subject: Help with AIO In-Reply-To: <20110916141002.GH14211@nginx.com> References: <20110906073352.GR1137@mdounin.ru> <20110916103907.GC14211@nginx.com> <20110916141002.GH14211@nginx.com> Message-ID: <20110917105900.GC50310@nginx.com> On Fri, Sep 16, 2011 at 06:10:02PM +0400, Igor Sysoev wrote: > On Fri, Sep 16, 2011 at 02:39:07PM +0400, Igor Sysoev wrote: > > On Thu, Sep 15, 2011 at 04:21:44PM +0200, Hagai Avrahami wrote: > > > Hi > > > > > > When benchmarking AIO read, I reached more than 1024 concurrent Async IO - > > > 1. I saw a weird error log > > > 2. Nginx did not fallback to regular blocking read > > > > > > I looked on the source code -- src/os/unix/ngx_linux_aio_read.c line:105 > > > and I think there is a problem in errno handling > > > > > > // Current Code > > > //---------------------------------------------------------------------------- > > > *n = io_submit(ngx_aio_ctx, 1, piocb); > > > > > > if (n == 1) { > > > ev->active = 1; > > > ev->ready = 0; > > > ev->complete = 0; > > > > > > return NGX_AGAIN; > > > } > > > > > > n = -n; <---------------------------------------------------------?? > > > > Thank you, this is a bug. I confused this with _syscall(2). > > Linux AIO fixed in these two commits: > > http://trac.nginx.org/nginx/changeset/4130/nginx > http://trac.nginx.org/nginx/changeset/4131/nginx > > Also I'm going to introduce the directive: > > events { > worker_aio_events 100; > } > > to set how much aio events worker may request to the kernel. > I'm going to set default value to 32 events per worker. > Currenly this value is hardcoded to 1024 and it seems it is too large, > since default /proc/sys/fs/aio-max-nr value is 65536 and this means > that you can run no more than 64 workers. I think it should be renamed to events { worker_aio_requests 100; } -- Igor Sysoev From agentzh at gmail.com Sat Sep 17 13:58:14 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 17 Sep 2011 21:58:14 +0800 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 4:53 PM, Nginx User wrote: > The configure script under the "for my $opt (@ARGV) {" loop covers a few > typical items and any others cause the "die "Invalid option $opt\n";" line > to be triggered. However, when in a Fedora/Enterprise Linux build > environment, the "%configure" macro in the spec file adds several other > switches (which work fine when building nginx directly). Which options do not work for you? The last part in that loop is actually: } elsif ($opt =~ /^--\w.*/) { push @ngx_opts, $opt; } else { die "Invalid option $opt\n"; } That is, any options starting with a /\w/ will be matched in the last 2nd condition and passed to nginx's configure script. > Can the upstream please consider?modifying? the configure script to allow > for these? > A possiblity is: > for my $opt (@ARGV) { > ... > ? ? } elsif ($opt =~ /^--build=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--host=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--target=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--program-prefix=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--exec-prefix=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--bindir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--sbindir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--sysconfdir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--datadir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--includedir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--libexecdir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--localstatedir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--sharedstatedir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--mandir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } elsif ($opt =~ /^--infodir=(.*)/) { > ? ? ? ? push @ngx_opts, $opt; > ? ? } else { > ? ? ? ? die "Invalid option $opt\n"; > ? ? } > } These options should be happily accepted by the last 2nd option. If not, please let me know :) > Also, can the upstream consider dropping version numbers from the folders in > the "bundle" directory and record the version numbers in a README? Would > save having to edit the spec file for every release. Okay, I'll remove version numbers in my build script in the next release of ngx_openresty :) > Finally, can the upstream consider allowing the with luajit option to be > selected but not to try to build luajit? I.E. set openresty up to use luajit > but have the luajit build done separately and not try to replace this by the > standard lua. I suppose the same applies to the standard lua. Basically, > third party applications should ideally be built separately and we would > look into creating seperate rpms for those. Will adding new options like --with-luajit=PATH and --with-lua51=PATH work for you? That is, telling ngx_openresty to use an external luajit or lua 5.1 build located by PATH? By default, ngx_openresty will continue try to build its bundled version of LuaJIT or Lua 5.1 and use it whenever possible and that's the whole point of a bundle ;) But I'm still willing to add special options to help RPM/Debian/etc packaging for sure :) > Can foresee some potential > knotty issues to overcome with this but if?distributing?an rpm, then there > are issues anyway. I'm very willing to help and solve any issues along the way ;) Thanks! -agentzh From agentzh at gmail.com Sat Sep 17 14:08:18 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 17 Sep 2011 22:08:18 +0800 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 4:53 PM, Nginx User wrote: > Also, can the upstream consider dropping version numbers from the folders in > the "bundle" directory and record the version numbers in a README? Would > save having to edit the spec file for every release. Just out of curiosity, why will you hard-code the directory names under bundle/ in your rpm spec file? Regards, -agentzh From nginx at nginxuser.net Sat Sep 17 14:43:17 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 17 Sep 2011 17:43:17 +0300 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 4:58 PM, agentzh wrote: > On Sat, Sep 17, 2011 at 4:53 PM, Nginx User wrote: > > The configure script under the "for my $opt (@ARGV) {" loop covers a few > > typical items and any others cause the "die "Invalid option $opt\n";" > line > > to be triggered. However, when in a Fedora/Enterprise Linux build > > environment, the "%configure" macro in the spec file adds several other > > switches (which work fine when building nginx directly). > > Which options do not work for you? The last part in that loop is actually: > > } elsif ($opt =~ /^--\w.*/) { > push @ngx_opts, $opt; > > } else { > die "Invalid option $opt\n"; > } > > That is, any options starting with a /\w/ will be matched in the last > 2nd condition and passed to nginx's configure script. > Correct and it matches all the "--with XYZ" and "--without XYZ" flags for nginx. > > Can the upstream please consider modifying the configure script to allow > > for these? > > A possiblity is: > > for my $opt (@ARGV) { > > ... > > } elsif ($opt =~ /^--build=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--host=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--target=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--program-prefix=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--exec-prefix=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--bindir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--sbindir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--sysconfdir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--datadir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--includedir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--libexecdir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--localstatedir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--sharedstatedir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--mandir=(.*)/) { > > push @ngx_opts, $opt; > > } elsif ($opt =~ /^--infodir=(.*)/) { > > push @ngx_opts, $opt; > > } else { > > die "Invalid option $opt\n"; > > } > > } > > These options should be happily accepted by the last 2nd option. If > not, please let me know :) > They are matched by the last option of 'die "Invalid option $opt\n";' . > > > Also, can the upstream consider dropping version numbers from the folders > in > > the "bundle" directory and record the version numbers in a README? Would > > save having to edit the spec file for every release. > > Okay, I'll remove version numbers in my build script in the next > release of ngx_openresty :) > No longer required thanks. > > > Finally, can the upstream consider allowing the with luajit option to be > > selected but not to try to build luajit? I.E. set openresty up to use > luajit > > but have the luajit build done separately and not try to replace this by > the > > standard lua. I suppose the same applies to the standard lua. Basically, > > third party applications should ideally be built separately and we would > > look into creating seperate rpms for those. > > Will adding new options like --with-luajit=PATH and --with-lua51=PATH > work for you? That is, telling ngx_openresty to use an external luajit > or lua 5.1 build located by PATH? > This should work. We can then switch piar this with --without luajit. We obviously want to keep the lua-rds-parser and lua-redis options. > > By default, ngx_openresty will continue try to build its bundled > version of LuaJIT or Lua 5.1 and use it whenever possible and that's > the whole point of a bundle ;) But I'm still willing to add special > options to help RPM/Debian/etc packaging for sure :) > > > Can foresee some potential > > knotty issues to overcome with this but if distributing an rpm, then > there > > are issues anyway. > > I'm very willing to help and solve any issues along the way ;) > > Thanks! > -agentzh > Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Sat Sep 17 15:22:03 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 17 Sep 2011 23:22:03 +0800 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 10:43 PM, Nginx User wrote: >> >> These options should be happily accepted by the last 2nd option. If >> not, please let me know :) > > > They are matched by the last option of 'die "Invalid option $opt\n";' . > I've just confirmed that at least "--includedir=PATH" and "--datadir=PATH" are accepted by ngx_openresty's configure script but rejected by nginx's configure script: ~/work/nginx-1.0.6 $ ./configure --includedir=/tmp/blah ./configure: error: invalid option "--includedir=/tmp/blah" ~/work/nginx-1.0.6 $ ./configure --datadir=/tmp/blah ./configure: error: invalid option "--datadir=/tmp/blah" Please note that the 'error: invalid option ".*"' messages *different* from the one output by 'die "Invalid option $opt\n";'. Regards, -agentzh From nginx at nginxuser.net Sat Sep 17 16:04:58 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 17 Sep 2011 19:04:58 +0300 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 6:42 PM, Nginx User wrote: > > > On Sat, Sep 17, 2011 at 6:22 PM, agentzh wrote: > >> On Sat, Sep 17, 2011 at 10:43 PM, Nginx User wrote: >> >> >> >> These options should be happily accepted by the last 2nd option. If >> >> not, please let me know :) >> > >> > >> > They are matched by the last option of 'die "Invalid option $opt\n";' . >> > >> >> I've just confirmed that at least "--includedir=PATH" and >> "--datadir=PATH" are accepted by ngx_openresty's configure script but >> rejected by nginx's configure script: >> >> ~/work/nginx-1.0.6 $ ./configure --includedir=/tmp/blah >> ./configure: error: invalid option "--includedir=/tmp/blah" >> >> ~/work/nginx-1.0.6 $ ./configure --datadir=/tmp/blah >> ./configure: error: invalid option "--datadir=/tmp/blah" >> >> Please note that the 'error: invalid option ".*"' messages >> *different* from the one output by 'die "Invalid option $opt\n";'. >> >> Regards, >> -agentzh >> > > Nginx configure script has to be patched for rpm build environment. > Below is the standard patch used. > > --- auto/cc/gcc.orig 2007-03-22 08:34:53.000000000 -0600 > +++ auto/cc/gcc 2007-03-22 08:58:47.000000000 -0600 > @@ -172,7 +172,9 @@ > > > # stop on warning > -CFLAGS="$CFLAGS -Werror" > +# This combined with Fedora's FORTIFY_SOURCE=2 option causes it nginx > +# to not compile. > +#CFLAGS="$CFLAGS -Werror" > > # debug > CFLAGS="$CFLAGS -g" > > > The standard outputs from the rpm %configure macro including all those > elements build fine after this when building nginx by itself. An example of > the typical spec file with this patch is > http://www4.atomicorp.com/channels/source/nginx/nginx.spec (they are not > up to date but it does work as is for 1.0.6 and should for the 1.1.x branch > as well. > > However things crash with the openresty configure as said. Specifically, > the message returned is for on "--build" which is the first one encountered. > Recreating the build machine at the moment so can't give specifics right > now. I'll try changing the text in 'die "Invalid option $opt\n";' when > having another go to verify whether it is actually this or not. Looking at > the code though, it seems clear that these extra options will fail at the > specified point. > > Thanks. > Hi. Just looking at the spec file example I linked to, I can see it is not using the rpm %configure macro. So you were on to something there. I suppose the only remaining valid request from my original post is the lua one. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Sat Sep 17 22:49:01 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sat, 17 Sep 2011 23:49:01 +0100 Subject: Problem with Hotlink Protection In-Reply-To: References: <0c253481fec8974edd546fbde9b7c383.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87d3eyyeci.wl%appa@perusio.net> On 16 Set 2011 19h47 WEST, nginx-forum at nginx.us wrote: > Thank you both! I totally agree with you, but as soon as I restrict > referer checking to the image.php script only, there is a flaw > appearing: image.php then gets downloaded by the browser instead of > displaying it. Do you have any idea why this happens? It would be > great if I could restrict the check only to this one .php file, but > - as said > - it does not work here... No I don't. If you replicated the FastCGI stuff it should work. The request should be sent upstream to the FastCGI listener that you have on port 9000. Your config had a strange thing. You used a try_files directive. That doesn't make sense unless you're serving the file directly or using another location (try_files does an internal redirect). My suggestion omitted that. The $fastcgi_script_name variable takes as value the $uri. In this case image.php. If you request http://www.mydomain.com/image.php?twg_album=album-05900-05999&twg_show=image-05995.jpg this location is used and the request is handled upstream bu the FastCGI process that will use image.php and whatever arguments you give. --- appa From agentzh at gmail.com Sun Sep 18 04:28:17 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 18 Sep 2011 12:28:17 +0800 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 11:42 PM, Nginx User wrote: > Nginx configure script has to be patched for rpm build environment. > Below is the standard patch used. > > --- auto/cc/gcc.orig 2007-03-22 08:34:53.000000000 -0600 > +++ auto/cc/gcc 2007-03-22 08:58:47.000000000 -0600 > @@ -172,7 +172,9 @@ > > > ?# stop on warning > -CFLAGS="$CFLAGS -Werror" > +# This combined with Fedora's FORTIFY_SOURCE=2 option causes it nginx > +# to not compile. > +#CFLAGS="$CFLAGS -Werror" > > ?# debug > ?CFLAGS="$CFLAGS -g" > The nginx core bundled by ngx_openresty has this patch as well. > The standard outputs from the rpm %configure macro including all those > elements build fine after this when building nginx by itself. An example of > the typical spec file with this patch > is?http://www4.atomicorp.com/channels/source/nginx/nginx.spec (they are not > up to date but it does work as is for 1.0.6 and should for the 1.1.x branch > as well. > However things crash with the openresty configure as said. Specifically, the > message returned is for on "--build" which is the first one encountered. The configure command in the RPM spec file you link to does not crash on my slackware linux x86_64 for ngx_openresty 1.0.6.5. I wonder what error messages are you getting? > Recreating the build machine at the moment so can't give specifics right > now. I'll try changing the text in?'die "Invalid option $opt\n";' when > having another go to verify whether it is actually this or not. Looking at > the code though, it seems clear that these extra options will fail at the > specified point. Why won't "--build" be matched by /^--\w.*/ in ngx_openresty's configure script? I've said extra options would be captured by the last 2nd condition and be passed verbatim to nginx's configure script and would not reach the last "die" statement there. Regards, -agentzh From agentzh at gmail.com Sun Sep 18 05:34:28 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 18 Sep 2011 13:34:28 +0800 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sat, Sep 17, 2011 at 10:43 PM, Nginx User wrote: > On Sat, Sep 17, 2011 at 4:58 PM, agentzh wrote: >> >> Will adding new options like --with-luajit=PATH and --with-lua51=PATH >> work for you? That is, telling ngx_openresty to use an external luajit >> or lua 5.1 build located by PATH? > > This should work. We can then switch piar this with --without luajit. We > obviously want to keep the lua-rds-parser and lua-redis options. > I've just added the --with-luajit=PATH and --with-lua51=PATH options to ngx_openresty's configure script and this update has already been included in the latest devel release, 1.0.6.7: http://openresty.org/#Download Please test it out to see if it fits your requirements :) All of those Lua modules bundled by ngx_openresty will still be built by default when either --with-luajit=PATH or --with-lua51=PATH is specified unless being explicitly disabled. Enjoy! -agentzh From nginx-forum at nginx.us Sun Sep 18 13:50:33 2011 From: nginx-forum at nginx.us (SergeyQw) Date: Sun, 18 Sep 2011 09:50:33 -0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <301b3dfe2d6e0ed1ad4bc5ca953cda63.NginxMailingListEnglish@forum.nginx.org> References: <20110910114625.GB18804@nginx.com> <2fa3cc7ba9e0e80774ea82240e53fde3.NginxMailingListEnglish@forum.nginx.org> <301b3dfe2d6e0ed1ad4bc5ca953cda63.NginxMailingListEnglish@forum.nginx.org> Message-ID: <75a98594b894ac906e6e9591c20459f9.NginxMailingListEnglish@forum.nginx.org> ?????? ????. ?? ?? ????????. Mac OS X Lion. ?????? ??????? ????? ????????? perl 5.12 ?? MacPorts. Summary of my perl5 (revision 5 version 12 subversion 3) configuration: Platform: osname=darwin, osvers=11.1.0, archname=darwin-multi-2level uname='darwin macbook-pro-sergey.local 11.1.0 darwin kernel version 11.1.0: tue jul 26 16:07:11 pdt 2011; root:xnu-1699.22.81~1release_x86_64 x86_64 ' config_args='-D inc_version_list=5.12.2/darwin-multi-2level 5.12.2 5.12.1/darwin-multi-2level 5.12.1 5.12.0/darwin-multi-2level 5.12.0 -des -Dprefix=/opt/local -Dscriptdir=/opt/local/bin -Dcppflags=-I/opt/local/include -Dccflags=-pipe -O2 -arch x86_64 -Dldflags=-L/opt/local/lib -arch x86_64 -Dvendorprefix=/opt/local -Dusemultiplicity=y -D cc=/Developer/usr/bin/llvm-gcc-4.2 -D ld=/Developer/usr/bin/llvm-gcc-4.2 -D man1ext=1pm -D man3ext=3pm -D man1dir=/opt/local/share/man/man1p -D man3dir=/opt/local/share/man/man3p -D siteman1dir=/opt/local/share/man/man1 -D siteman3dir=/opt/local/share/man/man3 -D vendorman1dir=/opt/local/share/man/man1 -D vendorman3dir=/opt/local/share/man/man3 -D pager=/usr/bin/less -sR' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/Developer/usr/bin/llvm-gcc-4.2', ccflags ='-pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include', optimize='-O3', cppflags='-I/opt/local/include -no-cpp-precomp -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include' ccversion='', gccversion='4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 /Developer/usr/bin/llvm-gcc-4.2', ldflags ='-L/opt/local/lib -arch x86_64 -fstack-protector' libpth=/opt/local/lib /usr/lib libs=-lgdbm -ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-L/opt/local/lib -arch x86_64 -bundle -undefined dynamic_lookup -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under darwin Compiled at Sep 18 2011 13:11:44 @INC: /opt/local/lib/perl5/site_perl/5.12.3/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.12.3 /opt/local/lib/perl5/vendor_perl/5.12.3/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.12.3 /opt/local/lib/perl5/5.12.3/darwin-multi-2level /opt/local/lib/perl5/5.12.3 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl ------------ ???????? nginx 1.0.6 ? nginx 1.1.3 ????????? ?? ?????????? ? perl ???????. ??? ?????? ??? ???????. ./configure \ --sbin-path=/usr/local/nginx/nginx \ --conf-path=/usr/local/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --with-http_perl_module --with-perl=/usr/bin/perl \ --with-http_ssl_module \ --with-pcre=../pcre-8.12 \ --with-zlib=../zlib-1.2.5 make In file included from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3336: error: expected specifier-qualifier-list before ?bool? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3419, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/regexp.h:612: error: expected specifier-qualifier-list before ?bool? /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/regexp.h:640: error: expected specifier-qualifier-list before ?bool? /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/regexp.h:700: error: expected specifier-qualifier-list before ?bool? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3428, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/cop.h:35: error: expected specifier-qualifier-list before ?bool? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3449, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/parser.h:47: error: expected specifier-qualifier-list before ?bool? In file included from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4196: error: expected declaration specifiers or ?...? before ?*? token cc1: warnings being treated as errors /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4196: warning: type defaults to ?int? in declaration of ?bool? /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4196: error: ?bool? declared as function returning a function In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4913, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:168: error: field ?Iutf8locale? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:169: error: field ?Irehash_seed_set? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:205: error: field ?Icolorset? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:206: error: field ?Idirty? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:209: error: field ?Itainted? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:233: error: field ?Iminus_c? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:234: error: field ?Iminus_n? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:235: error: field ?Iminus_p? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:236: error: field ?Iminus_l? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:237: error: field ?Iminus_a? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:238: error: field ?Iminus_F? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:239: error: field ?Idoswitches? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:240: error: field ?Iminus_E? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:252: error: field ?Idoextract? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:253: error: field ?Isawampersand? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:254: error: field ?Iunsafe? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:256: error: field ?Isrand_called? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:258: error: field ?Itainting? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:377: error: field ?Icv_has_eval? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:378: error: field ?Itaint_warn? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:421: error: field ?Iin_clean_objs? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:422: error: field ?Iin_clean_all? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:423: error: field ?Inomemok? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:424: error: field ?Isavebegin? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:494: error: field ?Icollation_standard? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:510: error: field ?Inumeric_standard? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:512: error: field ?Inumeric_local? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:558: error: field ?Ipad_reset_pending? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:710: error: expected specifier-qualifier-list before ?destroyable_proc_t? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4946, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:63: error: ?Perl_doing_taint? declared as function returning a function In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4946, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:176: error: ?Perl_av_exists? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:299: error: ?Perl_cando? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:544: error: ?Perl_do_aexec5? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:559: error: ?Perl_do_close? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:561: error: ?Perl_do_eof? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:600: error: ?Perl_do_exec3? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:669: error: ?Perl_do_open9? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:675: error: ?Perl_do_openn? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:680: error: ?Perl_do_print? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:692: error: ?Perl_do_seek? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1142: error: ?Perl_io_close? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1166: error: ?Perl_is_uni_alnum? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1170: error: ?Perl_is_uni_idfirst? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1174: error: ?Perl_is_uni_alpha? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1178: error: ?Perl_is_uni_ascii? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1182: error: ?Perl_is_uni_space? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1186: error: ?Perl_is_uni_cntrl? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1190: error: ?Perl_is_uni_graph? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1194: error: ?Perl_is_uni_digit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1198: error: ?Perl_is_uni_upper? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1202: error: ?Perl_is_uni_lower? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1206: error: ?Perl_is_uni_print? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1210: error: ?Perl_is_uni_punct? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1214: error: ?Perl_is_uni_xdigit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1242: error: ?Perl_is_uni_alnum_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1246: error: ?Perl_is_uni_idfirst_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1250: error: ?Perl_is_uni_alpha_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1254: error: ?Perl_is_uni_ascii_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1258: error: ?Perl_is_uni_space_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1262: error: ?Perl_is_uni_cntrl_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1266: error: ?Perl_is_uni_graph_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1270: error: ?Perl_is_uni_digit_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1274: error: ?Perl_is_uni_upper_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1278: error: ?Perl_is_uni_lower_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1282: error: ?Perl_is_uni_print_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1286: error: ?Perl_is_uni_punct_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1290: error: ?Perl_is_uni_xdigit_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1293: error: ?Perl_is_ascii_string? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1303: error: ?Perl_is_utf8_string? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1313: error: ?Perl_is_utf8_string_loclen? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1319: error: ?Perl_is_utf8_alnum? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1325: error: ?Perl_is_utf8_idfirst? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1331: error: ?Perl_is_utf8_idcont? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1337: error: ?Perl_is_utf8_alpha? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1343: error: ?Perl_is_utf8_ascii? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1349: error: ?Perl_is_utf8_space? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1355: error: ?Perl_is_utf8_perl_space? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1361: error: ?Perl_is_utf8_perl_word? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1367: error: ?Perl_is_utf8_cntrl? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1373: error: ?Perl_is_utf8_digit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1379: error: ?Perl_is_utf8_posix_digit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1385: error: ?Perl_is_utf8_graph? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1391: error: ?Perl_is_utf8_upper? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1397: error: ?Perl_is_utf8_lower? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1403: error: ?Perl_is_utf8_print? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1409: error: ?Perl_is_utf8_punct? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1415: error: ?Perl_is_utf8_xdigit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1421: error: ?Perl_is_utf8_mark? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1427: error: ?Perl_is_utf8_X_begin? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1433: error: ?Perl_is_utf8_X_extend? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1439: error: ?Perl_is_utf8_X_prepend? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1445: error: ?Perl_is_utf8_X_non_hangul? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1451: error: ?Perl_is_utf8_X_L? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1457: error: ?Perl_is_utf8_X_LV? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1463: error: ?Perl_is_utf8_X_LVT? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1469: error: ?Perl_is_utf8_X_LV_LVT_V? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1475: error: ?Perl_is_utf8_X_T? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1481: error: ?Perl_is_utf8_X_V? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1511: error: ?Perl_lex_bufutf8? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1538: error: ?Perl_lex_next_chunk? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1606: error: ?Perl_grok_numeric_radix? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:2410: error: ?Perl_vverify? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:2750: error: ?Perl_reg_named_buff_exists? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3135: error: ?Perl_sv_2bool? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3310: error: ?Perl_sv_derived_from? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3317: error: ?Perl_sv_does? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3421: error: ?Perl_sv_cat_decode? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3524: error: ?Perl_sv_tainted? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:4132: error: ?Perl_sv_utf8_downgrade? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:4142: error: ?Perl_sv_utf8_decode? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:4331: error: ?Perl_sv_destroyable? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6496: error: ?Perl_is_gv_magical_sv? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6504: error: ?Perl_stashpv_hvname_match? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6523: error: ?Perl_ckwarn? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6524: error: ?Perl_ckwarn_d? declared as function returning a function In file included from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3336: error: expected specifier-qualifier-list before ?bool? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3419, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/regexp.h:612: error: expected specifier-qualifier-list before ?bool? /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/regexp.h:640: error: expected specifier-qualifier-list before ?bool? /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/regexp.h:700: error: expected specifier-qualifier-list before ?bool? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3428, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/cop.h:35: error: expected specifier-qualifier-list before ?bool? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3449, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/parser.h:47: error: expected specifier-qualifier-list before ?bool? In file included from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4196: error: expected declaration specifiers or ?...? before ?*? token cc1: warnings being treated as errors /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4196: warning: type defaults to ?int? in declaration of ?bool? /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4196: error: ?bool? declared as function returning a function In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4913, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:168: error: field ?Iutf8locale? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:169: error: field ?Irehash_seed_set? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:205: error: field ?Icolorset? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:206: error: field ?Idirty? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:209: error: field ?Itainted? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:233: error: field ?Iminus_c? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:234: error: field ?Iminus_n? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:235: error: field ?Iminus_p? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:236: error: field ?Iminus_l? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:237: error: field ?Iminus_a? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:238: error: field ?Iminus_F? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:239: error: field ?Idoswitches? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:240: error: field ?Iminus_E? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:252: error: field ?Idoextract? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:253: error: field ?Isawampersand? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:254: error: field ?Iunsafe? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:256: error: field ?Isrand_called? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:258: error: field ?Itainting? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:377: error: field ?Icv_has_eval? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:378: error: field ?Itaint_warn? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:421: error: field ?Iin_clean_objs? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:422: error: field ?Iin_clean_all? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:423: error: field ?Inomemok? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:424: error: field ?Isavebegin? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:494: error: field ?Icollation_standard? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:510: error: field ?Inumeric_standard? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:512: error: field ?Inumeric_local? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:558: error: field ?Ipad_reset_pending? declared as a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/intrpvar.h:710: error: expected specifier-qualifier-list before ?destroyable_proc_t? In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4946, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:63: error: ?Perl_doing_taint? declared as function returning a function In file included from /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:4946, from src/http/modules/perl/ngx_http_perl_module.h:17, from src/http/modules/perl/ngx_http_perl_module.c:10: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:176: error: ?Perl_av_exists? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:299: error: ?Perl_cando? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:544: error: ?Perl_do_aexec5? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:559: error: ?Perl_do_close? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:561: error: ?Perl_do_eof? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:600: error: ?Perl_do_exec3? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:669: error: ?Perl_do_open9? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:675: error: ?Perl_do_openn? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:680: error: ?Perl_do_print? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:692: error: ?Perl_do_seek? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1142: error: ?Perl_io_close? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1166: error: ?Perl_is_uni_alnum? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1170: error: ?Perl_is_uni_idfirst? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1174: error: ?Perl_is_uni_alpha? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1178: error: ?Perl_is_uni_ascii? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1182: error: ?Perl_is_uni_space? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1186: error: ?Perl_is_uni_cntrl? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1190: error: ?Perl_is_uni_graph? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1194: error: ?Perl_is_uni_digit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1198: error: ?Perl_is_uni_upper? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1202: error: ?Perl_is_uni_lower? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1206: error: ?Perl_is_uni_print? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1210: error: ?Perl_is_uni_punct? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1214: error: ?Perl_is_uni_xdigit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1242: error: ?Perl_is_uni_alnum_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1246: error: ?Perl_is_uni_idfirst_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1250: error: ?Perl_is_uni_alpha_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1254: error: ?Perl_is_uni_ascii_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1258: error: ?Perl_is_uni_space_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1262: error: ?Perl_is_uni_cntrl_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1266: error: ?Perl_is_uni_graph_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1270: error: ?Perl_is_uni_digit_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1274: error: ?Perl_is_uni_upper_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1278: error: ?Perl_is_uni_lower_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1282: error: ?Perl_is_uni_print_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1286: error: ?Perl_is_uni_punct_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1290: error: ?Perl_is_uni_xdigit_lc? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1293: error: ?Perl_is_ascii_string? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1303: error: ?Perl_is_utf8_string? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1313: error: ?Perl_is_utf8_string_loclen? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1319: error: ?Perl_is_utf8_alnum? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1325: error: ?Perl_is_utf8_idfirst? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1331: error: ?Perl_is_utf8_idcont? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1337: error: ?Perl_is_utf8_alpha? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1343: error: ?Perl_is_utf8_ascii? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1349: error: ?Perl_is_utf8_space? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1355: error: ?Perl_is_utf8_perl_space? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1361: error: ?Perl_is_utf8_perl_word? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1367: error: ?Perl_is_utf8_cntrl? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1373: error: ?Perl_is_utf8_digit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1379: error: ?Perl_is_utf8_posix_digit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1385: error: ?Perl_is_utf8_graph? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1391: error: ?Perl_is_utf8_upper? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1397: error: ?Perl_is_utf8_lower? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1403: error: ?Perl_is_utf8_print? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1409: error: ?Perl_is_utf8_punct? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1415: error: ?Perl_is_utf8_xdigit? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1421: error: ?Perl_is_utf8_mark? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1427: error: ?Perl_is_utf8_X_begin? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1433: error: ?Perl_is_utf8_X_extend? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1439: error: ?Perl_is_utf8_X_prepend? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1445: error: ?Perl_is_utf8_X_non_hangul? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1451: error: ?Perl_is_utf8_X_L? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1457: error: ?Perl_is_utf8_X_LV? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1463: error: ?Perl_is_utf8_X_LVT? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1469: error: ?Perl_is_utf8_X_LV_LVT_V? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1475: error: ?Perl_is_utf8_X_T? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1481: error: ?Perl_is_utf8_X_V? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1511: error: ?Perl_lex_bufutf8? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1538: error: ?Perl_lex_next_chunk? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:1606: error: ?Perl_grok_numeric_radix? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:2410: error: ?Perl_vverify? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:2750: error: ?Perl_reg_named_buff_exists? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3135: error: ?Perl_sv_2bool? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3310: error: ?Perl_sv_derived_from? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3317: error: ?Perl_sv_does? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3421: error: ?Perl_sv_cat_decode? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:3524: error: ?Perl_sv_tainted? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:4132: error: ?Perl_sv_utf8_downgrade? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:4142: error: ?Perl_sv_utf8_decode? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:4331: error: ?Perl_sv_destroyable? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6496: error: ?Perl_is_gv_magical_sv? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6504: error: ?Perl_stashpv_hvname_match? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6523: error: ?Perl_ckwarn? declared as function returning a function /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/proto.h:6524: error: ?Perl_ckwarn_d? declared as function returning a function ? ?????? ?? ??????? ????? ??? ??????? ????????? ??? ???????? ????. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215048,215355#msg-215355 From mdounin at mdounin.ru Sun Sep 18 14:10:54 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 18 Sep 2011 18:10:54 +0400 Subject: nginx 1.0.6 perl module build failure In-Reply-To: <75a98594b894ac906e6e9591c20459f9.NginxMailingListEnglish@forum.nginx.org> References: <20110910114625.GB18804@nginx.com> <2fa3cc7ba9e0e80774ea82240e53fde3.NginxMailingListEnglish@forum.nginx.org> <301b3dfe2d6e0ed1ad4bc5ca953cda63.NginxMailingListEnglish@forum.nginx.org> <75a98594b894ac906e6e9591c20459f9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110918141054.GW1137@mdounin.ru> Hello! On Sun, Sep 18, 2011 at 09:50:33AM -0400, SergeyQw wrote: > ?????? ????. ?? ?? ????????. This is English mailing list, please don't write in Russian here. > Mac OS X Lion. > ?????? ??????? ????? ????????? perl 5.12 ?? > MacPorts. [...] > ./configure \ > --sbin-path=/usr/local/nginx/nginx \ > --conf-path=/usr/local/nginx/nginx.conf \ > --error-log-path=/var/log/nginx/error.log \ > --http-log-path=/var/log/nginx/access.log \ > --pid-path=/var/run/nginx.pid \ > --lock-path=/var/lock/nginx.lock \ > --with-http_perl_module --with-perl=/usr/bin/perl \ You are building with system perl, not MacPorts one. Make sure to use path to correct perl binary in --with-perl configure argument. > --with-http_ssl_module \ > --with-pcre=../pcre-8.12 \ > --with-zlib=../zlib-1.2.5 > > > make > > In file included from src/http/modules/perl/ngx_http_perl_module.h:17, > from src/http/modules/perl/ngx_http_perl_module.c:10: > /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/perl.h:3336: > error: expected specifier-qualifier-list before ?bool? [...] > ? ?????? ?? ??????? ????? ??? ??????? > ????????? ??? ???????? ????. 1. You need to build with perl from MacPorts. 2. With Perl 5.8 and 5.10 from MacPorts it builds fine out of the box. For Perl 5.12 and 5.14 (from MacPorts) you need patch posted earlier in this thread. Maxim Dounin From nginx at nginxuser.net Sun Sep 18 16:18:20 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 18 Sep 2011 19:18:20 +0300 Subject: Openresty downstream bundle maintenance requests In-Reply-To: References: Message-ID: On Sun, Sep 18, 2011 at 8:34 AM, agentzh wrote: > On Sat, Sep 17, 2011 at 10:43 PM, Nginx User wrote: > > On Sat, Sep 17, 2011 at 4:58 PM, agentzh wrote: > >> > >> Will adding new options like --with-luajit=PATH and --with-lua51=PATH > >> work for you? That is, telling ngx_openresty to use an external luajit > >> or lua 5.1 build located by PATH? > > > > This should work. We can then switch piar this with --without luajit. We > > obviously want to keep the lua-rds-parser and lua-redis options. > > > > I've just added the --with-luajit=PATH and --with-lua51=PATH options > to ngx_openresty's configure script and this update has already been > included in the latest devel release, 1.0.6.7: > > http://openresty.org/#Download > > Please test it out to see if it fits your requirements :) All of those > Lua modules bundled by ngx_openresty will still be built by default > when either --with-luajit=PATH or --with-lua51=PATH is specified > unless being explicitly disabled. > > Enjoy! > -agentzh > Hi. I'll have a go later. Just as an update, please ignore the other requests. The only one that needed attention was this lua related one. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Sep 18 18:05:36 2011 From: nginx-forum at nginx.us (jthaddeusc) Date: Sun, 18 Sep 2011 14:05:36 -0400 Subject: GET, POST, COOKIE methods same as Apache? Message-ID: Hi, New to Nginx and Rails. Are GET, POST, and COOKIE the same as Apache? Will using POST in a form convert data into a hash/array? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215359,215359#msg-215359 From magicbearmo at gmail.com Sun Sep 18 19:54:15 2011 From: magicbearmo at gmail.com (MagicBear) Date: Mon, 19 Sep 2011 03:54:15 +0800 Subject: GET, POST, COOKIE methods same as Apache? In-Reply-To: References: Message-ID: yes, that is standard MagicBear 2011/9/19 jthaddeusc : > Hi, > > New to Nginx and Rails. > > Are GET, POST, and COOKIE the same as Apache? Will using POST in a form > convert data into a hash/array? > > Thanks! > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215359,215359#msg-215359 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Sun Sep 18 23:28:29 2011 From: nginx-forum at nginx.us (raffo) Date: Sun, 18 Sep 2011 19:28:29 -0400 Subject: $request_filename rename in download Message-ID: <6b99d39b79d9df564cfc861c894d6efd.NginxMailingListEnglish@forum.nginx.org> Hi, I have created a public proxy with nginx but when i download files like "proxy.*****.com/?url=google.com/images/logo_sm.gif" the filename "logo_sm.gif" it's not save in browse as the real name but with the name: "download". I need a rewrite rules that rename the filename with $args of url. Eg: site.tld/?url=proxed.tld/file.zip the file.zip will be downloaded as "download" name, not with file.zip name. So i need a rule that rename the file with another with: site.tld/?url=proxed.tld/file.zip&=filename.zip This is very easy for who know rewrite of nginx, i searn a lot of combination but i loss only time.. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215361,215361#msg-215361 From wendal1985 at gmail.com Mon Sep 19 05:56:28 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Mon, 19 Sep 2011 13:56:28 +0800 Subject: [ANN] ngx_drizzle v0.1.1: fixed segfaults on 32-bit systems In-Reply-To: References: Message-ID: Great 2011/9/17 agentzh > Hi, folks! > > I'm happy to announce that ngx_drizzle v0.1.1 has been released. You > can download the latest release tarball from > > https://github.com/chaoslawful/drizzle-nginx-module/downloads > > This release fixed a long-standing segmentation fault on 32-bit > systems, as well as some other issues. Here goes the complete change > log: > > * fixed segmentation faults on 32-bit systems. thanks @??? and > @stefanli for reporting this issue. > * documented the $drizzle_thread_id variable. > * added lots of debug outputs (enabled by the --with-debug option > while building Nginx or OpenResty), inspired by github issue #10. > * fixed issues regarding defining global variables in C header files: > we should have defined rds_rough_col_type_t as a type rather than a > global variable. thanks @???. > * documented the python -> python3 pitfall while building libdrizzle > 1.0 on at least ArchLinux. > * fixed the automatic libdrizzle searching algorithm in the config > file: now we should look under libdrizzle-1.0/ instead. thanks ??? > (Calio) for reporting this issue. > > ngx_drizzle is an nginx upstream module integrating libdrizzle into > Nginx in a non-blocking and streamming way. > > Essentially it provides a very efficient and flexible way for nginx > internals to access MySQL, Drizzle, as well as other RDBMS's that > support the Drizzle or MySQL wired protocol. Also it can serve as a > direct REST interface to those RDBMS backends. > > This module does not generate human-readable outputs, rather, in a > binary format called Resty-DBD-Stream (RDS) designed by ourselves. You > usually need other components, like ngx_rds_json [1], ngx_rds_csv [2], > or lua-rds-parser [3], to work with this module. See the RDS output > format spec for more details: > http://wiki.nginx.org/HttpDrizzleModule#Output_Format > > You can find the complete documentation for ngx_drizzle on Nginx Wiki: > > http://wiki.nginx.org/HttpDrizzleModule > > and the latest source is on GitHub: > > https://github.com/chaoslawful/drizzle-nginx-module > > This module is also bundled (though not enabled by default) by the > ngx_openresty bundle: > > http://openresty.org/ > > You can check out this wiki page to enable this component while > building ngx_openresty: > > http://openresty.org/#DrizzleNginxModule > > Have fun! > -agentzh > > [1] https://github.com/agentzh/rds-json-nginx-module > [2] https://github.com/agentzh/rds-csv-nginx-module > [3] https://github.com/agentzh/lua-rds-parser > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From amoiz.shine at gmail.com Mon Sep 19 05:59:42 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Mon, 19 Sep 2011 13:59:42 +0800 Subject: [ANN] ngx_drizzle v0.1.1: fixed segfaults on 32-bit systems In-Reply-To: References: Message-ID: <1316411982.5414.1.camel@sharl-desktop> ? 2011-09-19?? 13:56 +0800?Wendal Chen??? > Great > > 2011/9/17 agentzh > Hi, folks! > > I'm happy to announce that ngx_drizzle v0.1.1 has been > released. You > can download the latest release tarball from > > > https://github.com/chaoslawful/drizzle-nginx-module/downloads > > This release fixed a long-standing segmentation fault on > 32-bit > systems, as well as some other issues. Here goes the complete > change > log: > > * fixed segmentation faults on 32-bit systems. thanks @??? > and > @stefanli for reporting this issue. > * documented the $drizzle_thread_id variable. > * added lots of debug outputs (enabled by the --with-debug > option > while building Nginx or OpenResty), inspired by github issue > #10. > * fixed issues regarding defining global variables in C header > files: > we should have defined rds_rough_col_type_t as a type rather > than a > global variable. thanks @???. > * documented the python -> python3 pitfall while building > libdrizzle > 1.0 on at least ArchLinux. > * fixed the automatic libdrizzle searching algorithm in the > config > file: now we should look under libdrizzle-1.0/ instead. thanks > ??? > (Calio) for reporting this issue. > > ngx_drizzle is an nginx upstream module integrating libdrizzle > into > Nginx in a non-blocking and streamming way. > > Essentially it provides a very efficient and flexible way for > nginx > internals to access MySQL, Drizzle, as well as other RDBMS's > that > support the Drizzle or MySQL wired protocol. Also it can serve > as a > direct REST interface to those RDBMS backends. > > This module does not generate human-readable outputs, rather, > in a > binary format called Resty-DBD-Stream (RDS) designed by > ourselves. You > usually need other components, like ngx_rds_json [1], > ngx_rds_csv [2], > or lua-rds-parser [3], to work with this module. See the RDS > output > format spec for more details: > http://wiki.nginx.org/HttpDrizzleModule#Output_Format > > You can find the complete documentation for ngx_drizzle on > Nginx Wiki: > > http://wiki.nginx.org/HttpDrizzleModule > > and the latest source is on GitHub: > > https://github.com/chaoslawful/drizzle-nginx-module > > This module is also bundled (though not enabled by default) by > the > ngx_openresty bundle: > > http://openresty.org/ > > You can check out this wiki page to enable this component > while > building ngx_openresty: > > http://openresty.org/#DrizzleNginxModule > > Have fun! > -agentzh > > [1] https://github.com/agentzh/rds-json-nginx-module > [2] https://github.com/agentzh/rds-csv-nginx-module > [3] https://github.com/agentzh/lua-rds-parser > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > > -- > Wendal Chen > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Thanks for your great work of mod_ngx_drizzle! ???????????????????? ????????? -- Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) Using Gmail? Please read this important notice: http://www.fsf.org/campaigns/jstrap/gmail?10073. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: This is a digitally signed message part URL: From wendal1985 at gmail.com Mon Sep 19 06:02:40 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Mon, 19 Sep 2011 14:02:40 +0800 Subject: [ANN] ngx_drizzle v0.1.1: fixed segfaults on 32-bit systems In-Reply-To: <1316411982.5414.1.camel@sharl-desktop> References: <1316411982.5414.1.camel@sharl-desktop> Message-ID: ??????????, ?????????,????, cool~~ 2011/9/19 Sharl.Jimh.Tsin > ? 2011-09-19?? 13:56 +0800?Wendal Chen??? > > Great > > > > 2011/9/17 agentzh > > Hi, folks! > > > > I'm happy to announce that ngx_drizzle v0.1.1 has been > > released. You > > can download the latest release tarball from > > > > > > https://github.com/chaoslawful/drizzle-nginx-module/downloads > > > > This release fixed a long-standing segmentation fault on > > 32-bit > > systems, as well as some other issues. Here goes the complete > > change > > log: > > > > * fixed segmentation faults on 32-bit systems. thanks @??? > > and > > @stefanli for reporting this issue. > > * documented the $drizzle_thread_id variable. > > * added lots of debug outputs (enabled by the --with-debug > > option > > while building Nginx or OpenResty), inspired by github issue > > #10. > > * fixed issues regarding defining global variables in C header > > files: > > we should have defined rds_rough_col_type_t as a type rather > > than a > > global variable. thanks @???. > > * documented the python -> python3 pitfall while building > > libdrizzle > > 1.0 on at least ArchLinux. > > * fixed the automatic libdrizzle searching algorithm in the > > config > > file: now we should look under libdrizzle-1.0/ instead. thanks > > ??? > > (Calio) for reporting this issue. > > > > ngx_drizzle is an nginx upstream module integrating libdrizzle > > into > > Nginx in a non-blocking and streamming way. > > > > Essentially it provides a very efficient and flexible way for > > nginx > > internals to access MySQL, Drizzle, as well as other RDBMS's > > that > > support the Drizzle or MySQL wired protocol. Also it can serve > > as a > > direct REST interface to those RDBMS backends. > > > > This module does not generate human-readable outputs, rather, > > in a > > binary format called Resty-DBD-Stream (RDS) designed by > > ourselves. You > > usually need other components, like ngx_rds_json [1], > > ngx_rds_csv [2], > > or lua-rds-parser [3], to work with this module. See the RDS > > output > > format spec for more details: > > http://wiki.nginx.org/HttpDrizzleModule#Output_Format > > > > You can find the complete documentation for ngx_drizzle on > > Nginx Wiki: > > > > http://wiki.nginx.org/HttpDrizzleModule > > > > and the latest source is on GitHub: > > > > https://github.com/chaoslawful/drizzle-nginx-module > > > > This module is also bundled (though not enabled by default) by > > the > > ngx_openresty bundle: > > > > http://openresty.org/ > > > > You can check out this wiki page to enable this component > > while > > building ngx_openresty: > > > > http://openresty.org/#DrizzleNginxModule > > > > Have fun! > > -agentzh > > > > [1] https://github.com/agentzh/rds-json-nginx-module > > [2] https://github.com/agentzh/rds-csv-nginx-module > > [3] https://github.com/agentzh/lua-rds-parser > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > -- > > Wendal Chen > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > Thanks for your great work of mod_ngx_drizzle! > > ???????????????????? ????????? > > -- > Best regards, > Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) > > Using Gmail? Please read this important notice: > http://www.fsf.org/campaigns/jstrap/gmail?10073. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Sep 19 09:26:34 2011 From: nginx-forum at nginx.us (liushaobo) Date: Mon, 19 Sep 2011 05:26:34 -0400 Subject: nginx : segfault at Message-ID: hi,all message log , I ask why ? use nginx-1.0.4-1 ?thanks, Sep 18 15:43:29 web kernel: nginx[794]: segfault at 00007fff4ca24fd8 rip 0000003ea681398b rsp 00007fff4ca24fb0 error 6 Sep 18 16:39:03 web kernel: nginx[800]: segfault at 00007fff4ca24ff8 rip 0000003ea6812a65 rsp 00007fff4ca25000 error 6 Sep 18 21:59:17 web kernel: nginx[799]: segfault at 00007fff4ca24ff8 rip 0000003ea6812a65 rsp 00007fff4ca25000 error 6 Sep 18 23:18:47 web kernel: nginx[10573]: segfault at 00007fff4ca24ff8 rip 0000003ea68139c2 rsp 00007fff4ca25000 error 6 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215370,215370#msg-215370 From nginx-forum at nginx.us Mon Sep 19 09:31:59 2011 From: nginx-forum at nginx.us (liushaobo) Date: Mon, 19 Sep 2011 05:31:59 -0400 Subject: nginx : segfault at In-Reply-To: References: Message-ID: <2b6d0227c6c5ad5f93364f18d255a7de.NginxMailingListEnglish@forum.nginx.org> # nginx -V nginx: nginx version: nginx/1.0.4 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) nginx: TLS SNI support disabled nginx: configure arguments: --user=www --group=www --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --add-module=/usr/src/redhat/BUILD/nginx-1.0.4/nginx-upstream-fair Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215370,215371#msg-215371 From webwindy at gmail.com Mon Sep 19 10:02:00 2011 From: webwindy at gmail.com (C.F) Date: Mon, 19 Sep 2011 18:02:00 +0800 Subject: $request_filename rename in download In-Reply-To: <6b99d39b79d9df564cfc861c894d6efd.NginxMailingListEnglish@forum.nginx.org> References: <6b99d39b79d9df564cfc861c894d6efd.NginxMailingListEnglish@forum.nginx.org> Message-ID: try it key=filename add_header Content-Disposition "attachment; filename=$arg_key"; 2011/9/19 raffo > Hi, > > I have created a public proxy with nginx but when i download files like > "proxy.*****.com/?url=google.com/images/logo_sm.gif" the filename > "logo_sm.gif" it's not save in browse as the real name but with the > name: "download". > > I need a rewrite rules that rename the filename with $args of url. > Eg: > site.tld/?url=proxed.tld/file.zip > > the file.zip will be downloaded as "download" name, not with file.zip > name. So i need a rule that rename the file with another with: > site.tld/?url=proxed.tld/file.zip&=filename.zip > > This is very easy for who know rewrite of nginx, i searn a lot of > combination but i loss only time.. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215361,215361#msg-215361 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Sep 19 11:03:13 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 19 Sep 2011 15:03:13 +0400 Subject: nginx : segfault at In-Reply-To: References: Message-ID: <20110919110312.GY1137@mdounin.ru> Hello! On Mon, Sep 19, 2011 at 05:26:34AM -0400, liushaobo wrote: > hi,all > > message log , I ask why ? use nginx-1.0.4-1 ?thanks, > > Sep 18 15:43:29 web kernel: nginx[794]: segfault at 00007fff4ca24fd8 rip > 0000003ea681398b rsp 00007fff4ca24fb0 error 6 > Sep 18 16:39:03 web kernel: nginx[800]: segfault at 00007fff4ca24ff8 rip > 0000003ea6812a65 rsp 00007fff4ca25000 error 6 > Sep 18 21:59:17 web kernel: nginx[799]: segfault at 00007fff4ca24ff8 rip > 0000003ea6812a65 rsp 00007fff4ca25000 error 6 > Sep 18 23:18:47 web kernel: nginx[10573]: segfault at 00007fff4ca24ff8 > rip 0000003ea68139c2 rsp 00007fff4ca25000 error 6 Please upgrade to at least 1.0.6 (latest stable), there are several segmentation faults fixed in it since 1.0.4. If it doesn't help, please upgrade to 1.1.3 (latest devel), there are fixes for several segmentation faults which weren't yet merged into stable branch. If it doesn't help either, please follow procedure described here: http://wiki.nginx.org/Debugging#Asking_for_help Notably, please provide nginx -V output, full config and stack trace for segfaults you see. Maxim Dounin From nginx-forum at nginx.us Mon Sep 19 14:29:29 2011 From: nginx-forum at nginx.us (dullnicker) Date: Mon, 19 Sep 2011 10:29:29 -0400 Subject: How to tune nginx for 800-1200 concurrent connections? Message-ID: Dear all, I run nginx as stand-alone webserver (not as Apache proxy) on an image gallery website. The server has to handle up to 1,200 concurrent connections on Port 80, the average number throughout the day is around 500-600. During peak times, the server suffers a bit under its load and I wonder whether there is anything that I can do to decrease the load by tuning the nginx config. I should add that Apache went nuts handling the site and therefore nginx is already a great relief to have. The site has just around 3,000 unique visitors but up to 250,000 pageviews per day. Here are the relevant server specs: -------------------------------------------- 4 cores at 2.1 GHz 1 GB RAM (average free RAM is around 800 MB even during peak times) Here is my current nginx.conf: ------------------------------------- user nginx nginx; worker_processes 8; # default: 2 error_log logs/error.log; pid logs/nginx.pid; events { worker_connections 2048; # default: 1024 } http { include mime.types; default_type application/octet-stream; client_max_body_size 64M; sendfile on; tcp_nopush on; keepalive_timeout 20; #default: 3 gzip on; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; server_tokens off; include /etc/nginx/conf.d/*; } Here are the fastcgi settings (The gallery is heavily PHP-driven): ------------------------------------------------------------------------------ include fastcgi_params; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri =404; fastcgi_pass 127.0.0.1:9000; I would appreciate your comments and suggestions a lot - Thank you very much in advance! Kind regards -A Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215383,215383#msg-215383 From mat999 at gmail.com Mon Sep 19 14:52:08 2011 From: mat999 at gmail.com (SplitIce) Date: Tue, 20 Sep 2011 00:52:08 +1000 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: are the images served through PHP? if so make them static and it will increase thoughrougput by tons. Additionally you could possibly reduce worker_processes to 4-6 to reduce context switching. On Tue, Sep 20, 2011 at 12:29 AM, dullnicker wrote: > Dear all, > > I run nginx as stand-alone webserver (not as Apache proxy) on an image > gallery website. The server has to handle up to 1,200 concurrent > connections on Port 80, the average number throughout the day is around > 500-600. During peak times, the server suffers a bit under its load and > I wonder whether there is anything that I can do to decrease the load by > tuning the nginx config. I should add that Apache went nuts handling the > site and therefore nginx is already a great relief to have. The site has > just around 3,000 unique visitors but up to 250,000 pageviews per day. > > Here are the relevant server specs: > -------------------------------------------- > 4 cores at 2.1 GHz > 1 GB RAM (average free RAM is around 800 MB even during peak times) > > Here is my current nginx.conf: > ------------------------------------- > > user nginx nginx; > worker_processes 8; # default: 2 > > > error_log logs/error.log; > > pid logs/nginx.pid; > > events { > worker_connections 2048; # default: 1024 > } > > http { > include mime.types; > default_type application/octet-stream; > client_max_body_size 64M; > sendfile on; > tcp_nopush on; > > keepalive_timeout 20; #default: 3 > > gzip on; > gzip_comp_level 2; > gzip_proxied any; > gzip_types text/plain text/css application/x-javascript > text/xml application/xml application/xml+rss text/javascript; > > server_tokens off; > > include /etc/nginx/conf.d/*; > } > > Here are the fastcgi settings (The gallery is heavily PHP-driven): > > ------------------------------------------------------------------------------ > > include fastcgi_params; > fastcgi_intercept_errors on; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > try_files $uri =404; > fastcgi_pass 127.0.0.1:9000; > > I would appreciate your comments and suggestions a lot - Thank you very > much in advance! > > Kind regards > -A > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215383,215383#msg-215383 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From al-nginx at none.at Mon Sep 19 19:56:19 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Mon, 19 Sep 2011 21:56:19 +0200 Subject: ssl benchmarks with and without nginx Message-ID: <20110919195619.GB6932@none.at> Dear Reader, today on the haproxy list was this link posted http://blog.exceliance.fr/2011/09/16/benchmarking_ssl_performance/ I have asked why they not have tried to use nginx the answer was another link http://vincent.bernat.im/en/blog/2011-ssl-benchmark.html Maybe someone can verify if there is really a problem in nginx or this difference is due to the fact that nginx is a REAL Webserver and the other both 'only' SSL-Terminator. BR Aleks From j at jjb.cc Mon Sep 19 20:40:05 2011 From: j at jjb.cc (John Joseph Bachir) Date: Mon, 19 Sep 2011 16:40:05 -0400 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: * might consider turning up keepalive to 65 * depending on the nature of your content you might want to turn up when it expires -- example: expires 10m; * looks like you have 2 workers per core -- typically a worker process per core is recommended (or maybe your have intel cores with "hyerthreding", in which case maybe 8 is the more relevant # * what's your cpu load like? is your server cpu-bound or is IO the problem? if you can find some way to do fewer disk reads and more ram reads that will help -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Sep 19 22:20:14 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Sep 2011 02:20:14 +0400 Subject: ssl benchmarks with and without nginx In-Reply-To: <20110919195619.GB6932@none.at> References: <20110919195619.GB6932@none.at> Message-ID: <20110919222014.GH1137@mdounin.ru> Hello! On Mon, Sep 19, 2011 at 09:56:19PM +0200, Aleksandar Lazic wrote: > Dear Reader, > > today on the haproxy list was this link posted > > http://blog.exceliance.fr/2011/09/16/benchmarking_ssl_performance/ > > I have asked why they not have tried to use nginx the answer was another > link > > http://vincent.bernat.im/en/blog/2011-ssl-benchmark.html > > Maybe someone can verify if there is really a problem in nginx or this > difference is due to the fact that nginx is a REAL Webserver and the > other both 'only' SSL-Terminator. The main problem I see is nginx configuration. By default nginx is configured to handle real-word load, not for ssl session microbenchmarks. And the config used in particular test makes things even worse due to "multi_accept on" used. For microbenchmarking ssl one want to use events { accept_mutext off; multi_accept off; ... } to ensure better distribution of connections between worker processes, this should resolve observed latency issues. Maxim Dounin p.s. Stunnel in the same test was obviously benchmarked with non-threaded OpenSSL, and that's why it doesn't scale to multiple CPUs. With properly compiled OpenSSL it will scale fine. From zjay1987 at gmail.com Tue Sep 20 06:22:18 2011 From: zjay1987 at gmail.com (li zJay) Date: Tue, 20 Sep 2011 14:22:18 +0800 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: I think the bottleneck may be the PHP, it is a piece of cake for ngx to handle 1k concurrent connections without any special tuning. On Tue, Sep 20, 2011 at 4:40 AM, John Joseph Bachir wrote: > * might consider turning up keepalive to 65 > * depending on the nature of your content you might want to turn up when it > expires -- example: expires 10m; > * looks like you have 2 workers per core -- typically a worker process per > core is recommended (or maybe your have intel cores with "hyerthreding", in > which case maybe 8 is the more relevant # > * what's your cpu load like? is your server cpu-bound or is IO the > problem? if you can find some way to do fewer disk reads and more ram reads > that will help > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomlove at gmail.com Tue Sep 20 08:14:16 2011 From: tomlove at gmail.com (Thomas Love) Date: Tue, 20 Sep 2011 10:14:16 +0200 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: On 19 September 2011 16:29, dullnicker wrote: > Dear all, > > I run nginx as stand-alone webserver (not as Apache proxy) on an image > gallery website. The server has to handle up to 1,200 concurrent > connections on Port 80, the average number throughout the day is around > 500-600. > The site has > just around 3,000 unique visitors but up to 250,000 pageviews per day. > So 80+ hits per person per day and 3 per second, but 550 concurrent connections? I haven't seen a pattern like this before and I'd be interested to know how it works. There may be ways to optimize the application for it. I wouldn't expect nginx to be the problem though. If any significant portion of that concurrency is being held by PHP, that'll be tying up a lot of resources. Thomas From igor at sysoev.ru Tue Sep 20 11:22:25 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 20 Sep 2011 15:22:25 +0400 Subject: nginx-1.1.4 Message-ID: <20110920112225.GC54733@nginx.com> Changes with nginx 1.1.4 20 Sep 2011 *) Feature: the ngx_http_upstream_keepalive module. *) Feature: the "proxy_http_version" directive. *) Feature: the "fastcgi_keep_conn" directive. *) Feature: the "worker_aio_requests" directive. *) Bugfix: if nginx was built --with-file-aio it could not be run on Linux kernel which did not support AIO. *) Bugfix: in Linux AIO error processing. Thanks to Hagai Avrahami. *) Bugfix: reduced memory consumption for long-lived requests. *) Bugfix: the module ngx_http_mp4_module did not support 64-bit MP4 "co64" atom. -- Igor Sysoev From mdounin at mdounin.ru Tue Sep 20 11:40:04 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Sep 2011 15:40:04 +0400 Subject: nginx-1.1.4 In-Reply-To: <20110920112225.GC54733@nginx.com> References: <20110920112225.GC54733@nginx.com> Message-ID: <20110920114004.GO1137@mdounin.ru> Hello! On Tue, Sep 20, 2011 at 03:22:25PM +0400, Igor Sysoev wrote: > Changes with nginx 1.1.4 20 Sep 2011 > > *) Feature: the ngx_http_upstream_keepalive module. [...] > *) Bugfix: reduced memory consumption for long-lived requests. [...] Note to module developers: this release introduces several API changes which may affect 3rd party modules. Please review svn commits for details. Most intresting commits are: http://trac.nginx.org/nginx/changeset/4115/nginx (ngx_chain_update_chains() api change) http://trac.nginx.org/nginx/changeset/4117/nginx http://trac.nginx.org/nginx/changeset/4118/nginx http://trac.nginx.org/nginx/changeset/4119/nginx http://trac.nginx.org/nginx/changeset/4120/nginx (various upstream module related changes) Maxim Dounin From b.yordanov at exsisto.com Tue Sep 20 12:12:00 2011 From: b.yordanov at exsisto.com (Boyko Yordanov) Date: Tue, 20 Sep 2011 15:12:00 +0300 Subject: nginx-1.1.4 In-Reply-To: <20110920114004.GO1137@mdounin.ru> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> Message-ID: <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> Thanks to both of you, Boyko From usirsiwal at verivue.com Tue Sep 20 12:29:06 2011 From: usirsiwal at verivue.com (Sirsiwal, Umesh) Date: Tue, 20 Sep 2011 08:29:06 -0400 Subject: nginx-1.1.4 In-Reply-To: <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru>, <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> Message-ID: Thanks to both of you. Great work. If I understand correctly, the only way to use upstream_keepalive module is with upstream module. This implies I cannot use upstream_keepalive where the upstream is identified by a variable. For example: proxy_pass http://$host$request_uri; Is my understand correct? Is there a way around this restriction? -Umesh ________________________________________ From: nginx-bounces at nginx.org [nginx-bounces at nginx.org] On Behalf Of Boyko Yordanov [b.yordanov at exsisto.com] Sent: Tuesday, September 20, 2011 8:12 AM To: nginx at nginx.org Cc: nginx-devel at nginx.org Subject: Re: nginx-1.1.4 Thanks to both of you, Boyko _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Tue Sep 20 12:52:19 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Sep 2011 16:52:19 +0400 Subject: nginx-1.1.4 In-Reply-To: References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> Message-ID: <20110920125219.GP1137@mdounin.ru> Hello! On Tue, Sep 20, 2011 at 08:29:06AM -0400, Sirsiwal, Umesh wrote: > Thanks to both of you. Great work. > > If I understand correctly, the only way to use > upstream_keepalive module is with upstream module. This implies > I cannot use upstream_keepalive where the upstream is identified > by a variable. For example: > > proxy_pass http://$host$request_uri; > > Is my understand correct? Yes. > Is there a way around this restriction? Currently no. Maxim Dounin From wendal1985 at gmail.com Tue Sep 20 14:06:11 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Tue, 20 Sep 2011 22:06:11 +0800 Subject: nginx-1.1.4 In-Reply-To: <20110920125219.GP1137@mdounin.ru> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> <20110920125219.GP1137@mdounin.ru> Message-ID: Great !! finally, upstream_keepalive is supported!! 2011/9/20 Maxim Dounin > Hello! > > On Tue, Sep 20, 2011 at 08:29:06AM -0400, Sirsiwal, Umesh wrote: > > > Thanks to both of you. Great work. > > > > If I understand correctly, the only way to use > > upstream_keepalive module is with upstream module. This implies > > I cannot use upstream_keepalive where the upstream is identified > > by a variable. For example: > > > > proxy_pass http://$host$request_uri; > > > > Is my understand correct? > > Yes. > > > Is there a way around this restriction? > > Currently no. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Sep 20 15:13:01 2011 From: nginx-forum at nginx.us (etrader) Date: Tue, 20 Sep 2011 11:13:01 -0400 Subject: 504 Gateway Time-out Message-ID: <954983e3e6e1d481fc1b6feaf871a5f1.NginxMailingListEnglish@forum.nginx.org> I have a php script which takes too long to be executed (a form for uploading large files). Upong running this I get "504 Gateway Time-out" error. Since I do not want to update php.ini for the whole server, I put set_time_limit(0); at the top of my php script; but still I get the same time-out error. What is the problem? I'm on Nginx 1.0.4. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215445,215445#msg-215445 From nginx-forum at nginx.us Tue Sep 20 15:26:34 2011 From: nginx-forum at nginx.us (locojohn) Date: Tue, 20 Sep 2011 11:26:34 -0400 Subject: 504 Gateway Time-out In-Reply-To: <954983e3e6e1d481fc1b6feaf871a5f1.NginxMailingListEnglish@forum.nginx.org> References: <954983e3e6e1d481fc1b6feaf871a5f1.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0c334ee1406b911ee68ef3c8d1e66b26.NginxMailingListEnglish@forum.nginx.org> Hi, Search the manual for the following directives: http { [..] client_header_timeout 10m; client_body_timeout 10m; send_timeout 10m; fastcgi_read_timeout 600; fastcgi_send_timeout 600; } Then experiment and specify values that are appropriate for your server or virtual host. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215445,215446#msg-215446 From nginx-forum at nginx.us Tue Sep 20 15:32:36 2011 From: nginx-forum at nginx.us (devdemi) Date: Tue, 20 Sep 2011 11:32:36 -0400 Subject: upstream timed out (110: Connection timed out) Message-ID: <9cf6ec328a38e9b6197206d805b2c3a6.NginxMailingListEnglish@forum.nginx.org> I installed on Debian Lenny nginx 0.6.32 and php-fpm and php file opens as well but went trying to do post request i get error in my /var/log/nginx/error.log "upstream timed out (110: Connection timed out) while reading response header from upstream, ....." My config of host ---------------------- server { listen 80; server_name domain.ru www.domain.ru; set $www_folder '/var/www'; set $root_path '$www_folder'; root $root_path; index index.htm index.html index.php; location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $root_path/$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $root_path; fastcgi_pass php-fpm; } location @phpscripts { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $root_path/$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $root_path; fastcgi_pass php-fpm; } location / { default_type text/html; root $root_path; if (!-e $request_filename) { return 404; } error_page 404 502 504 403 405 = @php; } location @php { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $root_path/index.php; fastcgi_pass php-fpm; } error_page 502 = /502.htm; location = /502.htm { root $www_folder; } location ~* \.(css|js|swf|ico|png|jpg|gif|jpeg|mp3|xml|html)$ { root $root_path; access_log off; expires 30d; } location ~ /\.ht { deny all; } location ~ /.svn/ { deny all; } } ---------------------- and my /etc/nginx/nginx.conf ---------------------- worker_processes 6; # worker_priority -1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 5024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; # PHP-FPM (backend) upstream php-fpm { server 127.0.0.1:9000; } include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } ---------------------- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215447,215447#msg-215447 From nginx-forum at nginx.us Tue Sep 20 15:36:59 2011 From: nginx-forum at nginx.us (devdemi) Date: Tue, 20 Sep 2011 11:36:59 -0400 Subject: upstream timed out (110: Connection timed out) In-Reply-To: <9cf6ec328a38e9b6197206d805b2c3a6.NginxMailingListEnglish@forum.nginx.org> References: <9cf6ec328a38e9b6197206d805b2c3a6.NginxMailingListEnglish@forum.nginx.org> Message-ID: size of post requst is not large, it's couple kb. php script is login form. so post request handles very slow. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215447,215448#msg-215448 From r at roze.lv Tue Sep 20 16:01:48 2011 From: r at roze.lv (Reinis Rozitis) Date: Tue, 20 Sep 2011 19:01:48 +0300 Subject: upstream timed out (110: Connection timed out) In-Reply-To: References: <9cf6ec328a38e9b6197206d805b2c3a6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <52F8668188974A1CB300C0A2453716C6@DD21> > php script is login form. > so post request handles very slow. What does the php-fpm log show? If its not enabled see where is your 'php-fpm.conf' is and under: [global] error_log = /path/to/your/php-fpm.log slowlog = /path/to/your/slow.log Optionaly (if not present) add something like: request_slowlog_timeout = 10s (it will log/backtrace all php requests which take longer than 10 seconds). rr From r at roze.lv Tue Sep 20 16:02:58 2011 From: r at roze.lv (Reinis Rozitis) Date: Tue, 20 Sep 2011 19:02:58 +0300 Subject: upstream timed out (110: Connection timed out) In-Reply-To: <52F8668188974A1CB300C0A2453716C6@DD21> References: <9cf6ec328a38e9b6197206d805b2c3a6.NginxMailingListEnglish@forum.nginx.org> <52F8668188974A1CB300C0A2453716C6@DD21> Message-ID: > Optionaly (if not present) add something like: > request_slowlog_timeout = 10s Of course after the changes restart php-fpm. rr From smartin at openclinica.com Tue Sep 20 17:32:33 2011 From: smartin at openclinica.com (Shaun Martin) Date: Tue, 20 Sep 2011 13:32:33 -0400 Subject: Timeout issues Message-ID: Hi All, Ok I am having issues with NGINX and it timing out. My scenario is that I am using NGINX as a web server front end for my application. I have two folder being served as alias?s for static content and one location doing a proxy_pass to a java server. My issue is that on one of the request that goes through the proxy_pass to the local java web server will time out through nginx within 10 minutes. The timeout is a browser timeout. It takes 11-12 minutes to load the page without nginx, so I need nginx to not kill the session until that time has passed. I have tried every timeout setting imaginable that I could find and I still get a browser timeout at 10 minutes. Note this is an SSL connection, the test without nginx in the way was also an SSL connection. Below are my configs, note all the timeout options have been slowly added over time and lots of testing.....they are not my wanted scenario but I am trying to figure out how this is done. NGINX.conf user www-data; worker_processes 4; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 900 900; client_body_timeout 900; client_header_timeout 900; send_timeout 900; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_types text/plain text/html text/css text/javascript image/png image/x-icon application/x-javascript application/xml image/gif; ssl_session_cache shared:SSL:100k; ssl_session_timeout 20m; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } Site Conf server { listen 80; server_name localhost; #charset koi8-r; access_log /var/log/nginx/80-app.access.log; error_log /var/log/nginx/80-app.error.log; location / { rewrite ^/(.*)$ https://$host/$1 redirect; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443; server_name localhost; access_log /var/log/nginx/app.access.log; error_log /var/log/nginx/app.error.log; ssl on; ssl_certificate /usr/local/oc/install/server.com.crt; ssl_certificate_key /usr/local/oc/install/server.key; # fail_timeout 3600s; keepalive_timeout 900 900; client_body_timeout 900; client_header_timeout 900; send_timeout 900; # directly serve the static files in the `images` directory location ~ ^/APP/includes/(.*)$ { # add future expiry date to force caching of the file on the client expires max; add_header Cache-Control "public"; alias /usr/local/tomcat/webapps/APP/includes/$1; } location ~ ^/APP/images/(.*)$ { # add future expiry date to force caching of the file on the client expires max; add_header Cache-Control "public"; alias /usr/local/tomcat/webapps/APP/images/$1; } # pass all other requests to Tomcat location /APP { proxy_read_timeout 3600s; proxy_connect_timeout 3600s; proxy_send_timeout 3600s; proxy_pass http://127.0.0.1:8080/APP; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } Any help is greatly appreciated. I wouldn?t even mind if it is possible to disable timeout all together just as a test. Thanks, Shaun -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Sep 20 18:44:34 2011 From: nginx-forum at nginx.us (etrader) Date: Tue, 20 Sep 2011 14:44:34 -0400 Subject: 504 Gateway Time-out In-Reply-To: <954983e3e6e1d481fc1b6feaf871a5f1.NginxMailingListEnglish@forum.nginx.org> References: <954983e3e6e1d481fc1b6feaf871a5f1.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3d3bd3ec463b876488540989383c46a3.NginxMailingListEnglish@forum.nginx.org> Thanks locojohn! It perfectly worked :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215445,215453#msg-215453 From nginx-forum at nginx.us Tue Sep 20 18:47:26 2011 From: nginx-forum at nginx.us (ynasser) Date: Tue, 20 Sep 2011 14:47:26 -0400 Subject: WebDriver and Nginx Message-ID: <4bd63487c17a749c842d5e6c46c46985.NginxMailingListEnglish@forum.nginx.org> Has anyone tried using nginx and webdriver together? Before I used nginx as a reverse proxy, I never had any problems, but now I can't get the browser being controlled by webdriver to get webpages. An example from the python shell: >>> import selenium >>> from selenium import webdriver >>> profile = webdriver.FirefoxProfile() >>> profile.set_preference("network.proxy.type", 1) >>> profile.set_preference("network.proxy.http", "127.0.0.1") >>> profile.set_preference("network.proxy.http_port", "80") >>> driver = webdriver.Firefox(firefox_profile=profile) >>> driver.get("http://www.google.com") And then nothing happens. Since it works when nginx isn't running, I'm guessing the problem is from the nginx side. Has anyone experienced something similar? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215454,215454#msg-215454 From smartin at openclinica.com Tue Sep 20 18:53:40 2011 From: smartin at openclinica.com (Shaun Martin) Date: Tue, 20 Sep 2011 14:53:40 -0400 Subject: Timeout issues In-Reply-To: Message-ID: Hi All, Oh yah I forgot to mention there are no entries in the error log saying anything about connection timed out. Thanks, Shaun On 9/20/11 01:32 PM, "Shaun Martin" wrote: > Hi All, > > Ok I am having issues with NGINX and it timing out. My scenario is that I am > using NGINX as a web server front end for my application. I have two folder > being served as alias?s for static content and one location doing a proxy_pass > to a java server. > > My issue is that on one of the request that goes through the proxy_pass to the > local java web server will time out through nginx within 10 minutes. The > timeout is a browser timeout. It takes 11-12 minutes to load the page without > nginx, so I need nginx to not kill the session until that time has passed. I > have tried every timeout setting imaginable that I could find and I still get > a browser timeout at 10 minutes. Note this is an SSL connection, the test > without nginx in the way was also an SSL connection. > > Below are my configs, note all the timeout options have been slowly added over > time and lots of testing.....they are not my wanted scenario but I am trying > to figure out how this is done. > > NGINX.conf > > user www-data; > worker_processes 4; > > error_log /var/log/nginx/error.log; > pid /var/run/nginx.pid; > > events { > worker_connections 1024; > # multi_accept on; > } > > http { > include /etc/nginx/mime.types; > > access_log /var/log/nginx/access.log; > > sendfile on; > #tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 900 900; > client_body_timeout 900; > client_header_timeout 900; > send_timeout 900; > > > tcp_nodelay on; > > gzip on; > gzip_disable "MSIE [1-6]\.(?!.*SV1)"; > gzip_types text/plain text/html text/css text/javascript image/png > image/x-icon application/x-javascript application/xml image/gif; > > ssl_session_cache shared:SSL:100k; > ssl_session_timeout 20m; > > > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; > } > > Site Conf > > server { > listen 80; > server_name localhost; > > #charset koi8-r; > > access_log /var/log/nginx/80-app.access.log; > error_log /var/log/nginx/80-app.error.log; > > location / { > rewrite ^/(.*)$ https://$host/$1 redirect; > } > > error_page 404 /404.html; > > # redirect server error pages to the static page /50x.html > # > error_page 500 502 503 504 /50x.html; > location = /50x.html { > root html; > } > } > server { > listen 443; > server_name localhost; > > > access_log /var/log/nginx/app.access.log; > error_log /var/log/nginx/app.error.log; > > ssl on; > ssl_certificate /usr/local/oc/install/server.com.crt; > ssl_certificate_key /usr/local/oc/install/server.key; > > # fail_timeout 3600s; > keepalive_timeout 900 900; > client_body_timeout 900; > client_header_timeout 900; > send_timeout 900; > # directly serve the static files in the `images` directory > location ~ ^/APP/includes/(.*)$ { > # add future expiry date to force caching of the file on the > client > expires max; > add_header Cache-Control "public"; > alias /usr/local/tomcat/webapps/APP/includes/$1; > } > > location ~ ^/APP/images/(.*)$ { > # add future expiry date to force caching of the file on the > client > expires max; > add_header Cache-Control "public"; > alias /usr/local/tomcat/webapps/APP/images/$1; > } > # pass all other requests to Tomcat > location /APP { > proxy_read_timeout 3600s; > proxy_connect_timeout 3600s; > proxy_send_timeout 3600s; > > proxy_pass http://127.0.0.1:8080/APP; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > } > > > Any help is greatly appreciated. I wouldn?t even mind if it is possible to > disable timeout all together just as a test. > > Thanks, > Shaun > > -- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Tue Sep 20 18:54:46 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Sep 2011 22:54:46 +0400 Subject: WebDriver and Nginx In-Reply-To: <4bd63487c17a749c842d5e6c46c46985.NginxMailingListEnglish@forum.nginx.org> References: <4bd63487c17a749c842d5e6c46c46985.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110920185446.GX1137@mdounin.ru> Hello! On Tue, Sep 20, 2011 at 02:47:26PM -0400, ynasser wrote: > Has anyone tried using nginx and webdriver together? Before I used nginx > as a reverse proxy, I never had any problems, but now I can't get the > browser being controlled by webdriver to get webpages. > > An example from the python shell: > > >>> import selenium > >>> from selenium import webdriver > >>> profile = webdriver.FirefoxProfile() > >>> profile.set_preference("network.proxy.type", 1) > >>> profile.set_preference("network.proxy.http", "127.0.0.1") > >>> profile.set_preference("network.proxy.http_port", "80") > >>> driver = webdriver.Firefox(firefox_profile=profile) > >>> driver.get("http://www.google.com") > > And then nothing happens. > > Since it works when nginx isn't running, I'm guessing the problem is > from the nginx side. Has anyone experienced something similar? Since I really doubt www.google.com running nginx, I suppose you are using nginx on 127.0.0.1:80, right? The problem is that nginx isn't a forward proxy and never was. Maxim Dounin From nginx-forum at nginx.us Tue Sep 20 21:38:32 2011 From: nginx-forum at nginx.us (akamaka) Date: Tue, 20 Sep 2011 17:38:32 -0400 Subject: need rewrite help Message-ID: <19a5c00618e68b56baa128ca45971fcd.NginxMailingListEnglish@forum.nginx.org> Hi, please help me to rewrite this mod_rewrite rule: RewriteRule (img/(.+))$ webroot/$1 [L] Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215460,215460#msg-215460 From appa at perusio.net Tue Sep 20 21:50:44 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 20 Sep 2011 22:50:44 +0100 Subject: need rewrite help In-Reply-To: <19a5c00618e68b56baa128ca45971fcd.NginxMailingListEnglish@forum.nginx.org> References: <19a5c00618e68b56baa128ca45971fcd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87mxdyzxvv.wl%appa@perusio.net> On 20 Set 2011 22h38 WEST, nginx-forum at nginx.us wrote: > Hi, > > please help me to rewrite this mod_rewrite rule: > > RewriteRule (img/(.+))$ webroot/$1 [L] Try: location ^~ /img/ { location ~* /img/(.+)$ { return 301 /webroot/$1; } } Or 302 if you want it to be temporary. --- appa From latypoff at yandex.ru Tue Sep 20 21:57:10 2011 From: latypoff at yandex.ru (Denis F. Latypoff) Date: Wed, 21 Sep 2011 04:57:10 +0700 Subject: need rewrite help In-Reply-To: <87mxdyzxvv.wl%appa@perusio.net> References: <19a5c00618e68b56baa128ca45971fcd.NginxMailingListEnglish@forum.nginx.org> <87mxdyzxvv.wl%appa@perusio.net> Message-ID: <638501316555830@web47.yandex.ru> 21.09.2011, 04:50, "Ant?nio P. P. Almeida" : > On 20 Set 2011 22h38 WEST, nginx-forum at nginx.us wrote: > >> ?Hi, >> >> ?please help me to rewrite this mod_rewrite rule: >> ?RewriteRule ???(img/(.+))$ webroot/$1 ????[L] > > Try: > > location ^~ /img/ { > ????location ~* /img/(.+)$ { > ???????return 301 /webroot/$1; > ???} > } > > Or 302 if you want it to be temporary. There is no [R] flag in the rewrite rule, so it should be internal redirect location /img/ { alias /path/to/webroot/; } -- br, Denis F. Latypoff. From yomnanasser at gmail.com Tue Sep 20 21:59:59 2011 From: yomnanasser at gmail.com (Yomna Nasser) Date: Tue, 20 Sep 2011 17:59:59 -0400 Subject: WebDriver and Nginx In-Reply-To: <20110920185446.GX1137@mdounin.ru> References: <4bd63487c17a749c842d5e6c46c46985.NginxMailingListEnglish@forum.nginx.org> <20110920185446.GX1137@mdounin.ru> Message-ID: The problem isn't that it can't access google.com (or whatever url), but that it won't even try. If my code was successful, an error message should be displayed in the browser saying that it can't access google because nginx is running, or something along those lines (so, exactly what you said). The problem is that I can't control the instance of the browser once it's opened. It won't respond to any navigation requests and I think that nginx is somehow interfering, but I have no idea how. It doesn't make much sense that a web server is interfering with the ability to control a web browser via software :/ On Tue, Sep 20, 2011 at 2:54 PM, Maxim Dounin wrote: > Hello! > > On Tue, Sep 20, 2011 at 02:47:26PM -0400, ynasser wrote: > >> Has anyone tried using nginx and webdriver together? Before I used nginx >> as a reverse proxy, I never had any problems, but now I can't get the >> browser being controlled by webdriver to get webpages. >> >> An example from the python shell: >> >> >>> import selenium >> >>> from selenium import webdriver >> >>> profile = webdriver.FirefoxProfile() >> >>> profile.set_preference("network.proxy.type", 1) >> >>> profile.set_preference("network.proxy.http", "127.0.0.1") >> >>> profile.set_preference("network.proxy.http_port", "80") >> >>> driver = webdriver.Firefox(firefox_profile=profile) >> >>> driver.get("http://www.google.com") >> >> And then nothing happens. >> >> Since it works when nginx isn't running, I'm guessing the problem is >> from the nginx side. Has anyone experienced something similar? > > Since I really doubt www.google.com running nginx, I suppose you > are using nginx on 127.0.0.1:80, right? > > The problem is that nginx isn't a forward proxy and never was. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Tue Sep 20 22:39:08 2011 From: nginx-forum at nginx.us (sailorfred) Date: Tue, 20 Sep 2011 18:39:08 -0400 Subject: Need client cert common name as user Message-ID: <8c35b9a8bdee80d739cf8f6e9d68e3cb.NginxMailingListEnglish@forum.nginx.org> I'm in the process of converting from lighttpd to nginx, but I'm not finding an equivalent of the lighttpd directive: ssl.verifyclient.username = "SSL_CLIENT_S_DN_CN" This sets the REMOTE_USER environment variable for the backend FastCGI process, and logs the common name into the access log. Is it possible to do this in nginx? Thanks, Fred Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215461,215461#msg-215461 From mdounin at mdounin.ru Tue Sep 20 23:05:26 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Sep 2011 03:05:26 +0400 Subject: Need client cert common name as user In-Reply-To: <8c35b9a8bdee80d739cf8f6e9d68e3cb.NginxMailingListEnglish@forum.nginx.org> References: <8c35b9a8bdee80d739cf8f6e9d68e3cb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110920230526.GD1137@mdounin.ru> Hello! On Tue, Sep 20, 2011 at 06:39:08PM -0400, sailorfred wrote: > I'm in the process of converting from lighttpd to nginx, but I'm not > finding an equivalent of the lighttpd directive: > > ssl.verifyclient.username = "SSL_CLIENT_S_DN_CN" > > This sets the REMOTE_USER environment variable for the backend FastCGI > process, and logs the common name into the access log. > > Is it possible to do this in nginx? There is no direct replacement. If you are ok with full cert subject DN as a user name, use something like this: fastcgi_pass ... fastcgi_param REMOTE_USER $ssl_client_s_dn; ... Extracting only CN should be possible with "if" directive, though will require writing some regexp to parse CN from DN. (And please make sure to read http://wiki.nginx.org/IfIsEvil as "if" may cause problems by itself if used in location context.) Maxim Dounin From igor at sysoev.ru Wed Sep 21 03:38:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 21 Sep 2011 07:38:02 +0400 Subject: Need client cert common name as user In-Reply-To: <20110920230526.GD1137@mdounin.ru> References: <8c35b9a8bdee80d739cf8f6e9d68e3cb.NginxMailingListEnglish@forum.nginx.org> <20110920230526.GD1137@mdounin.ru> Message-ID: <20110921033802.GB77063@nginx.com> On Wed, Sep 21, 2011 at 03:05:26AM +0400, Maxim Dounin wrote: > Hello! > > On Tue, Sep 20, 2011 at 06:39:08PM -0400, sailorfred wrote: > > > I'm in the process of converting from lighttpd to nginx, but I'm not > > finding an equivalent of the lighttpd directive: > > > > ssl.verifyclient.username = "SSL_CLIENT_S_DN_CN" > > > > This sets the REMOTE_USER environment variable for the backend FastCGI > > process, and logs the common name into the access log. > > > > Is it possible to do this in nginx? > > There is no direct replacement. If you are ok with full cert subject > DN as a user name, use something like this: > > fastcgi_pass ... > fastcgi_param REMOTE_USER $ssl_client_s_dn; > ... > > Extracting only CN should be possible with "if" directive, though > will require writing some regexp to parse CN from DN. (And please > make sure to read http://wiki.nginx.org/IfIsEvil as "if" may cause > problems by itself if used in location context.) The "map" directive with regex can be used instead of "if", something like this: map $ssl_client_s_dn $ssl_client_s_dn_cn { default ""; ~/CN=(?[^/]+) $CN; }; -- Igor Sysoev From igor at sysoev.ru Wed Sep 21 05:01:44 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 21 Sep 2011 09:01:44 +0400 Subject: need rewrite help In-Reply-To: <638501316555830@web47.yandex.ru> References: <19a5c00618e68b56baa128ca45971fcd.NginxMailingListEnglish@forum.nginx.org> <87mxdyzxvv.wl%appa@perusio.net> <638501316555830@web47.yandex.ru> Message-ID: <20110921050144.GE77063@nginx.com> On Wed, Sep 21, 2011 at 04:57:10AM +0700, Denis F. Latypoff wrote: > 21.09.2011, 04:50, "Ant?nio P. P. Almeida" : > > On 20 Set 2011 22h38 WEST, nginx-forum at nginx.us wrote: > > > >> ?Hi, > >> > >> ?please help me to rewrite this mod_rewrite rule: > >> ?RewriteRule ???(img/(.+))$ webroot/$1 ????[L] > > > > Try: > > > > location ^~ /img/ { > > ????location ~* /img/(.+)$ { > > ???????return 301 /webroot/$1; > > ???} > > } > > > > Or 302 if you want it to be temporary. > > There is no [R] flag in the rewrite rule, so it should be internal redirect > > location /img/ { > alias /path/to/webroot/; > } I think $1 in RewriteRule is a whole "img/...": $ pcretest PCRE version 7.9 2009-04-11 re> #(img/(.+))$# data> img/qqq 0: img/qqq 1: img/qqq 2: qqq data> ^D So it should be "root": location /img/ { root /path/to/webroot/; } -- Igor Sysoev From quan.nexthop at gmail.com Wed Sep 21 09:58:59 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Wed, 21 Sep 2011 02:58:59 -0700 Subject: nginx-1.1.4 In-Reply-To: <20110920125219.GP1137@mdounin.ru> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> <20110920125219.GP1137@mdounin.ru> Message-ID: When is it ported to stable version? I means the upstream keep-alive feature? Thanks George 2011/9/20, Maxim Dounin : > Hello! > > On Tue, Sep 20, 2011 at 08:29:06AM -0400, Sirsiwal, Umesh wrote: > >> Thanks to both of you. Great work. >> >> If I understand correctly, the only way to use >> upstream_keepalive module is with upstream module. This implies >> I cannot use upstream_keepalive where the upstream is identified >> by a variable. For example: >> >> proxy_pass http://$host$request_uri; >> >> Is my understand correct? > > Yes. > >> Is there a way around this restriction? > > Currently no. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- ????????? From mdounin at mdounin.ru Wed Sep 21 10:20:46 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Sep 2011 14:20:46 +0400 Subject: nginx-1.1.4 In-Reply-To: References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> <20110920125219.GP1137@mdounin.ru> Message-ID: <20110921102045.GH1137@mdounin.ru> Hello! On Wed, Sep 21, 2011 at 02:58:59AM -0700, Geoge.Q wrote: > When is it ported to stable version? I means the upstream keep-alive feature? Most likely never: there are several API changes which are required for this. Breaking API in stable is a bad thing. Maxim Dounin > > Thanks > George > > 2011/9/20, Maxim Dounin : > > Hello! > > > > On Tue, Sep 20, 2011 at 08:29:06AM -0400, Sirsiwal, Umesh wrote: > > > >> Thanks to both of you. Great work. > >> > >> If I understand correctly, the only way to use > >> upstream_keepalive module is with upstream module. This implies > >> I cannot use upstream_keepalive where the upstream is identified > >> by a variable. For example: > >> > >> proxy_pass http://$host$request_uri; > >> > >> Is my understand correct? > > > > Yes. > > > >> Is there a way around this restriction? > > > > Currently no. > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > -- > ????????? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From igor at sysoev.ru Wed Sep 21 10:26:29 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 21 Sep 2011 14:26:29 +0400 Subject: nginx-1.1.4 In-Reply-To: <20110921102045.GH1137@mdounin.ru> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> <20110920125219.GP1137@mdounin.ru> <20110921102045.GH1137@mdounin.ru> Message-ID: <6C5C3A6B-D538-46BA-8825-F869297856FA@sysoev.ru> On Sep 21, 2011, at 14:20 , Maxim Dounin wrote: > Hello! > > On Wed, Sep 21, 2011 at 02:58:59AM -0700, Geoge.Q wrote: > >> When is it ported to stable version? I means the upstream keep-alive feature? > > Most likely never: there are several API changes which are > required for this. Breaking API in stable is a bad thing. At some point 1.1.x will just become stable :) -- Igor Sysoev http://sysoev.ru/en/ From gmm at csdoc.com Wed Sep 21 10:51:34 2011 From: gmm at csdoc.com (Gena Makhomed) Date: Wed, 21 Sep 2011 13:51:34 +0300 Subject: nginx-1.1.4 In-Reply-To: <6C5C3A6B-D538-46BA-8825-F869297856FA@sysoev.ru> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> <20110920125219.GP1137@mdounin.ru> <20110921102045.GH1137@mdounin.ru> <6C5C3A6B-D538-46BA-8825-F869297856FA@sysoev.ru> Message-ID: <4E79C1B6.50808@csdoc.com> On 21.09.2011 13:26, Igor Sysoev wrote: >>> When is it ported to stable version? I means the upstream keep-alive feature? >> >> Most likely never: there are several API changes which are >> required for this. Breaking API in stable is a bad thing. > > At some point 1.1.x will just become stable :) major.minor.revision nginx will not use odd minor version numbers to denote development releases and even minor version numbers to denote stable releases? 1.0.x - stable branch 1.1.x - devel branch 1.2.x - stable branch 1.3.x - devel branch and so on? if not - it will be many confusion, which version 1.1.x is stable, and which nginx 1.2.x version is devel or stable. use odd minor version numbers to denote development releases and even minor version numbers to denote stable releases - imho is very useful and clear version numbering scheme. (but looks like apache/squid/haproxy not use this scheme) -- Best regards, Gena From mdounin at mdounin.ru Wed Sep 21 11:11:08 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Sep 2011 15:11:08 +0400 Subject: nginx-1.1.4 In-Reply-To: <4E79C1B6.50808@csdoc.com> References: <20110920112225.GC54733@nginx.com> <20110920114004.GO1137@mdounin.ru> <32453ED0-15C3-406F-9EA5-92B05E7B0F60@exsisto.com> <20110920125219.GP1137@mdounin.ru> <20110921102045.GH1137@mdounin.ru> <6C5C3A6B-D538-46BA-8825-F869297856FA@sysoev.ru> <4E79C1B6.50808@csdoc.com> Message-ID: <20110921111108.GI1137@mdounin.ru> Hello! On Wed, Sep 21, 2011 at 01:51:34PM +0300, Gena Makhomed wrote: > On 21.09.2011 13:26, Igor Sysoev wrote: > > >>>When is it ported to stable version? I means the upstream keep-alive feature? > >> > >>Most likely never: there are several API changes which are > >>required for this. Breaking API in stable is a bad thing. > > > >At some point 1.1.x will just become stable :) > > major.minor.revision > > nginx will not use odd minor version numbers to denote development > releases and even minor version numbers to denote stable releases? > > 1.0.x - stable branch > 1.1.x - devel branch > > 1.2.x - stable branch > 1.3.x - devel branch > > and so on? > > if not - it will be many confusion, which version 1.1.x is stable, > and which nginx 1.2.x version is devel or stable. > > use odd minor version numbers to denote development releases > and even minor version numbers to denote stable releases - > imho is very useful and clear version numbering scheme. Yes, I've already proposed this to Igor to simplify stable vs. devel distinction. He isn't convinced yet, but we have some time to think about this. Maxim Dounin From nginx-forum at nginx.us Wed Sep 21 12:39:42 2011 From: nginx-forum at nginx.us (Hety) Date: Wed, 21 Sep 2011 08:39:42 -0400 Subject: $server_name in error_log logfile name Message-ID: I'm currently trying to make a template for future virtual hosts. To minimize the amount of editing required i am using $server_name in some parts of the template. For example: server_name example.com access_log /var/log/www/$server_name-access combined; error_log /var/log/www/$server_name-error error; While it works great for access_log directive(logfile is named example.com-access), error log file name is, actually $server_name-error. I'm running nginx 1.0.6 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215503,215503#msg-215503 From nginx-forum at nginx.us Wed Sep 21 13:04:44 2011 From: nginx-forum at nginx.us (Hety) Date: Wed, 21 Sep 2011 09:04:44 -0400 Subject: Enabeling SSL causes Redirect Loop errors ??? In-Reply-To: References: Message-ID: There are two things to be aware of here: 1. fastcgi_param HTTPS on; - add this to your location ~ \.php$ {}. 2. If you use php-fpm chroot set: fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; fastcgi_param PATH_TRANSLATED $fastcgi_script_name; Thats because your document root will be just /, but only if your chroot dir = your actual site dir. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215136,215505#msg-215505 From mdounin at mdounin.ru Wed Sep 21 13:31:50 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Sep 2011 17:31:50 +0400 Subject: $server_name in error_log logfile name In-Reply-To: References: Message-ID: <20110921133150.GQ1137@mdounin.ru> Hello! On Wed, Sep 21, 2011 at 08:39:42AM -0400, Hety wrote: > I'm currently trying to make a template for future virtual hosts. To > minimize the amount of editing required i am using $server_name in some > parts of the template. > > For example: > server_name example.com > access_log /var/log/www/$server_name-access combined; > error_log /var/log/www/$server_name-error error; > > While it works great for access_log directive(logfile is named > example.com-access), error log file name is, actually > $server_name-error. > I'm running nginx 1.0.6 The "error_log" directive doesn't support variables. Addtionally, this is not intended use of variables. They are run-time and evaluated for each request. You want to use some config generator instead. Maxim Dounin From nginx-forum at nginx.us Wed Sep 21 14:18:31 2011 From: nginx-forum at nginx.us (ahu) Date: Wed, 21 Sep 2011 10:18:31 -0400 Subject: mp4 module In-Reply-To: <20110915052602.GE73767@nginx.com> References: <20110915052602.GE73767@nginx.com> Message-ID: <072588df6d07290a30ba33099451c5f9.NginxMailingListEnglish@forum.nginx.org> I am very curious about what the difference between this modle and the 3rd modle(http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Nginx-Version2). Which one should I use? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215011,215506#msg-215506 From agentzh at gmail.com Wed Sep 21 15:35:52 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 21 Sep 2011 23:35:52 +0800 Subject: [ANN] ngx_openresty 1.0.6.12 released In-Reply-To: References: Message-ID: Hi, folks! I've just kicked the ngx_openresty 1.0.6.12 release out of the door, which is the first stable release of ngx_openresty based on the nginx 1.0.6 core: http://openresty.org/#Download Here goes the complete change log, as compared to the last stable release 1.0.5.1: - upgraded RdsJsonNginxModule to v0.12rc4. - made rds_json_ret honor rds_json_success_property and rds_json_user_property. thanks Liseen Wan (???) - only register our output filters when the rds_json directive is actually used in nginx.conf. - upgraded RdsCsvNginxModule to v0.03. - only register our output filters when the rds_csv directive is actually used in nginx.conf. - added new options --with-luajit=PATH and --with-lua51=PATH to the ./configure script. thanks NginxUser. - upgraded DrizzleNginxModule to v0.1.1. - upgraded RdsJsonNginxModule to 0.12rc3. - implemented new directive rds_json_root. - implemented new directive rds_json_success_property. - implemented new directive rds_json_user_property. - upgraded LuaNginxModule to 0.3.1rc3. - implemented and documented the API for reading response headers from within Lua: value = ngx.header.HEADER. - fixed a bug when setting a multi-value response header to a single value (via writing to ngx.header.HEADER): the single value will be repeated on each old value. - upgraded EchoNginxModule to 0.37rc4. - fixed a bug in echo_after_body: when network is not perfect, data truncation might occur. we should have taken into account NGX_AGAINreturned by the downstream output filters. thanks Sparsh Gupta. - upgraded HeadersMoreNginxModule to v0.16rc2. - fixed a bug when setting a multi-value response header to a single value: the single value will be repeated on each old value. - applied the patch from Maxim Dounin to fix a bug in the standard ngx_gzip module when dealing with empty flush buffers: http://mailman.nginx.org/pipermail/nginx-devel/2011-February/000730.html - updated the no-pool-patch to eliminate the -Wset-but-not-used warnings issued by gcc 4.6.0. - upgraded LuaNginxModule to 0.3.1rc1. - fixed a bug when the both the main request and the subrequest are POST requests with a body: we should not forward the main request's Content-Length headers to the user subrequests. thanks ??. - upgraded HeadersMoreNginxModule to 0.16rc1. - fixed on-demand hander/filter registration trick for HUP signal restarts. - added some debugging outputs that can be enabled by the --with-debugoption when building Nginx or OpenResty. - Upgraded the nginx core to 1.0.6. Enjoy! -agentzh -------------- next part -------------- An HTML attachment was scrubbed... URL: From avishai.ish-shalom at mail.huji.ac.il Wed Sep 21 20:03:31 2011 From: avishai.ish-shalom at mail.huji.ac.il (Avishai Ish-Shalom) Date: Wed, 21 Sep 2011 23:03:31 +0300 Subject: process corruption on CentOS 5.6 Message-ID: <4E7A4313.9090703@mail.huji.ac.il> On CentOS 5.6, nginx 1.1.4 configured to work with php-fpm using fastcgi port. nginx was compiled with: configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_realip_module --with-http_geoip_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_addition_module --with-http_image_filter_module --with-http_sub_module --with-http_degradation_module --add-module=addons/ngx_upstream_fair --with-cc-opt="-D NGX_UPSTREAM_KEEPALIVE_PATCHED" every few seconds, i get: *** glibc detected *** nginx: worker process: double free or corruption (!prev): 0x000000001d069800 *** ======= Backtrace: ========= /lib64/libc.so.6[0x3cd4c7245f] /lib64/libc.so.6(cfree+0x4b)[0x3cd4c728bb] nginx: worker process[0x407628] nginx: worker process[0x43c6e1] nginx: worker process[0x43ec4a] nginx: worker process[0x43e691] nginx: worker process[0x43eca3] nginx: worker process[0x43ed2e] nginx: worker process[0x43d26d] nginx: worker process[0x421a96] nginx: worker process[0x41ab68] nginx: worker process[0x420720] nginx: worker process[0x41f057] nginx: worker process[0x420f09] nginx: worker process[0x406a7a] /lib64/libc.so.6(__libc_start_main+0xf4)[0x3cd4c1d994] nginx: worker process[0x405249] ======= Memory map: ======== 00400000-00482000 r-xp 00000000 68:05 6882046 /usr/local/nginx/sbin/nginx 00681000-00693000 rw-p 00081000 68:05 6882046 /usr/local/nginx/sbin/nginx 00693000-006a1000 rw-p 00693000 00:00 0 1d041000-1d22b000 rw-p 1d041000 00:00 0 [heap] 3cd4800000-3cd481c000 r-xp 00000000 68:05 6389762 /lib64/ld-2.5.so 3cd4a1c000-3cd4a1d000 r--p 0001c000 68:05 6389762 /lib64/ld-2.5.so 3cd4a1d000-3cd4a1e000 rw-p 0001d000 68:05 6389762 /lib64/ld-2.5.so 3cd4c00000-3cd4d4e000 r-xp 00000000 68:05 6389764 /lib64/libc-2.5.so 3cd4d4e000-3cd4f4e000 ---p 0014e000 68:05 6389764 /lib64/libc-2.5.so 3cd4f4e000-3cd4f52000 r--p 0014e000 68:05 6389764 /lib64/libc-2.5.so 3cd4f52000-3cd4f53000 rw-p 00152000 68:05 6389764 /lib64/libc-2.5.so 3cd4f53000-3cd4f58000 rw-p 3cd4f53000 00:00 0 3cd5000000-3cd501e000 r-xp 00000000 68:05 6391224 /lib64/libpcre.so.0.0.1 3cd501e000-3cd521e000 ---p 0001e000 68:05 6391224 /lib64/libpcre.so.0.0.1 3cd521e000-3cd521f000 rw-p 0001e000 68:05 6391224 /lib64/libpcre.so.0.0.1 3cd5400000-3cd5416000 r-xp 00000000 68:05 6389787 /lib64/libpthread-2.5.so 3cd5416000-3cd5615000 ---p 00016000 68:05 6389787 /lib64/libpthread-2.5.so 3cd5615000-3cd5616000 r--p 00015000 68:05 6389787 /lib64/libpthread-2.5.so 3cd5616000-3cd5617000 rw-p 00016000 68:05 6389787 /lib64/libpthread-2.5.so 3cd5617000-3cd561b000 rw-p 3cd5617000 00:00 0 3cd5800000-3cd5882000 r-xp 00000000 68:05 6389811 /lib64/libm-2.5.so 3cd5882000-3cd5a81000 ---p 00082000 68:05 6389811 /lib64/libm-2.5.so 3cd5a81000-3cd5a82000 r--p 00081000 68:05 6389811 /lib64/libm-2.5.so 3cd5a82000-3cd5a83000 rw-p 00082000 68:05 6389811 /lib64/libm-2.5.so 3cd5c00000-3cd5c14000 r-xp 00000000 68:05 6260001 /usr/lib64/libz.so.1.2.3 3cd5c14000-3cd5e13000 ---p 00014000 68:05 6260001 /usr/lib64/libz.so.1.2.3 3cd5e13000-3cd5e14000 rw-p 00013000 68:05 6260001 /usr/lib64/libz.so.1.2.3 3cd6000000-3cd6020000 r-xp 00000000 68:05 6272360 /usr/lib64/libgd.so.2.0.0 3cd6020000-3cd621f000 ---p 00020000 68:05 6272360 /usr/lib64/libgd.so.2.0.0 3cd621f000-3cd6240000 rw-p 0001f000 68:05 6272360 /usr/lib64/libgd.so.2.0.0 3cd6240000-3cd6254000 rw-p 3cd6240000 00:00 0 3cd6400000-3cd6415000 r-xp 00000000 68:05 6391132 /lib64/libselinux.so.1 3cd6415000-3cd6615000 ---p 00015000 68:05 6391132 /lib64/libselinux.so.1 3cd6615000-3cd6617000 rw-p 00015000 68:05 6391132 /lib64/libselinux.so.1 3cd6617000-3cd6618000 rw-p 3cd6617000 00:00 0 3cd6c00000-3cd6c0d000 r-xp 00000000 68:05 6391157 /lib64/libgcc_s-4.1.2-20080825.so.1 3cd6c0d000-3cd6e0d000 ---p 0000d000 68:05 6391157 /lib64/libgcc_s-4.1.2-20080825.so.1 3cd6e0d000-3cd6e0e000 rw-p 0000d000 68:05 6391157 /lib64/libgcc_s-4.1.2-20080825.so.1 3cd7400000-3cd7409000 r-xp 00000000 68:05 6391136 /lib64/libcrypt-2.5.so 3cd7409000-3cd7608000 ---p 00009000 68:05 6391136 /lib64/libcrypt-2.5.so 3cd7608000-3cd7609000 r--p 00008000 68:05 6391136 /lib64/libcrypt-2.5.so 3cd7609000-3cd760a000 rw-p 00009000 68:05 6391136 /lib64/libcrypt-2.5.so 3cd760a000-3cd7638000 rw-p 3cd760a000 00:00 0 3cd7800000-3cd787f000 r-xp 00000000 68:05 6260010 /usr/lib64/libfreetype.so.6.3.10 3cd787f000-3cd7a7f000 ---p 0007f000 68:05 6260010 /usr/lib64/libfreetype.so.6.3.10 3cd7a7f000-3cd7a84000 rw-p 0007f000 68:05 6260010 /usr/lib64/libfreetype.so.6.3.10 3cd8000000-3cd8021000 r-xp 00000000 68:05 6260000 /usr/lib64/libjpeg.so.62.0.0 3cd8021000-3cd8220000 ---p 00021000 68:05 6260000 /usr/lib64/libjpeg.so.62.0.0 3cd8220000-3cd8221000 rw-p 00020000 68:05 6260000 /usr/lib64/libjpeg.so.62.0.0 3cd8400000-3cd8429000 r-xp 00000000 68:05 6260011 /usr/lib64/libfontconfig.so.1.1.0 3cd8429000-3cd8629000 ---p 00029000 68:05 6260011 /usr/lib64/libfontconfig.so.1.1.0 3cd8629000-3cd8633000 rw-p 00029000 68:05 6260011 /usr/lib64/libfontconfig.so.1.1.0 3cd8633000-3cd8634000 rw-p 3cd8633000 00:00 0 3cd8800000-3cd8905000 r-xp 00000000 68:05 6260015 /usr/lib64/libX11.so.6.2.0 3cd8905000-3cd8b05000 ---p 00105000 68:05 6260015 /usr/lib64/libX11.so.6.2.0 3cd8b05000-3cd8b0c000 rw-p 00105000 68:05 6260015 /usr/lib64/libX11.so.6.2.0 3cd8c00000-3cd8c02000 r-xp 00000000 68:05 6260013 /usr/lib64/libXau.so.6.0.0 3cd8c02000-3cd8e01000 ---p 00002000 68:05 6260013 /usr/lib64/libXau.so.6.0.0 3cd8e01000-3cd8e02000 rw-p 00001000 68:05 6260013 /usr/lib64/libXau.so.6.0.0 3cd9400000-3cd9420000 r-xp 00000000 68:05 6391150 /lib64/libexpat.so.0.5.0 3cd9420000-3cd961f000 ---p 00020000 68:05 6391150 /lib64/libexpat.so.0.5.0 3cd961f000-3cd9622000 rw-p 0001f000 68:05 6391150 /lib64/libexpat.so.0.5.0 3cd9c00000-3cd9c05000 r-xp 00000000 68:05 6260014 /usr/lib64/libXdmcp.so.6.0.0 3cd9c05000-3cd9e04000 ---p 00005000 68:05 6260014 /usr/lib64/libXdmcp.so.6.0.0 3cd9e04000-3cd9e05000 rw-p 00004000 68:05 6260014 /usr/lib64/libXdmcp.so.6.0.0 3cda400000-3cda402000 r-xp 00000000 68:05 6391216 /lib64/libkeyutils-1.2.so 3cda402000-3cda601000 ---p 00002000 68:05 6391216 /lib64/libkeyutils-1.2.so 3cda601000-3cda602000 rw-p 00001000 68:05 6391216 /lib64/libkeyutils-1.2.so 3cda800000-3cda811000 r-xp 00000000 68:05 6391217 /lib64/libresolv-2.5.so 3cda811000-3cdaa11000 ---p 00011000 68:05 6391217 /lib64/libresolv-2.5.so 3cdaa11000-3cdaa12000 r--p 00011000 68:05 6391217 /lib64/libresolv-2.5.so 3cdaa12000-3cdaa13000 rw-p 00012000 68:05 6391217 /lib64/libresolv-2.5.so 3cdaa13000-3cdaa15000 rw-p 3cdaa13000 00:00 0 3cdb000000-3cdb002000 r-xp 00000000 68:05 6391218 /lib64/libcom_err.so.2.1 3cdb002000-3cdb201000 ---p 00002000 68:05 6391218 /lib64/libcom_err.so.2.1 3cdb201000-3cdb202000 rw-p 00001000 68:05 6391218 /lib64/libcom_err.so.2.1 3cdc000000-3cdc023000 r-xp 00000000 68:05 6260012 /usr/lib64/libpng12.so.0.10.0 3cdc023000-3cdc223000 ---p 00023000 68:05 6260012 /usr/lib64/libpng12.so.0.10.0 3cdc223000-3cdc224000 rw-p 00023000 68:05 6260012 /usr/lib64/libpng12.so.0.10.0 3cdc400000-3cdc52d000 r-xp 00000000 68:05 6391146 /lib64/libcrypto.so.0.9.8e 3cdc52d000-3cdc72c000 ---p 0012d000 68:05 6391146 /lib64/libcrypto.so.0.9.8e 3cdc72c000-3cdc74d000 rw-p 0012c000 68:05 6391146 /lib64/libcrypto.so.0.9.8e 3cdc74d000-3cdc751000 rw-p 3cdc74d000 00:00 0 3cdc800000-3cdc892000 r-xp 00000000 68:05 6270008 /usr/lib64/libkrb5.so.3.3 3cdc892000-3cdca91000 ---p 00092000 68:05 6270008 /usr/lib64/libkrb5.so.3.3 3cdca91000-3cdca95000 rw-p 00091000 68:05 6270008 /usr/lib64/libkrb5.so.3.3 3cdcc00000-3cdcc24000 r-xp 00000000 68:05 6270001 /usr/lib64/libk5crypto.so.3.1 3cdcc24000-3cdce23000 ---p 00024000 68:05 6270001 /usr/lib64/libk5crypto.so.3.1 3cdce23000-3cdce25000 rw-p 00023000 68:05 6270001 /usr/lib64/libk5crypto.so.3.1 3cdd000000-3cdd008000 r-xp 00000000 68:05 6269995 /usr/lib64/libkrb5support.so.0.1 3cdd008000-3cdd207000 ---p 00008000 68:05 6269995 /usr/lib64/libkrb5support.so.0.1 3cdd207000-3cdd208000 rw-p 00007000 68:05 6269995 /usr/lib64/libkrb5support.so.0.1 3cdd400000-3cdd42c000 r-xp 00000000 68:05 6270239 /usr/lib64/libgssapi_krb5.so.2.2 3cdd42c000-3cdd62c000 ---p 0002c000 68:05 6270239 /usr/lib64/libgssapi_krb5.so.2.2 3cdd62c000-3cdd62e000 rw-p 0002c000 68:05 6270239 /usr/lib64/libgssapi_krb5.so.2.2 3cddc00000-3cddc46000 r-xp 00000000 68:05 6391219 /lib64/libssl.so.0.9.8e 3cddc46000-3cdde46000 ---p 00046000 68:05 6391219 /lib64/libssl.so.0.9.8e 3cdde46000-3cdde4c000 rw-p 00046000 68:05 6391219 /lib64/libssl.so.0.9.8e 3fee800000-3fee832000 r-xp 00000000 68:05 6276884 /usr/lib64/libGeoIP.so.1.4.6 3fee832000-3feea32000 ---p 00032000 68:05 6276884 /usr/lib64/libGeoIP.so.1.4.6 3feea32000-3feea33000 rw-p 00032000 68:05 6276884 /usr/lib64/libGeoIP.so.1.4.6 2b71700eb000-2b71700ed000 rw-p 2b71700eb000 00:00 0 2b71700ed000-2b71700f5000 rw-s 00000000 00:09 3585823051 /dev/zero (deleted) 2b71700f5000-2b71700f6000 rw-s 00000000 00:09 3585823054 /dev/zero (deleted) 2b71700fc000-2b71700fd000 rw-p 2b71700fc000 00:00 0 2b71700fd000-2b71700ff000 r-xp 00000000 68:05 6389771 /lib64/libdl-2.5.so 2b71700ff000-2b71702ff000 ---p 00002000 68:05 6389771 /lib64/libdl-2.5.so 2b71702ff000-2b7170300000 r--p 00002000 68:05 6389771 /lib64/libdl-2.5.so 2b7170300000-2b7170301000 rw-p 00003000 68:05 6389771 /lib64/libdl-2.5.so 2b7170301000-2b7170304000 rw-p 2b7170301000 00:00 0 2b7170304000-2b7170314000 r-xp 00000000 68:05 6269359 /usr/lib64/libXpm.so.4.11.0 2b7170314000-2b7170514000 ---p 00010000 68:05 6269359 /usr/lib64/libXpm.so.4.11.0 2b7170514000-2b7170515000 rw-p 00010000 68:05 6269359 /usr/lib64/libXpm.so.4.11.0 2b7170515000-2b717051a000 rw-p 2b7170515000 00:00 0 2b717051a000-2b7170555000 r-xp 00000000 68:05 6389821 /lib64/libsepol.so.1 2b7170555000-2b7170755000 ---p 0003b000 68:05 6389821 /lib64/libsepol.so.1 2b7170755000-2b7170756000 rw-p 0003b000 68:05 6389821 /lib64/libsepol.so.1 2b7170756000-2b7170763000 rw-p 2b7170756000 00:00 0 2b7170763000-2b717076d000 r-xp 00000000 68:05 6389786 /lib64/libnss_files-2.5.so 2b717076d000-2b717096c000 ---p 0000a000 68:05 6389786 /lib64/libnss_files-2.5.so 2b717096c000-2b717096d000 r--p 00009000 68:05 6389786 /lib64/libnss_files-2.5.so 2b717096d000-2b717096e000 rw-p 0000a000 68:05 6389786 /lib64/libnss_files-2.5.so 2b717096e000-2b7170c91000 rw-p 2b717096e000 00:00 0 7fffa9293000-7fffa92a8000 rw-p 7ffffffe9000 00:00 0 [stack] 7fffa92a9000-7fffa92ad000 r-xp 7fffa92a9000 00:00 0 [vdso] ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vsyscall] 2011/09/21 22:00:01 [alert] 29216#0: worker process 29786 exited on signal 6 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4376 bytes Desc: S/MIME Cryptographic Signature URL: From mdounin at mdounin.ru Wed Sep 21 20:18:10 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 22 Sep 2011 00:18:10 +0400 Subject: process corruption on CentOS 5.6 In-Reply-To: <4E7A4313.9090703@mail.huji.ac.il> References: <4E7A4313.9090703@mail.huji.ac.il> Message-ID: <20110921201810.GA1137@mdounin.ru> Hello! On Wed, Sep 21, 2011 at 11:03:31PM +0300, Avishai Ish-Shalom wrote: > On CentOS 5.6, nginx 1.1.4 configured to work with php-fpm using fastcgi > port. nginx was compiled with: configure --prefix=/usr/local/nginx > --with-http_ssl_module --with-http_realip_module > --with-http_geoip_module --with-http_flv_module > --with-http_gzip_static_module --with-http_stub_status_module > --with-http_addition_module --with-http_image_filter_module > --with-http_sub_module --with-http_degradation_module > --add-module=addons/ngx_upstream_fair --with-cc-opt="-D > NGX_UPSTREAM_KEEPALIVE_PATCHED" Just a side note: you don't need --with-cc-opt="-D NGX_UPSTREAM_KEEPALIVE_PATCHED"'. > > every few seconds, i get: > > *** glibc detected *** nginx: worker process: double free or corruption > (!prev): 0x000000001d069800 *** Could you please provide backtrace? See here for details: http://wiki.nginx.org/Debugging Alternatively, please try the patch from here: http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001233.html (And provide backtrace if it doesn't help.) Maxim Dounin From info at bizhat.com Wed Sep 21 20:44:04 2011 From: info at bizhat.com (BizHat.com Support) Date: Thu, 22 Sep 2011 02:14:04 +0530 Subject: Problem with MediaWiki File page Message-ID: HI, I have following nginx configuration for a MediaWiki based site server { listen 174.36.130.243:80; server_name webhostingneeds.com www.webhostingneeds.com; location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg|html)$ { root /home/webhost/public_html/; access_log /var/log/nginx/webhostingneeds.com_static.log; } location / { proxy_pass http://174.36.130.243:81/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 1m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } } The problem is when a file is uploaded to MediaWIki, i shows a page like http://webhostingneeds.com/File:FILENAME.exten For example http://webhostingneeds.com/File:Averttv_device_property.jpg Since the file extension is .jpg, nginx try to service this as static content. How i can set nginx to serve static files, pass anything starting with /File: to apache ? Thanks, Santhosh From abioy.sun at gmail.com Wed Sep 21 23:36:31 2011 From: abioy.sun at gmail.com (Abioy Sun) Date: Thu, 22 Sep 2011 07:36:31 +0800 Subject: returning NGX_AGAIN kills performance? Message-ID: hi, i currently dev a module which makes multi subrequest sequently in the access phase handler, via returning NGX_AGAIN. my question is, will this kill the performance? and how far could it go in killing performance. thx! Abioy -------------- next part -------------- An HTML attachment was scrubbed... URL: From kworthington at gmail.com Thu Sep 22 01:10:49 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Wed, 21 Sep 2011 21:10:49 -0400 Subject: nginx-1.1.4 In-Reply-To: <20110920112225.GC54733@nginx.com> References: <20110920112225.GC54733@nginx.com> Message-ID: Hello Nginx Users, I just released Nginx 1.1.4 For Windows http://goo.gl/WzEeA (32-bit and 64-bit) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Official Windows binaries are at nginx.org Thanks, Kevin -- Kevin Worthington kworthington (at] gmail {dot) com On Tue, Sep 20, 2011 at 7:22 AM, Igor Sysoev wrote: > Changes with nginx 1.1.4 20 Sep > 2011 > > *) Feature: the ngx_http_upstream_keepalive module. > > *) Feature: the "proxy_http_version" directive. > > *) Feature: the "fastcgi_keep_conn" directive. > > *) Feature: the "worker_aio_requests" directive. > > *) Bugfix: if nginx was built --with-file-aio it could not be run on > Linux kernel which did not support AIO. > > *) Bugfix: in Linux AIO error processing. > Thanks to Hagai Avrahami. > > *) Bugfix: reduced memory consumption for long-lived requests. > > *) Bugfix: the module ngx_http_mp4_module did not support 64-bit MP4 > "co64" atom. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierig at linuxdataflow.org Wed Sep 21 14:52:29 2011 From: pierig at linuxdataflow.org (Pierig Le Saux) Date: Wed, 21 Sep 2011 16:52:29 +0200 (CEST) Subject: mp4 module In-Reply-To: <072588df6d07290a30ba33099451c5f9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <26b417a4-12dc-4c21-bf9d-7cbb89fbc51f@mail1.linuxdataflow.org> To my understanding both mod-h264 (code-shop) and mod-mp4 (nginx) are very similar, as they allow seeking in mp4 files. The mod_smooth_streaming for Code-shop is the one that is different. Regards, Pierig Le Saux ----- Mail original ----- De: "ahu" ?: nginx at nginx.org Envoy?: Mercredi 21 Septembre 2011 16:18:31 Objet: Re: mp4 module I am very curious about what the difference between this modle and the 3rd modle(http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Nginx-Version2). Which one should I use? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215011,215506#msg-215506 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From kingsley at internode.com.au Thu Sep 22 08:07:24 2011 From: kingsley at internode.com.au (Kingsley Foreman) Date: Thu, 22 Sep 2011 08:07:24 +0000 Subject: keepalive_requests on backend Message-ID: <6FA1B8C1117F444AB55F3E36E9314EC841591BF6@EXCHMBX-ADL6-01.staff.internode.com.au> Hi guys I use upstream backend{ server xxx.xxx.xxx.xxx:80; keepalive 40; } I was wondering if this listened to "keepalive_requests" I would like to be able to make sure the backend will only maintain a connection for say 1000 queries before it reconnects. Kingsley -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Sep 22 08:37:05 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 22 Sep 2011 12:37:05 +0400 Subject: keepalive_requests on backend In-Reply-To: <6FA1B8C1117F444AB55F3E36E9314EC841591BF6@EXCHMBX-ADL6-01.staff.internode.com.au> References: <6FA1B8C1117F444AB55F3E36E9314EC841591BF6@EXCHMBX-ADL6-01.staff.internode.com.au> Message-ID: <20110922083705.GD1137@mdounin.ru> Hello! On Thu, Sep 22, 2011 at 08:07:24AM +0000, Kingsley Foreman wrote: > Hi guys > > I use > > upstream backend{ > server xxx.xxx.xxx.xxx:80; > keepalive 40; > } > > I was wondering if this listened to "keepalive_requests" > > I would like to be able to make sure the backend will only > maintain a connection for say 1000 queries before it reconnects. Right now nginx doesn't set any limits on number of requests to backend via single keepalive connection. Backend may do so. Maxim Dounin From atistler at gmail.com Thu Sep 22 09:17:18 2011 From: atistler at gmail.com (Adam Tistler) Date: Thu, 22 Sep 2011 05:17:18 -0400 Subject: ssl redirect issue Message-ID: <20A49295-A19F-49A2-8AFB-C4C6145DB2C7@gmail.com> Hi, I have an ssl nginx setup which was working fine with one server { ssl on }. However I have legacy ssl server_names that I would like to have a 'catch all' for that should be redirected back to the 'main' ssl server name. Config is pasted here. http://pastebin.com/dXU7BHaB ( I removed some sections for brevity ) When the following lines are enabled: server { listen 443 default; server_name _; rewrite ^(.*) https://my.example.net$1 permanent; } I will get: SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long) If i comment those lines out, the request will go thru just fine. However since: server { listen 443; server_name my.example.net; is treated as the default vhost, even ssl requests for myold.example.net are serviced by this server {} and are not redirected to https://my.example.net (obviously not what I want). Thanks for the help in advanced. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Sep 22 09:25:05 2011 From: nginx-forum at nginx.us (lys0212) Date: Thu, 22 Sep 2011 05:25:05 -0400 Subject: nginx use memc Message-ID: <2e626c380c15420f5b6177d971a07eae.NginxMailingListEnglish@forum.nginx.org> Hello! Encountered in the use of memc such a problem, I do not know how to solve. In the nginx configuration file and php file using memc, can be normal cache. However, if the cache of php file include jump statement, such as @header, then jump failure. How to solve this problem? nginx.conf server { ... location ~ /async/(.*) { set_md5 $md5 $host$request_uri; set $memc_key $md5; memc_pass memcbackend; memc_flags_to_last_modified on; memc_connect_timeout 30s; memc_send_timeout 30s; memc_read_timeout 30s; access_log off; expires max; error_page 404 = /async/index.php?$query_string ; } ... } php file /async/index.php addServer('192.168.3.101', 3000); $m->setOption(Memcached::OPT_COMPRESSION, false); $time = time(); $urlInfo = parse_url($_SERVER ['REQUEST_URI']); $key = $_SERVER ['SERVER_NAME'].$_SERVER ['REQUEST_URI']; echo $key; $m->set(md5($key), $time ,60); ?> If the access address http://www.test.com/async/test.php /async/ directory is not include test.phpd file, it will be 404 redirected to /async/ index.php, but the @header in /async/index.php will not be effective. How to solve this problem? Thank you very much! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215565,215565#msg-215565 From agentzh at gmail.com Thu Sep 22 09:44:43 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 22 Sep 2011 17:44:43 +0800 Subject: nginx use memc In-Reply-To: <2e626c380c15420f5b6177d971a07eae.NginxMailingListEnglish@forum.nginx.org> References: <2e626c380c15420f5b6177d971a07eae.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Sep 22, 2011 at 5:25 PM, lys0212 wrote: > Hello! > ? ? Encountered in the use of memc such a problem, I do not know how to > solve. In the nginx configuration file and php file using memc, can be > normal cache. However, if the cache of php file include jump statement, > such as @header, then jump failure. How to solve this problem? Please do not abuse the error_page directive with ngx_memc to do response caching; it's problematic. I suggest you take a look at the ngx_srcache module which can serve as a generic cache layer and can be used safely with backend storage modules like ngx_memc: http://wiki.nginx.org/HttpSRCacheModule Regards, -agentzh From nginx-forum at nginx.us Thu Sep 22 10:44:19 2011 From: nginx-forum at nginx.us (Lintu) Date: Thu, 22 Sep 2011 06:44:19 -0400 Subject: php-fastcgi always exits.. resulting in 502 bad gateway Message-ID: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> Hello everyone, I'm using nginx since some days and I got a little trouble. It seems that after some while of working fine nginx exits the fastcgi-daemon and whenever I try to call a php site then, it shows me 502 Bad Gateway. Then I have to "/usr/bin/php-fastcgi start" and everything runs fine again. So basically my question: How do I make the php-fastcgi not exit itself or how do I make it automatically restart on exit? It's annoying that my website everytime turns to "502 Bad Gateway" to everyone and I don't even know about that! Can anyone help me please? :( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215576,215576#msg-215576 From nginx-forum at nginx.us Thu Sep 22 11:03:57 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Thu, 22 Sep 2011 07:03:57 -0400 Subject: mp4 module In-Reply-To: <20110909115107.GH97288@nginx.com> References: <20110909115107.GH97288@nginx.com> Message-ID: <76c3136923f6db464986dd2fd3c4fa01.NginxMailingListEnglish@forum.nginx.org> To quote Igors original post: "If you use 3rd-party mp4 module, it should be removed." Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215011,215577#msg-215577 From atistler at gmail.com Thu Sep 22 11:23:46 2011 From: atistler at gmail.com (Adam Tistler) Date: Thu, 22 Sep 2011 07:23:46 -0400 Subject: ssl redirect issue In-Reply-To: <20A49295-A19F-49A2-8AFB-C4C6145DB2C7@gmail.com> References: <20A49295-A19F-49A2-8AFB-C4C6145DB2C7@gmail.com> Message-ID: Actually, I can work around this issue by adding: if ($host !~* ^(my.example.net)$ ) { rewrite ^(.*) https://my.example.net$1 permanent; } I am curious however this does not work when I put the redirect in the default ( '_' ) server config On Sep 22, 2011, at 5:17 AM, Adam Tistler wrote: > Hi, > > I have an ssl nginx setup which was working fine with one server { ssl on }. However I have legacy ssl server_names that I would like to have a 'catch all' for that should be redirected back to the 'main' ssl server name. Config is pasted here. > > http://pastebin.com/dXU7BHaB ( I removed some sections for brevity ) > > > When the following lines are enabled: > > server { > listen 443 default; > server_name _; > rewrite ^(.*) https://my.example.net$1 permanent; > } > > I will get: > > SSL received a record that exceeded the maximum permissible length. > (Error code: ssl_error_rx_record_too_long) > > If i comment those lines out, the request will go thru just fine. However since: > > server { > listen 443; > server_name my.example.net; > > > is treated as the default vhost, even ssl requests for myold.example.net are serviced by this server {} and are not redirected to https://my.example.net (obviously not what I want). > > Thanks for the help in advanced. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kingsley at internode.com.au Thu Sep 22 11:26:42 2011 From: kingsley at internode.com.au (Kingsley Foreman) Date: Thu, 22 Sep 2011 11:26:42 +0000 Subject: keepalive_requests on backend In-Reply-To: <20110922083705.GD1137@mdounin.ru> References: <6FA1B8C1117F444AB55F3E36E9314EC841591BF6@EXCHMBX-ADL6-01.staff.internode.com.au>, <20110922083705.GD1137@mdounin.ru> Message-ID: <6FA1B8C1117F444AB55F3E36E9314EC841591DE7@EXCHMBX-ADL6-01.staff.internode.com.au> Is it worth making it a feature request? Kingsley ________________________________________ From: nginx-bounces at nginx.org [nginx-bounces at nginx.org] on behalf of Maxim Dounin [mdounin at mdounin.ru] Sent: 22 September 2011 18:07 To: nginx at nginx.org Subject: Re: keepalive_requests on backend Hello! On Thu, Sep 22, 2011 at 08:07:24AM +0000, Kingsley Foreman wrote: > Hi guys > > I use > > upstream backend{ > server xxx.xxx.xxx.xxx:80; > keepalive 40; > } > > I was wondering if this listened to "keepalive_requests" > > I would like to be able to make sure the backend will only > maintain a connection for say 1000 queries before it reconnects. Right now nginx doesn't set any limits on number of requests to backend via single keepalive connection. Backend may do so. Maxim Dounin _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From r at roze.lv Thu Sep 22 11:28:36 2011 From: r at roze.lv (Reinis Rozitis) Date: Thu, 22 Sep 2011 14:28:36 +0300 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> References: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3F87DBC5FDD04B4CAA08159D02DF9147@DD21> > So basically my question: How do I make the php-fastcgi not exit itself or how do I make it automatically restart on exit? Best way to do it is to use inbuilt process manager PHP-FPM http://www.php.net/manual/en/install.fpm.php (since 5.3.x its in php core). rr From francis at daoine.org Thu Sep 22 11:29:51 2011 From: francis at daoine.org (Francis Daly) Date: Thu, 22 Sep 2011 12:29:51 +0100 Subject: Problem with MediaWiki File page In-Reply-To: References: Message-ID: <20110922112951.GF12179@craic.sysops.org> On Thu, Sep 22, 2011 at 02:14:04AM +0530, BizHat.com Support wrote: Hi there, > location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg|html)$ { > root /home/webhost/public_html/; > access_log /var/log/nginx/webhostingneeds.com_static.log; > } > location / { > proxy_pass http://174.36.130.243:81/; (plus extra proxy settings) > } > The problem is when a file is uploaded to MediaWIki, i shows a page like > > http://webhostingneeds.com/File:FILENAME.exten > > For example > > http://webhostingneeds.com/File:Averttv_device_property.jpg > > Since the file extension is .jpg, nginx try to service this as static content. > > How i can set nginx to serve static files, pass anything starting with > /File: to apache ? nginx configuration is based on location blocks. One request is handled by one location. Details at http://wiki.nginx.org/HttpCoreModule#location Your current config has one location for urls that match a regex, such that they end in one of 11 specific strings; plus one location for everything else. You want a new location for urls that start with one specific string, and you want regex locations not to be tested if this location matches. So do exactly that: location ^~ /File: { } and inside that location block, put your full proxy_pass and other relevant configuration. All the best, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Thu Sep 22 11:34:02 2011 From: nginx-forum at nginx.us (tomp) Date: Thu, 22 Sep 2011 07:34:02 -0400 Subject: max_fails includes read_timeout even if timeout is excluded from proxy_next_upstream Message-ID: Hi, I am having some trouble with the latest stable of Nginx's proxy upstream support. I would like Nginx to NOT count read timeouts towards the max_fails in the upstream definition. Here is what I have: proxy_cache_path /var/cache/nginx/tptest levels=1:2 keys_zone=tptest:10m; upstream tptestBackend { server tp.dev.infinity.local max_fails=1 fail_timeout=30s; server dn.dev.infinity.local max_fails=1 fail_timeout=30s; } server { listen 172.16.0.64:80; server_name tp.nginx.dev.infinity.local; proxy_cache tptest; proxy_set_header Host 'tp.dev.infinity.local'; proxy_set_header X-Real-IP $remote_addr; proxy_cache_key http://$host$request_uri; proxy_connect_timeout 1; proxy_cache_use_stale error timeout updating invalid_header http_500 http_502 http_503 http_504; proxy_next_upstream error http_500 http_502 http_503 http_504; proxy_read_timeout 5; location / { proxy_pass http://tptestBackend; } } I have removed "timeout" from the proxy_next_upstream directive, however when I try with a script that sleeps forever, the timeout kicks in, but it does count towards the max_fails, and so next time only the second server is used. Is this a bug? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215585,215585#msg-215585 From mdounin at mdounin.ru Thu Sep 22 11:34:36 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 22 Sep 2011 15:34:36 +0400 Subject: keepalive_requests on backend In-Reply-To: <6FA1B8C1117F444AB55F3E36E9314EC841591DE7@EXCHMBX-ADL6-01.staff.internode.com.au> References: <6FA1B8C1117F444AB55F3E36E9314EC841591BF6@EXCHMBX-ADL6-01.staff.internode.com.au> <20110922083705.GD1137@mdounin.ru> <6FA1B8C1117F444AB55F3E36E9314EC841591DE7@EXCHMBX-ADL6-01.staff.internode.com.au> Message-ID: <20110922113436.GH1137@mdounin.ru> Hello! On Thu, Sep 22, 2011 at 11:26:42AM +0000, Kingsley Foreman wrote: > Is it worth making it a feature request? As long as you'll explain why do you think it's usefull. Maxim Dounin > > Kingsley > > ________________________________________ > From: nginx-bounces at nginx.org [nginx-bounces at nginx.org] on behalf of Maxim Dounin [mdounin at mdounin.ru] > Sent: 22 September 2011 18:07 > To: nginx at nginx.org > Subject: Re: keepalive_requests on backend > > Hello! > > On Thu, Sep 22, 2011 at 08:07:24AM +0000, Kingsley Foreman wrote: > > > Hi guys > > > > I use > > > > upstream backend{ > > server xxx.xxx.xxx.xxx:80; > > keepalive 40; > > } > > > > I was wondering if this listened to "keepalive_requests" > > > > I would like to be able to make sure the backend will only > > maintain a connection for say 1000 queries before it reconnects. > > Right now nginx doesn't set any limits on number of requests to > backend via single keepalive connection. Backend may do so. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu Sep 22 11:44:37 2011 From: nginx-forum at nginx.us (Lintu) Date: Thu, 22 Sep 2011 07:44:37 -0400 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <3F87DBC5FDD04B4CAA08159D02DF9147@DD21> References: <3F87DBC5FDD04B4CAA08159D02DF9147@DD21> Message-ID: <2d5f13bd1416db57ed25a2212d34bf94.NginxMailingListEnglish@forum.nginx.org> I'm running Debian Lenny which has only php 5.2 :( I tried apt-get install php5-fpm and php-fpm, but both don't work. How to get it on Debian Lenny? I cant compile php on my own... :( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215576,215588#msg-215588 From edho at myconan.net Thu Sep 22 11:55:44 2011 From: edho at myconan.net (Edho P Arief) Date: Thu, 22 Sep 2011 18:55:44 +0700 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <2d5f13bd1416db57ed25a2212d34bf94.NginxMailingListEnglish@forum.nginx.org> References: <3F87DBC5FDD04B4CAA08159D02DF9147@DD21> <2d5f13bd1416db57ed25a2212d34bf94.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Sep 22, 2011 6:44 PM, "Lintu" wrote: > > I'm running Debian Lenny which has only php 5.2 :( > > I tried apt-get install php5-fpm and php-fpm, but both don't work. How > to get it on Debian Lenny? I cant compile php on my own... Install supervisord. You can then create as many php-cgi processes using supervisord which will be automatically restarted upon killed. I usually use virtualenv to create dedicated python environment for supervisord. - extract virtualenv to /opt - create supervisord environment by issuing /opt/virtualenv/virtualenv.py /opt/supervisor - install supervisord /opt/supervisor/bin/easy_install supervisor - configure accordingly (check its documentation) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Sep 22 12:08:45 2011 From: nginx-forum at nginx.us (Lintu) Date: Thu, 22 Sep 2011 08:08:45 -0400 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: References: Message-ID: Hey, thanks for the tip with supervisord. I found a site (http://sachachua.com/blog/2010/06/using-supervisord-for-nginxfastcgiphp/) saying its easy to set up with: >apt-get install python-setuptools >easy_install supervisor And actually it was. No error on that. But then the site says I should add something to /etc/supervisord.conf, but there is no file like that? I created it with the content I got told to, but well, nothing happens now... Or is everything fine now? Is everything automated about supervisord? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215576,215593#msg-215593 From jdmls at yahoo.com Thu Sep 22 12:10:53 2011 From: jdmls at yahoo.com (John Doe) Date: Thu, 22 Sep 2011 05:10:53 -0700 (PDT) Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> References: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1316693453.92570.YahooMailNeo@web114711.mail.gq1.yahoo.com> From: Lintu > I'm using nginx since some days and I got a little trouble. It seems > that after some while of working fine nginx exits the fastcgi-daemon and > whenever I try to call a php site then, it shows me 502 Bad Gateway. > Then I have to "/usr/bin/php-fastcgi start" and everything runs fine > again. > So basically my question: How do I make the php-fastcgi not exit itself > or how do I make it automatically restart on exit? It's annoying that my > website everytime turns to "502 Bad Gateway" to everyone and I > don't even know about that! We use spawn-fcgi here. JD From edho at myconan.net Thu Sep 22 12:22:52 2011 From: edho at myconan.net (Edho P Arief) Date: Thu, 22 Sep 2011 19:22:52 +0700 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: References: Message-ID: On Thu, Sep 22, 2011 at 7:08 PM, Lintu wrote: > Hey, thanks for the tip with supervisord. > > I found a site > (http://sachachua.com/blog/2010/06/using-supervisord-for-nginxfastcgiphp/) > saying its easy to set up with: > >>apt-get install python-setuptools >>easy_install supervisor > > And actually it was. No error on that. But then the site says I should > add something to /etc/supervisord.conf, but there is no file like that? > I created it with the content I got told to, but well, nothing happens > now... Or is everything fine now? Is everything automated about > supervisord? > run supervisorctl or just use ps check if the php-cgi processes are running. Set nginx fastcgi_pass to whatever path you set in supervisord for php-cgi. -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From edho at myconan.net Thu Sep 22 12:25:12 2011 From: edho at myconan.net (Edho P Arief) Date: Thu, 22 Sep 2011 19:25:12 +0700 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: References: Message-ID: On Thu, Sep 22, 2011 at 7:22 PM, Edho P Arief wrote: > On Thu, Sep 22, 2011 at 7:08 PM, Lintu wrote: >> Hey, thanks for the tip with supervisord. >> >> I found a site >> (http://sachachua.com/blog/2010/06/using-supervisord-for-nginxfastcgiphp/) >> saying its easy to set up with: >> >>>apt-get install python-setuptools >>>easy_install supervisor >> >> And actually it was. No error on that. But then the site says I should >> add something to /etc/supervisord.conf, but there is no file like that? the basic config can be generated by command echo_supervisord_conf (you need to copy-paste the result or pipe it to file). -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From appa at perusio.net Thu Sep 22 12:32:17 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 22 Sep 2011 13:32:17 +0100 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> References: <97d9cbc8779183130f5ec6d9cf5ec82e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <877h504v1q.wl%appa@perusio.net> On 22 Set 2011 11h44 WEST, nginx-forum at nginx.us wrote: > Hello everyone, > > I'm using nginx since some days and I got a little trouble. It seems > that after some while of working fine nginx exits the fastcgi-daemon > and whenever I try to call a php site then, it shows me 502 Bad > Gateway. > > Then I have to "/usr/bin/php-fastcgi start" and everything runs fine > again. > So basically my question: How do I make the php-fastcgi not exit > itself or how do I make it automatically restart on exit? It's > annoying that my website everytime turns to "502 Bad Gateway" to > everyone and I don't even know about that! > > Can anyone help me please? :( Use one of the many init scripts available throughout the interwebs. Also I suggest monit for monitoring the process. I now use php-fpm, but before I used the "regular" php-cgi with this init script: https://github.com/perusio/php-fastcgi-debian-script and a monit configuration for monitoring it: https://github.com/perusio/monit-miscellaneous/blob/master/php-cgi HTH, --- appa From appa at perusio.net Thu Sep 22 12:41:08 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 22 Sep 2011 13:41:08 +0100 Subject: ssl redirect issue In-Reply-To: References: <20A49295-A19F-49A2-8AFB-C4C6145DB2C7@gmail.com> Message-ID: <8762kk4umz.wl%appa@perusio.net> On 22 Set 2011 12h23 WEST, atistler at gmail.com wrote: > Actually, I can work around this issue by adding: > > if ($host !~* ^(my.example.net)$ ) { > rewrite ^(.*) https://my.example.net$1 permanent; > } > > I am curious however this does not work when I put the redirect in > the default ( '_' ) server config '_' is a not a valid hostname. The reason it's used in the recommended configuration for default servers is that there's no risk of colliding with anything else and you can have individual vhost configs for each proper hostname. Your config should be something like this: server { server_name my.example.net; return 301 https://myexample.net$request_uri; } Then you should have the regular HTTPs server config that listens on port 443. server { listen 443 ssl; server_name my.example.net; # remaining server config... } Repeat the above for each domain redirect you want to have. Additional reading: http://nginx.org/en/docs/http/configuring_https_servers.html http://nginx.org/en/docs/http/server_names.html --- appa From r at roze.lv Thu Sep 22 12:45:34 2011 From: r at roze.lv (Reinis Rozitis) Date: Thu, 22 Sep 2011 15:45:34 +0300 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <2d5f13bd1416db57ed25a2212d34bf94.NginxMailingListEnglish@forum.nginx.org> References: <3F87DBC5FDD04B4CAA08159D02DF9147@DD21> <2d5f13bd1416db57ed25a2212d34bf94.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5BC8A8A188F3425EB0C8FCD7C8605D8A@DD21> > I'm running Debian Lenny which has only php 5.2 :( I'm not a Debian user but you could add the dotdeb repo ( http://www.dotdeb.org/2011/08/30/php-5-3-8-is-available/ ). Sticking with old and unsupported php release isnt a good thing. rr From ian.hobson at ntlworld.com Thu Sep 22 13:29:38 2011 From: ian.hobson at ntlworld.com (Ian Hobson) Date: Thu, 22 Sep 2011 14:29:38 +0100 Subject: Config help needed Message-ID: <4E7B3842.1040708@ntlworld.com> Hi All, My site is wordpress, and configured as follows. # Statements for KindleMonster.com virtual server server { listen 80; # server_name kindlemonster.com www.kindlemonster.com; root /var/www/kindlemonster.com/htdocs; access_log /var/www/kindlemonster.com/access.log; index index.php index.html index.htm; # # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; # protect usage stats location ^~ /usage/ { auth_basic "Hello, please login"; auth_basic_user_file /var/www/kindlemnonster.com/passwords; } # all .php requests to fastcgi using uri. location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } try_files $uri $uri/ /index.php; } Wordpress works just fine. I have just uploaded a new file to /form.php and when I try to browse to it I get the super helpful error message of No input file specified. The log says its a 404. OK - Why do all the wordpress files (mostly php) work just fine, and my new file does not? Thanks Ian From appa at perusio.net Thu Sep 22 13:45:00 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 22 Sep 2011 14:45:00 +0100 Subject: Problem with MediaWiki File page In-Reply-To: References: Message-ID: <871uv84roj.wl%appa@perusio.net> On 21 Set 2011 21h44 WEST, info at bizhat.com wrote: > HI, > > I have following nginx configuration for a MediaWiki based site > > > server { > listen 174.36.130.243:80; > server_name webhostingneeds.com www.webhostingneeds.com; > > location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg|html)$ { > root /home/webhost/public_html/; > access_log /var/log/nginx/webhostingneeds.com_static.log; > } > > location / { > proxy_pass http://174.36.130.243:81/; > proxy_redirect off; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > client_max_body_size 1m; > client_body_buffer_size 128k; > proxy_connect_timeout 90; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 4k; > proxy_buffers 4 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > } > } > > The problem is when a file is uploaded to MediaWIki, i shows a page > like > > http://webhostingneeds.com/File:FILENAME.exten This should work: location / { proxy_pass http://174.36.130.243:81/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 1m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; location ^~ /File: { location ~* /File:[^/]*\.(?:jpe?g|png|gif|html)$ { proxy_pass http://174.36.130.243:81/; } } } > For example > > http://webhostingneeds.com/File:Averttv_device_property.jpg > > Since the file extension is .jpg, nginx try to service this as > static content. > > How i can set nginx to serve static files, pass anything starting > with /File: to apache ? --- appa From nginx-forum at nginx.us Thu Sep 22 15:39:36 2011 From: nginx-forum at nginx.us (etrader) Date: Thu, 22 Sep 2011 11:39:36 -0400 Subject: How to avoid 404 for images in access log? Message-ID: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> My access log is full of 404 logs for images not found; thus, it is difficult to find real 200 successful visits. The lines include ... GET /css/img/calendar.png HTTP/1.1" 404 31 "http://mydomain.com.page.html ... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215626,215626#msg-215626 From zzz at zzz.org.ua Thu Sep 22 15:45:32 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Thu, 22 Sep 2011 18:45:32 +0300 Subject: How to avoid 404 for images in access log? In-Reply-To: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> References: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 9/22/11, etrader wrote: > My access log is full of 404 logs for images not found; thus, it is > difficult to find real 200 successful visits. The lines include > > ... GET /css/img/calendar.png HTTP/1.1" 404 31 > "http://mydomain.com.page.html ... Try something like cat access.log | grep " 200 " From nginx-forum at nginx.us Thu Sep 22 15:49:20 2011 From: nginx-forum at nginx.us (openclinica) Date: Thu, 22 Sep 2011 11:49:20 -0400 Subject: Timeout Issues Message-ID: Hi All, I submitted this originally through the lists but I noticed it did not create a topic here for it. So I am adding it as a topic, I hope this acceptable. Hi All, Ok I am having issues with NGINX and it timing out. My scenario is that I am using NGINX as a web server front end for my application. I have two folder being served as alias?s for static content and one location doing a proxy_pass to a java server. My issue is that on one of the request that goes through the proxy_pass to the local java web server will time out through nginx within 10 minutes. The timeout is a browser timeout. It takes 11-12 minutes to load the page without nginx, so I need nginx to not kill the session until that time has passed. I have tried every timeout setting imaginable that I could find and I still get a browser timeout at 10 minutes. Note this is an SSL connection, the test without nginx in the way was also an SSL connection. Below are my configs, note all the timeout options have been slowly added over time and lots of testing.....they are not my wanted scenario but I am trying to figure out how this is done. NGINX.conf user www-data; worker_processes 4; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 900 900; client_body_timeout 900; client_header_timeout 900; send_timeout 900; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_types text/plain text/html text/css text/javascript image/png image/x-icon application/x-javascript application/xml image/gif; ssl_session_cache shared:SSL:100k; ssl_session_timeout 20m; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } Site Conf server { listen 80; server_name localhost; #charset koi8-r; access_log /var/log/nginx/80-app.access.log; error_log /var/log/nginx/80-app.error.log; location / { rewrite ^/(.*)$ https://$host/$1 redirect; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443; server_name localhost; access_log /var/log/nginx/app.access.log; error_log /var/log/nginx/app.error.log; ssl on; ssl_certificate /usr/local/oc/install/server.com.crt; ssl_certificate_key /usr/local/oc/install/server.key; # fail_timeout 3600s; keepalive_timeout 900 900; client_body_timeout 900; client_header_timeout 900; send_timeout 900; # directly serve the static files in the `images` directory location ~ ^/APP/includes/(.*)$ { # add future expiry date to force caching of the file on the client expires max; add_header Cache-Control "public"; alias /usr/local/tomcat/webapps/APP/includes/$1; } location ~ ^/APP/images/(.*)$ { # add future expiry date to force caching of the file on the client expires max; add_header Cache-Control "public"; alias /usr/local/tomcat/webapps/APP/images/$1; } # pass all other requests to Tomcat location /APP { proxy_read_timeout 3600s; proxy_connect_timeout 3600s; proxy_send_timeout 3600s; proxy_pass http://127.0.0.1:8080/APP; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } Any help is greatly appreciated. I wouldn?t even mind if it is possible to disable timeout all together just as a test. Thanks, Shaun Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215628,215628#msg-215628 From nginx-forum at nginx.us Thu Sep 22 15:53:10 2011 From: nginx-forum at nginx.us (etrader) Date: Thu, 22 Sep 2011 11:53:10 -0400 Subject: How to avoid 404 for images in access log? In-Reply-To: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> References: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1b2407e8370fcacfce54bc5828f07bad.NginxMailingListEnglish@forum.nginx.org> You mean to read only 200 requests in ssh or something like that? I am looking for a way to avoid writing 404 requests in access log file to keep the file tidy. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215626,215630#msg-215630 From zzz at zzz.org.ua Thu Sep 22 16:03:09 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Thu, 22 Sep 2011 19:03:09 +0300 Subject: How to avoid 404 for images in access log? In-Reply-To: <1b2407e8370fcacfce54bc5828f07bad.NginxMailingListEnglish@forum.nginx.org> References: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> <1b2407e8370fcacfce54bc5828f07bad.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 9/22/11, etrader wrote: > You mean to read only 200 requests in ssh or something like that? > I am looking for a way to avoid writing 404 requests in access log file > to keep the file tidy. There is a way. But 404 requests are essential for security, i.e. to see when someone is trying to hack your website, etc. From r at roze.lv Thu Sep 22 16:16:05 2011 From: r at roze.lv (Reinis Rozitis) Date: Thu, 22 Sep 2011 19:16:05 +0300 Subject: How to avoid 404 for images in access log? In-Reply-To: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> References: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> Message-ID: <49D0103F7210443997EF51AA7BD8EB4B@DD21> > My access log is full of 404 logs for images not found; thus, it is difficult to find real 200 successful visits. The lines > include > ... GET /css/img/calendar.png HTTP/1.1" 404 31 > "http://mydomain.com.page.html ... Depending on if you don't want to log 404 requests at all or just for the images can probably do something like this: location ~* ^.+\.(jpg|jpeg|gif|png)$ { error_page 404 @nolog; } location @nolog { access_log off; } If you want it for any request just use the error_page without location or even give a different logfile for the 404s. rr From nginx-forum at nginx.us Thu Sep 22 16:17:10 2011 From: nginx-forum at nginx.us (etrader) Date: Thu, 22 Sep 2011 12:17:10 -0400 Subject: How to avoid 404 for images in access log? In-Reply-To: References: Message-ID: Isn't it possible to use multiple access_log to split the access log to traffic and 404 logs ? Or probably writing 404 logs to error_log. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215626,215634#msg-215634 From ian at ianhobson.co.uk Thu Sep 22 16:33:15 2011 From: ian at ianhobson.co.uk (Ian Hobson) Date: Thu, 22 Sep 2011 17:33:15 +0100 Subject: Config help needed In-Reply-To: <4E7B3842.1040708@ntlworld.com> References: <4E7B3842.1040708@ntlworld.com> Message-ID: <4E7B634B.2070307@ianhobson.co.uk> To reply to my own post. It was a permissions problem. php could not read the file, and was reporting it as not there! Thanks Ian On 22/09/2011 14:29, Ian Hobson wrote: > Hi All, > > My site is wordpress, and configured as follows. > > # Statements for KindleMonster.com virtual server > server { > listen 80; > # > server_name kindlemonster.com www.kindlemonster.com; > root /var/www/kindlemonster.com/htdocs; > access_log /var/www/kindlemonster.com/access.log; > index index.php index.html index.htm; > # > # redirect server error pages to the static page /50x.html > # > error_page 500 502 503 504 /50x.html; > # protect usage stats > location ^~ /usage/ { > auth_basic "Hello, please login"; > auth_basic_user_file /var/www/kindlemnonster.com/passwords; > } > # all .php requests to fastcgi using uri. > location ~ \.php$ { > include /etc/nginx/fastcgi_params; > fastcgi_pass 127.0.0.1:9000; > # fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > } > try_files $uri $uri/ /index.php; > } > > Wordpress works just fine. I have just uploaded a new file to > /form.php and when > I try to browse to it I get the super helpful error message of > > No input file specified. > > The log says its a 404. > > OK - Why do all the wordpress files (mostly php) work just fine, and > my new file does not? > > Thanks > > Ian > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1410 / Virus Database: 1520/3911 - Release Date: 09/21/11 > > From nginx-forum at nginx.us Thu Sep 22 16:54:05 2011 From: nginx-forum at nginx.us (etrader) Date: Thu, 22 Sep 2011 12:54:05 -0400 Subject: How to avoid 404 for images in access log? In-Reply-To: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> References: <9f2d51afcce11583480dece2d34febee.NginxMailingListEnglish@forum.nginx.org> Message-ID: <520df39faeda9d3f65a3b700f1e0b8dc.NginxMailingListEnglish@forum.nginx.org> Thanks Reinis! It worked like a charm. But I have another problem (maybe I should to start a new thread). It lists the access of my own server to images. When someone visits an html page, an addition to this trick, a line is added with my server IP for reading the image within the html page. Since I just want the track of my traffic, this is useless to have it as my server has loaded the images. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215626,215642#msg-215642 From nginx-forum at nginx.us Thu Sep 22 17:17:25 2011 From: nginx-forum at nginx.us (etrader) Date: Thu, 22 Sep 2011 13:17:25 -0400 Subject: $server_name in error_log logfile name In-Reply-To: References: Message-ID: As far as I know, Nginx does not support variable in error_log. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215503,215647#msg-215647 From nginx-forum at nginx.us Thu Sep 22 17:47:47 2011 From: nginx-forum at nginx.us (Lintu) Date: Thu, 22 Sep 2011 13:47:47 -0400 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <5BC8A8A188F3425EB0C8FCD7C8605D8A@DD21> References: <5BC8A8A188F3425EB0C8FCD7C8605D8A@DD21> Message-ID: Reinis Rozitis Wrote: ------------------------------------------------------- > > I'm running Debian Lenny which has only php 5.2 > :( > > I'm not a Debian user but you could add the dotdeb > repo ( > http://www.dotdeb.org/2011/08/30/php-5-3-8-is-avai > lable/ ). > Sticking with old and unsupported php release isnt > a good thing. > > > rr > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx I used to do this and I hat php 5.3 running with apache. But when I decided to try something new to go with nginx instead of apache, I had trouble setting up nginx with php as that repository doesnt have the php-cgi package. Therefor all attempts to get any phpinfo() file run failed and I was forced to uninstall php 5.3 to install php 5.2. I wasn't really happy with that, but at least it works at all... So far I'm only half-satisfied with nginx, but I'm pretty sure thats just about the config, nginx sounds fine. Gonne read tons of HowTos and Docs and stuff I suppose Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215576,215649#msg-215649 From r at roze.lv Thu Sep 22 18:19:42 2011 From: r at roze.lv (Reinis Rozitis) Date: Thu, 22 Sep 2011 21:19:42 +0300 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: References: <5BC8A8A188F3425EB0C8FCD7C8605D8A@DD21> Message-ID: <029D40CC0F3D4095AEFFEC05BB25DA67@NeiRoze> > as that repository doesnt have the php-cgi package. You don't need the -cgi (it is the old naming when fastcgi was built in the cgi sapi) package but 'php5-fpm' . Also I think the packages are prefixed with 'php5' and called php5-fpm / php5-cgi ( http://php53.dotdeb.org/dists/lenny/php5/binary-amd64/ ) rr From nginx-forum at nginx.us Thu Sep 22 18:23:08 2011 From: nginx-forum at nginx.us (skyshade) Date: Thu, 22 Sep 2011 14:23:08 -0400 Subject: New MP4 Module and proxy_cache Message-ID: <8375196d213446dd1aa144c62daa47d2.NginxMailingListEnglish@forum.nginx.org> Hello, I test the new mp4 module, but its dont work with proxy_cache. There is any way to make its works with proxy_cache? Thanks all Sky Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215651,215651#msg-215651 From nginx-forum at nginx.us Thu Sep 22 20:03:51 2011 From: nginx-forum at nginx.us (stonor) Date: Thu, 22 Sep 2011 16:03:51 -0400 Subject: Serving stale items from cache In-Reply-To: <4262924B-D501-46F1-95D8-C0DA85D975D3@nginx.com> References: <4262924B-D501-46F1-95D8-C0DA85D975D3@nginx.com> Message-ID: <774008bf7b14a3cec6eb468015aedf62.NginxMailingListEnglish@forum.nginx.org> I would love to see this too in Nginx. The pattern is described here: http://www.mnot.net/blog/2007/12/12/stale The only software I've seen this implemented in is Squid 2.7 (stale-while-revalidate). >From time to time I see backends taking 800ms+ to generate a page at low traffic. It would be nice to hide most of these requests to the end user. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214606,215654#msg-215654 From sjaak23 at gmail.com Thu Sep 22 20:34:52 2011 From: sjaak23 at gmail.com (Sjaak Pieterse) Date: Thu, 22 Sep 2011 22:34:52 +0200 Subject: HttpHealthcheckModule server not marked down Message-ID: Hi there, i'm trying to use the HttpHealthcheckModule for nginx, but i have some troubles with it. i have two servers in my upstream, when sabotaging the health for one server i see in the status view of healthcheck that the server is down(1), but if i go to the website i'm checking i still come out on it and see a broken page. how can i arrange that the server automatically is marked as down when the check fails? sorry for my bad english and maybe noob questions. config: ?upstream www-health{ ??????? server x.x.x.1 ; ??????? server x.x.x.2 ; ??? healthcheck_enabled; ??? healthcheck_delay 10000 ; ??? healthcheck_timeout 1000; ??? healthcheck_failcount 2; ??? #healthcheck_expected 'I_AM_ALIVE'; ??? #Important: HTTP/1.0 ??? healthcheck_send "GET / HTTP/1.0" 'Host: health.test.x.com' 'Conection: close' ; } nginx: nginx version: nginx/1.0.6 nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) nginx: TLS SNI support enabled nginx: configure arguments: --with-http_ssl_module --add-module=/gnosek-nginx-upstream-fair-2131c73 --with-http_stub_status_module --add-module=/cep21-healthcheck_nginx_upstreams-b33a846 --prefix=/usr/local/nginx-1.0.6 --with-debug used: peckhardt at test-nginx:~/nginx-1.0.6$patch -p1 < /cep21-healthcheck_nginx_upstreams-5fa4bff/nginx.patch hope someone would help me. greetings From nginx-forum at nginx.us Thu Sep 22 20:50:41 2011 From: nginx-forum at nginx.us (Lintu) Date: Thu, 22 Sep 2011 16:50:41 -0400 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: <029D40CC0F3D4095AEFFEC05BB25DA67@NeiRoze> References: <029D40CC0F3D4095AEFFEC05BB25DA67@NeiRoze> Message-ID: So I removed php again, putting dotdeb into sources and commenting debian out, trying to reinstall php5-common, but this appears: Package php5-common is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source What am I doing wrong now? I did update apt-get after editing sources Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215576,215659#msg-215659 From nginx-forum at nginx.us Thu Sep 22 21:02:18 2011 From: nginx-forum at nginx.us (danieljoleary) Date: Thu, 22 Sep 2011 17:02:18 -0400 Subject: SSL_write() failed - v1.0.4 Message-ID: <1a69ebe0ef8c4aba5a2fe9ad3e1098b3.NginxMailingListEnglish@forum.nginx.org> Hello, I am getting the following in my error.log file: 2011/09/22 14:09:19 [crit] 29589#0: *27891 SSL_write() failed (SSL:) while sending to client, client: 187.32.96.60, server: innovationgames.com, request: "GET /game_view/instant_play/SECVSRHNYL3G5UZGCFSOP2455TURX25Q HTTP/1.1", upstream: "http://127.0.0.1:9911/game_view/instant_play/SECVSRHNYL3G5UZGCFSOP2455TURX25Q", host: "innovationgames.com", referrer: "http://translate.googleusercontent.com/translate_c?hl=pt-BR&rurl=translate.google.com.br&sl=en&tl=pt&u=http://innovationgames.com/&usg=ALkJrhjEddqgpHPPquhnwql-3tdLHC5nDQ" I am running nginx v1.0.4. I noticed another user (dryang) posted a similar problem agains v0.7.67, but there was no further information on that post. I also notice the following post in the development forum (http://mailman.nginx.org/pipermail/nginx-devel/2010-February/000118.html) which indicated a patch but that was over a year and a half ago. Any help very much appreciated. Thanks for allowing me to post here. Dan O'Leary The Innovation Games Company Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215662,215662#msg-215662 From nginx-forum at nginx.us Thu Sep 22 21:03:24 2011 From: nginx-forum at nginx.us (Lintu) Date: Thu, 22 Sep 2011 17:03:24 -0400 Subject: php-fastcgi always exits.. resulting in 502 bad gateway In-Reply-To: References: <029D40CC0F3D4095AEFFEC05BB25DA67@NeiRoze> Message-ID: Disregard that, I just directly downloaded the debs with wget. For the moment its working, thanks alot! I hope it won't crash down every now and then anymore. Thanks alot again to anyone who spent his time in this thread! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215576,215663#msg-215663 From erik at erikwickstrom.com Thu Sep 22 21:09:45 2011 From: erik at erikwickstrom.com (Erik Wickstrom) Date: Thu, 22 Sep 2011 14:09:45 -0700 Subject: Serving stale items from cache In-Reply-To: <774008bf7b14a3cec6eb468015aedf62.NginxMailingListEnglish@forum.nginx.org> References: <4262924B-D501-46F1-95D8-C0DA85D975D3@nginx.com> <774008bf7b14a3cec6eb468015aedf62.NginxMailingListEnglish@forum.nginx.org> Message-ID: I ended up using Varnish for this. I set a long TTL for the cache, and then another long "grace" period for those expired objects. Then I use a script to loop through all of my URLs and rewarm the cache every few days. https://www.varnish-cache.org/trac/wiki/VCLExampleHashAlwaysMiss Seems to be working. On Thu, Sep 22, 2011 at 1:03 PM, stonor wrote: > I would love to see this too in Nginx. > > The pattern is described here: http://www.mnot.net/blog/2007/12/12/stale > > > The only software I've seen this implemented in is Squid 2.7 > (stale-while-revalidate). > > From time to time I see backends taking 800ms+ ?to generate a page at > low traffic. It would be nice to hide most of these requests to the end > user. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214606,215654#msg-215654 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From brian at akins.org Thu Sep 22 23:05:01 2011 From: brian at akins.org (Brian Akins) Date: Thu, 22 Sep 2011 19:05:01 -0400 Subject: Serving stale items from cache In-Reply-To: <774008bf7b14a3cec6eb468015aedf62.NginxMailingListEnglish@forum.nginx.org> References: <4262924B-D501-46F1-95D8-C0DA85D975D3@nginx.com> <774008bf7b14a3cec6eb468015aedf62.NginxMailingListEnglish@forum.nginx.org> Message-ID: proxy_cache_use_stale updating does soemthing similar. You may could do something like (from the docs) proxy_cache_bypass $http_my_secret_header; without a corresponding proxy_no_cache and that should make nginx go to the origin server but cache the results. --Brian From mdounin at mdounin.ru Thu Sep 22 23:18:23 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 23 Sep 2011 03:18:23 +0400 Subject: SSL_write() failed - v1.0.4 In-Reply-To: <1a69ebe0ef8c4aba5a2fe9ad3e1098b3.NginxMailingListEnglish@forum.nginx.org> References: <1a69ebe0ef8c4aba5a2fe9ad3e1098b3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110922231822.GK1137@mdounin.ru> Hello! On Thu, Sep 22, 2011 at 05:02:18PM -0400, danieljoleary wrote: > Hello, > > I am getting the following in my error.log file: > > > 2011/09/22 14:09:19 [crit] 29589#0: *27891 SSL_write() failed (SSL:) > while sending to client, client: 187.32.96.60, server: > innovationgames.com, request: "GET > /game_view/instant_play/SECVSRHNYL3G5UZGCFSOP2455TURX25Q HTTP/1.1", > upstream: > "http://127.0.0.1:9911/game_view/instant_play/SECVSRHNYL3G5UZGCFSOP2455TURX25Q", > host: "innovationgames.com", referrer: > "http://translate.googleusercontent.com/translate_c?hl=pt-BR&rurl=translate.google.com.br&sl=en&tl=pt&u=http://innovationgames.com/&usg=ALkJrhjEddqgpHPPquhnwql-3tdLHC5nDQ" > > I am running nginx v1.0.4. I noticed another user (dryang) posted a > similar problem agains v0.7.67, but there was no further information on > that post. Are you able to reproduce this? If yes, please provide debug log. See http://wiki.nginx.org/Debugging for details. > I also notice the following post in the development forum > (http://mailman.nginx.org/pipermail/nginx-devel/2010-February/000118.html) > which indicated a patch but that was over a year and a half ago. This post just mentions such errors as something not-yet-identified, patch is unrelated and tunes logging level for other common SSL errors. Maxim Dounin From nginx-forum at nginx.us Thu Sep 22 23:26:57 2011 From: nginx-forum at nginx.us (danieljoleary) Date: Thu, 22 Sep 2011 19:26:57 -0400 Subject: SSL_write() failed - v1.0.4 In-Reply-To: <20110922231822.GK1137@mdounin.ru> References: <20110922231822.GK1137@mdounin.ru> Message-ID: <17379b62945337b8bfdbd270abb82999.NginxMailingListEnglish@forum.nginx.org> Hi Maxim, I currently only have one instance of the error but expect there will be more. To prepare for this, I will build a debug version of nginx and set the log level to debug per the directions you have indicated. It may be a while before I come back on this thread. Thanks for your response! Dan Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215662,215671#msg-215671 From amitkulz at gmail.com Thu Sep 22 23:54:48 2011 From: amitkulz at gmail.com (Amit Kulkarni) Date: Thu, 22 Sep 2011 18:54:48 -0500 Subject: nginx imported into OpenBSD base Message-ID: Hi all, You guys will get that chroot stuff and the httpd man page due to the hard work of OpenBSD guys... Eventually it will replace Apache-1.3 in base. It will be mutually beneficial relationship. thanks!!! From nginx-forum at nginx.us Fri Sep 23 01:01:25 2011 From: nginx-forum at nginx.us (ahu) Date: Thu, 22 Sep 2011 21:01:25 -0400 Subject: mp4 module In-Reply-To: <76c3136923f6db464986dd2fd3c4fa01.NginxMailingListEnglish@forum.nginx.org> References: <20110909115107.GH97288@nginx.com> <76c3136923f6db464986dd2fd3c4fa01.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6deffe35747aebe8fddcc59d0a973221.NginxMailingListEnglish@forum.nginx.org> for me,"If you use 3rd-party mp4 module, it should be removed." just means they are different.I want to know the detail :) Should I use the official mp4 module instead of the 3rd-party one? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215011,215678#msg-215678 From ianevans at digitalhit.com Fri Sep 23 06:45:09 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Fri, 23 Sep 2011 02:45:09 -0400 Subject: CSS file in Facebook app being served up as text/html Message-ID: <4E7C2AF5.1060403@digitalhit.com> I'm hosting a Facebook canvas app on my server and a CSS file is not getting loaded because it's apparently being served up as text/html and not text/css. I have no problems with the css files on my web site hosted on the same server and my nginx conf has the standard mime types file loaded in the conf. Not sure why calling it in a facebook iframe is causing the error. Here's the dump from Live HTTP Headers: GET /myappname/multifriend.css HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 Accept: text/css,*/*;q=0.1 Accept-Language: en-gb,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: keep-alive Referer: https://www.example.com/myappname/invite3.php HTTP/1.1 200 OK Date: Fri, 23 Sep 2011 06:28:49 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: keep-alive X-Powered-By: PHP/5.3.6 Thanks! From nginx-forum at nginx.us Fri Sep 23 07:24:26 2011 From: nginx-forum at nginx.us (yamanyar) Date: Fri, 23 Sep 2011 03:24:26 -0400 Subject: Accept all server_name's except empty Message-ID: <411ab344243934ff710696ca9a21ed6d.NginxMailingListEnglish@forum.nginx.org> Dear all, How can I set up my nginx configuration file so that it will accept all request; however it will deny if "host" header is not added? Also currently I am logging bytes_send per "host" and then take sum of them with a cron job monthly. Is there a better way to achieve this? Cheers, Kaan Yamanyar Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215685,215685#msg-215685 From igor at sysoev.ru Fri Sep 23 07:47:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 23 Sep 2011 11:47:56 +0400 Subject: Accept all server_name's except empty In-Reply-To: <411ab344243934ff710696ca9a21ed6d.NginxMailingListEnglish@forum.nginx.org> References: <411ab344243934ff710696ca9a21ed6d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0D73320C-46C0-42F4-9029-40DD8A0C83CC@sysoev.ru> On Sep 23, 2011, at 11:24 , yamanyar wrote: > Dear all, > > How can I set up my nginx configuration file so that it will accept all > request; however it will deny if "host" header is not added? server { server_name ""; # no host header field in request return 444; } server { server_name _; ... } > Also currently I am logging bytes_send per "host" and then take sum of > them with a cron job monthly. Is there a better way to achieve this? Currently no. -- Igor Sysoev http://sysoev.ru/en/ From osa at FreeBSD.org.ru Fri Sep 23 08:31:25 2011 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Fri, 23 Sep 2011 12:31:25 +0400 Subject: [ANN] ngx_http_redis-0.3.5 released Message-ID: <20110923083125.GD81654@FreeBSD.org.ru> ngx_http_redis module version 0.3.5 released, available for immediate download at http://people.freebsd.org/~osa/ngx_http_redis-0.3.5.tar.gz SHA256 (ngx_http_redis-0.3.5.tar.gz) = 5398805bbc790b8ae5ddb5079cf726df63c8c206bbf9a3a4b035412194aac82e SIZE (ngx_http_redis-0.3.5.tar.gz) = 11373 *) Feature: add test for not set $redis_db directive. *) Feature: keep-alive support merged from original memcached module 1.1.4. Note. Keep-alive support works only with nginx 1.1.4 and later. For previous versions of nginx use ngx_http_upstream_keepalive module from Maxim Dounin. -- Sergey A. Osokin osa at FreeBSD.ORG.ru osa at FreeBSD.ORG From nginx-forum at nginx.us Fri Sep 23 10:52:50 2011 From: nginx-forum at nginx.us (Hety) Date: Fri, 23 Sep 2011 06:52:50 -0400 Subject: $server_name in error_log logfile name In-Reply-To: References: Message-ID: <6416e397fc9e97304d5da10be69a1ebe.NginxMailingListEnglish@forum.nginx.org> Why its supports it in access_log then? I fail to see logic here. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215503,215702#msg-215702 From r at roze.lv Fri Sep 23 11:09:45 2011 From: r at roze.lv (Reinis Rozitis) Date: Fri, 23 Sep 2011 14:09:45 +0300 Subject: CSS file in Facebook app being served up as text/html In-Reply-To: <4E7C2AF5.1060403@digitalhit.com> References: <4E7C2AF5.1060403@digitalhit.com> Message-ID: > I have no problems with the css files on my web site hosted on the same server and my nginx conf has the standard mime types file > loaded in the conf. Post your nginx config since you may have a misconfiguration somewhere and css files are being served through php - header line' X-Powered-By: PHP/5.3.6' indicates that (it shouldn't be there for static content). p.s. If that is intended though you will have to modify your php and add at the top. rr From mdounin at mdounin.ru Fri Sep 23 11:19:09 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 23 Sep 2011 15:19:09 +0400 Subject: $server_name in error_log logfile name In-Reply-To: <6416e397fc9e97304d5da10be69a1ebe.NginxMailingListEnglish@forum.nginx.org> References: <6416e397fc9e97304d5da10be69a1ebe.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110923111908.GR1137@mdounin.ru> Hello! On Fri, Sep 23, 2011 at 06:52:50AM -0400, Hety wrote: > Why its supports it in access_log then? I fail to see logic here. Access log is quite different as it's only needed/used during http request processing. On the other hand, error_log is global thing and used even if no http requests exists, e.g. to log signals and various other internal actions. It's not possible to use variables which are only exists in http request context to log internal actions. And again (this tends to be a FAQ): You shouldn't use variables to shorten configs by storing static strings in them. Variables are evaluated at run-time during request process, they are costly compared to static strings. You need some macro expansion instead. Right now it may be done via external tools, e.g. sed + make will do (as well as any other template mechanism). Maxim Dounin From nginx-forum at nginx.us Fri Sep 23 11:58:23 2011 From: nginx-forum at nginx.us (Hety) Date: Fri, 23 Sep 2011 07:58:23 -0400 Subject: $server_name in error_log logfile name In-Reply-To: <20110923111908.GR1137@mdounin.ru> References: <20110923111908.GR1137@mdounin.ru> Message-ID: Thanks. Point taken. Will go RTFMmore and will try to avoid stupid questions in future :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215503,215713#msg-215713 From igor at sysoev.ru Fri Sep 23 15:22:58 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 23 Sep 2011 19:22:58 +0400 Subject: mp4 module In-Reply-To: <6deffe35747aebe8fddcc59d0a973221.NginxMailingListEnglish@forum.nginx.org> References: <20110909115107.GH97288@nginx.com> <76c3136923f6db464986dd2fd3c4fa01.NginxMailingListEnglish@forum.nginx.org> <6deffe35747aebe8fddcc59d0a973221.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Sep 23, 2011, at 5:01 , ahu wrote: > for me,"If you use 3rd-party mp4 module, it should be removed." just > means they are different.I want to know the detail :) > Should I use the official mp4 module instead of the 3rd-party one? You should use only one of them. If you have issues with 3rd-party, you can try the official mp4 module. If you have issues with the official module, you should report them and I wll try to fix them. -- Igor Sysoev http://sysoev.ru/en/ From contact at jpluscplusm.com Fri Sep 23 16:37:29 2011 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Fri, 23 Sep 2011 17:37:29 +0100 Subject: Override proxy's incorrect Content-Type via mime settings Message-ID: Hi all - I have an upstream proxy that sends the wrong Content-Type header for a load of images. Sometime it doesn't send any header at all. I'm trying to get Nginx not only to remove the upstream's Content-Type header ("proxy_hide_header"), but also to insert the correct header. Unfortunately, I can't hard-code the value as there are a variety of image formats being used. "proxy_hide_header" doesn't seem to do anything other than block the incorrect value, and "proxy_ignore_headers" won't accept "Content-Type". How can I both remote upstream's incorrect header, and also add the header than Nginx *would* have used if it were serving the content from local disk? In other words, how do I add the header with a value derived from the MIME settings currently configured, via the requested file's extension? Version 0.7.67, but can upgrade if required. Many thanks, Jonathan -- Jonathan Matthews London, UK http://www.jpluscplusm.com/contact.html From contact at jpluscplusm.com Fri Sep 23 16:45:33 2011 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Fri, 23 Sep 2011 17:45:33 +0100 Subject: Override proxy's incorrect Content-Type via mime settings In-Reply-To: References: Message-ID: On 23 September 2011 17:37, Jonathan Matthews wrote: > How can I both remote upstream's incorrect header, and also add the *remove* From ianevans at digitalhit.com Fri Sep 23 19:12:03 2011 From: ianevans at digitalhit.com (Ian Evans) Date: Fri, 23 Sep 2011 15:12:03 -0400 Subject: CSS file in Facebook app being served up as text/html In-Reply-To: References: <4E7C2AF5.1060403@digitalhit.com> Message-ID: <4E7CDA03.2020308@digitalhit.com> On 23/09/2011 7:09 AM, Reinis Rozitis wrote: > Post your nginx config since you may have a misconfiguration somewhere > and css files are being served through php - header line' X-Powered-By: > PHP/5.3.6' indicates that (it shouldn't be there for static content). You hit the nail on the head...I don't do much work on the SSL side of my server and forgot to allow it to be served directly. Thanks. From nginx-forum at nginx.us Sat Sep 24 01:15:11 2011 From: nginx-forum at nginx.us (ahu) Date: Fri, 23 Sep 2011 21:15:11 -0400 Subject: mp4 module In-Reply-To: References: Message-ID: Ok,I get it.Thanks very much. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215011,215751#msg-215751 From luke at visionlaunchers.com Sat Sep 24 07:12:35 2011 From: luke at visionlaunchers.com (Luke Scott) Date: Sat, 24 Sep 2011 07:12:35 +0000 Subject: $https variable? Message-ID: <283FEC93C84E1248B931166DC960A8AA1A647C3D@MBX205.domain.local> It would be great if there was an $https variable that was "on" or "off" (or "") so you could do something like this: fastcgi_param HTTPS $https; Because currently telling PHP https is enabled is much harder, especially for those that prefer to have a single server{} block for both HTTP and HTTPS. Typically PHP uses $_SERVER['HTTPS'] === 'on' to detect whether or not HTTPS is enabled. http://us3.php.net/manual/en/reserved.variables.server.php Luke From ano at bestmx.ru Sat Sep 24 07:24:48 2011 From: ano at bestmx.ru (Andrey N. Oktyabrski) Date: Sat, 24 Sep 2011 11:24:48 +0400 Subject: $https variable? In-Reply-To: <283FEC93C84E1248B931166DC960A8AA1A647C3D@MBX205.domain.local> References: <283FEC93C84E1248B931166DC960A8AA1A647C3D@MBX205.domain.local> Message-ID: <4E7D85C0.3080103@bestmx.ru> On 24.09.11 11:12, Luke Scott wrote: > It would be great if there was an $https variable that was "on" or > "off" (or "") so you could do something like this: > fastcgi_param HTTPS $https; map $scheme $https { https on; default off; } From mike503 at gmail.com Sat Sep 24 07:25:55 2011 From: mike503 at gmail.com (Michael Shadle) Date: Sat, 24 Sep 2011 00:25:55 -0700 Subject: $https variable? In-Reply-To: <283FEC93C84E1248B931166DC960A8AA1A647C3D@MBX205.domain.local> References: <283FEC93C84E1248B931166DC960A8AA1A647C3D@MBX205.domain.local> Message-ID: Igor proposed this a while ago: on the global level (in http{} block) map $scheme $php_https { https on; http off; } then in fastcgi_params fastcgi_param HTTPS $php_https; On Sat, Sep 24, 2011 at 12:12 AM, Luke Scott wrote: > It would be great if there was an $https variable that was "on" or "off" (or "") so you could do something like this: > > fastcgi_param ?HTTPS $https; > > Because currently telling PHP https is enabled is much harder, especially for those that prefer to have a single server{} block for both HTTP and HTTPS. > > Typically PHP uses $_SERVER['HTTPS'] === 'on' to detect whether or not HTTPS is enabled. > > http://us3.php.net/manual/en/reserved.variables.server.php > > Luke > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From luc.juggery at gmail.com Sat Sep 24 11:43:12 2011 From: luc.juggery at gmail.com (Luc Juggery) Date: Sat, 24 Sep 2011 13:43:12 +0200 Subject: Cannot remove Content Length header Message-ID: Hello, I'm using Nginx as a front end to my node.js application, nginx proxying https request to my app. When the browser gets the response back, instead of pure json ({"error":"query error","message":"Parameter(s) missing: user,password"}), I receive something like: 47 {"error":"query error","message":"Parameter(s) missing: user,password"} 0 I use 'more_clear_headers' module but do not have any luck. This is the config I use: server { listen 443; server_name my.server.com; ssl on; ssl_certificate certificate.pem; ssl_certificate_key privatekey.pem; keepalive_timeout 70; location / { more_clear_headers 'Content-Length'; # Does not work as I would expect proxy_pass https://localhost:8443; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_buffering off; proxy_buffers 8 8k; } } Would you have any idea ? Thanks a lot for your help, -- Luc -------------- next part -------------- An HTML attachment was scrubbed... URL: From Richard.Kearsley at m247.com Sat Sep 24 11:49:34 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Sat, 24 Sep 2011 11:49:34 +0000 Subject: Cannot remove Content Length header In-Reply-To: References: Message-ID: How are you testing it? That looks like results I saw using telnet but those numbers do not appear with a http client such as curl On 24 Sep 2011, at 12:43, "Luc Juggery" > wrote: Hello, I'm using Nginx as a front end to my node.js application, nginx proxying https request to my app. When the browser gets the response back, instead of pure json ({"error":"query error","message":"Parameter(s) missing: user,password"}), I receive something like: 47 {"error":"query error","message":"Parameter(s) missing: user,password"} 0 I use 'more_clear_headers' module but do not have any luck. This is the config I use: server { listen 443; server_name my.server.com; ssl on; ssl_certificate certificate.pem; ssl_certificate_key privatekey.pem; keepalive_timeout 70; location / { more_clear_headers 'Content-Length'; # Does not work as I would expect proxy_pass https://localhost:8443; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_buffering off; proxy_buffers 8 8k; } } Would you have any idea ? Thanks a lot for your help, -- Luc _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sat Sep 24 12:05:31 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 24 Sep 2011 16:05:31 +0400 Subject: Cannot remove Content Length header In-Reply-To: References: Message-ID: <20110924120530.GA1137@mdounin.ru> Hello! On Sat, Sep 24, 2011 at 01:43:12PM +0200, Luc Juggery wrote: > Hello, > > I'm using Nginx as a front end to my node.js application, nginx proxying > https request to my app. > When the browser gets the response back, instead of pure json > ({"error":"query error","message":"Parameter(s) missing: user,password"}), I > receive something like: > > 47 > {"error":"query error","message":"Parameter(s) missing: user,password"} > 0 This is chunked encoding, likely sent by your backend in violation of HTTP specification. Right now there are two options available: 1. Fix your backend. 2. Upgrade to nginx 1.1.4, it has code needed to talk to such broken backends. Maxim Dounin From luc.juggery at gmail.com Sat Sep 24 12:58:59 2011 From: luc.juggery at gmail.com (Luc Juggery) Date: Sat, 24 Sep 2011 14:58:59 +0200 Subject: Cannot remove Content Length header In-Reply-To: <20110924120530.GA1137@mdounin.ru> References: <20110924120530.GA1137@mdounin.ru> Message-ID: Hello, thanks for your answers. Maxim, what would you recommend to fix the backend ? I do not really see where could be the violation in fact. -- Luc Le Sep 24, 2011 ? 14:05, Maxim Dounin a ?crit : > Hello! > > On Sat, Sep 24, 2011 at 01:43:12PM +0200, Luc Juggery wrote: > >> Hello, >> >> I'm using Nginx as a front end to my node.js application, nginx proxying >> https request to my app. >> When the browser gets the response back, instead of pure json >> ({"error":"query error","message":"Parameter(s) missing: user,password"}), I >> receive something like: >> >> 47 >> {"error":"query error","message":"Parameter(s) missing: user,password"} >> 0 > > This is chunked encoding, likely sent by your backend in violation > of HTTP specification. > > Right now there are two options available: > > 1. Fix your backend. > > 2. Upgrade to nginx 1.1.4, it has code needed to talk to such > broken backends. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From luc.juggery at gmail.com Sat Sep 24 13:06:32 2011 From: luc.juggery at gmail.com (Luc Juggery) Date: Sat, 24 Sep 2011 15:06:32 +0200 Subject: Cannot remove Content Length header In-Reply-To: References: Message-ID: Hello, I'm testing it from a browser and with curl as well and I got the same. When I bypass nginx the response is correct. When I request from nginx, the lenght is added at the beginning and 0 at the end of the json I would expect. -- Luc Le Sep 24, 2011 ? 13:49, Richard Kearsley a ?crit : > How are you testing it? > That looks like results I saw using telnet but those numbers do not appear with a http client such as curl > > > On 24 Sep 2011, at 12:43, "Luc Juggery" wrote: > >> Hello, >> >> I'm using Nginx as a front end to my node.js application, nginx proxying https request to my app. >> When the browser gets the response back, instead of pure json ({"error":"query error","message":"Parameter(s) missing: user,password"}), I receive something like: >> >> 47 >> {"error":"query error","message":"Parameter(s) missing: user,password"} >> 0 >> >> I use 'more_clear_headers' module but do not have any luck. >> >> This is the config I use: >> >> server { >> listen 443; >> server_name my.server.com; >> ssl on; >> ssl_certificate certificate.pem; >> ssl_certificate_key privatekey.pem; >> >> keepalive_timeout 70; >> >> location / { >> more_clear_headers 'Content-Length'; # Does not work as I would expect >> proxy_pass https://localhost:8443; >> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; >> proxy_set_header Host $http_host; >> proxy_buffering off; >> proxy_buffers 8 8k; >> } >> } >> >> Would you have any idea ? >> Thanks a lot for your help, >> >> -- >> Luc > >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From abioy.sun at gmail.com Sat Sep 24 14:47:50 2011 From: abioy.sun at gmail.com (Abioy Sun) Date: Sat, 24 Sep 2011 22:47:50 +0800 Subject: will NGX_AGAIN kill performance? Message-ID: hi, i currently dev a module which makes multi subrequest sequently in the access phase handler, via returning NGX_AGAIN. my question is, will this kill the performance? and how far could it go in killing performance. thx! Abioy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sat Sep 24 14:54:47 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 24 Sep 2011 18:54:47 +0400 Subject: Cannot remove Content Length header In-Reply-To: References: <20110924120530.GA1137@mdounin.ru> Message-ID: <20110924145447.GB1137@mdounin.ru> Hello! On Sat, Sep 24, 2011 at 02:58:59PM +0200, Luc Juggery wrote: > Hello, > > thanks for your answers. > Maxim, what would you recommend to fix the backend ? I do not really see where could be the violation in fact. Backend MUST NOT (as per RFC 2616) return chunked to HTTP/1.0 clients, while nginx uses HTTP/1.0 to talk to backends. See RFC 2616, "3.6 Transfer Codings" http://tools.ietf.org/html/rfc2616#section-3.6 ... A server MUST NOT send transfer-codings to an HTTP/1.0 client. Maxim Dounin > > -- > Luc > > Le Sep 24, 2011 ? 14:05, Maxim Dounin a ?crit : > > > Hello! > > > > On Sat, Sep 24, 2011 at 01:43:12PM +0200, Luc Juggery wrote: > > > >> Hello, > >> > >> I'm using Nginx as a front end to my node.js application, nginx proxying > >> https request to my app. > >> When the browser gets the response back, instead of pure json > >> ({"error":"query error","message":"Parameter(s) missing: user,password"}), I > >> receive something like: > >> > >> 47 > >> {"error":"query error","message":"Parameter(s) missing: user,password"} > >> 0 > > > > This is chunked encoding, likely sent by your backend in violation > > of HTTP specification. > > > > Right now there are two options available: > > > > 1. Fix your backend. > > > > 2. Upgrade to nginx 1.1.4, it has code needed to talk to such > > broken backends. > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From luc.juggery at gmail.com Sat Sep 24 17:24:08 2011 From: luc.juggery at gmail.com (Luc Juggery) Date: Sat, 24 Sep 2011 19:24:08 +0200 Subject: Cannot remove Content Length header In-Reply-To: <20110924145447.GB1137@mdounin.ru> References: <20110924120530.GA1137@mdounin.ru> <20110924145447.GB1137@mdounin.ru> Message-ID: Does it mean something (like a parameter or something) needs to be modified on my node.js application ? Do I need to send additionnal stuff ? I did not really get the "chunked" part. -- Luc Le Sep 24, 2011 ? 16:54, Maxim Dounin a ?crit : > Hello! > > On Sat, Sep 24, 2011 at 02:58:59PM +0200, Luc Juggery wrote: > >> Hello, >> >> thanks for your answers. >> Maxim, what would you recommend to fix the backend ? I do not really see where could be the violation in fact. > > Backend MUST NOT (as per RFC 2616) return chunked to HTTP/1.0 > clients, while nginx uses HTTP/1.0 to talk to backends. > > See RFC 2616, "3.6 Transfer Codings" > http://tools.ietf.org/html/rfc2616#section-3.6 > > ... A server MUST NOT send transfer-codings to an HTTP/1.0 > client. > > Maxim Dounin > >> >> -- >> Luc >> >> Le Sep 24, 2011 ? 14:05, Maxim Dounin a ?crit : >> >>> Hello! >>> >>> On Sat, Sep 24, 2011 at 01:43:12PM +0200, Luc Juggery wrote: >>> >>>> Hello, >>>> >>>> I'm using Nginx as a front end to my node.js application, nginx proxying >>>> https request to my app. >>>> When the browser gets the response back, instead of pure json >>>> ({"error":"query error","message":"Parameter(s) missing: user,password"}), I >>>> receive something like: >>>> >>>> 47 >>>> {"error":"query error","message":"Parameter(s) missing: user,password"} >>>> 0 >>> >>> This is chunked encoding, likely sent by your backend in violation >>> of HTTP specification. >>> >>> Right now there are two options available: >>> >>> 1. Fix your backend. >>> >>> 2. Upgrade to nginx 1.1.4, it has code needed to talk to such >>> broken backends. >>> >>> Maxim Dounin >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From savages at mozapps.com Sun Sep 25 00:39:32 2011 From: savages at mozapps.com (Shaun savage) Date: Sun, 25 Sep 2011 08:39:32 +0800 Subject: $http_HEADER Message-ID: <4E7E7844.7060005@mozapps.com> Does the $http_HEADER have custom headers? example X-Auth-Token=0123456789 does $http_x_auth_token is it defined and have a value? From contact at jpluscplusm.com Sun Sep 25 00:42:59 2011 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 25 Sep 2011 01:42:59 +0100 Subject: $http_HEADER In-Reply-To: <4E7E7844.7060005@mozapps.com> References: <4E7E7844.7060005@mozapps.com> Message-ID: On 25 September 2011 01:39, Shaun savage wrote: > Does the $http_HEADER have custom headers? > > example > X-Auth-Token=0123456789 > > does $http_x_auth_token ?is it defined and have a value? http://wiki.nginx.org/HttpCoreModule#.24http_HEADER HTH, Jonathan -- Jonathan Matthews London, UK http://www.jpluscplusm.com/contact.html From savages at savages.com Sun Sep 25 01:38:31 2011 From: savages at savages.com (Shaun savage) Date: Sun, 25 Sep 2011 09:38:31 +0800 Subject: $http_HEADER In-Reply-To: <4E7E7844.7060005@mozapps.com> References: <4E7E7844.7060005@mozapps.com> Message-ID: <4E7E8617.2090000@savages.com> I was using curl and the header was formated wrong, my bad. It works as expected. On 09/25/2011 08:39 AM, Shaun savage wrote: > Does the $http_HEADER have custom headers? > > example > X-Auth-Token=0123456789 > > does $http_x_auth_token is it defined and have a value? > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Sun Sep 25 03:14:03 2011 From: nginx-forum at nginx.us (khizar) Date: Sat, 24 Sep 2011 23:14:03 -0400 Subject: nginx download resume is not working plzzz help... Message-ID: <96279e852d47e36832439223e565e66a.NginxMailingListEnglish@forum.nginx.org> hello guys... hope you all are doing well download resume for any file is not working here is nginx configuration ########################################################## user www www; worker_processes 1; error_log /home/wwwlogs/nginx_error.log crit; pid /usr/local/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 32; client_header_buffer_size 4k; large_client_header_buffers 256 4k; client_max_body_size 20m; sendfile on; tcp_nopush on; keepalive_timeout 45; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 8k; fastcgi_buffers 256 8k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 16m; gzip off; gzip_min_length 1k; gzip_buffers 16 8k; gzip_http_version 1.0; gzip_comp_level 9; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; #limit_zone crawler $binary_remote_addr 10m; server { listen 80; server_name xyz.com; index index.html index.htm index.php; root /home/wwwroot/m/; access_log off; location ~ .*\.(php|php5)?$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fcgi.conf; } location /status { stub_status on; access_log off; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 7d; } error_page 404 500 502 504 503 /error.htm; rewrite ^/menu/all_files/page(.*)\.html$ /index.php?a=all&p=$1 last; rewrite ^/menu/all_files/$ /index.php?a=all last; rewrite ^/file-extension/(.*)\.html$ /index.php?a=ft&ft=$1 last; rewrite ^/file/(.*)/(.*)/warn\.html$ /index.php?a=fid&fid=$2&warn=adult&k=$1 last; # log_format access '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" $http_x_forwarded_for'; # access_log /home/wwwlogs/access.log access; } include vhost/*.conf; } ############################################################### hey guys please tell me why download resume is not working and how can i solve this issue... thank you Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215775,215775#msg-215775 From nginx-forum at nginx.us Sun Sep 25 05:03:18 2011 From: nginx-forum at nginx.us (ohjyops) Date: Sun, 25 Sep 2011 01:03:18 -0400 Subject: Help: My rewriting does not work. Message-ID: <2cfc08de7f692d76366169377e136fee.NginxMailingListEnglish@forum.nginx.org> I want to rewrite an old page to a new location, I use this code: rewrite ^/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html /w/??? permanent; But it does not work. I still can open the old page from http://mysite.com/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html, not being redirected to the new location. Can you help me correct my rewriting code? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215776,215776#msg-215776 From avishai at fewbytes.com Sat Sep 24 20:36:25 2011 From: avishai at fewbytes.com (Avishai Ish-Shalom) Date: Sat, 24 Sep 2011 23:36:25 +0300 Subject: process corruption on CentOS 5.6 In-Reply-To: <20110921201810.GA1137@mdounin.ru> References: <4E7A4313.9090703@mail.huji.ac.il> <20110921201810.GA1137@mdounin.ru> Message-ID: <4E7E3F49.6070707@fewbytes.com> Thanks! this patch seems to have fixed it. Regards, Avishai On -10/01/37 21:59, Maxim Dounin wrote: > Hello! > > On Wed, Sep 21, 2011 at 11:03:31PM +0300, Avishai Ish-Shalom wrote: > >> On CentOS 5.6, nginx 1.1.4 configured to work with php-fpm using fastcgi >> port. nginx was compiled with: configure --prefix=/usr/local/nginx >> --with-http_ssl_module --with-http_realip_module >> --with-http_geoip_module --with-http_flv_module >> --with-http_gzip_static_module --with-http_stub_status_module >> --with-http_addition_module --with-http_image_filter_module >> --with-http_sub_module --with-http_degradation_module >> --add-module=addons/ngx_upstream_fair --with-cc-opt="-D >> NGX_UPSTREAM_KEEPALIVE_PATCHED" > Just a side note: you don't need --with-cc-opt="-D > NGX_UPSTREAM_KEEPALIVE_PATCHED"'. > >> every few seconds, i get: >> >> *** glibc detected *** nginx: worker process: double free or corruption >> (!prev): 0x000000001d069800 *** > Could you please provide backtrace? See here for details: > http://wiki.nginx.org/Debugging > > Alternatively, please try the patch from here: > http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001233.html > > (And provide backtrace if it doesn't help.) > > Maxim Dounin > > From agentzh at gmail.com Sun Sep 25 07:23:36 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 25 Sep 2011 15:23:36 +0800 Subject: will NGX_AGAIN kill performance? In-Reply-To: References: Message-ID: On Sat, Sep 24, 2011 at 10:47 PM, Abioy Sun wrote: > hi, > > i currently dev a module which makes multi subrequest sequently in the > access phase handler, via returning NGX_AGAIN. > > my question is, will this kill the performance? and how far could it go in > killing performance. NGX_AGAIN is usually for non-blocking I/O operations, it's key for good performance under high concurrency levels. Regards, -agentzh From nginx-forum at nginx.us Sun Sep 25 09:13:54 2011 From: nginx-forum at nginx.us (orensol) Date: Sun, 25 Sep 2011 05:13:54 -0400 Subject: Weird behavior on SSL, and corruption on reload Message-ID: <6eab22ff27053776e27ee385bb82062d.NginxMailingListEnglish@forum.nginx.org> Hello, I had a weird behavior in nginx, in which SSL connections were suddenly denied. It happened with no apparent reason. A reload of nginx seemed to have solved it, but on reload, error.log had this stack trace: *** glibc detected *** nginx: worker process is shutting down: double free or corruption (out): 0x080ca518 *** ======= Backtrace: ========= /lib/i686/nosegneg/libc.so.6[0xb7d0ccfd] /lib/i686/nosegneg/libc.so.6(cfree+0x90)[0xb7d103b0] /lib/libcrypto.so.6(CRYPTO_free+0x3a)[0xb7e3046a] /lib/libcrypto.so.6(BN_free+0x68)[0xb7e5a1d8] /lib/libcrypto.so.6(BN_MONT_CTX_free+0x29)[0xb7e63d99] /lib/libcrypto.so.6[0xb7e683e9] /lib/libcrypto.so.6(RSA_free+0x61)[0xb7e6afc1] /lib/libcrypto.so.6[0xb7e8cacd] /lib/libcrypto.so.6(EVP_PKEY_free+0x67)[0xb7e8cb47] /lib/libssl.so.6(ssl_cert_free+0xa0)[0xb7f5e5c0] /lib/libssl.so.6(SSL_CTX_free+0xe3)[0xb7f5bb73] nginx: worker process is shutting down[0x8066bbb] nginx: worker process is shutting down[0x804d1d0] nginx: worker process is shutting down[0x80645fe] nginx: worker process is shutting down[0x80646eb] nginx: worker process is shutting down[0x8062ff1] nginx: worker process is shutting down[0x8064f2c] nginx: worker process is shutting down[0x804c891] /lib/i686/nosegneg/libc.so.6(__libc_start_main+0xdc)[0xb7cbbdec] nginx: worker process is shutting down[0x804b141] ======= Memory map: ======== 08048000-080ab000 r-xp 00000000 08:01 298520 /usr/local/nginx/sbin/nginx 080ab000-080b3000 rw-p 00062000 08:01 298520 /usr/local/nginx/sbin/nginx 080b3000-0829e000 rw-p 080b3000 00:00 0 [heap] b4600000-b4621000 rw-p b4600000 00:00 0 b4621000-b4700000 ---p b4621000 00:00 0 b479b000-b47a6000 r-xp 00000000 08:01 262401 /lib/libgcc_s-4.1.1-20070105.so.1 b47a6000-b47a7000 rw-p 0000a000 08:01 262401 /lib/libgcc_s-4.1.1-20070105.so.1 b47a7000-b47ab000 r-xp 00000000 08:01 262411 /lib/libnss_dns-2.5.so b47ab000-b47ac000 r--p 00003000 08:01 262411 /lib/libnss_dns-2.5.so b47ac000-b47ad000 rw-p 00004000 08:01 262411 /lib/libnss_dns-2.5.so b47b3000-b49a0000 rw-p b47b3000 00:00 0 b49a0000-b49a1000 rw-s 00000000 00:08 1620412881 /dev/zero (deleted) b49a1000-b7ba1000 rw-s 00000000 00:08 1620412878 /dev/zero (deleted) b7ba1000-b7baa000 r-xp 00000000 08:01 262412 /lib/libnss_files-2.5.so b7baa000-b7bab000 r--p 00008000 08:01 262412 /lib/libnss_files-2.5.so b7bab000-b7bac000 rw-p 00009000 08:01 262412 /lib/libnss_files-2.5.so b7bac000-b7bae000 rw-p b7bac000 00:00 0 b7bae000-b7bb5000 r-xp 00000000 08:01 65580 /usr/lib/libkrb5support.so.0.1 b7bb5000-b7bb6000 rw-p 00006000 08:01 65580 /usr/lib/libkrb5support.so.0.1 b7bb6000-b7bc5000 r-xp 00000000 08:01 262423 /lib/libresolv-2.5.so b7bc5000-b7bc6000 r--p 0000e000 08:01 262423 /lib/libresolv-2.5.so b7bc6000-b7bc7000 rw-p 0000f000 08:01 262423 /lib/libresolv-2.5.so b7bc7000-b7bc9000 rw-p b7bc7000 00:00 0 b7bc9000-b7bee000 r-xp 00000000 08:01 65574 /usr/lib/libk5crypto.so.3.0 b7bee000-b7bef000 rw-p 00025000 08:01 65574 /usr/lib/libk5crypto.so.3.0 b7bef000-b7bf1000 r-xp 00000000 08:01 262387 /lib/libcom_err.so.2.1 b7bf1000-b7bf2000 rw-p 00001000 08:01 262387 /lib/libcom_err.so.2.1 b7bf2000-b7bf3000 rw-p b7bf2000 00:00 0 b7bf3000-b7c79000 r-xp 00000000 08:01 65579 /usr/lib/libkrb5.so.3.2 b7c79000-b7c7b000 rw-p 00086000 08:01 65579 /usr/lib/libkrb5.so.3.2 b7c7b000-b7ca5000 r-xp 00000000 08:01 65561 /usr/lib/libgssapi_krb5.so.2.2 b7ca5000-b7ca6000 rw-p 00029000 08:01 65561 /usr/lib/libgssapi_krb5.so.2.2 b7ca6000-b7de1000 r-xp 00000000 08:01 262438 /lib/i686/nosegneg/libc-2.5.so b7de1000-b7de3000 r--p 0013a000 08:01 262438 /lib/i686/nosegneg/libc-2.5.so b7de3000-b7de4000 rw-p 0013c000 08:01 262438 /lib/i686/nosegneg/libc-2.5.so b7de4000-b7de7000 rw-p b7de4000 00:00 0 b7de7000-b7df9000 r-xp 00000000 08:01 65693 /usr/lib/libz.so.1.2.3 b7df9000-b7dfa000 rw-p 00011000 08:01 65693 /usr/lib/libz.so.1.2.3 b7dfa000-b7dfc000 r-xp 00000000 08:01 262397 /lib/libdl-2.5.so b7dfc000-b7dfd000 r--p 00001000 08:01 262397 /lib/libdl-2.5.so b7dfd000-b7dfe000 rw-p 00002000 08:01 262397 /lib/libdl-2.5.so b7dfe000-b7f1b000 r-xp 00000000 08:01 262389 /lib/libcrypto.so.0.9.8b b7f1b000-b7f2e000 rw-p 0011c000 08:01 262389 /lib/libcrypto.so.0.9.8b b7f2e000-b7f32000 rw-p b7f2e000 00:00 0 b7f32000-b7f73000 r-xp 00000000 08:01 262428 /lib/libssl.so.0.9.8b b7f73000-b7f77000 rw-p 00040000 08:01 262428 /lib/libssl.so.0.9.8b b7f77000-b7f93000 r-xp 00000000 08:01 262420 /lib/libpcre.so.0.0.1 b7f93000-b7f94000 rw-p 0001b000 08:01 262420 /lib/libpcre.so.0.0.1 b7f94000-b7f99000 r-xp 00000000 08:01 262388 /lib/libcrypt-2.5.so b7f99000-b7f9a000 r--p 00004000 08:01 262388 /lib/libcrypt-2.5.so b7f9a000-b7f9b000 rw-p 00005000 08:01 262388 /lib/libcrypt-2.5.so b7f9b000-b7fc2000 rw-p b7f9b000 00:00 0 b7fc8000-b7fc9000 rw-p b7fc8000 00:00 0 b7fc9000-b7fca000 r-xp b7fc9000 00:00 0 [vdso] b7fca000-b7fe3000 r-xp 00000000 08:01 262375 /lib/ld-2.5.so b7fe3000-b7fe4000 r--p 00018000 08:01 262375 /lib/ld-2.5.so b7fe4000-b7fe5000 rw-p 00019000 08:01 262375 /lib/ld-2.5.so bfdae000-bfdd2000 rw-p bfdae000 00:00 0 [stack] 2011/09/25 05:01:43 [alert] 21233#0: worker process 1870 exited on signal 6 Any ideas on what happened, and what can be done to prevent it in the future? Thanks, Oren Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215785,215785#msg-215785 From nginx-forum at nginx.us Sun Sep 25 09:50:27 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Sun, 25 Sep 2011 05:50:27 -0400 Subject: nginx download resume is not working plzzz help... In-Reply-To: <96279e852d47e36832439223e565e66a.NginxMailingListEnglish@forum.nginx.org> References: <96279e852d47e36832439223e565e66a.NginxMailingListEnglish@forum.nginx.org> Message-ID: If you are having PHP read the file directly then Nginx is not responsible for the file sending and as such your PHP application needs to implementing range requests. Ideally, you should be using x-accel-redirect to have Nginx handle the file sending once PHP is done. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215775,215789#msg-215789 From mdounin at mdounin.ru Sun Sep 25 11:01:13 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 25 Sep 2011 15:01:13 +0400 Subject: Weird behavior on SSL, and corruption on reload In-Reply-To: <6eab22ff27053776e27ee385bb82062d.NginxMailingListEnglish@forum.nginx.org> References: <6eab22ff27053776e27ee385bb82062d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110925110112.GD1137@mdounin.ru> Hello! On Sun, Sep 25, 2011 at 05:13:54AM -0400, orensol wrote: > Hello, > > I had a weird behavior in nginx, in which SSL connections were suddenly > denied. It happened with no apparent reason. A reload of nginx seemed to > have solved it, but on reload, error.log had this stack trace: > > *** glibc detected *** nginx: worker process is shutting down: double > free or corruption (out): 0x080ca518 *** > ======= Backtrace: ========= > /lib/i686/nosegneg/libc.so.6[0xb7d0ccfd] > /lib/i686/nosegneg/libc.so.6(cfree+0x90)[0xb7d103b0] > /lib/libcrypto.so.6(CRYPTO_free+0x3a)[0xb7e3046a] > /lib/libcrypto.so.6(BN_free+0x68)[0xb7e5a1d8] > /lib/libcrypto.so.6(BN_MONT_CTX_free+0x29)[0xb7e63d99] > /lib/libcrypto.so.6[0xb7e683e9] > /lib/libcrypto.so.6(RSA_free+0x61)[0xb7e6afc1] > /lib/libcrypto.so.6[0xb7e8cacd] > /lib/libcrypto.so.6(EVP_PKEY_free+0x67)[0xb7e8cb47] > /lib/libssl.so.6(ssl_cert_free+0xa0)[0xb7f5e5c0] > /lib/libssl.so.6(SSL_CTX_free+0xe3)[0xb7f5bb73] > nginx: worker process is shutting down[0x8066bbb] > nginx: worker process is shutting down[0x804d1d0] > nginx: worker process is shutting down[0x80645fe] > nginx: worker process is shutting down[0x80646eb] > nginx: worker process is shutting down[0x8062ff1] > nginx: worker process is shutting down[0x8064f2c] > nginx: worker process is shutting down[0x804c891] > /lib/i686/nosegneg/libc.so.6(__libc_start_main+0xdc)[0xb7cbbdec] > nginx: worker process is shutting down[0x804b141] [...] > 2011/09/25 05:01:43 [alert] 21233#0: worker process 1870 exited on > signal 6 > > > Any ideas on what happened, and what can be done to prevent it in the > future? Are you able to reproduce the problem? If yes, please follow instructions here: http://wiki.nginx.org/Debugging At least proper backtrace is needed to debug this further. And you may need to make sure your nginx binary isn't stripped. If not, please at least provide "nginx -V" output, config and OpenSSL version details (output of "openssl version -a"). Maxim Dounin From nginx-forum at nginx.us Sun Sep 25 11:14:40 2011 From: nginx-forum at nginx.us (orensol) Date: Sun, 25 Sep 2011 07:14:40 -0400 Subject: Weird behavior on SSL, and corruption on reload In-Reply-To: <6eab22ff27053776e27ee385bb82062d.NginxMailingListEnglish@forum.nginx.org> References: <6eab22ff27053776e27ee385bb82062d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0df21e21f71559a9b9d85dba3a785ef2.NginxMailingListEnglish@forum.nginx.org> Hello Maxim, For now I can't reproduce the problem, if it happens again i'll try to catch a real backtrace. Here are the other details. Thanks! nginx: nginx version: nginx/0.8.35 built by gcc 4.1.1 20070105 (Red Hat 4.1.1-52) TLS SNI support disabled configure arguments: --with-http_ssl_module --add-module=/root/ngx_cache_purge-1.0 openssl: OpenSSL 0.9.8b 04 May 2006 built on: Wed Oct 17 18:15:17 EDT 2007 platform: linux-elf options: bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -I/usr/kerberos/include -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=generic -fasynchronous-unwind-tables -Wa,--noexecstack -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM OPENSSLDIR: "/etc/pki/tls" engines: dynamic padlock nginx conf: user nginx; worker_processes 1; worker_rlimit_nofile 10240; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 10240; } http { include /usr/local/nginx/conf/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; log_format cache '***$time_local ' '$upstream_cache_status ' 'Cache-Control: $upstream_http_cache_control ' 'Expires: $upstream_http_expires ' '"$host" "$request" ($status) ' '"$http_user_agent" '; access_log /var/log/nginx/cache.log cache; sendfile on; keepalive_timeout 65; gzip on; gzip_types text/css text/javascript application/x-javascript; proxy_cache_path /mnt/nginx/cache levels=1:2 keys_zone=myzone:50m inactive=2h max_size=3000m; proxy_temp_path /mnt/nginx/temp; upstream backend_ssl { server 10.255.10.255:443; } server { listen 443; server_name _; ssl on; ssl_certificate /usr/local/nginx/conf/cert; ssl_certificate_key /usr/local/nginx/conf/key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; location / { proxy_pass http://backend_ssl; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; } # static files served locally location ~* \.(css|js)$ { root /home/static; } # static images served locally and get Expires header location ~* \.(jpg|jpeg|gif|png|ico|bmp)$ { root /home/static; expires 30d; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215785,215795#msg-215795 From mdounin at mdounin.ru Sun Sep 25 12:13:26 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 25 Sep 2011 16:13:26 +0400 Subject: Weird behavior on SSL, and corruption on reload In-Reply-To: <0df21e21f71559a9b9d85dba3a785ef2.NginxMailingListEnglish@forum.nginx.org> References: <6eab22ff27053776e27ee385bb82062d.NginxMailingListEnglish@forum.nginx.org> <0df21e21f71559a9b9d85dba3a785ef2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110925121326.GE1137@mdounin.ru> Hello! On Sun, Sep 25, 2011 at 07:14:40AM -0400, orensol wrote: > Hello Maxim, > > For now I can't reproduce the problem, if it happens again i'll try to > catch a real backtrace. > > Here are the other details. Thanks! > > > > nginx: > nginx version: nginx/0.8.35 > built by gcc 4.1.1 20070105 (Red Hat 4.1.1-52) > TLS SNI support disabled > configure arguments: --with-http_ssl_module > --add-module=/root/ngx_cache_purge-1.0 > > > > openssl: > OpenSSL 0.9.8b 04 May 2006 > built on: Wed Oct 17 18:15:17 EDT 2007 > platform: linux-elf > options: bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) > blowfish(idx) > compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT > -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -I/usr/kerberos/include -DL_ENDIAN > -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions > -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 > -mtune=generic -fasynchronous-unwind-tables -Wa,--noexecstack > -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM > -DRMD160_ASM -DAES_ASM > OPENSSLDIR: "/etc/pki/tls" > engines: dynamic padlock Both nginx 0.8.35 and openssl 0.9.8b are rather old and have known memory corruption issues. You may want to upgrade before doing anything else. Maxim Dounin From nginx-forum at nginx.us Sun Sep 25 13:02:37 2011 From: nginx-forum at nginx.us (ahu) Date: Sun, 25 Sep 2011 09:02:37 -0400 Subject: Trouble getting UploadProgress module to work In-Reply-To: <4BF8482A.1050208@daysofwonder.com> References: <4BF8482A.1050208@daysofwonder.com> Message-ID: <0352c082063ce9c35bf75e551259733e.NginxMailingListEnglish@forum.nginx.org> I got the uploadprogress module worked yestoday and I have not change any configuration today,while I find it out of working then. Who can help me? Here are some debug logs I find: ----------------------------------------------------------------- 2011/09/25 21:04:53 [debug] 9445#0: *10 test location: "/progress" 2011/09/25 21:04:53 [debug] 9445#0: *10 using configuration "/progress" 2011/09/25 21:04:53 [debug] 9445#0: *10 http cl:-1 max:2097152000 2011/09/25 21:04:53 [debug] 9445#0: *10 rewrite phase: 2 2011/09/25 21:04:53 [debug] 9445#0: *10 rewrite phase: 3 2011/09/25 21:04:53 [debug] 9445#0: *10 post rewrite phase: 4 2011/09/25 21:04:53 [debug] 9445#0: *10 generic phase: 5 2011/09/25 21:04:53 [debug] 9445#0: *10 generic phase: 6 2011/09/25 21:04:53 [debug] 9445#0: *10 access phase: 7 2011/09/25 21:04:53 [debug] 9445#0: *10 access phase: 8 2011/09/25 21:04:53 [debug] 9445#0: *10 post access phase: 9 2011/09/25 21:04:53 [debug] 9445#0: *10 http set discard body 2011/09/25 21:04:53 [debug] 9445#0: *10 upload-progress: get_tracking_id 2011/09/25 21:04:53 [debug] 9445#0: *10 malloc: 0000000007D1D2C0:16 2011/09/25 21:04:53 [debug] 9445#0: *10 upload-progress: get_tracking_id found header: d3182603d117b2a2505d00183485feb5 2011/09/25 21:04:53 [debug] 9445#0: *10 reportuploads handler found id: d3182603d117b2a2505d00183485feb5 2011/09/25 21:04:53 [debug] 9445#0: shmtx lock 2011/09/25 21:04:53 [debug] 9445#0: *10 upload-progress: find_node d3182603d117b2a2505d00183485feb5 2011/09/25 21:04:53 [debug] 9445#0: *10 upload-progress: can't find node 2011/09/25 21:04:53 [debug] 9445#0: *10 reportuploads not found: d3182603d117b2a2505d00183485feb5 2011/09/25 21:04:53 [debug] 9445#0: shmtx unlock 2011/09/25 21:04:53 [debug] 9445#0: *10 http script copy: "new Object({ 'state' : 'starting' }) " 2011/09/25 21:04:53 [debug] 9445#0: *10 upload progress: state=0, err_status=0, remaining=0, length=0 2011/09/25 21:04:53 [debug] 9445#0: *10 uploadprogress error-tracker error: 0 2011/09/25 21:04:53 [debug] 9445#0: *10 HTTP/1.1 200 OK Server: nginx/1.1.4 Date: Sun, 25 Sep 2011 13:04:53 GMT Content-Type: text/javascript Content-Length: 38 Connection: keep-alive Expires: Thu, 01 Jan 1970 00:00:01 GMT Cache-Control: no-cache 2011/09/25 21:04:53 [debug] 9445#0: *10 write new buf t:1 f:0 0000000007D8C178, pos 0000000007D8C178, size: 217 file: 0, size: 0 2011/09/25 21:04:53 [debug] 9445#0: *10 http write filter: l:0 f:0 s:217 2011/09/25 21:04:53 [debug] 9445#0: *10 http output filter "/progress?" 2011/09/25 21:04:53 [debug] 9445#0: *10 http copy filter: "/progress?" 2011/09/25 21:04:53 [debug] 9445#0: *10 http postpone filter "/progress?" 00007FFFB0EF7DB0 2011/09/25 21:04:53 [debug] 9445#0: *10 write old buf t:1 f:0 0000000007D8C178, pos 0000000007D8C178, size: 217 file: 0, size: 0 2011/09/25 21:04:53 [debug] 9445#0: *10 write new buf t:1 f:0 0000000007D8C0B0, pos 0000000007D8C0B0, size: 38 file: 0, size: 0 2011/09/25 21:04:53 [debug] 9445#0: *10 http write filter: l:1 f:0 s:255 2011/09/25 21:04:53 [debug] 9445#0: *10 http write filter limit 0 2011/09/25 21:04:53 [debug] 9445#0: *10 writev: 255 2011/09/25 21:04:53 [debug] 9445#0: *10 http write filter 0000000000000000 2011/09/25 21:04:53 [debug] 9445#0: *10 http copy filter: 0 "/progress?" 2011/09/25 21:04:53 [debug] 9445#0: *10 http finalize request: 0, "/progress?" a:1, c:1 2011/09/25 21:04:53 [debug] 9445#0: *10 set http keepalive handler 2011/09/25 21:04:53 [debug] 9445#0: *10 http close request 2011/09/25 21:04:53 [debug] 9445#0: *10 http log handler 2011/09/25 21:04:53 [debug] 9445#0: *10 free: 0000000007D8B400, unused: 42 2011/09/25 21:04:53 [debug] 9445#0: *10 event timer add: 14: 60000:1316955953219 2011/09/25 21:04:53 [debug] 9445#0: *10 free: 0000000007D2A600 2011/09/25 21:04:53 [debug] 9445#0: *10 free: 0000000007D803C0 2011/09/25 21:04:53 [debug] 9445#0: *10 hc free: 0000000000000000 0 2011/09/25 21:04:53 [debug] 9445#0: *10 hc busy: 0000000000000000 0 2011/09/25 21:04:53 [debug] 9445#0: *10 reusable connection: 1 2011/09/25 21:04:53 [debug] 9445#0: *10 post event 00002B2063134148 2011/09/25 21:04:53 [debug] 9445#0: timer delta: 495 2011/09/25 21:04:53 [debug] 9445#0: posted events 00002B2063134148 2011/09/25 21:04:53 [debug] 9445#0: posted event 00002B2063134148 2011/09/25 21:04:53 [debug] 9445#0: *10 delete posted event 00002B2063134148 2011/09/25 21:04:53 [debug] 9445#0: *10 http keepalive handler 2011/09/25 21:04:53 [debug] 9445#0: *10 malloc: 0000000007D803C0:32768 2011/09/25 21:04:53 [debug] 9445#0: *10 recv: fd:14 -1 of 32768 2011/09/25 21:04:53 [debug] 9445#0: *10 recv() not ready (11: Resource temporarily unavailable) 2011/09/25 21:04:53 [debug] 9445#0: posted event 0000000000000000 2011/09/25 21:04:53 [debug] 9445#0: worker cycle 2011/09/25 21:04:53 [debug] 9445#0: accept mutex lock failed: 0 2011/09/25 21:04:53 [debug] 9445#0: epoll timer: 500 2011/09/25 21:04:53 [debug] 9448#0: timer delta: 500 2011/09/25 21:04:53 [debug] 9448#0: posted events 0000000000000000 2011/09/25 21:04:53 [debug] 9448#0: worker cycle 2011/09/25 21:04:53 [debug] 9448#0: accept mutex lock failed: 0 2011/09/25 21:04:53 [debug] 9448#0: epoll timer: 500 2011/09/25 21:04:53 [debug] 9449#0: timer delta: 500 2011/09/25 21:04:53 [debug] 9449#0: posted events 0000000000000000 2011/09/25 21:04:53 [debug] 9449#0: worker cycle 2011/09/25 21:04:53 [debug] 9449#0: accept mutex lock failed: 0 2011/09/25 21:04:53 [debug] 9449#0: epoll timer: 500 2011/09/25 21:04:53 [debug] 9445#0: timer delta: 510 2011/09/25 21:04:53 [debug] 9445#0: posted events 0000000000000000 2011/09/25 21:04:53 [debug] 9445#0: worker cycle 2011/09/25 21:04:53 [debug] 9445#0: accept mutex lock failed: 0 2011/09/25 21:04:53 [debug] 9445#0: epoll timer: 500 2011/09/25 21:04:53 [debug] 9448#0: timer delta: 500 2011/09/25 21:04:53 [debug] 9448#0: posted events 0000000000000000 2011/09/25 21:04:53 [debug] 9448#0: worker cycle 2011/09/25 21:04:53 [debug] 9448#0: accept mutex lock failed: 0 2011/09/25 21:04:53 [debug] 9448#0: epoll timer: 500 2011/09/25 21:04:54 [debug] 9449#0: timer delta: 500 2011/09/25 21:04:54 [debug] 9449#0: posted events 0000000000000000 2011/09/25 21:04:54 [debug] 9449#0: worker cycle 2011/09/25 21:04:54 [debug] 9449#0: accept mutex lock failed: 0 2011/09/25 21:04:54 [debug] 9449#0: epoll timer: 500 2011/09/25 21:04:54 [debug] 9445#0: epoll: fd:14 ev:0001 d:00002B20627D3250 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,88713,215798#msg-215798 From hagaia at qwilt.com Sun Sep 25 14:42:11 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Sun, 25 Sep 2011 16:42:11 +0200 Subject: FLV Message-ID: Hi My question is about FLV Module NGINX documentation mentions that FLV module supports time-based offsets* "This module provides the ability to seek within FLV (Flash) files using time-based offsets."* http://wiki.nginx.org/HttpFlvStreamModule When looking on the source code and some testing I could see that its supports byte-based offset Can you help me fill the gap Thanks a lot *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From luky-37 at hotmail.com Sun Sep 25 15:16:46 2011 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sun, 25 Sep 2011 17:16:46 +0200 Subject: FLV In-Reply-To: References: Message-ID: FLV pseudostreaming is always in bytes, not seconds (like MP4). Please see http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12534/video-delivery-http-pseudo-streaming#mechanism Lukas From: hagaia at qwilt.com Date: Sun, 25 Sep 2011 16:42:11 +0200 Subject: FLV To: nginx at nginx.org Hi My question is about FLV Module NGINX documentation mentions that FLV module supports time-based offsets "This module provides the ability to seek within FLV (Flash) files using time-based offsets." http://wiki.nginx.org/HttpFlvStreamModule When looking on the source code and some testing I could see that its supports byte-based offset Can you help me fill the gap Thanks a lot Hagai Avrahami Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.juggery at gmail.com Sun Sep 25 16:06:19 2011 From: luc.juggery at gmail.com (Luc Juggery) Date: Sun, 25 Sep 2011 18:06:19 +0200 Subject: Cannot remove Content Length header In-Reply-To: References: <20110924120530.GA1137@mdounin.ru> <20110924145447.GB1137@mdounin.ru> Message-ID: Thanks, I corrected this on back-end side (adding a content-length). Luc 2011/9/24 Luc Juggery > Does it mean something (like a parameter or something) needs to be modified > on my node.js application ? Do I need to send additionnal stuff ? I did not > really get the "chunked" part. > > -- > Luc > > Le Sep 24, 2011 ? 16:54, Maxim Dounin a ?crit : > > > Hello! > > > > On Sat, Sep 24, 2011 at 02:58:59PM +0200, Luc Juggery wrote: > > > >> Hello, > >> > >> thanks for your answers. > >> Maxim, what would you recommend to fix the backend ? I do not really see > where could be the violation in fact. > > > > Backend MUST NOT (as per RFC 2616) return chunked to HTTP/1.0 > > clients, while nginx uses HTTP/1.0 to talk to backends. > > > > See RFC 2616, "3.6 Transfer Codings" > > http://tools.ietf.org/html/rfc2616#section-3.6 > > > > ... A server MUST NOT send transfer-codings to an HTTP/1.0 > > client. > > > > Maxim Dounin > > > >> > >> -- > >> Luc > >> > >> Le Sep 24, 2011 ? 14:05, Maxim Dounin a ?crit : > >> > >>> Hello! > >>> > >>> On Sat, Sep 24, 2011 at 01:43:12PM +0200, Luc Juggery wrote: > >>> > >>>> Hello, > >>>> > >>>> I'm using Nginx as a front end to my node.js application, nginx > proxying > >>>> https request to my app. > >>>> When the browser gets the response back, instead of pure json > >>>> ({"error":"query error","message":"Parameter(s) missing: > user,password"}), I > >>>> receive something like: > >>>> > >>>> 47 > >>>> {"error":"query error","message":"Parameter(s) missing: > user,password"} > >>>> 0 > >>> > >>> This is chunked encoding, likely sent by your backend in violation > >>> of HTTP specification. > >>> > >>> Right now there are two options available: > >>> > >>> 1. Fix your backend. > >>> > >>> 2. Upgrade to nginx 1.1.4, it has code needed to talk to such > >>> broken backends. > >>> > >>> Maxim Dounin > >>> > >>> _______________________________________________ > >>> nginx mailing list > >>> nginx at nginx.org > >>> http://mailman.nginx.org/mailman/listinfo/nginx > >> > >> _______________________________________________ > >> nginx mailing list > >> nginx at nginx.org > >> http://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > -- Luc -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Sep 25 16:45:20 2011 From: nginx-forum at nginx.us (tsaavik) Date: Sun, 25 Sep 2011 12:45:20 -0400 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: Lots of directions to go with this question, here are 2. 1. The IO bound questions: Your client_max_body_size has me wondering how big these images actually are. Whats the average size of these images? A few lines of output from "dstat" or "vmstat 1" during peak output would be useful (or even "sar" if you run it). If you are IO bound like I suspect, a reverse proxy via nginx's proxy_cache might be beneficial. You could just toss some 'hot' files into a ramdrive (/dev/shm) and symlink them (ln -s) to test. 2. Your PHP app is inefficent: I run a php gallery (gallery2). Its pretty damn slow/cpu hungry. In order to speed things up make sure your php has something like http://eaccelerator.net running. It increased my performance more then moving from apace1 (yes 1) to nginx. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215383,215807#msg-215807 From mdounin at mdounin.ru Sun Sep 25 18:33:52 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 25 Sep 2011 22:33:52 +0400 Subject: FLV In-Reply-To: References: Message-ID: <20110925183352.GG1137@mdounin.ru> Hello! On Sun, Sep 25, 2011 at 04:42:11PM +0200, Hagai Avrahami wrote: > Hi > > My question is about FLV Module > > NGINX documentation mentions that FLV module supports time-based offsets* > "This module provides the ability to seek within FLV (Flash) files using > time-based offsets."* > http://wiki.nginx.org/HttpFlvStreamModule Looks like wiki is wrong, feel free to fix it. Original documentation (in Russian) may be found here: http://sysoev.ru/nginx/docs/http/ngx_http_flv_module.html > When looking on the source code and some testing I could see that its > supports byte-based offset Yes, for flv offset is in bytes. Maxim Dounin From dennisml at conversis.de Sun Sep 25 19:20:30 2011 From: dennisml at conversis.de (Dennis Jacobfeuerborn) Date: Sun, 25 Sep 2011 21:20:30 +0200 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: <4E7F7EFE.80704@conversis.de> On 09/25/2011 06:45 PM, tsaavik wrote: > Lots of directions to go with this question, here are 2. > > 1. The IO bound questions: > Your client_max_body_size has me wondering how big these images > actually are. Whats the average size of these images? > > A few lines of output from "dstat" or "vmstat 1" during peak output > would be useful (or even "sar" if you run it). > > If you are IO bound like I suspect, a reverse proxy via nginx's > proxy_cache might be beneficial. You could just toss some 'hot' files > into a ramdrive (/dev/shm) and symlink them (ln -s) to test. The page cache will do something like this transparently. If there's not enough ram left for the page cache to keep the files in memory then you also don't have enough ram to add a ram drive. Regards, Dennis From nginx-forum at nginx.us Sun Sep 25 21:50:58 2011 From: nginx-forum at nginx.us (ptimo3) Date: Sun, 25 Sep 2011 17:50:58 -0400 Subject: nginx redirect loop under ssl In-Reply-To: References: Message-ID: <128fac09f98f0bff96508a5f0faa8a24.NginxMailingListEnglish@forum.nginx.org> similar to this ? http://forum.nginx.org/read.php?9,200930 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,165266,215812#msg-215812 From magicbearmo at gmail.com Mon Sep 26 00:16:03 2011 From: magicbearmo at gmail.com (MagicBear) Date: Mon, 26 Sep 2011 08:16:03 +0800 Subject: Help: My rewriting does not work. In-Reply-To: <2cfc08de7f692d76366169377e136fee.NginxMailingListEnglish@forum.nginx.org> References: <2cfc08de7f692d76366169377e136fee.NginxMailingListEnglish@forum.nginx.org> Message-ID: you may need to using ^/?????.html /w/??? permanent; note: You need save the file at ASCII mode for match GBK charset. But I am not share may it work for this. 2011/9/25 ohjyops : > I want to rewrite an old page to a new location, I use this code: > > rewrite ^/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html /w/??? permanent; > > But it does not work. I still can open the old page from > http://mysite.com/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html, not being > redirected to the new location. > > Can you help me correct my rewriting code? Thanks. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215776,215776#msg-215776 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- MagicBear From abioy.sun at gmail.com Mon Sep 26 02:59:14 2011 From: abioy.sun at gmail.com (Abioy Sun) Date: Mon, 26 Sep 2011 10:59:14 +0800 Subject: will NGX_AGAIN kill performance? In-Reply-To: References: Message-ID: hi, > > NGX_AGAIN is usually for non-blocking I/O operations, it's key for > good performance under high concurrency level in fact, that's what i'm doing. but i also doubt if the main request wake up every time an event arrived(made by not only subrequest), will it spent most of the time doing sth useless? thx Abioy -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Sep 26 04:19:21 2011 From: nginx-forum at nginx.us (ohjyops) Date: Mon, 26 Sep 2011 00:19:21 -0400 Subject: Help: My rewriting does not work. In-Reply-To: References: Message-ID: <48fa1a1e3528583681e75c927b640e2b.NginxMailingListEnglish@forum.nginx.org> Thank you for your reply. I tried: ^/?????.html /w/??? permanent; But it did not work. ( I did not covert the file to ASCII mode, It is UTF8) My nginx configuration file was saved in UTF8 encoding. The name of the old page file is a unescaped form of "?????.html" in GBK encoding. I converted my old website system from GBK encoding to a new UTF8 encoding one, and I use a new location /w/??? to replace the old "/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html". Here is the related part of my conf file: server { ... charset utf-8; source_charset utf-8; ... location ~ .html$ { rewrite ^/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html /w/??? permanent; } } What words will "/%C8%CB%CC%E5%D1%A8%CE%BB%CD%BC.html" be translated by nginx? How can I catch the path and rewrite it to the new location? If I covert my nginx conf file to ASCII encoding, will my new site system (in UTF8 encoding) still work? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215776,215824#msg-215824 From hagaia at qwilt.com Mon Sep 26 07:05:45 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Mon, 26 Sep 2011 09:05:45 +0200 Subject: FLV In-Reply-To: References: Message-ID: Hi You Tube Videos is in FLV format and use begin=X in millisecond for Advance seeking Hagai On Sun, Sep 25, 2011 at 5:16 PM, Lukas Tribus wrote: > FLV pseudostreaming is always in bytes, not seconds (like MP4). > > Please see > http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12534/video-delivery-http-pseudo-streaming#mechanism > > > Lukas > > > ------------------------------ > From: hagaia at qwilt.com > Date: Sun, 25 Sep 2011 16:42:11 +0200 > Subject: FLV > To: nginx at nginx.org > > > Hi > > My question is about FLV Module > > NGINX documentation mentions that FLV module supports time-based offsets* > "This module provides the ability to seek within FLV (Flash) files using > time-based offsets."* > http://wiki.nginx.org/HttpFlvStreamModule > > When looking on the source code and some testing I could see that its > supports byte-based offset > > Can you help me fill the gap > Thanks a lot > *Hagai Avrahami* > Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com > > > _______________________________________________ nginx mailing list > nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hagaia at qwilt.com Mon Sep 26 07:09:19 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Mon, 26 Sep 2011 09:09:19 +0200 Subject: FLV In-Reply-To: <20110925183352.GG1137@mdounin.ru> References: <20110925183352.GG1137@mdounin.ru> Message-ID: Thanks On Sun, Sep 25, 2011 at 8:33 PM, Maxim Dounin wrote: > Hello! > > On Sun, Sep 25, 2011 at 04:42:11PM +0200, Hagai Avrahami wrote: > > > Hi > > > > My question is about FLV Module > > > > NGINX documentation mentions that FLV module supports time-based offsets* > > "This module provides the ability to seek within FLV (Flash) files using > > time-based offsets."* > > http://wiki.nginx.org/HttpFlvStreamModule > > Looks like wiki is wrong, feel free to fix it. Original > documentation (in Russian) may be found here: > > http://sysoev.ru/nginx/docs/http/ngx_http_flv_module.html > > > When looking on the source code and some testing I could see that its > > supports byte-based offset > > Yes, for flv offset is in bytes. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Sep 26 08:16:00 2011 From: lists at ruby-forum.com (Sandesh K.) Date: Mon, 26 Sep 2011 10:16:00 +0200 Subject: Cannot remove Content Length header In-Reply-To: References: <20110924120530.GA1137@mdounin.ru> <20110924145447.GB1137@mdounin.ru> Message-ID: Luc Juggery wrote in post #1023663: > Thanks, I corrected this on back-end side (adding a content-length). > Luc > > 2011/9/24 Luc Juggery Hi Maxim, We are facing issues with certain phones which post data with chunked headers and no content length. These clients get error as 411. i have tried this w/ apache it works. Have we fixed this in any of current stable release we have any patch for it to work. Issue is similar to the one discussed in this link: http://www.ruby-forum.com/topic/162976 Regards, Sandesh K -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Mon Sep 26 08:42:07 2011 From: nginx-forum at nginx.us (csg) Date: Mon, 26 Sep 2011 04:42:07 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? Message-ID: <848a831e65a88f0624cdf43d741d0cda.NginxMailingListEnglish@forum.nginx.org> I have a short question on Nginx's proxy module. In our setup we reverse proxy specific requests to the server of an external partner via proxy_pass. Over the weekend the partner updated DNS but Nginx wasn't catching up the change and still sent traffic to the old server despite the fact the TTL of the record was little enough. An additional obstacle might be that in our case we have for example proxy_pass http://foo.example.com; where foo.example.com is a CNAME to bar.example.com (TTL of 1 hour) which is a A record (TTL of 60 seconds). Does Nginx honor DNS changes for upstream proxies or are lookups only done once on startup? If not, will the TTL being honor even if it has to traverse a list of CNAME records until it hits an A record? Both configuration directives, resolver and resolver_timeout are not set, therefore the default of 30 seconds should apply (if that is relevant here). $ nginx -V nginx: nginx version: nginx/1.0.3 nginx: configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --user=nginx --group=nginx --with-http_geoip_module --with-http_gzip_static_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --add-module=../agentzh-echo-nginx-module-1c4e116 --add-module=../ngx-fancyindex-0.3.1 --add-module=../agentzh-headers-more-nginx-module-2cbbc15 Thanks in advance! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,215830#msg-215830 From nginx-forum at nginx.us Mon Sep 26 09:30:49 2011 From: nginx-forum at nginx.us (dullnicker) Date: Mon, 26 Sep 2011 05:30:49 -0400 Subject: How to tune nginx for 800-1200 concurrent connections? In-Reply-To: References: Message-ID: <12107d44f2052e1fa0e179d4319587b1.NginxMailingListEnglish@forum.nginx.org> Dear all, thank you very much for your answers. What I did some days ago was installing APC (Alternative PHP Cache) on the server. I could not believe the results, but still - days after - they are as good as they were from the start. Server Load dropped like crazy. The momentary average server load is < 0.60, while it was >2.00 before. Therefore the need for any further optimization has vanished. Again, thank you both for taking the time to answer to my question. Kind regards -Amitz Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215383,215831#msg-215831 From mdounin at mdounin.ru Mon Sep 26 09:37:47 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 26 Sep 2011 13:37:47 +0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <848a831e65a88f0624cdf43d741d0cda.NginxMailingListEnglish@forum.nginx.org> References: <848a831e65a88f0624cdf43d741d0cda.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110926093747.GL1137@mdounin.ru> Hello! On Mon, Sep 26, 2011 at 04:42:07AM -0400, csg wrote: > I have a short question on Nginx's proxy module. In our setup we reverse > proxy specific requests to the server of an external partner via > proxy_pass. Over the weekend the partner updated DNS but Nginx wasn't > catching up the change and still sent traffic to the old server despite > the fact the TTL of the record was little enough. > > An additional obstacle might be that in our case we have for example > > proxy_pass http://foo.example.com; > > where foo.example.com is a CNAME to bar.example.com (TTL of 1 hour) > which is a A record (TTL of 60 seconds). > > Does Nginx honor DNS changes for upstream proxies or are lookups only > done once on startup? If not, will the TTL being honor even if it has to > traverse a list of CNAME records until it hits an A record? No, domain names statically configured in config are only looked up once on startup (or configuration reload). > Both configuration directives, resolver and resolver_timeout are not > set, therefore the default of 30 seconds should apply (if that is > relevant here). These are not relevant for "proxy_pass http://foo.example.com;". Resolver is only used for proxy_pass with variables, i.e. something like resolver 127.0.0.1; set $backend "foo.example.com"; proxy_pass http://$backend; In such setup ip address of "foo.example.com" will be looked up dynamically and result will be cached for 5 minutes. Maxim Dounin From nginx-forum at nginx.us Mon Sep 26 10:11:44 2011 From: nginx-forum at nginx.us (tcbarrett) Date: Mon, 26 Sep 2011 06:11:44 -0400 Subject: Best way to burst static file cache Message-ID: <0668d2360623a0b4f9f9c84c0ab39f30.NginxMailingListEnglish@forum.nginx.org> Hi Loving nginx, thanks Igor! I'm caching static files in a very traditional way, I hope: location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { #expires max; expires 30m; access_log off; log_not_found on; } I would like to have longer caching. Sometimes there is a fast turn around on live sites and clients have an issue bursting the cache. These tend to be Windows based clients. No matter what they or I do, they continue to retrieve cached versions of css and pngs. Is there a better configuration, or anything that I am not doing at my end to ensure they get served the fresh files? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215835,215835#msg-215835 From calin.don at gmail.com Mon Sep 26 10:57:14 2011 From: calin.don at gmail.com (Calin Don) Date: Mon, 26 Sep 2011 13:57:14 +0300 Subject: Log response errors to a separate file Message-ID: Hello, I would like to log to the general access log and also to a separate log 404, 403, 500, 501, 502, 503 responses. Is there a way of doing this? Is anyone doing this? Currently nginx is running in front of fastcgi and I would like 404 to be handled by the fastcgi backend (front controller pattern). Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Sep 26 13:40:53 2011 From: nginx-forum at nginx.us (csg) Date: Mon, 26 Sep 2011 09:40:53 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <20110926093747.GL1137@mdounin.ru> References: <20110926093747.GL1137@mdounin.ru> Message-ID: <800929933ba3c1edd4f169e2a7fb2319.NginxMailingListEnglish@forum.nginx.org> Maxim Dounin Wrote: ------------------------------------------------------- > Resolver is only used for proxy_pass with > variables, i.e. > something like > > resolver 127.0.0.1; > set $backend "foo.example.com"; > proxy_pass http://$backend; > > In such setup ip address of "foo.example.com" will > be looked up > dynamically and result will be cached for 5 > minutes. Thanks Maxim, that would be great but is it really supposed to work (in the stable branch)? The 1.0.3 which was deployed up to now gave me no host in upstream "" errors, with 1.0.6 I am getting invalid URL prefix in "http://" errors. If it helps I can try to setup a simplified test case, because posting the full configuration would certainly exceed some acceptable message limit of this list/forum. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,215844#msg-215844 From mdounin at mdounin.ru Mon Sep 26 13:56:25 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 26 Sep 2011 17:56:25 +0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <800929933ba3c1edd4f169e2a7fb2319.NginxMailingListEnglish@forum.nginx.org> References: <20110926093747.GL1137@mdounin.ru> <800929933ba3c1edd4f169e2a7fb2319.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110926135624.GO1137@mdounin.ru> Hello! On Mon, Sep 26, 2011 at 09:40:53AM -0400, csg wrote: > Maxim Dounin Wrote: > ------------------------------------------------------- > > Resolver is only used for proxy_pass with > > variables, i.e. > > something like > > > > resolver 127.0.0.1; > > set $backend "foo.example.com"; > > proxy_pass http://$backend; > > > > In such setup ip address of "foo.example.com" will > > be looked up > > dynamically and result will be cached for 5 > > minutes. > > Thanks Maxim, that would be great but is it really supposed to work (in > the stable branch)? The 1.0.3 which was deployed up to now gave me > > no host in upstream "" > > errors, with 1.0.6 I am getting > > invalid URL prefix in "http://" > > errors. If it helps I can try to setup a simplified test case, because > posting the full configuration would certainly exceed some acceptable > message limit of this list/forum. Errors suggest you don't have $backend set, and resulting proxy_pass tries to go to "http://" which is invalid. Maxim Dounin From ian.hobson at ntlworld.com Mon Sep 26 20:33:11 2011 From: ian.hobson at ntlworld.com (Ian Hobson) Date: Mon, 26 Sep 2011 21:33:11 +0100 Subject: Does the long polling module work with nginx 1.0.6? Message-ID: <4E80E187.6030807@ntlworld.com> Hi, I am using nginx with the long polling module. When 0.7 something was new, I compiled nginx with the long polling module and wrote my application. It ran under Ubuntu for 18 months or so, without problem. During this time I have not changed the code that handles messages or startup. In fact, there are only two commits to the VCS. About a month ago, I recompiled 1.0.6 with the long polling module using the same script as before. And the application has started to show intermittent errors. Can anyone confirm that they are using the long-polling module with 1.0.6 without problems? The symptom appears to be that if the second person to join the chat room, does not send a message for 5 minutes and they do not receive one in this time either, then they get timed out, and never receive a reply to the read issued after the start-up phase. Regards Ian From tomlove at gmail.com Mon Sep 26 20:58:56 2011 From: tomlove at gmail.com (Thomas Love) Date: Mon, 26 Sep 2011 22:58:56 +0200 Subject: Does the long polling module work with nginx 1.0.6? In-Reply-To: <4E80E187.6030807@ntlworld.com> References: <4E80E187.6030807@ntlworld.com> Message-ID: Are you referring to the push module? (http://pushmodule.slact.net/) Thomas On 26 September 2011 22:33, Ian Hobson wrote: > Hi, > > I am using nginx with the long polling module. ?When 0.7 something was new, > I compiled nginx with the long polling module and wrote my application. ?It > ran under Ubuntu for 18 months or so, without problem. > > During this time I have not changed the code that handles messages or > startup. In fact, there are only two commits to the VCS. > > About a month ago, I recompiled 1.0.6 with the long polling module using the > same script as before. ?And the application has started to show intermittent > errors. > > Can anyone confirm that they are using the long-polling module with 1.0.6 > without problems? > > The symptom appears to be that if the second person to join the chat room, > does not send a message for 5 minutes and they do not receive one in this > time either, then they get timed out, and never receive a reply to the read > issued after the start-up phase. > > Regards > > Ian > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From ian at ianhobson.co.uk Mon Sep 26 21:14:49 2011 From: ian at ianhobson.co.uk (Ian Hobson) Date: Mon, 26 Sep 2011 22:14:49 +0100 Subject: Does the long polling module work with nginx 1.0.6? In-Reply-To: References: <4E80E187.6030807@ntlworld.com> Message-ID: <4E80EB49.9000108@ianhobson.co.uk> On 26/09/2011 21:58, Thomas Love wrote: > Are you referring to the push module? (http://pushmodule.slact.net/) > > Thomas > Yes - Version 0.69 From tomlove at gmail.com Mon Sep 26 22:10:40 2011 From: tomlove at gmail.com (Thomas Love) Date: Tue, 27 Sep 2011 00:10:40 +0200 Subject: Does the long polling module work with nginx 1.0.6? In-Reply-To: <4E80EB49.9000108@ianhobson.co.uk> References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> Message-ID: I put the push module into production for a while a few months ago and suffered intermittent segfaults. It also has a couple of design limitations that were problematic in my case. It doesn't seem to be under active development, so I doubt these issues will be fixed any time soon. But I wonder whether the module isn't a poor solution architecturally, in any case. I eventually dropped it and implemented long-polling in a Node.js script. This turned out to be almost trivial -- far faster than trying to fix the module. Nginx is set up as a reverse proxy to this server, so it's insulated from any bad behaviour. I found the stability and ease of maintenance of this design easily worth the extra ~50 MB and CPU cycles. Cheers Thomas On 26 September 2011 23:14, Ian Hobson wrote: > On 26/09/2011 21:58, Thomas Love wrote: >> >> Are you referring to the push module? (http://pushmodule.slact.net/) >> >> Thomas >> > Yes - Version 0.69 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From ezwetkow at gmx.de Tue Sep 27 04:52:03 2011 From: ezwetkow at gmx.de (Elena Zwetkow) Date: Tue, 27 Sep 2011 06:52:03 +0200 Subject: Does the long polling module work with nginx 1.0.6? In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> Message-ID: <20110927045203.20830@gmx.net> Hi, -------- Original-Nachricht -------- > Datum: Tue, 27 Sep 2011 00:10:40 +0200 > Von: Thomas Love > An: nginx at nginx.org > Betreff: Re: Does the long polling module work with nginx 1.0.6? > I put the push module into production for a while a few months ago and > suffered intermittent segfaults. It also has a couple of design > limitations that were problematic in my case. It doesn't seem to be > under active development, so I doubt these issues will be fixed any > time soon. > > But I wonder whether the module isn't a poor solution architecturally, > in any case. I eventually dropped it and implemented long-polling in a > Node.js script. This turned out to be almost trivial -- far faster > than trying to fix the module. Nginx is set up as a reverse proxy to > this server, so it's insulated from any bad behaviour. I found the > stability and ease of maintenance of this design easily worth the > extra ~50 MB and CPU cycles. > > Cheers > Thomas > > > > > On 26 September 2011 23:14, Ian Hobson wrote: > > On 26/09/2011 21:58, Thomas Love wrote: > >> > >> Are you referring to the push module? (http://pushmodule.slact.net/) > >> > >> Thomas > >> > > Yes - Version 0.69 > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx or have a look at wandenbergs nginx-push-module, since version 0.3.0 (master branch) it also support long-polling and polling and its under active develpment. https://github.com/wandenberg/nginx-push-stream-module Cheers, Elena -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur?ck-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone From martronic at martronic.ch Tue Sep 27 06:41:33 2011 From: martronic at martronic.ch (Martronic SA) Date: Tue, 27 Sep 2011 08:41:33 +0200 Subject: Nginx Substitutions Filter problem In-Reply-To: <20110927045203.20830@gmx.net> References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> Message-ID: <4E81701D.408@martronic.ch> Hello, We are using the "Substitutions Filter module" to replace html content in our pages. Our configuration is : location /{ subs_filter_types text/html text/xml; subs_filter 'http://bale.hopla.net/bons-plans' 'http://bons-plans.hopla.net'; subs_filter 'id="portal-logo" href="http://bale.hopla.net"' 'id="portal-logo" href="http://www.hopla.net"'; } The first substitution is working, but the second not. Are we missing something? Is the "space" supported in substitution module? Thank you for your help! Martronic SA nginx -V nginx: nginx version: nginx/1.1.4 nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) nginx: TLS SNI support enabled nginx: configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --with-http_dav_module --http-client-body-temp-path=/var/lib/nginx/body --with-http_ssl_module --http-proxy-temp-path=/var/lib/nginx/proxy --with-http_stub_status_module --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --add-module=/var/lib/substitutions4nginx-read-only From nginx-forum at nginx.us Tue Sep 27 07:54:07 2011 From: nginx-forum at nginx.us (springbok) Date: Tue, 27 Sep 2011 03:54:07 -0400 Subject: Nginx and/or Passenger failing Message-ID: Hi, Envirionment: Passenger 3.0.9 nginx 1.0.6 Suse SLE 11 Rails 3.0.7 Ruby 1.9.2 p136 Quad core 8 GB Single Rails application nginx settings: worker_processes 3; worker_rlimit_nofile 8192; worker_priority 0; events { multi_accept off; worker_connections 4096; } pid /var/run/nginx.pid; error_log logs/error.log debug; http { passenger_root /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9; passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; passenger_max_pool_size 4; passenger_min_instances 1; keepalive_timeout 180; client_body_buffer_size 128k; client_header_buffer_size 2k; large_client_header_buffers 32 64k; passenger_pool_idle_time 300; passenger_log_level 2; passenger_use_global_queue on; include /opt/nginx/conf/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" ' '"$gzip_ratio"'; access_log logs/access.log main; sendfile on; tcp_nopush on; tcp_nodelay off; gzip on; gzip_http_version 1.0; gzip_comp_level 2; gzip_proxied any; gzip_min_length 1000; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; ... I'm not sure if the problem lies with passenger or nginx, after a period of time the passenger as well as the nginx master process shuts down. When I look in the log file I have the following: 2011/09/27 16:45:36 [info] 6408#0: *204 client 61.88.141.194 closed keepalive connection [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:45:46.849 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:46:01.848 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:46:16.848 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:46:31.848 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:46:46.849 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:47:01.849 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:47:16.848 ]: Flushing all sinks (periodic action) [ pid=6381 thr=140088026498848 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 16:47:31.848 ]: Flushing all sinks (periodic action) [ pid=6371 thr=139975134312192 file=ext/common/Watchdog.cpp:1057 time=2011-09-27 16:47:38.756 ]: Web server did not exit gracefully, forcing shutdown of all service processes... 2011/09/27 16:49:00 [crit] 6410#0: *250 connect() to unix:/passenger_helper_server failed (2: No such file or directory) while connecting to upstream, client: 120.146.194.176, serv er: localhost, request: "GET /candidates/new HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "61.88.141.221", referrer: "http://61.88.141.221/home/view_repor ts" When I look at the running processes the nginx master is no longer running but the workers are still running, I have to kill them before I can restart. All passenger processes are not longer running. As I said I'm not sure which process is causing the other to close and I have no idea what the problem may be, so any help greatly appreciated. Etienne. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215871,215871#msg-215871 From wangxichun at 300.cn Tue Sep 27 07:55:18 2011 From: wangxichun at 300.cn (wangxc) Date: Tue, 27 Sep 2011 15:55:18 +0800 Subject: how can i run/debug nginx in eclipse? Message-ID: <4E818166.1070705@300.cn> hi, all: I want to run/debug the nginx in Eclipse, how can i configure it ? thanks in advance! -- best regards rmn190 From david.yu.ftw at gmail.com Tue Sep 27 08:02:00 2011 From: david.yu.ftw at gmail.com (David Yu) Date: Tue, 27 Sep 2011 16:02:00 +0800 Subject: how can i run/debug nginx in eclipse? In-Reply-To: <4E818166.1070705@300.cn> References: <4E818166.1070705@300.cn> Message-ID: Run via External tools and point to your local nginx bin dir. On Tue, Sep 27, 2011 at 3:55 PM, wangxc wrote: > > > hi, all: > > I want to run/debug the nginx in Eclipse, how can i configure it ? > > thanks in advance! > > -- > > best regards > > rmn190 > > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -- When the cat is away, the mouse is alone. - David Yu -------------- next part -------------- An HTML attachment was scrubbed... URL: From osa at FreeBSD.org.ru Tue Sep 27 08:21:35 2011 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Tue, 27 Sep 2011 12:21:35 +0400 Subject: Nginx and/or Passenger failing In-Reply-To: References: Message-ID: <20110927082135.GF81654@FreeBSD.org.ru> On Tue, Sep 27, 2011 at 03:54:07AM -0400, springbok wrote: > Hi, > > Envirionment: > Passenger 3.0.9 > nginx 1.0.6 > Suse SLE 11 > Rails 3.0.7 > Ruby 1.9.2 p136 > Quad core > 8 GB > Single Rails application > > nginx settings: > > worker_processes 3; > worker_rlimit_nofile 8192; > worker_priority 0; > events { > multi_accept off; > worker_connections 4096; > } > > pid /var/run/nginx.pid; > error_log logs/error.log debug; > http { > passenger_root > /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9; > passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; > passenger_max_pool_size 4; > passenger_min_instances 1; > keepalive_timeout 180; > client_body_buffer_size 128k; > client_header_buffer_size 2k; > large_client_header_buffers 32 64k; > passenger_pool_idle_time 300; > passenger_log_level 2; > passenger_use_global_queue on; > include /opt/nginx/conf/mime.types; > default_type application/octet-stream; > log_format main '$remote_addr - $remote_user [$time_local] ' > '"$request" $status $bytes_sent ' > '"$http_referer" "$http_user_agent" ' > '"$gzip_ratio"'; > access_log logs/access.log main; > sendfile on; > tcp_nopush on; > tcp_nodelay off; > gzip on; > gzip_http_version 1.0; > gzip_comp_level 2; > gzip_proxied any; > gzip_min_length 1000; > gzip_types text/plain text/css application/x-javascript > text/xml application/xml application/xml+rss text/javascript; > ... > > I'm not sure if the problem lies with passenger or nginx, after a period > of time the passenger as well as the nginx master process shuts down. > When I look in the log file I have the following: > > 2011/09/27 16:45:36 [info] 6408#0: *204 client 61.88.141.194 closed > keepalive connection > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:45:46.849 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:46:01.848 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:46:16.848 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:46:31.848 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:46:46.849 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:47:01.849 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:47:16.848 ]: Flushing all sinks (periodic action) > [ pid=6381 thr=140088026498848 > file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27 > 16:47:31.848 ]: Flushing all sinks (periodic action) > [ pid=6371 thr=139975134312192 file=ext/common/Watchdog.cpp:1057 > time=2011-09-27 16:47:38.756 ]: Web server did not exit gracefully, > forcing shutdown of all service processes... > 2011/09/27 16:49:00 [crit] 6410#0: *250 connect() to > unix:/passenger_helper_server failed (2: No such file or directory) > while connecting to upstream, client: 120.146.194.176, serv > er: localhost, request: "GET /candidates/new HTTP/1.1", upstream: > "passenger:unix:/passenger_helper_server:", host: "61.88.141.221", > referrer: "http://61.88.141.221/home/view_repor > ts" > > When I look at the running processes the nginx master is no longer > running but the workers are still running, I have to kill them before I > can restart. All passenger processes are not longer running. > > As I said I'm not sure which process is causing the other to close and I > have no idea what the problem may be, so any help greatly appreciated. Could you try very simple config with small application from passenger distro, i.e. something like this. http { include mime.types; default_type application/octet-stream; passenger_root /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9; passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; passenger_default_user www; server { listen 127.0.0.1:80; server_name localhost; root /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9/test/stub/rack/public; passenger_enabled on; passenger_use_global_queue on; } } After restart your nginx with passenger you should find nginx and passenger processes. % ps auxww | grep nginx | grep -v nginx root 18932 4,0 15,9 44464 39656 ?? Ss 8:46 0:00,01 nginx: master process /usr/local/sbin/nginx www 18933 4,0 16,0 44464 39904 ?? S 8:46 0:00,02 nginx: worker process (nginx) % ps uaxww | grep -i passenger | grep -v grep root 18923 0,0 1,0 5760 2508 ?? Is 8:46 0:00,07 PassengerWatchdog root 18926 0,0 1,5 15052 3820 ?? I 8:46 0:00,09 PassengerHelperAgent root 18929 0,0 2,7 13176 6620 ?? I 8:46 0:01,75 ruby: Passenger spawn server (ruby) nobody 18930 0,0 1,4 6688 3600 ?? I 8:46 0:00,07 PassengerLoggingAgent % telnet 127.0.0.1 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 200 OK Content-Type: text/html Connection: close Status: 200 X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9 Server: nginx/1.0.6 + Phusion Passenger 3.0.9 (mod_rails/mod_rack) hello worldConnection closed by foreign host. Does it possible reproduce your problem for simple configuration? -- Sergey A. Osokin osa at FreeBSD.ORG.ru osa at FreeBSD.ORG From nginx-forum at nginx.us Tue Sep 27 08:56:27 2011 From: nginx-forum at nginx.us (springbok) Date: Tue, 27 Sep 2011 04:56:27 -0400 Subject: Nginx and/or Passenger failing In-Reply-To: <20110927082135.GF81654@FreeBSD.org.ru> References: <20110927082135.GF81654@FreeBSD.org.ru> Message-ID: <95a734f49d7c5f4544e1e759ff8e57e2.NginxMailingListEnglish@forum.nginx.org> Sergey A. Osokin Wrote: ------------------------------------------------------- > On Tue, Sep 27, 2011 at 03:54:07AM -0400, > > Could you try very simple config with small > application from passenger > distro, i.e. something like this. > > http { > include mime.types; > default_type application/octet-stream; > > passenger_root > /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger > -3.0.9; > passenger_ruby > /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; > passenger_default_user www; > > server { > listen 127.0.0.1:80; > server_name localhost; > > root > /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger > -3.0.9/test/stub/rack/public; > passenger_enabled on; > passenger_use_global_queue on; > } > } > > After restart your nginx with passenger you should > find nginx and passenger > processes. > > % ps auxww | grep nginx | grep -v nginx > root 18932 4,0 15,9 44464 39656 ?? Ss 8:46 > 0:00,01 nginx: master process > /usr/local/sbin/nginx > www 18933 4,0 16,0 44464 39904 ?? S 8:46 > 0:00,02 nginx: worker process (nginx) > % ps uaxww | grep -i passenger | grep -v grep > root 18923 0,0 1,0 5760 2508 ?? Is 8:46 > 0:00,07 PassengerWatchdog > root 18926 0,0 1,5 15052 3820 ?? I 8:46 > 0:00,09 PassengerHelperAgent > root 18929 0,0 2,7 13176 6620 ?? I 8:46 > 0:01,75 ruby: Passenger spawn server (ruby) > nobody 18930 0,0 1,4 6688 3600 ?? I 8:46 > 0:00,07 PassengerLoggingAgent > > % telnet 127.0.0.1 80 > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > GET / HTTP/1.0 > > HTTP/1.1 200 OK > Content-Type: text/html > Connection: close > Status: 200 > X-Powered-By: Phusion Passenger > (mod_rails/mod_rack) 3.0.9 > Server: nginx/1.0.6 + Phusion Passenger 3.0.9 > (mod_rails/mod_rack) > > hello worldConnection closed by foreign > host. > > Does it possible reproduce your problem for simple > configuration? > > -- > Sergey A. Osokin > osa at FreeBSD.ORG.ru > osa at FreeBSD.ORG > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hi Sergey, Thank you so much for the prompt reply. Sorry I just can't get this working, nginx fires up ok but nothing happens when I telnet. I checked passenger using passenger-status --verbose and it shows the details for passenger but when I check for running passenger processes it's not running. When I do GET / HTTP/1.0 nothing happens. Am I missing something? user ....; events { multi_accept off; worker_connections 4096; } http { include mime.types; default_type application/octet-stream; passenger_root /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9; passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; passenger_default_user ...; server { listen 80; server_name localhost; root /home/etienne/test/stub/rack/public; passenger_enabled on; passenger_use_global_queue on; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215871,215876#msg-215876 From nginx-forum at nginx.us Tue Sep 27 09:10:48 2011 From: nginx-forum at nginx.us (springbok) Date: Tue, 27 Sep 2011 05:10:48 -0400 Subject: Nginx and/or Passenger failing In-Reply-To: <95a734f49d7c5f4544e1e759ff8e57e2.NginxMailingListEnglish@forum.nginx.org> References: <20110927082135.GF81654@FreeBSD.org.ru> <95a734f49d7c5f4544e1e759ff8e57e2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1dbda862d38fd600df56430d84b13c56.NginxMailingListEnglish@forum.nginx.org> springbok Wrote: ------------------------------------------------------- > Sergey A. Osokin Wrote: > -------------------------------------------------- > ----- > > On Tue, Sep 27, 2011 at 03:54:07AM -0400, > > > > Could you try very simple config with small > > application from passenger > > distro, i.e. something like this. > > > > http { > > include mime.types; > > default_type application/octet-stream; > > > > passenger_root > > > /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger > > > -3.0.9; > > passenger_ruby > > /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; > > passenger_default_user www; > > > > server { > > listen 127.0.0.1:80; > > server_name localhost; > > > > root > > > /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger > > > -3.0.9/test/stub/rack/public; > > passenger_enabled on; > > passenger_use_global_queue on; > > } > > } > > > > After restart your nginx with passenger you > should > > find nginx and passenger > > processes. > > > > % ps auxww | grep nginx | grep -v nginx > > root 18932 4,0 15,9 44464 39656 ?? Ss > 8:46 > > 0:00,01 nginx: master process > > /usr/local/sbin/nginx > > www 18933 4,0 16,0 44464 39904 ?? S > 8:46 > > 0:00,02 nginx: worker process (nginx) > > % ps uaxww | grep -i passenger | grep -v grep > > root 18923 0,0 1,0 5760 2508 ?? Is > 8:46 > > 0:00,07 PassengerWatchdog > > root 18926 0,0 1,5 15052 3820 ?? I > 8:46 > > 0:00,09 PassengerHelperAgent > > root 18929 0,0 2,7 13176 6620 ?? I > 8:46 > > 0:01,75 ruby: Passenger spawn server (ruby) > > nobody 18930 0,0 1,4 6688 3600 ?? I > 8:46 > > 0:00,07 PassengerLoggingAgent > > > > % telnet 127.0.0.1 80 > > Trying 127.0.0.1... > > Connected to localhost. > > Escape character is '^]'. > > GET / HTTP/1.0 > > > > HTTP/1.1 200 OK > > Content-Type: text/html > > Connection: close > > Status: 200 > > X-Powered-By: Phusion Passenger > > (mod_rails/mod_rack) 3.0.9 > > Server: nginx/1.0.6 + Phusion Passenger 3.0.9 > > (mod_rails/mod_rack) > > > > hello worldConnection closed by foreign > > host. > > > > Does it possible reproduce your problem for > simple > > configuration? > > > > -- > > Sergey A. Osokin > > osa at FreeBSD.ORG.ru > > osa at FreeBSD.ORG > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > Hi Sergey, > > Thank you so much for the prompt reply. > > Sorry I just can't get this working, nginx fires > up ok but nothing happens when I telnet. I checked > passenger using passenger-status --verbose > and it shows the details for passenger but when I > check for running passenger processes it's not > running. > > When I do GET / HTTP/1.0 nothing happens. > > Am I missing something? > > > user ....; > events { > multi_accept off; > worker_connections 4096; > } > > http { > include mime.types; > default_type application/octet-stream; > > passenger_root > /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger > -3.0.9; > passenger_ruby > /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby; > > passenger_default_user ...; > > server { > listen 80; > server_name localhost; > > root /home/etienne/test/stub/rack/public; > passenger_enabled on; > passenger_use_global_queue on; > } > } Hi Sergey, One other thing I'd mention is that our application works great for most of the time but intermittently it fails with the symptoms I describe so I'm not sure I can reproduce it with the simple setup if I did get it going. Regards, Etienne. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215871,215877#msg-215877 From nginx-forum at nginx.us Tue Sep 27 09:35:57 2011 From: nginx-forum at nginx.us (springbok) Date: Tue, 27 Sep 2011 05:35:57 -0400 Subject: Nginx and/or Passenger failing In-Reply-To: <1dbda862d38fd600df56430d84b13c56.NginxMailingListEnglish@forum.nginx.org> References: <20110927082135.GF81654@FreeBSD.org.ru> <95a734f49d7c5f4544e1e759ff8e57e2.NginxMailingListEnglish@forum.nginx.org> <1dbda862d38fd600df56430d84b13c56.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5d87c4291809984407c6d4ce1679c712.NginxMailingListEnglish@forum.nginx.org> Ok, I've got passenger loading and appearing in the process list, I created a index.html file and was able to display it doing a GET / but when I try GET / HTTP/1.0 it just sits there and nothing happens. If I remove the index.html I get "Hello world" returned, no mention of passenger. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215871,215879#msg-215879 From osa at FreeBSD.org.ru Tue Sep 27 11:01:46 2011 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Tue, 27 Sep 2011 15:01:46 +0400 Subject: Nginx and/or Passenger failing In-Reply-To: <5d87c4291809984407c6d4ce1679c712.NginxMailingListEnglish@forum.nginx.org> References: <20110927082135.GF81654@FreeBSD.org.ru> <95a734f49d7c5f4544e1e759ff8e57e2.NginxMailingListEnglish@forum.nginx.org> <1dbda862d38fd600df56430d84b13c56.NginxMailingListEnglish@forum.nginx.org> <5d87c4291809984407c6d4ce1679c712.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110927110146.GA90093@FreeBSD.org.ru> On Tue, Sep 27, 2011 at 05:35:57AM -0400, springbok wrote: > Ok, I've got passenger loading and appearing in the process list, I > created a index.html file and was able to display it doing a GET / but > when I try GET / HTTP/1.0 it just sits there and nothing happens. If I > remove the index.html I get "Hello world" returned, no mention of > passenger. So, if you got "Hello, world this means passenger works well with default installation. Could you please check your application or try to use previous version of nginx and/or passenger. -- Sergey A. Osokin osa at FreeBSD.ORG.ru osa at FreeBSD.ORG From nginx-forum at nginx.us Tue Sep 27 11:08:00 2011 From: nginx-forum at nginx.us (liushaobo) Date: Tue, 27 Sep 2011 07:08:00 -0400 Subject: php-fpm Input/output error Message-ID: <2b6a402bd983a82820bbf0286a825073.NginxMailingListEnglish@forum.nginx.org> hi all ,please help me php-fpm error log [27-Sep-2011 11:42:20] ERROR: ptrace(PEEKDATA) failed: Input/output error (5) php-fpm.slow.log [27-Sep-2011 13:49:50] [pool www] pid 24386 script_filename = /www/nmarket/index.php [0x000000001adaa0e8] execute() /data0/www/yii-1.1.8.r3324/framework/yiilite.php:8599 [0x000000001ada9f48] queryInternal() /data0/www/yii-1.1.8.r3324/framework/yiilite.php:8550 [0x000000001ada95f0] queryAll() /data0/www/nmarket/protected/modules/web/components/GuessWidget.php:36 [0x000000001ada9480] getGuessList() /data0/www/nmarket/protected/modules/web/components/GuessWidget.php:62 [0x000000001ada9198] run() /data0/www/yii-1.1.8.r3324/framework/yiilite.php:3097 [0x000000001ada6fd8] widget() /data0/www/nmarket/protected/modules/web/views/soft/show.php:157 [0x000000001ada6dc0] +++ dump failed [27-Sep-2011 13:49:50] [pool www] pid 25608 script_filename = /www/nmarket/index.php [0x000000001adbd6c0] execute() /data0/www/yii-1.1.8.r3324/framework/yiilite.php:8599 [0x000000001adbd520] queryInternal() /data0/www/yii-1.1.8.r3324/framework/yiilite.php:8550 [0x000000001adbc7a8] queryAll() /data0/www/nmarket/protected/modules/web/components/JustDownloadedByCat.php:45 [0x000000001adbc4c0] run() /data0/www/yii-1.1.8.r3324/framework/yiilite.php:3097 [0x000000001adbb6e0] widget() /data0/www/nmarket/protected/modules/web/views/soft/index.php:56 [0x000000001adbb4c8] +++ dump failed Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215882,215882#msg-215882 From hagaia at qwilt.com Tue Sep 27 11:36:45 2011 From: hagaia at qwilt.com (Hagai Avrahami) Date: Tue, 27 Sep 2011 13:36:45 +0200 Subject: Static Files Message-ID: Hi I am intend to use NGINX (LINUX) for serving static files with high concurrency and bandwidth. Some of the files is served from the disk and some from cache. I am trying to find the configuration for best performance. I have some questions regarding NGINX configuration. 1. *output_buffers 1 32k* ---------------------------------------- This directive excepts 2 inputs can someone explain me the meaning of each input I can see that 32K is size of data (per fetch) when reading from a DIsk - what else it influences? When serving big files, best Disk utilization is in blocks of 1MB, is it OK to change this directive to 1024k? 2. *aio* ---------------------------------------- **I read in Wiki the following *" This directive is usable as of Linux kernel 2.6.22. For Linux it is required to use directio, this automatically disables sendfile support."* when using AIO I must use *directio on*? (when testing I could see the file is served from the cache - which means it is not using O_DIRECT) 3. *sendfile *---------------------------------------- Is NGINX try to send a file using 1 sendfile call (count = file size)? If so when trying to send file residing only on the Disk, the server is blocked till end of transmition? In this model serving multiple files some on the disk and some cached is inefficient? Will be happy to get any answer or opinion Thanks Hagai -- *Hagai Avrahami* Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Sep 27 14:03:30 2011 From: nginx-forum at nginx.us (springbok) Date: Tue, 27 Sep 2011 10:03:30 -0400 Subject: Nginx and/or Passenger failing In-Reply-To: <20110927110146.GA90093@FreeBSD.org.ru> References: <20110927110146.GA90093@FreeBSD.org.ru> Message-ID: Sergey A. Osokin Wrote: ------------------------------------------------------- > On Tue, Sep 27, 2011 at 05:35:57AM -0400, > springbok wrote: > > Ok, I've got passenger loading and appearing in > the process list, I > > created a index.html file and was able to > display it doing a GET / but > > when I try GET / HTTP/1.0 it just sits there and > nothing happens. If I > > remove the index.html I get "Hello world" > returned, no mention of > > passenger. > > So, if you got "Hello, world this means > passenger works well with > default installation. Could you please check your > application or try to use > previous version of nginx and/or passenger. > > -- > Sergey A. Osokin > osa at FreeBSD.ORG.ru > osa at FreeBSD.ORG > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hi Sergey, I was using 0.8.53 when I started getting the errors and decided to upgrade before posting my question. Do you believe this is an nginx or passenger problem, is nginx causing passenger to shutdown or the other way around? To me it looks like the watchdog process is getting an error from nginx and closing the passenger processes. We have 8GB of memory and 4 processors, do you think it could be memory related/CPU load related, I know it's difficult to say without seeing our app and the load it places on the system, but if you had to guess? It has plenty of memory available so I don't think that's a problem, the IT manager for the client which I developed the app is convinced the shutdown is caused by CPU load. When monitoring the load the passenger processes spike up to around 50-80% but settle down to 10% of less when idling, at the moment they are < 1% as the load is low. The shutdown has happened when there is not a lot of load so I'm not convinced. I just really don't know where to start looking, could it be something external for example the DB the app uses is running on a different server maybe it's a network problem, what about rogue messages is that possible, the IT manager did say he removed the firewall to the machine. I'm sure he has something else in place, but this app has been running fine for the last 6 months, it only started happening after the weekend when we went live and the DB was moved from the same machine to another. Sorry for all the questions but I'm really stumped and don't know what to try next. Thanks again for your help. Etienne. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215871,215902#msg-215902 From osa at FreeBSD.org.ru Tue Sep 27 15:38:59 2011 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Tue, 27 Sep 2011 19:38:59 +0400 Subject: Nginx and/or Passenger failing In-Reply-To: References: <20110927110146.GA90093@FreeBSD.org.ru> Message-ID: <20110927153859.GB90093@FreeBSD.org.ru> On Tue, Sep 27, 2011 at 10:03:30AM -0400, springbok wrote: > Sergey A. Osokin Wrote: > ------------------------------------------------------- > > On Tue, Sep 27, 2011 at 05:35:57AM -0400, > > springbok wrote: > > > Ok, I've got passenger loading and appearing in > > the process list, I > > > created a index.html file and was able to > > display it doing a GET / but > > > when I try GET / HTTP/1.0 it just sits there and > > nothing happens. If I > > > remove the index.html I get "Hello world" > > returned, no mention of > > > passenger. > > > > So, if you got "Hello, world this means > > passenger works well with > > default installation. Could you please check your > > application or try to use > > previous version of nginx and/or passenger. > > > > -- > > Sergey A. Osokin > > osa at FreeBSD.ORG.ru > > osa at FreeBSD.ORG > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > Hi Sergey, > > I was using 0.8.53 when I started getting the errors and decided to > upgrade before posting my question. > > Do you believe this is an nginx or passenger problem, is nginx causing > passenger to shutdown or the other way around? I don't know. > To me it looks like the > watchdog process is getting an error from nginx and closing the > passenger processes. I think you should ask about your problem authors of passenger at first. > We have 8GB of memory and 4 processors, do you think it could be memory > related/CPU load related, I know it's difficult to say without seeing > our app and the load it places on the system, but if you had to guess? > It has plenty of memory available so I don't think that's a problem, the > IT manager for the client which I developed the app is convinced the > shutdown is caused by CPU load. When monitoring the load the passenger > processes spike up to around 50-80% but settle down to 10% of less when > idling, at the moment they are < 1% as the load is low. The shutdown has > happened when there is not a lot of load so I'm not convinced. > > I just really don't know where to start looking, could it be something > external for example the DB the app uses is running on a different > server maybe it's a network problem, what about rogue messages is that > possible, the IT manager did say he removed the firewall to the machine. > I'm sure he has something else in place, but this app has been running > fine for the last 6 months, it only started happening after the weekend > when we went live and the DB was moved from the same machine to > another. > > Sorry for all the questions but I'm really stumped and don't know what > to try next. -- Sergey A. Osokin osa at FreeBSD.ORG osa at FreeBSD.ORG.ru From antoine.bonavita at gmail.com Tue Sep 27 15:52:44 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Tue, 27 Sep 2011 17:52:44 +0200 Subject: how can i run/debug nginx in eclipse? In-Reply-To: References: <4E818166.1070705@300.cn> Message-ID: A few extra things might be needed for debugging (http://www.nginx-discovery.com/2011/03/day-36-nginx-debug-and-valgrind-from.html) but you just need to import nginx as a C/C++ project with Makefile. Hope this helps, A. On Tue, Sep 27, 2011 at 10:02 AM, David Yu wrote: > Run via External tools and point to your local nginx bin dir. > > On Tue, Sep 27, 2011 at 3:55 PM, wangxc wrote: >> >> >> hi, all: >> >> I want to run/debug the nginx in Eclipse, how can i configure it ? >> >> thanks in advance! >> >> -- >> >> best regards >> >> rmn190 >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > > > -- > When the cat is away, the mouse is alone. > - David Yu > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From contact at jpluscplusm.com Tue Sep 27 22:23:47 2011 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Tue, 27 Sep 2011 23:23:47 +0100 Subject: Override proxy's incorrect Content-Type via mime settings In-Reply-To: References: Message-ID: Just a quick thread bump to see if anyone has any ideas ... On 23 September 2011 17:37, Jonathan Matthews wrote: > Hi all - > > I have an upstream proxy that sends the wrong Content-Type header for > a load of images. Sometime it doesn't send any header at all. > > I'm trying to get Nginx not only to remove the upstream's Content-Type > header ("proxy_hide_header"), but also to insert the correct header. > Unfortunately, I can't hard-code the value as there are a variety of > image formats being used. "proxy_hide_header" doesn't seem to do > anything other than block the incorrect value, and > "proxy_ignore_headers" won't accept "Content-Type". > > How can I both remove upstream's incorrect header, and also add the > header than Nginx *would* have used if it were serving the content > from local disk? > In other words, how do I add the header with a value derived from the > MIME settings currently configured, via the requested file's > extension? > > Version 0.7.67, but can upgrade if required. > > Many thanks, > Jonathan > -- > Jonathan Matthews > London, UK > http://www.jpluscplusm.com/contact.html > From abioy.sun at gmail.com Tue Sep 27 22:42:08 2011 From: abioy.sun at gmail.com (Abioy Sun) Date: Wed, 28 Sep 2011 06:42:08 +0800 Subject: how can i run/debug nginx in eclipse? In-Reply-To: <4E818166.1070705@300.cn> References: <4E818166.1070705@300.cn> Message-ID: in gdb, you may need to 'set follow-fork-mode child' or detach the worker's pid > > > hi, all: > > I want to run/debug the nginx in Eclipse, how can i configure it ? > > thanks in advance! > > -- > > best regards > > rmn190 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abioy.sun at gmail.com Tue Sep 27 22:48:21 2011 From: abioy.sun at gmail.com (Abioy Sun) Date: Wed, 28 Sep 2011 06:48:21 +0800 Subject: how can i run/debug nginx in eclipse? In-Reply-To: References: <4E818166.1070705@300.cn> Message-ID: > in gdb, you may need to 'set follow-fork-mode child' or detach the worker's pid sorry, should be 'attach the worker' >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.a.portante at gmail.com Wed Sep 28 01:30:40 2011 From: peter.a.portante at gmail.com (Peter Portante) Date: Tue, 27 Sep 2011 21:30:40 -0400 Subject: Small bug in rewrite rules using if (ugh, yes, if is bad ...) In-Reply-To: <20110831155233.GZ1137@mdounin.ru> References: <20110831155233.GZ1137@mdounin.ru> Message-ID: On Wed, Aug 31, 2011 at 11:52 AM, Maxim Dounin wrote: > Hello! > > On Wed, Aug 31, 2011 at 11:26:29AM -0400, Peter Portante wrote: > > > Hello folks, > > > > Just thought I would report a small bug with rewrite interacting with if. > > > > Here is my simple setup: > > > > server { > > server_name example.dev.com; > > location ^~ /salad/add { > > if ($arg_paramThree = "foobar") { > > rewrite ^ > > https://example.this.com?PARAM_ONE=$arg_paramOne&PARAM_TWO=$arg_paramTwo > ? > > redirect; > > } > > proxy_pass http://127.0.0.1:8080$request_uri; > > } > > } > > > > So when I hit the server with this URL: > > > > > http://example.dev.com/salad/add?paramThree=foobar¶mTwo=two¶mOne=one > > > > > > It is rewritten to be: > > > > https://example.this.com?PARAM_ONE=one&PARAM_TWO=two?paramThree=foobar > > > > > > If I use the following if conditional, the behavior is as expected: > > > > if ($args ~ "paramThree=foobar") { > > Works ok here. Which nginx version do you use? > 1.0.4 thanks for taking the time to check it out. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Sep 28 02:56:40 2011 From: nginx-forum at nginx.us (baalchina) Date: Tue, 27 Sep 2011 22:56:40 -0400 Subject: =?UTF-8?Q?why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= Message-ID: Hello everyone? I am working on an centos6 with nginx 1.0.6, php 5.3.6, and fpm. I found that php file in my subdirectory returns a 404,but in nginx home direcory works fine. For example , a phpinfo.php file works fine in /data/web/, where /data/web is my nginx document root. Buy the same file in /data/web/sub, the browser and nginx both tell a 404 error. Here is my nginx config file: server { listen 80; server_name abc.example.com; location / { root /data/web/; index index.html index.htm index.php; location ~ .*\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; } } } btw, static file such as html works fine. Thans a lot. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215921,215921#msg-215921 From simohayha.bobo at gmail.com Wed Sep 28 03:03:10 2011 From: simohayha.bobo at gmail.com (Simon Liu) Date: Wed, 28 Sep 2011 11:03:10 +0800 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: References: Message-ID: Hello. You shoude set (fastcgi_param SCRIPT_FILENAME) . example: location ~ .*\.(php|php5)?$ { fastcgi_param SCRIPT_FILENAME /data/web/$1; } On Wed, Sep 28, 2011 at 10:56 AM, baalchina wrote: > Hello everyone? > > I am working on an centos6 with nginx 1.0.6, php 5.3.6, and fpm. > > I found that php file in my subdirectory returns a 404,but in nginx home > direcory works fine. > > For example , a phpinfo.php file works fine in /data/web/, where > /data/web is my nginx document root. Buy the same file in /data/web/sub, > the browser and nginx both tell a 404 error. > > Here is my nginx config file: > > > server { > listen 80; > server_name abc.example.com; > > location / { > root /data/web/; > index index.html index.htm index.php; > > location ~ .*\.(php|php5)?$ > { > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > include fastcgi.conf; > fastcgi_connect_timeout 300; > fastcgi_send_timeout 300; > fastcgi_read_timeout 300; > fastcgi_buffer_size 64k; > fastcgi_buffers 4 64; > fastcgi_busy_buffers_size 128k; > fastcgi_temp_file_write_size 128k; > } > } > } > > > btw, static file such as html works fine. > > Thans a lot. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215921,215921#msg-215921 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- douban:www.douban.com/people/mustang/ blog: www.pagefault.info twitter: www.twitter.com/minibobo weibo: www.weibo.com/diaoliang -------------- next part -------------- An HTML attachment was scrubbed... URL: From simohayha.bobo at gmail.com Wed Sep 28 03:48:28 2011 From: simohayha.bobo at gmail.com (Simon Liu) Date: Wed, 28 Sep 2011 11:48:28 +0800 Subject: Static Files In-Reply-To: References: Message-ID: 1 output_buffers because static file used sendfile in nginx, and if you need modify file content, you need read file content to memory(example gzip filter), this memory size is output_buffers. first arg is buf number, second is buf size. if allocated memory greater than number*size, nginx will send buf and then continue read; 2 aio yes. 3 sendfile first, sendfile have limit(2g - 1) in nginx, if file size is greater than limit, nginx will send partially everytime. second, because fd is NONBLOCK, so server is not block. On Tue, Sep 27, 2011 at 7:36 PM, Hagai Avrahami wrote: > Hi > > I am intend to use NGINX (LINUX) for serving static files with high > concurrency and bandwidth. > Some of the files is served from the disk and some from cache. > I am trying to find the configuration for best performance. > > I have some questions regarding NGINX configuration. > > 1. *output_buffers 1 32k* > ---------------------------------------- > This directive excepts 2 inputs > can someone explain me the meaning of each input > I can see that 32K is size of data (per fetch) when reading from a DIsk - > what else it influences? > When serving big files, best Disk utilization is in blocks of 1MB, is it OK > to change this directive to 1024k? > > 2. *aio* > ---------------------------------------- > **I read in Wiki the following > *" This directive is usable as of Linux kernel 2.6.22. For Linux it is > required to use directio, this automatically disables sendfile support."* > when using AIO I must use *directio on*? (when testing I could see the > file is served from the cache - which means it is not using O_DIRECT) > > > 3. *sendfile > *---------------------------------------- > Is NGINX try to send a file using 1 sendfile call (count = file size)? > If so when trying to send file residing only on the Disk, the server is > blocked till end of transmition? > In this model serving multiple files some on the disk and some cached is > inefficient? > > Will be happy to get any answer or opinion > > Thanks > Hagai > > > > > > -- > > *Hagai Avrahami* > Qwilt | Work: +972-72-2221644| Mobile: +972-54-4895656 | hagaia at qwilt.com > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- douban:www.douban.com/people/mustang/ blog: www.pagefault.info twitter: www.twitter.com/minibobo weibo: www.weibo.com/diaoliang -------------- next part -------------- An HTML attachment was scrubbed... URL: From nbubingo at gmail.com Wed Sep 28 08:11:54 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Wed, 28 Sep 2011 16:11:54 +0800 Subject: Nginx Substitutions Filter problem In-Reply-To: <4E81701D.408@martronic.ch> References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> Message-ID: Can you show me your source page? Thanks. 2011/9/27 Martronic SA > Hello, > > We are using the "Substitutions Filter module" > to replace html content in our pages. > > Our configuration is : > > location /{ > subs_filter_types text/html text/xml; > subs_filter 'http://bale.hopla.net/bons-**plans' > 'http://bons-plans.hopla.net'; > subs_filter 'id="portal-logo" href="http://bale.hopla.net"' > 'id="portal-logo" href="http://www.hopla.net"'; > } > > The first substitution is working, but the second not. > Are we missing something? Is the "space" supported in substitution module? > > Thank you for your help! > > Martronic SA > > nginx -V > nginx: nginx version: nginx/1.1.4 > nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) > nginx: TLS SNI support enabled > nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf > --error-log-path=/var/log/**nginx/error.log --pid-path=/var/run/nginx.pid > --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** > nginx/access.log > --with-http_dav_module --http-client-body-temp-path=/**var/lib/nginx/body > --with-http_ssl_module > --http-proxy-temp-path=/var/**lib/nginx/proxy > --with-http_stub_status_module > --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi > --add-module=/var/lib/**substitutions4nginx-read-only > > > > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed Sep 28 08:25:39 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 28 Sep 2011 12:25:39 +0400 Subject: Small bug in rewrite rules using if (ugh, yes, if is bad ...) In-Reply-To: References: <20110831155233.GZ1137@mdounin.ru> Message-ID: <20110928082539.GV1137@mdounin.ru> Hello! On Tue, Sep 27, 2011 at 09:30:40PM -0400, Peter Portante wrote: > On Wed, Aug 31, 2011 at 11:52 AM, Maxim Dounin wrote: > > > Hello! > > > > On Wed, Aug 31, 2011 at 11:26:29AM -0400, Peter Portante wrote: > > > > > Hello folks, > > > > > > Just thought I would report a small bug with rewrite interacting with if. > > > > > > Here is my simple setup: > > > > > > server { > > > server_name example.dev.com; > > > location ^~ /salad/add { > > > if ($arg_paramThree = "foobar") { > > > rewrite ^ > > > https://example.this.com?PARAM_ONE=$arg_paramOne&PARAM_TWO=$arg_paramTwo > > ? > > > redirect; > > > } > > > proxy_pass http://127.0.0.1:8080$request_uri; > > > } > > > } > > > > > > So when I hit the server with this URL: > > > > > > > > http://example.dev.com/salad/add?paramThree=foobar¶mTwo=two¶mOne=one > > > > > > > > > It is rewritten to be: > > > > > > https://example.this.com?PARAM_ONE=one&PARAM_TWO=two?paramThree=foobar > > > > > > > > > If I use the following if conditional, the behavior is as expected: > > > > > > if ($args ~ "paramThree=foobar") { > > > > Works ok here. Which nginx version do you use? > > > > 1.0.4 > > thanks for taking the time to check it out. Could you please provide debug log? Please see http://wiki.nginx.org/Debugging for details. Maxim Dounin From cyril.lavier at davromaniak.eu Wed Sep 28 08:39:26 2011 From: cyril.lavier at davromaniak.eu (Cyril LAVIER) Date: Wed, 28 Sep 2011 10:39:26 +0200 Subject: Nginx build under Debian Hurd i386 Message-ID: Hi nginx lovers. As it's my first mail on this mailing list, I will introduce myself a little bit. I'm Cyril Lavier, a 25 years old System Administrator from France. I use nginx for barely a year now. I use it for my own website, and also for the company I'm working. Now, let's work :). For the Debian packaging purposes, we try to make nginx build properly under the hurd-i386 kernel. But it never built well, and Kartik sent a mail in January about this. Now, as I'm contributing to this packaging, I tried to figure out why nginx build failed. For this, I opened a ticket (http://trac.nginx.org/nginx/ticket/22), which provide a patch for this. With this patch it's building well and working well. After, we add the MP4 module to the nginx-extras package, but the module failed to compile under hurd-i386 (the build works like a charm on other architectures). I opened the ticket #23 (http://trac.nginx.org/nginx/ticket/23), with a first draft of a patch, which resolves one issue. By the way, my C coding knowledge is too low to completely correct this issue. We would like the hurd package being the same as the others, so if the developers (or other contributors with sufficient knowledge) can take a look at both tickets, and judging about a patch inclusion for #22 and a more complete patch #23, this would be very appreciated. Thanks. -- Cyril "Davromaniak" Lavier -------------- next part -------------- An HTML attachment was scrubbed... URL: From martronic at martronic.ch Wed Sep 28 09:42:29 2011 From: martronic at martronic.ch (Martronic SA) Date: Wed, 28 Sep 2011 11:42:29 +0200 (CEST) Subject: Nginx Substitutions Filter problem In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> Message-ID: <7c0b111efe8055c61d650f7706356751.squirrel@webmail.martronic.ch> full source attachment Thanks.
> Can you show me your source page? > > Thanks. > > 2011/9/27 Martronic SA > >> Hello, >> >> We are using the "Substitutions Filter module" >> to replace html content in our pages. >> >> Our configuration is : >> >> location /{ >> subs_filter_types text/html text/xml; >> subs_filter 'http://bale.hopla.net/bons-**plans' >> 'http://bons-plans.hopla.net'; >> subs_filter 'id="portal-logo" href="http://bale.hopla.net"' >> 'id="portal-logo" href="http://www.hopla.net"'; >> } >> >> The first substitution is working, but the second not. >> Are we missing something? Is the "space" supported in substitution module? >> >> Thank you for your help! >> >> Martronic SA >> >> nginx -V >> nginx: nginx version: nginx/1.1.4 >> nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) >> nginx: TLS SNI support enabled >> nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf >> --error-log-path=/var/log/**nginx/error.log --pid-path=/var/run/nginx.pid >> --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** >> nginx/access.log >> --with-http_dav_module --http-client-body-temp-path=/**var/lib/nginx/body >> --with-http_ssl_module >> --http-proxy-temp-path=/var/**lib/nginx/proxy >> --with-http_stub_status_module >> --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi >> --add-module=/var/lib/**substitutions4nginx-read-only >> >> >> >> ______________________________**_________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/**mailman/listinfo/nginx >> > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Avec nos meilleures salutations, MARTRONIC SA De votre site internet ? votre serveur d?applications Venez visiter notre nouvelle plateforme collaborative Web 2 de Martronic http://www.solgema.com http://www.solgema.ch http://www.martronic.ch Rue du Ch?teau-Vieux 12 Case postale 186 1870 Monthey VS Suisse / Switzerland T?l +41 24 471 51 07 Fax +41 24 471 58 47 e-mail : martronic at martronic.ch From martronic at martronic.ch Wed Sep 28 09:43:54 2011 From: martronic at martronic.ch (Martronic SA) Date: Wed, 28 Sep 2011 11:43:54 +0200 (CEST) Subject: Nginx Substitutions Filter problem In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> Message-ID: <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> full source attachment Thanks.
> Can you show me your source page? > > Thanks. > > 2011/9/27 Martronic SA > >> Hello, >> >> We are using the "Substitutions Filter module" >> to replace html content in our pages. >> >> Our configuration is : >> >> location /{ >> subs_filter_types text/html text/xml; >> subs_filter 'http://bale.hopla.net/bons-**plans' >> 'http://bons-plans.hopla.net'; >> subs_filter 'id="portal-logo" href="http://bale.hopla.net"' >> 'id="portal-logo" href="http://www.hopla.net"'; >> } >> >> The first substitution is working, but the second not. >> Are we missing something? Is the "space" supported in substitution module? >> >> Thank you for your help! >> >> Martronic SA >> >> nginx -V >> nginx: nginx version: nginx/1.1.4 >> nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) >> nginx: TLS SNI support enabled >> nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf >> --error-log-path=/var/log/**nginx/error.log --pid-path=/var/run/nginx.pid >> --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** >> nginx/access.log >> --with-http_dav_module --http-client-body-temp-path=/**var/lib/nginx/body >> --with-http_ssl_module >> --http-proxy-temp-path=/var/**lib/nginx/proxy >> --with-http_stub_status_module >> --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi >> --add-module=/var/lib/**substitutions4nginx-read-only >> >> >> >> ______________________________**_________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/**mailman/listinfo/nginx >> > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Avec nos meilleures salutations, MARTRONIC SA De votre site internet ? votre serveur d?applications Venez visiter notre nouvelle plateforme collaborative Web 2 de Martronic http://www.solgema.com http://www.solgema.ch http://www.martronic.ch Rue du Ch?teau-Vieux 12 Case postale 186 1870 Monthey VS Suisse / Switzerland T?l +41 24 471 51 07 Fax +41 24 471 58 47 e-mail : martronic at martronic.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.bonavita at gmail.com Wed Sep 28 10:20:21 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Wed, 28 Sep 2011 12:20:21 +0200 Subject: Happy birthday, Igor ? Message-ID: Given the amount of times Sep 28th 1970 is mentioned in the nginx code (see below), I am putting a rough guess that this is your birthday. So, in this very special day, I wanted to thank you for your amazing little kid and I would have loved to buy you a beer but you're a bit far away. If you ever get near the south of France, I'll buy you one. Of course, I could be completely wrong. A. nginx-HEAD]$ grep '1970' -R src src/http/ngx_http_variables.c: sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT") - 1); src/http/ngx_http_parse_time.c: * 719527 days were between March 1, 1 BC and March 1, 1970, src/http/ngx_http_parse_time.c: * 31 and 28 days were in January and February 1970 src/http/ngx_http_header_filter_module.c: len += sizeof("Date: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1; src/http/ngx_http_header_filter_module.c: len += sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1; src/http/modules/ngx_http_headers_filter_module.c: len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT"); src/http/modules/ngx_http_headers_filter_module.c: expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT"; src/http/modules/ngx_http_log_module.c: { ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1, src/http/modules/ngx_http_log_module.c: { ngx_string("time_iso8601"), sizeof("1970-09-28T12:00:00+06:00") - 1, src/http/modules/ngx_http_autoindex_module.c: + sizeof(" 28-Sep-1970 12:00 ") - 1 src/core/ngx_times.c: [sizeof("1970/09/28 12:00:00")]; src/core/ngx_times.c: [sizeof("Mon, 28 Sep 1970 06:00:00 GMT")]; src/core/ngx_times.c: [sizeof("28/Sep/1970:12:00:00 +0600")]; src/core/ngx_times.c: [sizeof("1970-09-28T12:00:00+06:00")]; src/core/ngx_times.c: ngx_cached_err_log_time.len = sizeof("1970/09/28 12:00:00") - 1; src/core/ngx_times.c: ngx_cached_http_time.len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1; src/core/ngx_times.c: ngx_cached_http_log_time.len = sizeof("28/Sep/1970:12:00:00 +0600") - 1; src/core/ngx_times.c: ngx_cached_http_log_iso8601.len = sizeof("1970-09-28T12:00:00+06:00") - 1; src/core/ngx_times.c: /* Jaunary 1, 1970 was Thursday */ src/os/win32/ngx_time.c: * Between January 1, 1970 (Epoch) and January 1, 1601 there were From nginx-forum at nginx.us Wed Sep 28 11:25:58 2011 From: nginx-forum at nginx.us (locojohn) Date: Wed, 28 Sep 2011 07:25:58 -0400 Subject: $https variable? In-Reply-To: References: Message-ID: <7473606372f371777d0c7915f4012213.NginxMailingListEnglish@forum.nginx.org> Unfortunately, PHP code in many known packages (such as Moodle) sometimes relies on the wrong assumption: $HTTPS = isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'; Because in Apache HTTPS variable is never submitted at all in http mode and coders believe this is enough information to check. So, is there a way to never submit HTTPS=off at all if HTTPS is not present? Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215756,215941#msg-215941 From igor at sysoev.ru Wed Sep 28 11:35:54 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 28 Sep 2011 15:35:54 +0400 Subject: Happy birthday, Igor ? In-Reply-To: References: Message-ID: <20110928113554.GF80782@nginx.com> On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: > Given the amount of times Sep 28th 1970 is mentioned in the nginx code > (see below), I am putting a rough guess that this is your birthday. > So, in this very special day, I wanted to thank you for your amazing > little kid and I would have loved to buy you a beer but you're a bit > far away. If you ever get near the south of France, I'll buy you one. > > Of course, I could be completely wrong. You are right, this is my birthday. Thank you. -- Igor Sysoev From mike503 at gmail.com Wed Sep 28 11:41:05 2011 From: mike503 at gmail.com (Michael Shadle) Date: Wed, 28 Sep 2011 04:41:05 -0700 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <58847010-7129-4E97-A293-FA95987BE07D@gmail.com> Happy birthday Igor :) nice find Antoine! On Sep 28, 2011, at 4:35 AM, Igor Sysoev wrote: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From smallfish.xy at gmail.com Wed Sep 28 11:43:08 2011 From: smallfish.xy at gmail.com (smallfish) Date: Wed, 28 Sep 2011 19:43:08 +0800 Subject: Happy birthday, Igor ? In-Reply-To: <58847010-7129-4E97-A293-FA95987BE07D@gmail.com> References: <20110928113554.GF80782@nginx.com> <58847010-7129-4E97-A293-FA95987BE07D@gmail.com> Message-ID: happy birthday~~~ -- blog: http://chenxiaoyu.org On Wed, Sep 28, 2011 at 7:41 PM, Michael Shadle wrote: > Happy birthday Igor :) nice find Antoine! > > On Sep 28, 2011, at 4:35 AM, Igor Sysoev wrote: > > > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: > >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code > >> (see below), I am putting a rough guess that this is your birthday. > >> So, in this very special day, I wanted to thank you for your amazing > >> little kid and I would have loved to buy you a beer but you're a bit > >> far away. If you ever get near the south of France, I'll buy you one. > >> > >> Of course, I could be completely wrong. > > > > You are right, this is my birthday. Thank you. > > > > > > -- > > Igor Sysoev > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nbubingo at gmail.com Wed Sep 28 11:48:00 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Wed, 28 Sep 2011 19:48:00 +0800 Subject: Happy birthday, Igor ? In-Reply-To: References: <20110928113554.GF80782@nginx.com> <58847010-7129-4E97-A293-FA95987BE07D@gmail.com> Message-ID: Best wishes from China[?][?]. 2011/9/28 smallfish > happy birthday~~~ > -- > blog: http://chenxiaoyu.org > > > > On Wed, Sep 28, 2011 at 7:41 PM, Michael Shadle wrote: > >> Happy birthday Igor :) nice find Antoine! >> >> On Sep 28, 2011, at 4:35 AM, Igor Sysoev wrote: >> >> > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> >> (see below), I am putting a rough guess that this is your birthday. >> >> So, in this very special day, I wanted to thank you for your amazing >> >> little kid and I would have loved to buy you a beer but you're a bit >> >> far away. If you ever get near the south of France, I'll buy you one. >> >> >> >> Of course, I could be completely wrong. >> > >> > You are right, this is my birthday. Thank you. >> > >> > >> > -- >> > Igor Sysoev >> > >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 330.gif Type: image/gif Size: 96 bytes Desc: not available URL: From mat999 at gmail.com Wed Sep 28 11:50:42 2011 From: mat999 at gmail.com (SplitIce) Date: Wed, 28 Sep 2011 21:50:42 +1000 Subject: Happy birthday, Igor ? In-Reply-To: References: <20110928113554.GF80782@nginx.com> <58847010-7129-4E97-A293-FA95987BE07D@gmail.com> Message-ID: Happy birthday man today and many more in the future. On Wed, Sep 28, 2011 at 9:48 PM, ??? wrote: > Best wishes from China[?][?]. > > 2011/9/28 smallfish > >> happy birthday~~~ >> -- >> blog: http://chenxiaoyu.org >> >> >> >> On Wed, Sep 28, 2011 at 7:41 PM, Michael Shadle wrote: >> >>> Happy birthday Igor :) nice find Antoine! >>> >>> On Sep 28, 2011, at 4:35 AM, Igor Sysoev wrote: >>> >>> > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >>> >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >>> >> (see below), I am putting a rough guess that this is your birthday. >>> >> So, in this very special day, I wanted to thank you for your amazing >>> >> little kid and I would have loved to buy you a beer but you're a bit >>> >> far away. If you ever get near the south of France, I'll buy you one. >>> >> >>> >> Of course, I could be completely wrong. >>> > >>> > You are right, this is my birthday. Thank you. >>> > >>> > >>> > -- >>> > Igor Sysoev >>> > >>> > _______________________________________________ >>> > nginx mailing list >>> > nginx at nginx.org >>> > http://mailman.nginx.org/mailman/listinfo/nginx >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 330.gif Type: image/gif Size: 96 bytes Desc: not available URL: From petite.abeille at gmail.com Wed Sep 28 11:57:57 2011 From: petite.abeille at gmail.com (Petite Abeille) Date: Wed, 28 Sep 2011 13:57:57 +0200 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <51A736D4-C827-4E3E-A58E-83EED5EE8BF2@gmail.com> On Sep 28, 2011, at 1:35 PM, Igor Sysoev wrote: > You are right, this is my birthday. Thank you. Happy birthday! Or should we call it Igor Epoch Day! :) From appa at perusio.net Wed Sep 28 12:08:26 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 28 Sep 2011 13:08:26 +0100 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <8762kcna2t.wl%appa@perusio.net> On 28 Set 2011 12h35 WEST, igor at sysoev.ru wrote: Congratulations Igor, from Lisbon. Thank you for your work on Nginx. All the best, --- appa From frumentius at gmail.com Wed Sep 28 12:11:15 2011 From: frumentius at gmail.com (Joe) Date: Wed, 28 Sep 2011 19:11:15 +0700 Subject: Happy birthday, Igor ? In-Reply-To: <8762kcna2t.wl%appa@perusio.net> References: <20110928113554.GF80782@nginx.com> <8762kcna2t.wl%appa@perusio.net> Message-ID: We are here from Indonesia, want to say Happy Birthday to Igor. All the Best... Always... Regards, Joe On Wed, Sep 28, 2011 at 7:08 PM, Ant?nio P. P. Almeida wrote: > On 28 Set 2011 12h35 WEST, igor at sysoev.ru wrote: > > Congratulations Igor, from Lisbon. Thank you for your work on Nginx. > > All the best, > --- appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 191919 at gmail.com Wed Sep 28 12:12:13 2011 From: 191919 at gmail.com (191919) Date: Wed, 28 Sep 2011 20:12:13 +0800 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <4E830F1D.8020102@gmail.com> On 9/28/11 7:35 PM, Igor Sysoev wrote: Happy birthday to Igor, from Beijing, China. > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > You are right, this is my birthday. Thank you. > > -- Regards, 191919 From pascal.nitsche at fansubcode.org Wed Sep 28 12:26:31 2011 From: pascal.nitsche at fansubcode.org (Pascal Nitsche) Date: Wed, 28 Sep 2011 14:26:31 +0200 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <4E831277.7020400@fansubcode.org> Happy Birthday Igor from M?lheim an der Ruhr (Germany). Am 28.09.2011 13:35, schrieb Igor Sysoev: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > You are right, this is my birthday. Thank you. > > From varia at e-healthexpert.org Wed Sep 28 12:29:05 2011 From: varia at e-healthexpert.org (Mark Alan) Date: Wed, 28 Sep 2011 13:29:05 +0100 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <20110928132905.75d20ee5@e-healthexpert.org> On Wed, 28 Sep 2011 15:35:54 +0400, Igor Sysoev wrote: > Happy birthday, Igor Happy birthday Igor. Keep up the good work. M. From usirsiwal at verivue.com Wed Sep 28 12:44:23 2011 From: usirsiwal at verivue.com (Sirsiwal, Umesh) Date: Wed, 28 Sep 2011 08:44:23 -0400 Subject: Happy birthday, Igor ? In-Reply-To: <20110928132905.75d20ee5@e-healthexpert.org> References: <20110928113554.GF80782@nginx.com>, <20110928132905.75d20ee5@e-healthexpert.org> Message-ID: Happy birthday Igor. -Umesh ________________________________________ From: nginx-bounces at nginx.org [nginx-bounces at nginx.org] On Behalf Of Mark Alan [varia at e-healthexpert.org] Sent: Wednesday, September 28, 2011 8:29 AM To: nginx at nginx.org Subject: Re: Happy birthday, Igor ? On Wed, 28 Sep 2011 15:35:54 +0400, Igor Sysoev wrote: > Happy birthday, Igor Happy birthday Igor. Keep up the good work. M. _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From gerjoo at gmail.com Wed Sep 28 12:49:38 2011 From: gerjoo at gmail.com (Gerard Meier) Date: Wed, 28 Sep 2011 14:49:38 +0200 Subject: Happy birthday, Igor ? In-Reply-To: References: <20110928113554.GF80782@nginx.com> <20110928132905.75d20ee5@e-healthexpert.org> Message-ID: Happy birthday from Amsterdam! Gerard On Wed, Sep 28, 2011 at 2:44 PM, Sirsiwal, Umesh wrote: > Happy birthday Igor. > > -Umesh > ________________________________________ > From: nginx-bounces at nginx.org [nginx-bounces at nginx.org] On Behalf Of Mark > Alan [varia at e-healthexpert.org] > Sent: Wednesday, September 28, 2011 8:29 AM > To: nginx at nginx.org > Subject: Re: Happy birthday, Igor ? > > On Wed, 28 Sep 2011 15:35:54 +0400, Igor Sysoev wrote: > > Happy birthday, Igor > > Happy birthday Igor. > Keep up the good work. > > M. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinloy.uy at gmail.com Wed Sep 28 12:52:24 2011 From: martinloy.uy at gmail.com (Martin Loy) Date: Wed, 28 Sep 2011 09:52:24 -0300 Subject: Happy birthday, Igor ? In-Reply-To: References: <20110928113554.GF80782@nginx.com> <20110928132905.75d20ee5@e-healthexpert.org> Message-ID: Congratulations Igor, from uruguay southern cone. Keep the hard work coming :P Regards M On Wed, Sep 28, 2011 at 9:49 AM, Gerard Meier wrote: > > Happy birthday from Amsterdam! > Gerard > > On Wed, Sep 28, 2011 at 2:44 PM, Sirsiwal, Umesh wrote: >> >> Happy birthday Igor. >> >> -Umesh >> ________________________________________ >> From: nginx-bounces at nginx.org [nginx-bounces at nginx.org] On Behalf Of Mark Alan [varia at e-healthexpert.org] >> Sent: Wednesday, September 28, 2011 8:29 AM >> To: nginx at nginx.org >> Subject: Re: Happy birthday, Igor ? >> >> On Wed, 28 Sep 2011 15:35:54 +0400, Igor Sysoev wrote: >> > Happy birthday, Igor >> >> Happy birthday Igor. >> Keep up the good work. >> >> M. >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Nunca hubo un amigo que hiciese un favor a un enano, ni un enemigo que le hiciese un mal, que no se viese recompensado por entero. From rami.essaid at gmail.com Wed Sep 28 13:01:01 2011 From: rami.essaid at gmail.com (Rami Essaid) Date: Wed, 28 Sep 2011 09:01:01 -0400 Subject: Happy birthday, Igor ? In-Reply-To: <4E831277.7020400@fansubcode.org> References: <20110928113554.GF80782@nginx.com> <4E831277.7020400@fansubcode.org> Message-ID: Happy birthday Igor. On Wed, Sep 28, 2011 at 8:26 AM, Pascal Nitsche < pascal.nitsche at fansubcode.org> wrote: > Happy Birthday Igor from M?lheim an der Ruhr (Germany). > > Am 28.09.2011 13:35, schrieb Igor Sysoev: > > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> >>> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >>> (see below), I am putting a rough guess that this is your birthday. >>> So, in this very special day, I wanted to thank you for your amazing >>> little kid and I would have loved to buy you a beer but you're a bit >>> far away. If you ever get near the south of France, I'll buy you one. >>> >>> Of course, I could be completely wrong. >>> >> You are right, this is my birthday. Thank you. >> >> >> > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed Sep 28 13:13:38 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 28 Sep 2011 17:13:38 +0400 Subject: Nginx build under Debian Hurd i386 In-Reply-To: References: Message-ID: <20110928131338.GX1137@mdounin.ru> Hello! On Wed, Sep 28, 2011 at 10:39:26AM +0200, Cyril LAVIER wrote: > > > Hi nginx lovers. > > As it's my first mail on this mailing list, I > will introduce myself a little bit. > > I'm Cyril Lavier, a 25 years old > System Administrator from France. I use nginx for barely a year now. I > use it for my own website, and also for the company I'm working. > > Now, > let's work :). > > For the Debian packaging purposes, we try to make nginx > build properly under the hurd-i386 kernel. > > But it never built well, > and Kartik sent a mail in January about this. > > Now, as I'm contributing > to this packaging, I tried to figure out why nginx build failed. > > For > this, I opened a ticket (http://trac.nginx.org/nginx/ticket/22), which > provide a patch for this. With this patch it's building well and working > well. There is a problem with this patch: nginx uses PATH_MAX to allocate buffer used in realpath(), and POSIX claims: : If resolved_name is not a null pointer and {PATH_MAX} is not : defined as a constant in the header, the behavior is : undefined. http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html Just using arbitrary value instead of PATH_MAX will likely lead to a problem. If we want to avoid usage of PATH_MAX the relevant code should be converted to use realpath() with NULL as resolved_name. Other current use of PATH_MAX is for getcwd() buffer which should be ok with any buffer size as getcwd() interface includes "size" argument. > After, we add the MP4 module to the nginx-extras package, but > the module failed to compile under hurd-i386 (the build works like a > charm on other architectures). > > I opened the ticket #23 > (http://trac.nginx.org/nginx/ticket/23), with a first draft of a patch, > which resolves one issue. By the way, my C coding knowledge is too low > to completely correct this issue. > > We would like the hurd package being > the same as the others, so if the developers (or other contributors with > sufficient knowledge) can take a look at both tickets, and judging about > a patch inclusion for #22 and a more complete patch #23, this would be > very appreciated. This looks like result of the fact that off_t used is 32-bit wide. I believe correct patch to support 32-bit off_t would require a bit more work. Meanwhile, you may want to focus on using 64-bit off_t instead. Under Linux it's typically done with "#define _FILE_OFFSET_BITS 64". Is it possible to do the same on Debian GNU/Hurd? Maxim Dounin From phanquochien at gmail.com Wed Sep 28 13:20:30 2011 From: phanquochien at gmail.com (Hien P) Date: Wed, 28 Sep 2011 20:20:30 +0700 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: Happy birthday Igor ~~~ from Vietnam On Wed, Sep 28, 2011 at 6:35 PM, Igor Sysoev wrote: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: > > Given the amount of times Sep 28th 1970 is mentioned in the nginx code > > (see below), I am putting a rough guess that this is your birthday. > > So, in this very special day, I wanted to thank you for your amazing > > little kid and I would have loved to buy you a beer but you're a bit > > far away. If you ever get near the south of France, I'll buy you one. > > > > Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Best regards, Mr.Hien -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.lavier at davromaniak.eu Wed Sep 28 13:32:54 2011 From: cyril.lavier at davromaniak.eu (Cyril LAVIER) Date: Wed, 28 Sep 2011 15:32:54 +0200 Subject: Nginx build under Debian Hurd i386 In-Reply-To: <20110928131338.GX1137@mdounin.ru> References: <20110928131338.GX1137@mdounin.ru> Message-ID: On Wed, 28 Sep 2011 17:13:38 +0400, Maxim Dounin wrote: > Hello! > > On Wed, Sep 28, 2011 at 10:39:26AM +0200, Cyril LAVIER wrote: > >> >> >> Hi nginx lovers. >> >> As it's my first mail on this mailing list, I >> will introduce myself a little bit. >> >> I'm Cyril Lavier, a 25 years old >> System Administrator from France. I use nginx for barely a year now. >> I >> use it for my own website, and also for the company I'm working. >> >> Now, >> let's work :). >> >> For the Debian packaging purposes, we try to make nginx >> build properly under the hurd-i386 kernel. >> >> But it never built well, >> and Kartik sent a mail in January about this. >> >> Now, as I'm contributing >> to this packaging, I tried to figure out why nginx build failed. >> >> For >> this, I opened a ticket (http://trac.nginx.org/nginx/ticket/22), >> which >> provide a patch for this. With this patch it's building well and >> working >> well. > > There is a problem with this patch: nginx uses PATH_MAX to > allocate buffer used in realpath(), and POSIX claims: > > : If resolved_name is not a null pointer and {PATH_MAX} is not > : defined as a constant in the header, the behavior is > : undefined. > > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html > > Just using arbitrary value instead of PATH_MAX will likely lead to > a problem. If we want to avoid usage of PATH_MAX the relevant > code should be converted to use realpath() with NULL as > resolved_name. > Thanks for this information. I was not aware of this, and also I don't have a big knowledge in C coding, I patched the file the easy way, by choosing an arbitrary value for PATH_MAX, but as it may cause problems, we may see a more accurate fix. Maybe Igor or any other developer can help providing a solution for this issue, because I know I won't be able to do a clean patch. > Other current use of PATH_MAX is for getcwd() buffer which should > be ok with any buffer size as getcwd() interface includes "size" > argument. > >> After, we add the MP4 module to the nginx-extras package, but >> the module failed to compile under hurd-i386 (the build works like a >> charm on other architectures). >> >> I opened the ticket #23 >> (http://trac.nginx.org/nginx/ticket/23), with a first draft of a >> patch, >> which resolves one issue. By the way, my C coding knowledge is too >> low >> to completely correct this issue. >> >> We would like the hurd package being >> the same as the others, so if the developers (or other contributors >> with >> sufficient knowledge) can take a look at both tickets, and judging >> about >> a patch inclusion for #22 and a more complete patch #23, this would >> be >> very appreciated. > > This looks like result of the fact that off_t used is 32-bit wide. > I believe correct patch to support 32-bit off_t would require a > bit more work. > > Meanwhile, you may want to focus on using 64-bit off_t instead. > Under Linux it's typically done with "#define _FILE_OFFSET_BITS > 64". Is it possible to do the same on Debian GNU/Hurd? > I don't know, as I said earlier, my knowledge in this domain is limited, but I just wanted to research a bit to try to help resolve this issue. Maybe Kartik will have this information, or maybe any other person in this mailing list. Thanks. > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Cyril "Davromaniak" Lavier From tillere at gmail.com Wed Sep 28 13:50:41 2011 From: tillere at gmail.com (Ed Tiller) Date: Wed, 28 Sep 2011 09:50:41 -0400 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: Happy Birthday Igor, from Washington DC. Thank you for all of your work on Nginx. Ed Tiller On Sep 28, 2011, at 7:35 AM, Igor Sysoev wrote: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From www at lc365.net Wed Sep 28 13:53:42 2011 From: www at lc365.net (=?gb2312?B?ufnV8cGi?=) Date: Wed, 28 Sep 2011 21:53:42 +0800 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: , <20110928113554.GF80782@nginx.com> Message-ID: Hi Igor, Happy birthday to you, and best wishes for you. PS. the OP is really a intelligent man. > Date: Wed, 28 Sep 2011 15:35:54 +0400 > From: igor at sysoev.ru > To: nginx at nginx.org > Subject: Re: Happy birthday, Igor ? > > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: > > Given the amount of times Sep 28th 1970 is mentioned in the nginx code > > (see below), I am putting a rough guess that this is your birthday. > > So, in this very special day, I wanted to thank you for your amazing > > little kid and I would have loved to buy you a beer but you're a bit > > far away. If you ever get near the south of France, I'll buy you one. > > > > Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Wed Sep 28 14:01:25 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 28 Sep 2011 18:01:25 +0400 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <20110928140124.GG80782@nginx.com> Thank you for congratulations, but there are more than thousand subscribers in this list and if even tenth of them will write congratulation, this will result in a lot of emails. Thank you. -- Igor Sysoev From kartik.mistry at gmail.com Wed Sep 28 14:38:51 2011 From: kartik.mistry at gmail.com (Kartik Mistry) Date: Wed, 28 Sep 2011 20:08:51 +0530 Subject: Happy birthday, Igor ? Message-ID: Hi Igor, Many many returns of the day! Happy Birthday!! -- with Debian package maintainer hat on. Proud to be working with one of the nicest and quick upstream I've seen :) -- Kartik Mistry Debian GNU/Linux Developer IRC: kart_ | Identica: @kartikm From saimonmoore at gmail.com Wed Sep 28 15:14:06 2011 From: saimonmoore at gmail.com (Saimon Moore) Date: Wed, 28 Sep 2011 17:14:06 +0200 Subject: Happy birthday, Igor ? In-Reply-To: References: Message-ID: Happy birthday Igor...from Barcelona On Wed, Sep 28, 2011 at 4:38 PM, Kartik Mistry wrote: > Hi Igor, > > Many many returns of the day! Happy Birthday!! > > -- with Debian package maintainer hat on. Proud to be working with one > of the nicest and quick upstream I've seen :) > > -- > Kartik Mistry > Debian GNU/Linux Developer > IRC: kart_ | Identica: @kartikm > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Saimon Moore Web Developer @ Teambox.com (http://teambox.com) Skype: saimonmoore Yahoo IM: saimonmoore Google IM: saimonmoore -------------- next part -------------- An HTML attachment was scrubbed... URL: From huseyinin at gmail.com Wed Sep 28 15:35:45 2011 From: huseyinin at gmail.com (=?ISO-8859-1?Q?H=FCseyin_Mert?=) Date: Wed, 28 Sep 2011 18:35:45 +0300 Subject: Happy birthday, Igor ? In-Reply-To: References: Message-ID: Happy birthday Igor...from Ankara -- H?seyin Mert http://www.hmert.com On Wed, Sep 28, 2011 at 6:14 PM, Saimon Moore wrote: > Happy birthday Igor...from Barcelona -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Sep 28 16:05:07 2011 From: nginx-forum at nginx.us (csg) Date: Wed, 28 Sep 2011 12:05:07 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <20110926135624.GO1137@mdounin.ru> References: <20110926135624.GO1137@mdounin.ru> Message-ID: <0ae2bc8b7ee889ae2c8b3841914e7d40.NginxMailingListEnglish@forum.nginx.org> Maxim Dounin Wrote: ------------------------------------------------------- > Errors suggest you don't have $backend set, and > resulting > proxy_pass tries to go to "http://" which is > invalid. Yup, I am just curious how to accomplish that if you want to perform some rewriting before, for example to strip off some leading parts of the URL path. I came up with following test case: worker_processes 3; events { worker_connections 1024; } http { server_tokens off; include nginx.mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 15; server { listen 0.0.0.0:90; server_name _; location / { root html; index index.html; } } server { listen 0.0.0.0:91; server_name _; location / { rewrite ^/foo/(.*)$ /$1 break; proxy_pass http://localhost:90; proxy_redirect off; } } server { listen 0.0.0.0:92; server_name _; location / { rewrite ^/foo/(.*)$ /$1 break; resolver 127.0.0.1; set $backend "localhost:90"; proxy_pass http://$backend; proxy_redirect off; } error_log /var/log/nginx/error.log debug; } } The port 91 server is a reverse proxy to the port 90 server with static upstream (DNS lookup only on startup/reload). I delivers happily the index.html of the port 90 server, regardless if I request http://localhost:91/ of http://localhost:91/foo/. Bringing the resolver into play doesn't seem to be that straight forward if you look at the port 92 reverse proxy. It works when no rewriting has to be performed, i.e., http://localhost:92/ works. But if I want to strip off the leading /foo/ URL path segment of the request http://localhost:92/foo/. 2011/09/28 17:55:51 [notice] 1490#0: *2 "^/foo/(.*)$" matches "/foo/", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/28 17:55:51 [notice] 1490#0: *2 rewritten data: "/", args: "", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/28 17:55:51 [warn] 1490#0: *2 using uninitialized "backend" variable, client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/28 17:55:51 [error] 1490#0: *2 invalid URL prefix in "http://", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" Any hints how to solve this the easiest way? Basically me requirement is to reverse proxy http://proxy.example.com/foo/bar/quux to http://upstream.example.com/bar/quux (so strip off "foo/") while the IP of upstream.example.com can change over time without prior announcement. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,215979#msg-215979 From mdounin at mdounin.ru Wed Sep 28 16:13:55 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 28 Sep 2011 20:13:55 +0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <0ae2bc8b7ee889ae2c8b3841914e7d40.NginxMailingListEnglish@forum.nginx.org> References: <20110926135624.GO1137@mdounin.ru> <0ae2bc8b7ee889ae2c8b3841914e7d40.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110928161355.GZ1137@mdounin.ru> Hello! On Wed, Sep 28, 2011 at 12:05:07PM -0400, csg wrote: > Maxim Dounin Wrote: > ------------------------------------------------------- > > Errors suggest you don't have $backend set, and > > resulting > > proxy_pass tries to go to "http://" which is > > invalid. > > Yup, I am just curious how to accomplish that if you want to perform > some rewriting before, for example to strip off some leading parts of > the URL path. I came up with following test case: [...] > location / { > rewrite ^/foo/(.*)$ /$1 break; The "break" here will stop execution of rewrite module directives (including "set" below) on match. > > resolver 127.0.0.1; > > set $backend "localhost:90"; This "set" won't be executed due to break above... > proxy_pass http://$backend; ... and $backend won't be set as a result. Moving "set" before "rewrite .. break" will do the trick. Maxim Dounin From nginx-forum at nginx.us Wed Sep 28 19:35:50 2011 From: nginx-forum at nginx.us (csg) Date: Wed, 28 Sep 2011 15:35:50 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <20110928161355.GZ1137@mdounin.ru> References: <20110928161355.GZ1137@mdounin.ru> Message-ID: <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> Maxim Dounin Wrote: ------------------------------------------------------- Hello again! > .... and $backend won't be set as a result. > Moving "set" before > "rewrite .. break" will do the trick. Right, in this case the $backend applies to proxy_pass and the request gets proxied but unfortunatelly in this case the rewrite rule does not have effect anymore. It still gets applied according to the error logs, but instead of the rewritten URL path to original one gets proxied. To make it more clear I changed the example configuration I posted above by having each virtual host its own access and error log. When I run following test ... $ curl -s -o - -D - http://localhost:92/foo/ HTTP/1.1 404 Not Found Server: nginx Date: Wed, 28 Sep 2011 19:26:04 GMT Content-Type: text/html Connection: keep-alive Content-Length: 162 404 Not Found

404 Not Found


nginx
I will get this in the error logs # tail -F /var/log/nginx/{access,error}9[012].log ==> /var/log/nginx/access90.log <== 127.0.0.1 - - [28/Sep/2011:21:26:04 +0200] "GET /foo/ HTTP/1.0" 404 162 "-" "curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" ==> /var/log/nginx/access92.log <== 127.0.0.1 - - [28/Sep/2011:21:26:04 +0200] "GET /foo/ HTTP/1.1" 404 162 "-" "curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" ==> /var/log/nginx/error90.log <== 2011/09/28 21:26:04 [error] 3078#0: *15 "/usr/share/nginx/html/foo/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.0", host: "localhost:90" ==> /var/log/nginx/error92.log <== 2011/09/28 21:26:04 [notice] 3078#0: *13 "^/foo/(.*)$" matches "/foo/", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/28 21:26:04 [notice] 3078#0: *13 rewritten data: "/", args: "", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/28 21:26:04 [notice] 3078#0: *13 "^/foo/(.*)$" does not match "/", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/28 21:26:04 [info] 3078#0: *13 client 127.0.0.1 closed keepalive connection If this in not what you would expect, I can rebuild Nginx with --with-debug tomorrow and repeat the test. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,215983#msg-215983 From paul at itools.com Wed Sep 28 20:44:30 2011 From: paul at itools.com (Paul Sarena) Date: Wed, 28 Sep 2011 13:44:30 -0700 Subject: Birthday gift for Igor In-Reply-To: <20110928140124.GG80782@nginx.com> References: <20110928113554.GF80782@nginx.com> <20110928140124.GG80782@nginx.com> Message-ID: <4E83872E.1030800@itools.com> nginx has been such a treat to use. To mark Igor's birthday I made a donation to his PayPal address: paypal at nginx.net If it's time for you to show some love, please consider making it an extra special day for him. Paul From nginx-forum at nginx.us Wed Sep 28 23:06:56 2011 From: nginx-forum at nginx.us (mojiz) Date: Wed, 28 Sep 2011 19:06:56 -0400 Subject: nginx won't honor limit_rate Message-ID: <830f3c7b2c19582deb96f252f5bb927e.NginxMailingListEnglish@forum.nginx.org> Hi I have an nginx server nginx version: nginx/1.1.2 I'm using limit_rate to limt download speed of my users however after an upgrade(I can't remember the version) it doesn't work anymore. Do you know why or how can I debug this? The debug log doesn't show anything. BTW I'm using nginx_proxy to send a file from my backends to my users. I have used X-Accel-Limit-Rate, limit_rate and $limit_rate but neither worked Regards Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215989,215989#msg-215989 From mdounin at mdounin.ru Wed Sep 28 23:23:28 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 29 Sep 2011 03:23:28 +0400 Subject: nginx won't honor limit_rate In-Reply-To: <830f3c7b2c19582deb96f252f5bb927e.NginxMailingListEnglish@forum.nginx.org> References: <830f3c7b2c19582deb96f252f5bb927e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110928232327.GA1137@mdounin.ru> Hello! On Wed, Sep 28, 2011 at 07:06:56PM -0400, mojiz wrote: > Hi > > I have an nginx server > nginx version: nginx/1.1.2 > I'm using limit_rate to limt download speed of my users however after an > upgrade(I can't remember the version) > it doesn't work anymore. > Do you know why or how can I debug this? > The debug log doesn't show anything. > BTW I'm using nginx_proxy to send a file from my backends to my users. > I have used X-Accel-Limit-Rate, limit_rate and $limit_rate but neither > worked Most likely you are using "proxy_buffering off;", it disables any buffering including limit_rate one. If in doubt, please follow http://wiki.nginx.org/Debugging. Maxim Dounin From nginx-forum at nginx.us Wed Sep 28 23:31:35 2011 From: nginx-forum at nginx.us (mojiz) Date: Wed, 28 Sep 2011 19:31:35 -0400 Subject: nginx won't honor limit_rate In-Reply-To: <20110928232327.GA1137@mdounin.ru> References: <20110928232327.GA1137@mdounin.ru> Message-ID: <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> Thanks Max. It worked! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215989,215991#msg-215991 From pengli.hust at qq.com Thu Sep 29 00:46:41 2011 From: pengli.hust at qq.com (lipeng) Date: Thu, 29 Sep 2011 08:46:41 +0800 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <4E83BFF1.5090600@qq.com> Happy birthday Igor! Thanks for your amazing work. On 2011?09?28? 19:35, Igor Sysoev wrote: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > You are right, this is my birthday. Thank you. > > From delphij at delphij.net Thu Sep 29 00:50:22 2011 From: delphij at delphij.net (Xin LI) Date: Wed, 28 Sep 2011 17:50:22 -0700 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: <4E83C0CE.2030401@delphij.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 09/28/11 04:35, Igor Sysoev wrote: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx >> code (see below), I am putting a rough guess that this is your >> birthday. So, in this very special day, I wanted to thank you for >> your amazing little kid and I would have loved to buy you a beer >> but you're a bit far away. If you ever get near the south of >> France, I'll buy you one. >> >> Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. Wish you enjoy your birthday and thanks for your work on nginx and FreeBSD! :) Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOg8DOAAoJEATO+BI/yjfBVg8H/ju3VAWb31JP/z+lXecjApEt m/r7Z1VoYSEBfxkHUZwBw9mnWyU7ppxZ16YWV3+T93Autd4uCPo2XnY9uiHS9Bx/ /BYBMrpR7rhUljP7oahrrUW5x+UHv5TGL7QCh5Huppmr/RreV2eZrbgRLwryru4d CPQO67u44W6swibJAisbCBm7XLTpXbPAH2mjpnF9cXDHoYNXP1qsp+ceWohXiF7c NJSVF6qL+3bmTiAWHI1DMFhLyv9dV8pK/WmAXxk5WaMeIuecb8TsC8gDus1By66u 7pISt0Fs9knQIGuZ6N9lDgTTMj4knDmJiST50V73es5vBk3PEKMl+gRM2V6rbaI= =8b2Z -----END PGP SIGNATURE----- From delta.yeh at gmail.com Thu Sep 29 00:57:35 2011 From: delta.yeh at gmail.com (Delta Yeh) Date: Thu, 29 Sep 2011 08:57:35 +0800 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: Congratulations from Shanghai, China! 2011/9/28 Igor Sysoev : > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From rkferreira at gmail.com Thu Sep 29 02:12:13 2011 From: rkferreira at gmail.com (Rodrigo K. Ferreira) Date: Wed, 28 Sep 2011 23:12:13 -0300 Subject: Happy birthday, Igor ? In-Reply-To: References: <20110928113554.GF80782@nginx.com> Message-ID: Happy birthday from Brazil! On 9/28/11, Delta Yeh wrote: > Congratulations from Shanghai, China! > > > 2011/9/28 Igor Sysoev : >> On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >>> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >>> (see below), I am putting a rough guess that this is your birthday. >>> So, in this very special day, I wanted to thank you for your amazing >>> little kid and I would have loved to buy you a beer but you're a bit >>> far away. If you ever get near the south of France, I'll buy you one. >>> >>> Of course, I could be completely wrong. >> >> You are right, this is my birthday. Thank you. >> >> >> -- >> Igor Sysoev >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From amoiz.shine at gmail.com Thu Sep 29 03:19:38 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Thu, 29 Sep 2011 11:19:38 +0800 Subject: Happy birthday, Igor ? In-Reply-To: References: Message-ID: <1317266378.1993.3.camel@sharl-desktop> ? 2011-09-28?? 18:35 +0300?H?seyin Mert??? > Happy birthday Igor...from Ankara > -- > H?seyin Mert > http://www.hmert.com > > > On Wed, Sep 28, 2011 at 6:14 PM, Saimon Moore > wrote: > Happy birthday Igor...from Barcelona > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Happy birthday Igor +1 from Shanghai,China. -- Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) Using Gmail? Please read this important notice: http://www.fsf.org/campaigns/jstrap/gmail?10073. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: This is a digitally signed message part URL: From nbubingo at gmail.com Thu Sep 29 04:42:39 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Thu, 29 Sep 2011 12:42:39 +0800 Subject: Nginx Substitutions Filter problem In-Reply-To: <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> Message-ID: It works in my box. Can you show me your debug log? http://wiki.nginx.org/Debugging Do't use this in the production server. The debug log will be very large. 2011/9/28 Martronic SA > full source attachment > Thanks. > > > > >
> >
>
> >
id="carousel-banner-0" > class="bando.jpg carousel-banner selected"> >
title="Une maison > dans un jardin, nouveau bandeau Hopla pour le printemps." > class="bandeau_image">
>
> > > > > > > > > >
>
> >
> > > Can you show me your source page? > > > > Thanks. > > > > 2011/9/27 Martronic SA > > > >> Hello, > >> > >> We are using the "Substitutions Filter module" > >> to replace html content in our pages. > >> > >> Our configuration is : > >> > >> location /{ > >> subs_filter_types text/html text/xml; > >> subs_filter 'http://bale.hopla.net/bons-**plans< > http://bale.hopla.net/bons-plans>' > >> 'http://bons-plans.hopla.net'; > >> subs_filter 'id="portal-logo" href="http://bale.hopla.net"' > >> 'id="portal-logo" href="http://www.hopla.net"'; > >> } > >> > >> The first substitution is working, but the second not. > >> Are we missing something? Is the "space" supported in substitution > module? > >> > >> Thank you for your help! > >> > >> Martronic SA > >> > >> nginx -V > >> nginx: nginx version: nginx/1.1.4 > >> nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) > >> nginx: TLS SNI support enabled > >> nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf > >> --error-log-path=/var/log/**nginx/error.log > --pid-path=/var/run/nginx.pid > >> --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** > >> nginx/access.log > >> --with-http_dav_module > --http-client-body-temp-path=/**var/lib/nginx/body > >> --with-http_ssl_module > >> --http-proxy-temp-path=/var/**lib/nginx/proxy > >> --with-http_stub_status_module > >> --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi > >> --add-module=/var/lib/**substitutions4nginx-read-only > >> > >> > >> > >> ______________________________**_________________ > >> nginx mailing list > >> nginx at nginx.org > >> http://mailman.nginx.org/**mailman/listinfo/nginx< > http://mailman.nginx.org/mailman/listinfo/nginx> > >> > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > Avec nos meilleures salutations, > > MARTRONIC SA > > De votre site internet? > ? votre serveur d?applications > Venez visiter notre nouvelle plateforme collaborative Web 2 de Martronic > http://www.solgema.com > http://www.solgema.ch > http://www.martronic.ch > > Rue du Ch?teau-Vieux 12 > Case postale 186 > 1870 Monthey VS > Suisse / Switzerland > > T?l +41 24 471 51 07 > Fax +41 24 471 58 47 > e-mail : martronic at martronic.ch > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From savages at mozapps.com Thu Sep 29 07:15:55 2011 From: savages at mozapps.com (Shaun savage) Date: Thu, 29 Sep 2011 15:15:55 +0800 Subject: fastcgi msg_id always 1? Message-ID: <4E841B2B.5060704@mozapps.com> I was looking at the fastcgi, I found out that all fcgi request have a msg_id of 1? What happens when more than 1 fcgi requests comes in and first one is still being handled. how does the fcgi server know the the difference in requests? Usually each request has it own connection, but if keepalive is on the then many request can come in on the same connection. I am use "ab" to test the nginx+ fastcgi server response time. From mdounin at mdounin.ru Thu Sep 29 07:28:33 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 29 Sep 2011 11:28:33 +0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> References: <20110928161355.GZ1137@mdounin.ru> <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110929072833.GB1137@mdounin.ru> Hello! On Wed, Sep 28, 2011 at 03:35:50PM -0400, csg wrote: > Maxim Dounin Wrote: > ------------------------------------------------------- > Hello again! > > > .... and $backend won't be set as a result. > > Moving "set" before > > "rewrite .. break" will do the trick. > > Right, in this case the $backend applies to proxy_pass and the request > gets proxied but unfortunatelly in this case the rewrite rule does not > have effect anymore. It still gets applied according to the error logs, > but instead of the rewritten URL path to original one gets proxied. To > make it more clear I changed the example configuration I posted above by > having each virtual host its own access and error log. This looks like a bug (or at least misfeature). Please try the attached patch. Maxim Dounin -------------- next part -------------- # HG changeset patch # User Maxim Dounin # Date 1317281138 -14400 # Node ID d6a0787307868c06073d92bb39eb2f73acf19d7c # Parent 29d417d419d946dce33023c71cce0e586ef3547b Proxy: made proxy_pass with variables more consitent. If proxy_pass were used with variables and there were no URI component, nginx always used unparsed URI. This isn't consistent with "no variables" case, where e.g. rewrites are applied even if there are no URI component. Fix is to use same logic in both cases, i.e. only use unparsed URI if it's valid and request is main one. diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -738,9 +738,6 @@ ngx_http_proxy_eval(ngx_http_request_t * url.uri.len++; url.uri.data = p - 1; } - - } else { - url.uri = r->unparsed_uri; } ctx->vars.key_start = u->schema; @@ -808,7 +805,7 @@ ngx_http_proxy_create_key(ngx_http_reque return NGX_ERROR; } - if (plcf->proxy_lengths) { + if (plcf->proxy_lengths && ctx->vars.uri.len) { *key = ctx->vars.uri; u->uri = ctx->vars.uri; @@ -918,7 +915,7 @@ ngx_http_proxy_create_request(ngx_http_r loc_len = 0; unparsed_uri = 0; - if (plcf->proxy_lengths) { + if (plcf->proxy_lengths && ctx->vars.uri.len) { uri_len = ctx->vars.uri.len; } else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main) @@ -1024,7 +1021,7 @@ ngx_http_proxy_create_request(ngx_http_r u->uri.data = b->last; - if (plcf->proxy_lengths) { + if (plcf->proxy_lengths && ctx->vars.uri.len) { b->last = ngx_copy(b->last, ctx->vars.uri.data, ctx->vars.uri.len); } else if (unparsed_uri) { From nginx-forum at nginx.us Thu Sep 29 07:31:07 2011 From: nginx-forum at nginx.us (csg) Date: Thu, 29 Sep 2011 03:31:07 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> References: <20110928161355.GZ1137@mdounin.ru> <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <826ac94aad7afd513c2d51d50fe1601f.NginxMailingListEnglish@forum.nginx.org> Here as a follow up the debug output plus additional information: # nginx -V nginx: nginx version: nginx/1.0.6 nginx: configure arguments: --with-debug --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --user=nginx --group=nginx --with-http_geoip_module --with-http_gzip_static_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --add-module=../chaoslawful-drizzle-nginx-module-1fc3af0 --add-module=../agentzh-echo-nginx-module-13dd12f --add-module=../ngx-fancyindex-0.3.1 --add-module=../agentzh-headers-more-nginx-module-137855d --add-module=../ngx_http_upstream_keepalive-2ee28064a04a --add-module=../agentzh-memc-nginx-module-4f1952c --add-module=../simpl-ngx_devel_kit-bc97eea --add-module=../chaoslawful-lua-nginx-module-dd0d4d0 --add-module=../agentzh-rds-csv-nginx-module-eb697d1 --add-module=../agentzh-rds-json-nginx-module-376db1f # cat /etc/nginx/nginx.conf ## ## /etc/nginx/nginx.conf ## worker_processes 3; events { worker_connections 1024; } http { server_tokens off; include nginx.mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 15; server { listen 0.0.0.0:90; server_name _; location / { root html; index index.html; } access_log /var/log/nginx/access90.log; error_log /var/log/nginx/error90.log debug; } server { listen 0.0.0.0:91; server_name _; location / { rewrite ^/foo/(.*)$ /$1 break; proxy_pass http://localhost:90; proxy_redirect off; } access_log /var/log/nginx/access91.log; error_log /var/log/nginx/error91.log debug; } server { listen 0.0.0.0:92; server_name _; location / { set $backend "localhost:90"; rewrite ^/foo/(.*)$ /$1 break; resolver 127.0.0.1; proxy_pass http://$backend; proxy_redirect off; } access_log /var/log/nginx/access92.log; error_log /var/log/nginx/error92.log debug; } } $ curl -s -o - -D - http://localhost:92/foo/ HTTP/1.1 404 Not Found Server: nginx Date: Thu, 29 Sep 2011 07:21:07 GMT Content-Type: text/html Connection: keep-alive Content-Length: 162 404 Not Found

404 Not Found


nginx
# cat access92.log 127.0.0.1 - - [29/Sep/2011:09:21:07 +0200] "GET /foo/ HTTP/1.1" 404 162 "-" "curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" # cat access90.log 127.0.0.1 - - [29/Sep/2011:09:21:07 +0200] "GET /foo/ HTTP/1.0" 404 162 "-" "curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" # cat error92.log 2011/09/29 09:21:05 [debug] 3565#0: epoll add event: fd:13 op:1 ev:00000001 2011/09/29 09:21:07 [debug] 3565#0: post event 0A15AC50 2011/09/29 09:21:07 [debug] 3565#0: delete posted event 0A15AC50 2011/09/29 09:21:07 [debug] 3565#0: accept on 0.0.0.0:92, ready: 0 2011/09/29 09:21:07 [debug] 3565#0: posix_memalign: 0A11BC80:256 @16 2011/09/29 09:21:07 [debug] 3565#0: *1 accept: 127.0.0.1 fd:17 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer add: 17: 60000:3020934938 2011/09/29 09:21:07 [debug] 3565#0: *1 epoll add event: fd:17 op:1 ev:80000001 2011/09/29 09:21:07 [debug] 3565#0: *1 post event 0A15ACB8 2011/09/29 09:21:07 [debug] 3565#0: *1 delete posted event 0A15ACB8 2011/09/29 09:21:07 [debug] 3565#0: *1 malloc: 0A124890:664 2011/09/29 09:21:07 [debug] 3565#0: *1 malloc: 0A124B30:1024 2011/09/29 09:21:07 [debug] 3565#0: *1 posix_memalign: 0A121C90:4096 @16 2011/09/29 09:21:07 [debug] 3565#0: *1 http process request line 2011/09/29 09:21:07 [debug] 3565#0: *1 recv: fd:17 158 of 1024 2011/09/29 09:21:07 [debug] 3565#0: *1 http request line: "GET /foo/ HTTP/1.1" 2011/09/29 09:21:07 [debug] 3565#0: *1 http uri: "/foo/" 2011/09/29 09:21:07 [debug] 3565#0: *1 http args: "" 2011/09/29 09:21:07 [debug] 3565#0: *1 http exten: "" 2011/09/29 09:21:07 [debug] 3565#0: *1 http process request header line 2011/09/29 09:21:07 [debug] 3565#0: *1 http header: "User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" 2011/09/29 09:21:07 [debug] 3565#0: *1 http header: "Host: localhost:92" 2011/09/29 09:21:07 [debug] 3565#0: *1 http header: "Accept: */*" 2011/09/29 09:21:07 [debug] 3565#0: *1 http header done 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer del: 17: 3020934938 2011/09/29 09:21:07 [debug] 3565#0: *1 generic phase: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 rewrite phase: 1 2011/09/29 09:21:07 [debug] 3565#0: *1 test location: "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 using configuration "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 http cl:-1 max:1048576 2011/09/29 09:21:07 [debug] 3565#0: *1 rewrite phase: 3 2011/09/29 09:21:07 [debug] 3565#0: *1 http script value: "localhost:90" 2011/09/29 09:21:07 [debug] 3565#0: *1 http script set $backend 2011/09/29 09:21:07 [debug] 3565#0: *1 http script regex: "^/foo/(.*)$" 2011/09/29 09:21:07 [notice] 3565#0: *1 "^/foo/(.*)$" matches "/foo/", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/29 09:21:07 [debug] 3565#0: *1 http script copy: "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 http script capture: "" 2011/09/29 09:21:07 [debug] 3565#0: *1 http script regex end 2011/09/29 09:21:07 [notice] 3565#0: *1 rewritten data: "/", args: "", client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.1", host: "localhost:92" 2011/09/29 09:21:07 [debug] 3565#0: *1 post rewrite phase: 4 2011/09/29 09:21:07 [debug] 3565#0: *1 generic phase: 5 2011/09/29 09:21:07 [debug] 3565#0: *1 generic phase: 6 2011/09/29 09:21:07 [debug] 3565#0: *1 generic phase: 7 2011/09/29 09:21:07 [debug] 3565#0: *1 access phase: 8 2011/09/29 09:21:07 [debug] 3565#0: *1 access phase: 9 2011/09/29 09:21:07 [debug] 3565#0: *1 post access phase: 10 2011/09/29 09:21:07 [debug] 3565#0: *1 http script copy: "http://" 2011/09/29 09:21:07 [debug] 3565#0: *1 http script var: "localhost:90" 2011/09/29 09:21:07 [debug] 3565#0: *1 http init upstream, client timer: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 epoll add event: fd:17 op:3 ev:80000005 2011/09/29 09:21:07 [debug] 3565#0: *1 http script copy: "Host: " 2011/09/29 09:21:07 [debug] 3565#0: *1 http script var: "localhost:90" 2011/09/29 09:21:07 [debug] 3565#0: *1 http script copy: " " 2011/09/29 09:21:07 [debug] 3565#0: *1 http script copy: "Connection: close " 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "Accept: */*" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "GET /foo/ HTTP/1.0 Host: localhost:90 Connection: close User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Accept: */* " 2011/09/29 09:21:07 [debug] 3565#0: *1 http cleanup add: 0A122630 2011/09/29 09:21:07 [debug] 3565#0: *1 get rr peer, try: 1 2011/09/29 09:21:07 [debug] 3565#0: *1 socket 18 2011/09/29 09:21:07 [debug] 3565#0: *1 epoll add connection: fd:18 ev:80000005 2011/09/29 09:21:07 [debug] 3565#0: *1 connect to 127.0.0.1:90, fd:18 #2 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream connect: -2 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer add: 18: 60000:3020934939 2011/09/29 09:21:07 [debug] 3565#0: *1 http finalize request: -4, "/?" a:1, c:2 2011/09/29 09:21:07 [debug] 3565#0: *1 http request count:2 blk:0 2011/09/29 09:21:07 [debug] 3565#0: *1 post event 0A167CF4 2011/09/29 09:21:07 [debug] 3565#0: *1 post event 0A167CC0 2011/09/29 09:21:07 [debug] 3565#0: *1 delete posted event 0A167CC0 2011/09/29 09:21:07 [debug] 3565#0: *1 http run request: "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream check client, write event:1, "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream recv(): -1 (11: Resource temporarily unavailable) 2011/09/29 09:21:07 [debug] 3565#0: *1 delete posted event 0A167CF4 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream request: "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream send request handler 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream send request 2011/09/29 09:21:07 [debug] 3565#0: *1 chain writer buf fl:1 s:177 2011/09/29 09:21:07 [debug] 3565#0: *1 chain writer in: 0A12264C 2011/09/29 09:21:07 [debug] 3565#0: *1 writev: 177 2011/09/29 09:21:07 [debug] 3565#0: *1 chain writer out: 00000000 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer del: 18: 3020934939 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer add: 18: 60000:3020934939 2011/09/29 09:21:07 [debug] 3565#0: *1 post event 0A15ACEC 2011/09/29 09:21:07 [debug] 3565#0: *1 post event 0A167CF4 2011/09/29 09:21:07 [debug] 3565#0: *1 delete posted event 0A167CF4 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream request: "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream dummy handler 2011/09/29 09:21:07 [debug] 3565#0: *1 delete posted event 0A15ACEC 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream request: "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream process header 2011/09/29 09:21:07 [debug] 3565#0: *1 malloc: 0A174BF8:4096 2011/09/29 09:21:07 [debug] 3565#0: *1 recv: fd:18 305 of 4096 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy status 404 "404 Not Found" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "Server: nginx" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "Date: Thu, 29 Sep 2011 07:21:07 GMT" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "Content-Type: text/html" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "Content-Length: 162" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header: "Connection: close" 2011/09/29 09:21:07 [debug] 3565#0: *1 http proxy header done 2011/09/29 09:21:07 [debug] 3565#0: *1 lua capture header filter, uri "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 HTTP/1.1 404 Not Found Server: nginx Date: Thu, 29 Sep 2011 07:21:07 GMT Content-Type: text/html Connection: keep-alive Content-Length: 162 2011/09/29 09:21:07 [debug] 3565#0: *1 write new buf t:1 f:0 0A1227F8, pos 0A1227F8, size: 148 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 http write filter: l:0 f:0 s:148 2011/09/29 09:21:07 [debug] 3565#0: *1 http cacheable: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream process upstream 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe read upstream: 1 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe preread: 162 2011/09/29 09:21:07 [debug] 3565#0: *1 readv: 1:3791 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe recv chain: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe buf free s:0 t:1 f:0 0A174BF8, pos 0A174C87, size: 162 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 input buf #0 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe write downstream: 1 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe write downstream flush in 2011/09/29 09:21:07 [debug] 3565#0: *1 http output filter "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http copy filter: "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 lua capture body filter, uri "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 http postpone filter "/?" 0A122970 2011/09/29 09:21:07 [debug] 3565#0: *1 write old buf t:1 f:0 0A1227F8, pos 0A1227F8, size: 148 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 write new buf t:1 f:0 0A174BF8, pos 0A174C87, size: 162 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 http write filter: l:0 f:0 s:310 2011/09/29 09:21:07 [debug] 3565#0: *1 http copy filter: 0 "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 pipe write downstream done 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer: 18, old: 3020934939, new: 3020934939 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream exit: 00000000 2011/09/29 09:21:07 [debug] 3565#0: *1 finalize http upstream request: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 finalize http proxy request 2011/09/29 09:21:07 [debug] 3565#0: *1 free rr peer 1 0 2011/09/29 09:21:07 [debug] 3565#0: *1 close http upstream connection: 18 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer del: 18: 3020934939 2011/09/29 09:21:07 [debug] 3565#0: *1 reusable connection: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 http upstream temp fd: -1 2011/09/29 09:21:07 [debug] 3565#0: *1 http output filter "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http copy filter: "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 lua capture body filter, uri "/" 2011/09/29 09:21:07 [debug] 3565#0: *1 http postpone filter "/?" BF8FAFD8 2011/09/29 09:21:07 [debug] 3565#0: *1 write old buf t:1 f:0 0A1227F8, pos 0A1227F8, size: 148 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 write old buf t:1 f:0 0A174BF8, pos 0A174C87, size: 162 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 write new buf t:0 f:0 00000000, pos 00000000, size: 0 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 http write filter: l:1 f:0 s:310 2011/09/29 09:21:07 [debug] 3565#0: *1 http write filter limit 0 2011/09/29 09:21:07 [debug] 3565#0: *1 writev: 310 2011/09/29 09:21:07 [debug] 3565#0: *1 http write filter 00000000 2011/09/29 09:21:07 [debug] 3565#0: *1 http copy filter: 0 "/?" 2011/09/29 09:21:07 [debug] 3565#0: *1 http finalize request: 0, "/?" a:1, c:1 2011/09/29 09:21:07 [debug] 3565#0: *1 set http keepalive handler 2011/09/29 09:21:07 [debug] 3565#0: *1 http close request 2011/09/29 09:21:07 [debug] 3565#0: *1 http log handler 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 0A174BF8 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 0A121C90, unused: 483 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer add: 17: 15000:3020889939 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 0A124890 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 0A124B30 2011/09/29 09:21:07 [debug] 3565#0: *1 hc free: 00000000 0 2011/09/29 09:21:07 [debug] 3565#0: *1 hc busy: 00000000 0 2011/09/29 09:21:07 [debug] 3565#0: *1 tcp_nodelay 2011/09/29 09:21:07 [debug] 3565#0: *1 reusable connection: 1 2011/09/29 09:21:07 [debug] 3565#0: *1 post event 0A15ACB8 2011/09/29 09:21:07 [debug] 3565#0: *1 delete posted event 0A15ACB8 2011/09/29 09:21:07 [debug] 3565#0: *1 http keepalive handler 2011/09/29 09:21:07 [debug] 3565#0: *1 malloc: 0A124890:1024 2011/09/29 09:21:07 [debug] 3565#0: *1 recv: fd:17 0 of 1024 2011/09/29 09:21:07 [info] 3565#0: *1 client 127.0.0.1 closed keepalive connection 2011/09/29 09:21:07 [debug] 3565#0: *1 close http connection: 17 2011/09/29 09:21:07 [debug] 3565#0: *1 event timer del: 17: 3020889939 2011/09/29 09:21:07 [debug] 3565#0: *1 reusable connection: 0 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 0A124890 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 00000000 2011/09/29 09:21:07 [debug] 3565#0: *1 free: 0A11BC80, unused: 56 # cat error90.log 2011/09/29 09:21:05 [debug] 3565#0: epoll add event: fd:11 op:1 ev:00000001 2011/09/29 09:21:07 [debug] 3565#0: post event 0A15ABE8 2011/09/29 09:21:07 [debug] 3565#0: delete posted event 0A15ABE8 2011/09/29 09:21:07 [debug] 3565#0: accept on 0.0.0.0:90, ready: 0 2011/09/29 09:21:07 [debug] 3565#0: posix_memalign: 0A11BE10:256 @16 2011/09/29 09:21:07 [debug] 3565#0: *3 accept: 127.0.0.1 fd:19 2011/09/29 09:21:07 [debug] 3565#0: *3 event timer add: 19: 60000:3020934939 2011/09/29 09:21:07 [debug] 3565#0: *3 epoll add event: fd:19 op:1 ev:80000001 2011/09/29 09:21:07 [debug] 3565#0: *3 post event 0A15AD20 2011/09/29 09:21:07 [debug] 3565#0: *3 delete posted event 0A15AD20 2011/09/29 09:21:07 [debug] 3565#0: *3 malloc: 0A124F38:664 2011/09/29 09:21:07 [debug] 3565#0: *3 malloc: 0A122CA8:1024 2011/09/29 09:21:07 [debug] 3565#0: *3 posix_memalign: 0A1230B0:4096 @16 2011/09/29 09:21:07 [debug] 3565#0: *3 http process request line 2011/09/29 09:21:07 [debug] 3565#0: *3 recv: fd:19 177 of 1024 2011/09/29 09:21:07 [debug] 3565#0: *3 http request line: "GET /foo/ HTTP/1.0" 2011/09/29 09:21:07 [debug] 3565#0: *3 http uri: "/foo/" 2011/09/29 09:21:07 [debug] 3565#0: *3 http args: "" 2011/09/29 09:21:07 [debug] 3565#0: *3 http exten: "" 2011/09/29 09:21:07 [debug] 3565#0: *3 http process request header line 2011/09/29 09:21:07 [debug] 3565#0: *3 http header: "Host: localhost:90" 2011/09/29 09:21:07 [debug] 3565#0: *3 http header: "Connection: close" 2011/09/29 09:21:07 [debug] 3565#0: *3 http header: "User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" 2011/09/29 09:21:07 [debug] 3565#0: *3 http header: "Accept: */*" 2011/09/29 09:21:07 [debug] 3565#0: *3 http header done 2011/09/29 09:21:07 [debug] 3565#0: *3 event timer del: 19: 3020934939 2011/09/29 09:21:07 [debug] 3565#0: *3 generic phase: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 rewrite phase: 1 2011/09/29 09:21:07 [debug] 3565#0: *3 test location: "/" 2011/09/29 09:21:07 [debug] 3565#0: *3 using configuration "/" 2011/09/29 09:21:07 [debug] 3565#0: *3 http cl:-1 max:1048576 2011/09/29 09:21:07 [debug] 3565#0: *3 rewrite phase: 3 2011/09/29 09:21:07 [debug] 3565#0: *3 post rewrite phase: 4 2011/09/29 09:21:07 [debug] 3565#0: *3 generic phase: 5 2011/09/29 09:21:07 [debug] 3565#0: *3 generic phase: 6 2011/09/29 09:21:07 [debug] 3565#0: *3 generic phase: 7 2011/09/29 09:21:07 [debug] 3565#0: *3 access phase: 8 2011/09/29 09:21:07 [debug] 3565#0: *3 access phase: 9 2011/09/29 09:21:07 [debug] 3565#0: *3 post access phase: 10 2011/09/29 09:21:07 [debug] 3565#0: *3 content phase: 11 2011/09/29 09:21:07 [debug] 3565#0: *3 open index "/usr/share/nginx/html/foo/index.html" 2011/09/29 09:21:07 [debug] 3565#0: *3 stat() "/usr/share/nginx/html/foo/index.html" failed (2: No such file or directory) 2011/09/29 09:21:07 [debug] 3565#0: *3 http index check dir: "/usr/share/nginx/html/foo" 2011/09/29 09:21:07 [error] 3565#0: *3 "/usr/share/nginx/html/foo/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /foo/ HTTP/1.0", host: "localhost:90" 2011/09/29 09:21:07 [debug] 3565#0: *3 http finalize request: 404, "/foo/?" a:1, c:1 2011/09/29 09:21:07 [debug] 3565#0: *3 http special response: 404, "/foo/?" 2011/09/29 09:21:07 [debug] 3565#0: *3 http set discard body 2011/09/29 09:21:07 [debug] 3565#0: *3 lua capture header filter, uri "/foo/" 2011/09/29 09:21:07 [debug] 3565#0: *3 HTTP/1.1 404 Not Found Server: nginx Date: Thu, 29 Sep 2011 07:21:07 GMT Content-Type: text/html Content-Length: 162 Connection: close 2011/09/29 09:21:07 [debug] 3565#0: *3 write new buf t:1 f:0 0A12362C, pos 0A12362C, size: 143 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 http write filter: l:0 f:0 s:143 2011/09/29 09:21:07 [debug] 3565#0: *3 http output filter "/foo/?" 2011/09/29 09:21:07 [debug] 3565#0: *3 http copy filter: "/foo/?" 2011/09/29 09:21:07 [debug] 3565#0: *3 lua capture body filter, uri "/foo/" 2011/09/29 09:21:07 [debug] 3565#0: *3 http postpone filter "/foo/?" 0A123778 2011/09/29 09:21:07 [debug] 3565#0: *3 write old buf t:1 f:0 0A12362C, pos 0A12362C, size: 143 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 write new buf t:0 f:0 00000000, pos 08116EE0, size: 116 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 write new buf t:0 f:0 00000000, pos 08116920, size: 46 file: 0, size: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 http write filter: l:1 f:0 s:305 2011/09/29 09:21:07 [debug] 3565#0: *3 http write filter limit 0 2011/09/29 09:21:07 [debug] 3565#0: *3 writev: 305 2011/09/29 09:21:07 [debug] 3565#0: *3 http write filter 00000000 2011/09/29 09:21:07 [debug] 3565#0: *3 http copy filter: 0 "/foo/?" 2011/09/29 09:21:07 [debug] 3565#0: *3 http finalize request: 0, "/foo/?" a:1, c:1 2011/09/29 09:21:07 [debug] 3565#0: *3 event timer add: 19: 5000:3020879939 2011/09/29 09:21:07 [debug] 3565#0: *3 http lingering close handler 2011/09/29 09:21:07 [debug] 3565#0: *3 recv: fd:19 -1 of 4096 2011/09/29 09:21:07 [debug] 3565#0: *3 recv() not ready (11: Resource temporarily unavailable) 2011/09/29 09:21:07 [debug] 3565#0: *3 lingering read: -2 2011/09/29 09:21:07 [debug] 3565#0: *3 event timer: 19, old: 3020879939, new: 3020879939 2011/09/29 09:21:07 [debug] 3565#0: *3 post event 0A15AD20 2011/09/29 09:21:07 [debug] 3565#0: *3 delete posted event 0A15AD20 2011/09/29 09:21:07 [debug] 3565#0: *3 http lingering close handler 2011/09/29 09:21:07 [debug] 3565#0: *3 recv: fd:19 0 of 4096 2011/09/29 09:21:07 [debug] 3565#0: *3 lingering read: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 http request count:1 blk:0 2011/09/29 09:21:07 [debug] 3565#0: *3 http close request 2011/09/29 09:21:07 [debug] 3565#0: *3 http log handler 2011/09/29 09:21:07 [debug] 3565#0: *3 free: 0A1230B0, unused: 2143 2011/09/29 09:21:07 [debug] 3565#0: *3 close http connection: 19 2011/09/29 09:21:07 [debug] 3565#0: *3 event timer del: 19: 3020879939 2011/09/29 09:21:07 [debug] 3565#0: *3 reusable connection: 0 2011/09/29 09:21:07 [debug] 3565#0: *3 free: 0A122CA8 2011/09/29 09:21:07 [debug] 3565#0: *3 free: 0A124F38 2011/09/29 09:21:07 [debug] 3565#0: *3 free: 0A11BE10, unused: 56 Any advice how to get rid of the 'foo/" in the proxied request would be highly welcome. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,216005#msg-216005 From nginx-forum at nginx.us Thu Sep 29 07:32:10 2011 From: nginx-forum at nginx.us (csg) Date: Thu, 29 Sep 2011 03:32:10 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <826ac94aad7afd513c2d51d50fe1601f.NginxMailingListEnglish@forum.nginx.org> References: <20110928161355.GZ1137@mdounin.ru> <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> <826ac94aad7afd513c2d51d50fe1601f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5f94f17a77abf763d5f2bbcca03f036f.NginxMailingListEnglish@forum.nginx.org> Ah sorry, just saw your patch ... will give that a try! Many thanks :-) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,216006#msg-216006 From mdounin at mdounin.ru Thu Sep 29 07:35:52 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 29 Sep 2011 11:35:52 +0400 Subject: fastcgi msg_id always 1? In-Reply-To: <4E841B2B.5060704@mozapps.com> References: <4E841B2B.5060704@mozapps.com> Message-ID: <20110929073552.GC1137@mdounin.ru> Hello! On Thu, Sep 29, 2011 at 03:15:55PM +0800, Shaun savage wrote: > I was looking at the fastcgi, I found out that all fcgi request have a > msg_id of 1? Yes. > What happens when more than 1 fcgi requests comes in and first one is > still being handled. how does the fcgi server know the the difference > in requests? Usually each request has it own connection, but if > keepalive is on the then many request can come in on the same connection. The id is only need to be unique when multiple request exists in parallel within a single connection. This is not the case even with keepalive used. Maxim Dounin From nginx-forum at nginx.us Thu Sep 29 07:53:47 2011 From: nginx-forum at nginx.us (csg) Date: Thu, 29 Sep 2011 03:53:47 -0400 Subject: Does Nginx honor DNS TTLs for proxy upstreams? In-Reply-To: <5f94f17a77abf763d5f2bbcca03f036f.NginxMailingListEnglish@forum.nginx.org> References: <20110928161355.GZ1137@mdounin.ru> <03e18959a4108577d38690656ce65b0f.NginxMailingListEnglish@forum.nginx.org> <826ac94aad7afd513c2d51d50fe1601f.NginxMailingListEnglish@forum.nginx.org> <5f94f17a77abf763d5f2bbcca03f036f.NginxMailingListEnglish@forum.nginx.org> Message-ID: I can confirm that the patch fixes the issue on my test setup :-) Will add it to my Nginx package and deploy it on production. Many thanks Maxim for your fantastic support on this issue (and all the work you do on this amazing and very helpful list)! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,216008#msg-216008 From david.yu.ftw at gmail.com Thu Sep 29 07:58:12 2011 From: david.yu.ftw at gmail.com (David Yu) Date: Thu, 29 Sep 2011 15:58:12 +0800 Subject: fastcgi msg_id always 1? In-Reply-To: <20110929073552.GC1137@mdounin.ru> References: <4E841B2B.5060704@mozapps.com> <20110929073552.GC1137@mdounin.ru> Message-ID: On Thu, Sep 29, 2011 at 3:35 PM, Maxim Dounin wrote: > Hello! > > On Thu, Sep 29, 2011 at 03:15:55PM +0800, Shaun savage wrote: > > > I was looking at the fastcgi, I found out that all fcgi request have a > > msg_id of 1? > > Yes. > > > What happens when more than 1 fcgi requests comes in and first one is > > still being handled. how does the fcgi server know the the difference > > in requests? Usually each request has it own connection, but if > > keepalive is on the then many request can come in on the same connection. > > The id is only need to be unique when multiple request exists in > parallel within a single connection. This is not the case even > with keepalive used. > E.g multiplexing not supported. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- When the cat is away, the mouse is alone. - David Yu -------------- next part -------------- An HTML attachment was scrubbed... URL: From martronic at martronic.ch Thu Sep 29 09:34:01 2011 From: martronic at martronic.ch (Martronic SA) Date: Thu, 29 Sep 2011 11:34:01 +0200 (CEST) Subject: Nginx Substitutions Filter problem In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> Message-ID: <744053bb97f08749b6230bfa2202e47e.squirrel@webmail.martronic.ch> hi log file and configuration file for nginx hopla.net are attached Thanks Martial > It works in my box. Can you show me your debug log? > > http://wiki.nginx.org/Debugging > > Do't use this in the production server. The debug log will be very large. > > > 2011/9/28 Martronic SA > >> full source attachment >> Thanks. >> >> >> >> >>
>> >>
>>
>> >>
> id="carousel-banner-0" >> class="bando.jpg carousel-banner selected"> >>
> title="Une maison >> dans un jardin, nouveau bandeau Hopla pour le printemps." >> class="bandeau_image">
>>
>> >> >> >> >> >> >> >> >> >>
>>
>> >>
>> >> > Can you show me your source page? >> > >> > Thanks. >> > >> > 2011/9/27 Martronic SA >> > >> >> Hello, >> >> >> >> We are using the "Substitutions Filter module" >> >> to replace html content in our pages. >> >> >> >> Our configuration is : >> >> >> >> location /{ >> >> subs_filter_types text/html text/xml; >> >> subs_filter 'http://bale.hopla.net/bons-**plans< >> http://bale.hopla.net/bons-plans>' >> >> 'http://bons-plans.hopla.net'; >> >> subs_filter 'id="portal-logo" href="http://bale.hopla.net"' >> >> 'id="portal-logo" href="http://www.hopla.net"'; >> >> } >> >> >> >> The first substitution is working, but the second not. >> >> Are we missing something? Is the "space" supported in substitution >> module? >> >> >> >> Thank you for your help! >> >> >> >> Martronic SA >> >> >> >> nginx -V >> >> nginx: nginx version: nginx/1.1.4 >> >> nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) >> >> nginx: TLS SNI support enabled >> >> nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf >> >> --error-log-path=/var/log/**nginx/error.log >> --pid-path=/var/run/nginx.pid >> >> --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** >> >> nginx/access.log >> >> --with-http_dav_module >> --http-client-body-temp-path=/**var/lib/nginx/body >> >> --with-http_ssl_module >> >> --http-proxy-temp-path=/var/**lib/nginx/proxy >> >> --with-http_stub_status_module >> >> --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi >> >> --add-module=/var/lib/**substitutions4nginx-read-only >> >> >> >> >> >> >> >> ______________________________**_________________ >> >> nginx mailing list >> >> nginx at nginx.org >> >> http://mailman.nginx.org/**mailman/listinfo/nginx< >> http://mailman.nginx.org/mailman/listinfo/nginx> >> >> >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- A non-text attachment was scrubbed... Name: hopla.net.gz Type: application/gzip Size: 1176 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: debug_nginx.log.gz Type: application/gzip Size: 106603 bytes Desc: not available URL: From nginx-forum at nginx.us Thu Sep 29 10:18:51 2011 From: nginx-forum at nginx.us (sajt) Date: Thu, 29 Sep 2011 06:18:51 -0400 Subject: conflicting server name "" on 0.0.0.0:80, ignored Message-ID: Hello, I have an Ubuntu for drupal development with 2+1 local domain. I putted 2 domain name to my hosts file, I have the default and two similar configuration files in my sites-enabled folder: -- server { if ($request_method !~ ^(GET|HEAD|POST)$ ) { return 444; } root /home/sajt/Projectek/eupharma/htdocs; index index.php server_name eupharmaltd; location / { # First attempt to serve request as file, then # as directory, then fall back to index.html try_files $uri $uri/ /index.html; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; # By all means use a different server for the fcgi processes if you need to fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /path/to/drupal$fastcgi_script_name; # !! <--- Another path reference for you. include /etc/nginx/fastcgi_params; } if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; break; } } -- The difference is only the root and the server_name. I get the following error: Restarting nginx: [warn]: conflicting server name "" on 0.0.0.0:80, ignored And when I try to access the all domain is showing the same page. The default is working fine. Thanks for answers Tamas Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216017,216017#msg-216017 From nbubingo at gmail.com Thu Sep 29 10:23:57 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Thu, 29 Sep 2011 18:23:57 +0800 Subject: Nginx Substitutions Filter problem In-Reply-To: <744053bb97f08749b6230bfa2202e47e.squirrel@webmail.martronic.ch> References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> <744053bb97f08749b6230bfa2202e47e.squirrel@webmail.martronic.ch> Message-ID: Sorry. I can't find any log from my substitutions module in your debug log. And I find the possible problem. The response from backend server is gzipped. You can compress the response with Nginx's gzip module. You should disable the gzipped response from backend server, like this: proxy_set_header Accept-Encoding ""; 2011/9/29 Martronic SA > hi > > log file and configuration file for nginx hopla.net are attached > > Thanks > Martial > > > > It works in my box. Can you show me your debug log? > > > > http://wiki.nginx.org/Debugging > > > > Do't use this in the production server. The debug log will be very large. > > > > > > 2011/9/28 Martronic SA > > > >> full source attachment > >> Thanks. > >> > >> > >> > >> > >>
> >> > >>
> >>
> >> > >>
>> id="carousel-banner-0" > >> class="bando.jpg carousel-banner selected"> > >>
>> title="Une maison > >> dans un jardin, nouveau bandeau Hopla pour le printemps." > >> class="bandeau_image">
> >>
> >> > >> > >> > >> > >> > >> > >> > >> > >> > >>
> >>
> >> > >>
> >> > >> > Can you show me your source page? > >> > > >> > Thanks. > >> > > >> > 2011/9/27 Martronic SA > >> > > >> >> Hello, > >> >> > >> >> We are using the "Substitutions Filter module" > >> >> to replace html content in our pages. > >> >> > >> >> Our configuration is : > >> >> > >> >> location /{ > >> >> subs_filter_types text/html text/xml; > >> >> subs_filter 'http://bale.hopla.net/bons-**plans< > >> http://bale.hopla.net/bons-plans>' > >> >> 'http://bons-plans.hopla.net'; > >> >> subs_filter 'id="portal-logo" href="http://bale.hopla.net"' > >> >> 'id="portal-logo" href="http://www.hopla.net"'; > >> >> } > >> >> > >> >> The first substitution is working, but the second not. > >> >> Are we missing something? Is the "space" supported in substitution > >> module? > >> >> > >> >> Thank you for your help! > >> >> > >> >> Martronic SA > >> >> > >> >> nginx -V > >> >> nginx: nginx version: nginx/1.1.4 > >> >> nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) > >> >> nginx: TLS SNI support enabled > >> >> nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf > >> >> --error-log-path=/var/log/**nginx/error.log > >> --pid-path=/var/run/nginx.pid > >> >> --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** > >> >> nginx/access.log > >> >> --with-http_dav_module > >> --http-client-body-temp-path=/**var/lib/nginx/body > >> >> --with-http_ssl_module > >> >> --http-proxy-temp-path=/var/**lib/nginx/proxy > >> >> --with-http_stub_status_module > >> >> --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi > >> >> --add-module=/var/lib/**substitutions4nginx-read-only > >> >> > >> >> > >> >> > >> >> ______________________________**_________________ > >> >> nginx mailing list > >> >> nginx at nginx.org > >> >> http://mailman.nginx.org/**mailman/listinfo/nginx< > >> http://mailman.nginx.org/mailman/listinfo/nginx> > >> >> > >> > _______________________________________________ > >> > nginx mailing list > >> > nginx at nginx.org > >> > http://mailman.nginx.org/mailman/listinfo/nginx > >> > >> > >> > >> _______________________________________________ > >> nginx mailing list > >> nginx at nginx.org > >> http://mailman.nginx.org/mailman/listinfo/nginx > >> > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarron at alketech.com Thu Sep 29 10:26:21 2011 From: ggarron at alketech.com (Guillermo Garron) Date: Thu, 29 Sep 2011 06:26:21 -0400 Subject: Happy birthday, Igor ? In-Reply-To: <20110928113554.GF80782@nginx.com> References: <20110928113554.GF80782@nginx.com> Message-ID: On Sep 28, 2011, at 7:35 AM, Igor Sysoev wrote: > On Wed, Sep 28, 2011 at 12:20:21PM +0200, Antoine Bonavita wrote: >> Given the amount of times Sep 28th 1970 is mentioned in the nginx code >> (see below), I am putting a rough guess that this is your birthday. >> So, in this very special day, I wanted to thank you for your amazing >> little kid and I would have loved to buy you a beer but you're a bit >> far away. If you ever get near the south of France, I'll buy you one. >> >> Of course, I could be completely wrong. > > You are right, this is my birthday. Thank you. > > > -- > Igor Sysoev A little late, but my best wishes and thanks from Bolivia! You've done a great contribution. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From martronic at martronic.ch Thu Sep 29 12:11:17 2011 From: martronic at martronic.ch (Martronic SA) Date: Thu, 29 Sep 2011 14:11:17 +0200 (CEST) Subject: Nginx Substitutions Filter problem In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> <744053bb97f08749b6230bfa2202e47e.squirrel@webmail.martronic.ch> Message-ID: hi thank you very much for your help. yes it was the gzip problematic. maitenent it works great Thanks Martial > Sorry. I can't find any log from my substitutions module in your debug log. > > And I find the possible problem. The response from backend server is > gzipped. You can compress the response with Nginx's gzip module. > > You should disable the gzipped response from backend server, like this: > > proxy_set_header Accept-Encoding ""; > > > 2011/9/29 Martronic SA > >> hi >> >> log file and configuration file for nginx hopla.net are attached >> >> Thanks >> Martial >> >> >> > It works in my box. Can you show me your debug log? >> > >> > http://wiki.nginx.org/Debugging >> > >> > Do't use this in the production server. The debug log will be very large. >> > >> > >> > 2011/9/28 Martronic SA >> > >> >> full source attachment >> >> Thanks. >> >> >> >> >> >> >> >> >> >>
>> >> >> >>
>> >>
>> >> >> >>
> >> id="carousel-banner-0" >> >> class="bando.jpg carousel-banner selected"> >> >>
> >> title="Une maison >> >> dans un jardin, nouveau bandeau Hopla pour le printemps." >> >> class="bandeau_image">
>> >>
>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
>> >>
>> >> >> >>
>> >> >> >> > Can you show me your source page? >> >> > >> >> > Thanks. >> >> > >> >> > 2011/9/27 Martronic SA >> >> > >> >> >> Hello, >> >> >> >> >> >> We are using the "Substitutions Filter module" >> >> >> to replace html content in our pages. >> >> >> >> >> >> Our configuration is : >> >> >> >> >> >> location /{ >> >> >> subs_filter_types text/html text/xml; >> >> >> subs_filter 'http://bale.hopla.net/bons-**plans< >> >> http://bale.hopla.net/bons-plans>' >> >> >> 'http://bons-plans.hopla.net'; >> >> >> subs_filter 'id="portal-logo" href="http://bale.hopla.net"' >> >> >> 'id="portal-logo" href="http://www.hopla.net"'; >> >> >> } >> >> >> >> >> >> The first substitution is working, but the second not. >> >> >> Are we missing something? Is the "space" supported in substitution >> >> module? >> >> >> >> >> >> Thank you for your help! >> >> >> >> >> >> Martronic SA >> >> >> >> >> >> nginx -V >> >> >> nginx: nginx version: nginx/1.1.4 >> >> >> nginx: built by gcc 4.3.2 (Debian 4.3.2-1.1) >> >> >> nginx: TLS SNI support enabled >> >> >> nginx: configure arguments: --conf-path=/etc/nginx/nginx.**conf >> >> >> --error-log-path=/var/log/**nginx/error.log >> >> --pid-path=/var/run/nginx.pid >> >> >> --lock-path=/var/lock/nginx.**lock --http-log-path=/var/log/** >> >> >> nginx/access.log >> >> >> --with-http_dav_module >> >> --http-client-body-temp-path=/**var/lib/nginx/body >> >> >> --with-http_ssl_module >> >> >> --http-proxy-temp-path=/var/**lib/nginx/proxy >> >> >> --with-http_stub_status_module >> >> >> --http-fastcgi-temp-path=/var/**lib/nginx/fastcgi >> >> >> --add-module=/var/lib/**substitutions4nginx-read-only >> >> >> >> >> >> >> >> >> >> >> >> ______________________________**_________________ >> >> >> nginx mailing list >> >> >> nginx at nginx.org >> >> >> http://mailman.nginx.org/**mailman/listinfo/nginx< >> >> http://mailman.nginx.org/mailman/listinfo/nginx> >> >> >> >> >> > _______________________________________________ >> >> > nginx mailing list >> >> > nginx at nginx.org >> >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> >> >> >> >> >> >> _______________________________________________ >> >> nginx mailing list >> >> nginx at nginx.org >> >> http://mailman.nginx.org/mailman/listinfo/nginx >> >> >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From sb at waeme.net Thu Sep 29 13:33:29 2011 From: sb at waeme.net (Sergey Budnevitch) Date: Thu, 29 Sep 2011 17:33:29 +0400 Subject: NGINX On REDHAT LINUX 5 In-Reply-To: References: Message-ID: <3DE0EF14-8A9C-4576-ACFC-756922577146@waeme.net> On 28.09.2011, at 20:25, RFGuerengomba at JLG.com wrote: > > Hi, > > I installed NGINX on Ubuntu before and it was working fine, but recently > our company decided to move to RedHat Linux. I am having little difficulty. > In Ubuntu under the NGINX system folder I have the folders called > "sites-available" and "sites-enabled" > I seem not to have that in REDHAT Linux. Can you please help me to > understand better? I am answering to nginx at nginx.org instead of nginx-devel, cause nginx-devel is incorrect maillist for questions of this kind In redhat linux you could place virtual sites configs in /etc/nginx/conf.d/ in files with .conf extension. ubuntu nginx package has "include /etc/nginx/sites-enabled;" directive in default nginx.conf, redhat one has "include /etc/nginx/conf.d/*.conf;". > > Roger F. Guerengomba > Senior System Administrator > JLG Industires, Inc. > 1 JLG Drive > McConnellsburg, PA 17233 > 717-485-6906 > rfguerengomba at jlg.com > http://www.jlg.com > > *********************************************************************** > The information contained in this transmission is confidential. It is > intended solely for the use of the individual(s) or organization(s) to > whom it is addressed. Any disclosure, copying or further distribution > is not permitted unless such privilege is explicitly granted in writing > by JLG Industries, Inc. > Further, JLG Industries, Inc. is not responsible for the proper and > complete transmission of the substance of this communication nor for > any delay in its receipt. > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From nginx-forum at nginx.us Thu Sep 29 14:16:21 2011 From: nginx-forum at nginx.us (firestorm) Date: Thu, 29 Sep 2011 10:16:21 -0400 Subject: Problem with GZIP Message-ID: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> I have ubuntu server 10.04, nginx 1.1.4(compiled) and my gzip support is not working. This is my configuration: nginx: nginx version: nginx/1.1.4 nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) nginx: TLS SNI support enabled nginx: configure arguments: --user=www-data --group=www-data --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-debug my nginx configuration is: http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; tcp_nodelay on; tcp_nopush off; #keepalive_timeout 0; keepalive_timeout 65; gzip on; gzip_min_length 1000; gzip_comp_level 6; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain application/xml; #gzip_disable "MSIE [1-6]\."; server { listen 80; server_name localhost; #access_log /var/log/nginx/alfaomega.access_log main; #error_log /var/log/nginx/alfaomega.error_log info; root /var/www/alfaomega/web; charset utf-8; location = / { index index.php; } } #Other locations } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216030,216030#msg-216030 From mdounin at mdounin.ru Thu Sep 29 14:27:43 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 29 Sep 2011 18:27:43 +0400 Subject: Problem with GZIP In-Reply-To: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110929142742.GF1137@mdounin.ru> Hello! On Thu, Sep 29, 2011 at 10:16:21AM -0400, firestorm wrote: > I have ubuntu server 10.04, nginx 1.1.4(compiled) and my gzip support is > not working. This is my configuration: Please show how do you test it's "not working". If in doubt, please provide debug log, see http://wiki.nginx.org/Debugging. Maxim Dounin From nginx-forum at nginx.us Thu Sep 29 15:06:22 2011 From: nginx-forum at nginx.us (tcbarrett) Date: Thu, 29 Sep 2011 11:06:22 -0400 Subject: Best way to burst static file cache In-Reply-To: <0668d2360623a0b4f9f9c84c0ab39f30.NginxMailingListEnglish@forum.nginx.org> References: <0668d2360623a0b4f9f9c84c0ab39f30.NginxMailingListEnglish@forum.nginx.org> Message-ID: Nobody has any ideas? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215835,216034#msg-216034 From RFGuerengomba at JLG.com Thu Sep 29 15:44:51 2011 From: RFGuerengomba at JLG.com (RFGuerengomba at JLG.com) Date: Thu, 29 Sep 2011 11:44:51 -0400 Subject: NGINX On REDHAT LINUX 5 In-Reply-To: <3DE0EF14-8A9C-4576-ACFC-756922577146@waeme.net> References: <3DE0EF14-8A9C-4576-ACFC-756922577146@waeme.net> Message-ID: Thank you so much for your help; I have some issues when I issue: /etc/init.d/nginx start or restart; it return not output. when I issued the command /usr/local/nginx/sbin/nginx -t the test is successful but /usr/local/nginx/sbin/nginx-s reload It gives me: invalid PID number "" in "/usr/local/nginx/logs/nginx.pid" when I look at the the nginx.pid number, there is no number in there. Can you please help me on how to solve this problem? Thanks, Roger F. Guerengomba Senior System Administrator JLG Industires, Inc. 1 JLG Drive McConnellsburg, PA 17233 717-485-6906 rfguerengomba at jlg.com http://www.jlg.com From: sb at waeme.net To: nginx at nginx.org Cc: rfguerengomba at jlg.com Date: 09/29/2011 09:33 AM Subject: Re: NGINX On REDHAT LINUX 5 On 28.09.2011, at 20:25, RFGuerengomba at JLG.com wrote: > > Hi, > > I installed NGINX on Ubuntu before and it was working fine, but recently > our company decided to move to RedHat Linux. I am having little difficulty. > In Ubuntu under the NGINX system folder I have the folders called > "sites-available" and "sites-enabled" > I seem not to have that in REDHAT Linux. Can you please help me to > understand better? I am answering to nginx at nginx.org instead of nginx-devel, cause nginx-devel is incorrect maillist for questions of this kind In redhat linux you could place virtual sites configs in /etc/nginx/conf.d/ in files with .conf extension. ubuntu nginx package has "include /etc/nginx/sites-enabled;" directive in default nginx.conf, redhat one has "include /etc/nginx/conf.d/*.conf;". > > Roger F. Guerengomba > Senior System Administrator > JLG Industires, Inc. > 1 JLG Drive > McConnellsburg, PA 17233 > 717-485-6906 > rfguerengomba at jlg.com > http://www.jlg.com > > *********************************************************************** > The information contained in this transmission is confidential. It is > intended solely for the use of the individual(s) or organization(s) to > whom it is addressed. Any disclosure, copying or further distribution > is not permitted unless such privilege is explicitly granted in writing > by JLG Industries, Inc. > Further, JLG Industries, Inc. is not responsible for the proper and > complete transmission of the substance of this communication nor for > any delay in its receipt. > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel *********************************************************************** The information contained in this transmission is confidential. It is intended solely for the use of the individual(s) or organization(s) to whom it is addressed. Any disclosure, copying or further distribution is not permitted unless such privilege is explicitly granted in writing by JLG Industries, Inc. Further, JLG Industries, Inc. is not responsible for the proper and complete transmission of the substance of this communication nor for any delay in its receipt. From agentzh at gmail.com Thu Sep 29 16:08:10 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 29 Sep 2011 09:08:10 -0700 Subject: Nginx Substitutions Filter problem In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> <744053bb97f08749b6230bfa2202e47e.squirrel@webmail.martronic.ch> Message-ID: 2011/9/29 ??? : > Sorry. I can't find any log from my substitutions module in your debug log. > And I find the possible problem. The response from backend server is > gzipped. Maybe we could check the Content-Encoding response header automatically in ngx_subs and if it's gzip/deflate, just issue a warning to error.log by default? ;) Regards, -agentzh From sb at waeme.net Thu Sep 29 20:02:10 2011 From: sb at waeme.net (Sergey Budnevitch) Date: Fri, 30 Sep 2011 00:02:10 +0400 Subject: NGINX On REDHAT LINUX 5 In-Reply-To: References: <3DE0EF14-8A9C-4576-ACFC-756922577146@waeme.net> Message-ID: <1778F702-B039-4482-8AFC-3F0E1B8641BC@waeme.net> On Sep 29, 2011, at 7:44 PM, RFGuerengomba at JLG.com wrote: > Thank you so much for your help; I have some issues when I issue: > > /etc/init.d/nginx start or restart; it return not output. > > when I issued the command > > /usr/local/nginx/sbin/nginx -t the test is successful > > but > > /usr/local/nginx/sbin/nginx-s reload It gives me: invalid PID number "" in > "/usr/local/nginx/logs/nginx.pid" It seems you install nginx from source. If you do not need third party modules try to install prebuild package (http://wiki.nginx.org/Install), it should work out of box From RFGuerengomba at JLG.com Thu Sep 29 20:26:14 2011 From: RFGuerengomba at JLG.com (RFGuerengomba at JLG.com) Date: Thu, 29 Sep 2011 16:26:14 -0400 Subject: Having Serious trouble and need help with NGINX Message-ID: I have some issues when I issue: Can someone please help me. (Running NGINX-1.0.4 On RedHat 5) /etc/init.d/nginx start or restart; it return not output. when I issued the command /usr/local/nginx/sbin/nginx -t the test is successful but /usr/local/nginx/sbin/nginx-s reload It gives me: invalid PID number "" in "/usr/local/nginx/logs/nginx.pid" when I look at the the nginx.pid number, there is no number in there. Can you please help me on how to solve this problem? Thanks, Rogergue *********************************************************************** The information contained in this transmission is confidential. It is intended solely for the use of the individual(s) or organization(s) to whom it is addressed. Any disclosure, copying or further distribution is not permitted unless such privilege is explicitly granted in writing by JLG Industries, Inc. Further, JLG Industries, Inc. is not responsible for the proper and complete transmission of the substance of this communication nor for any delay in its receipt. From nginx-forum at nginx.us Thu Sep 29 20:38:14 2011 From: nginx-forum at nginx.us (nailxx) Date: Thu, 29 Sep 2011 16:38:14 -0400 Subject: Odd reverse proxy behavior Message-ID: <63716caadbff839f3eced00f6ebce654.NginxMailingListEnglish@forum.nginx.org> Hi, all! I've stumbled upon a problem I can't find a solution for many hours in a row. I use nginx as a reverse proxy to python/spawning web-server. I've done it for 1000 times already and all worked fine before this day. Nginx on a server I'm talking about serves 3 separate projects (hostnames) as a reverse proxy. I've added fourth. Three existing projects continued to work perfectly. But the new one sometimes works and sometimes returns 502. The observation is: once it began to return 502 it would return it on every browser refresh. However if I'll throttle F5 fast, after 5-10 refreshes it starts to work properly. And vice versa: once it works like it should, slow refreshes keep it working, but if I'd throttle F5 again or if I'd wait for a minute or so nginx declines back to 502-state. There is nothing recorded in neither log (access/error nginx/backend) if it is in 502-state. The deal is not in a backend. I've tried to set proxy_pass to the same value as in a sibling well-working project conf and the same story repeats. Problem exists for static resources as well. Is this conf cursed? ++++ user www-data; worker_processes 1; error_log /var/log/nginx/error.log debug; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } #### /etc/nginx/sites-enabled/my-cursed-conf #### server { listen 80; server_name hostname.iam.listening.to; # Main location location / { proxy_pass http://127.0.0.1:8084; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /static/ { alias /srv/some/path/static/; } } ++++ I feel I've tried all combinations of buffer-tweaking and none of them helped. The system has > 700 Mb or RAM free and mostly idle CPU. Could someone guess what the hell is going on? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216073,216073#msg-216073 From nginx-forum at nginx.us Thu Sep 29 21:56:39 2011 From: nginx-forum at nginx.us (nailxx) Date: Thu, 29 Sep 2011 17:56:39 -0400 Subject: Odd reverse proxy behavior In-Reply-To: <63716caadbff839f3eced00f6ebce654.NginxMailingListEnglish@forum.nginx.org> References: <63716caadbff839f3eced00f6ebce654.NginxMailingListEnglish@forum.nginx.org> Message-ID: Got it! The problem was absolutely not related to nginx configuration. I found it when I continued to get 502s even with nginx process down O_o I've accidentally added two A-records to the DNS-zone with same name but different IPs. Looks like the resulting IP was chosen in semi-round-robin fashion. And when a not configured server was chosen, I've got those 502s. Whew!? Sorry for disturbing. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216073,216075#msg-216075 From nginx-forum at nginx.us Thu Sep 29 23:09:21 2011 From: nginx-forum at nginx.us (kaspars) Date: Thu, 29 Sep 2011 19:09:21 -0400 Subject: Best way to burst static file cache In-Reply-To: References: <0668d2360623a0b4f9f9c84c0ab39f30.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2ca1c0cfbd552de1033411ef7ba73187.NginxMailingListEnglish@forum.nginx.org> Well, if you set cache to expire 30 years from now the browser should honor that, that is if no Last-Modified is set. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215835,216076#msg-216076 From alex.thegreat at ambix.net Thu Sep 29 23:48:41 2011 From: alex.thegreat at ambix.net (Alex) Date: Thu, 29 Sep 2011 17:48:41 -0600 Subject: Nginx reverse proxy with cache - dynamic images do not display Message-ID: Hi, I set up this configuration: http://pastebin.com/R65RiX5n The images that are served by a servelet do not appear. Do you know how I can fix this so that images served by servelets (dotContent, contentAssets, or /resize_image) work? So the image tags on the HTML are: I appreciate any suggestions. Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Sep 30 00:01:56 2011 From: nginx-forum at nginx.us (naytro) Date: Thu, 29 Sep 2011 20:01:56 -0400 Subject: range request Message-ID: hello how to disable range request ? ciao Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216078,216078#msg-216078 From nginx-forum at nginx.us Fri Sep 30 00:32:59 2011 From: nginx-forum at nginx.us (naytro) Date: Thu, 29 Sep 2011 20:32:59 -0400 Subject: range request In-Reply-To: References: Message-ID: <7dd4fdaf69e96cdb225040689263e52e.NginxMailingListEnglish@forum.nginx.org> hello a few minutes later I found a solution, module ngx_headers_more is capable to remove input headers, so I removed a range and accept-rangers headers ciao Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216078,216080#msg-216080 From yaniv at aknin.name Fri Sep 30 08:11:53 2011 From: yaniv at aknin.name (Yaniv Aknin) Date: Fri, 30 Sep 2011 11:11:53 +0300 Subject: nginx and upstream Content-Length Message-ID: Hi, In a recent thread on the uwsgi mailing list[1], I began suspecting that nginx will not honor an upstream's Content-Length header. i.e., if an upstream mentions a Content-Length of 1,000 bytes, but the connection is broken after 500 bytes, nginx will still happily serve this entity with a 200 OK status. This may be a known bug in nginx, I wanted to be certain I indeed understand it correctly and raise the attention to it on the nginx mailing list - because I think this is a very serious bug with potentially disastrous consequences, as I describe below. I was able to confirm this both for uwsgi_pass and proxy_pass; if the upstream sets a Content-Length and then breaks the connection before that length was achieved, nginx will pass this onwards to the client. Furthermore, since the upstream protocol is HTTP 1.0 but the nginx-client protocl is HTTP 1.1 (with keepalive), the request will simply not terminate, because the client can't tell that the server has nothing more to send and nginx will not break the connection, despite the fact its connection with the upstream was broken and there's no chance this request will ever be fulfilled. Things get far worse with gzip compression on - nginx will remove the Content-Length header sent by the client and replace it with chunked encoding - /incorrect chunked encoding/, that will make the client believe it has the full entity, even though it has only a part of this. Think about this with regard to caching, ETags and transparent proxy caching - if something like this happens to a cachable entity, especially one with an ETag, especially if a large ISP's transparent proxy intercepts the request - you might end up serving an incorrect representation of the entity for a very long time and for many thousands of requests (!). Anyhow, I think the only sane resolution is that nginx will honor upstream Content-Length (and chunked encoding, if and when nginx will support it), and intentionally close the downstream connection prematurely in case the upstream connection is closed before the end of the Content-Length or the last chunk is received. I suspect the recent work in nginx 1.1.4 for ngx_http_upstream_keepalivecould be relevant here, but not sure, didn't read the code. I'll be happy to hear your thoughts or provide further data. - Yaniv 1: http://comments.gmane.org/gmane.comp.python.wsgi.uwsgi.general/2061 -------------- next part -------------- An HTML attachment was scrubbed... URL: From zjay1987 at gmail.com Fri Sep 30 08:22:52 2011 From: zjay1987 at gmail.com (li zJay) Date: Fri, 30 Sep 2011 16:22:52 +0800 Subject: nginx won't honor limit_rate In-Reply-To: <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> References: <20110928232327.GA1137@mdounin.ru> <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> Message-ID: set "proxy_buffering on", the upstream response may touch the disk this suffers a lot when nginx is used as a proxy to file download servers. On Thu, Sep 29, 2011 at 7:31 AM, mojiz wrote: > Thanks Max. > It worked! > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215989,215991#msg-215991 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From martronic at martronic.ch Fri Sep 30 08:52:29 2011 From: martronic at martronic.ch (Martronic SA) Date: Fri, 30 Sep 2011 10:52:29 +0200 Subject: Nginx Substitutions Filter problem In-Reply-To: References: <4E80E187.6030807@ntlworld.com> <4E80EB49.9000108@ianhobson.co.uk> <20110927045203.20830@gmx.net> <4E81701D.408@martronic.ch> <2a4c6102eba7e97f63ad316476db06b8.squirrel@webmail.martronic.ch> <744053bb97f08749b6230bfa2202e47e.squirrel@webmail.martronic.ch> Message-ID: <4E85834D.3060105@martronic.ch> Maybe the documentation of the module should be completed to notify about this problem. Thanks! Martronic SA Le 29.09.2011 18:08, agentzh a ?crit : > 2011/9/29 ??? : >> Sorry. I can't find any log from my substitutions module in your debug log. >> And I find the possible problem. The response from backend server is >> gzipped. > Maybe we could check the Content-Encoding response header > automatically in ngx_subs and if it's gzip/deflate, just issue a > warning to error.log by default? ;) > > Regards, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From j.vanarragon at lukkien.com Fri Sep 30 09:06:27 2011 From: j.vanarragon at lukkien.com (Jaap van Arragon) Date: Fri, 30 Sep 2011 11:06:27 +0200 Subject: HttpHealthcheckModule server not marked down In-Reply-To: Message-ID: Hi, I believe that the healthcheck module is only used for checking if the backend(node) is down. As I read it, it doesn't do anything with bringing the node "Down" in the nginx config but maybe I misunderstand it. Regards, Jaap On 9/22/11 10:34 PM, "Sjaak Pieterse" wrote: > Hi there, > > i'm trying to use the HttpHealthcheckModule for nginx, but i have some > troubles with it. > > i have two servers in my upstream, when sabotaging the health for one > server i see in the status view of healthcheck that the server is > down(1), but if i go to the website i'm checking i still come out on > it and see a broken page. > > how can i arrange that the server automatically is marked as down when > the check fails? > > sorry for my bad english and maybe noob questions. > > config: > ?upstream www-health{ > ??????? server x.x.x.1 ; > ??????? server x.x.x.2 ; > ??? healthcheck_enabled; > ??? healthcheck_delay 10000 ; > ??? healthcheck_timeout 1000; > ??? healthcheck_failcount 2; > ??? #healthcheck_expected 'I_AM_ALIVE'; > ??? #Important: HTTP/1.0 > ??? healthcheck_send "GET / HTTP/1.0" 'Host: health.test.x.com' > 'Conection: close' ; > } > > nginx: nginx version: nginx/1.0.6 > nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) > nginx: TLS SNI support enabled > nginx: configure arguments: --with-http_ssl_module > --add-module=/gnosek-nginx-upstream-fair-2131c73 > --with-http_stub_status_module > --add-module=/cep21-healthcheck_nginx_upstreams-b33a846 > --prefix=/usr/local/nginx-1.0.6 --with-debug > > used: > peckhardt at test-nginx:~/nginx-1.0.6$patch -p1 < > /cep21-healthcheck_nginx_upstreams-5fa4bff/nginx.patch > > hope someone would help me. > > greetings > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Fri Sep 30 09:18:54 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Sep 2011 13:18:54 +0400 Subject: nginx won't honor limit_rate In-Reply-To: References: <20110928232327.GA1137@mdounin.ru> <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110930091854.GI1137@mdounin.ru> Hello! On Fri, Sep 30, 2011 at 04:22:52PM +0800, li zJay wrote: > set "proxy_buffering on", the upstream response may touch the disk > this suffers a lot when nginx is used as a proxy to file download servers. If you want nginx to don't touch disk, use proxy_max_temp_file_size 0; instead. This will still allow in-memory buffering and wouldn't touch disk. Maxim Dounin > > On Thu, Sep 29, 2011 at 7:31 AM, mojiz wrote: > > > Thanks Max. > > It worked! > > > > Posted at Nginx Forum: > > http://forum.nginx.org/read.php?2,215989,215991#msg-215991 > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > -- > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Fri Sep 30 09:59:07 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Sep 2011 13:59:07 +0400 Subject: nginx and upstream Content-Length In-Reply-To: References: Message-ID: <20110930095907.GJ1137@mdounin.ru> Hello! On Fri, Sep 30, 2011 at 11:11:53AM +0300, Yaniv Aknin wrote: > In a recent thread on the uwsgi mailing list[1], I began suspecting that > nginx will not honor an upstream's Content-Length header. i.e., if an > upstream mentions a Content-Length of 1,000 bytes, but the connection is > broken after 500 bytes, nginx will still happily serve this entity with a > 200 OK status. Status code 200 is irrelevant - as it's generally not possible to know if connection will be broken in advance (i.e. before sending status). > This may be a known bug in nginx, I wanted to be certain I indeed understand > it correctly and raise the attention to it on the nginx mailing list - > because I think this is a very serious bug with potentially disastrous > consequences, as I describe below. > > I was able to confirm this both for uwsgi_pass and proxy_pass; if the > upstream sets a Content-Length and then breaks the connection before that > length was achieved, nginx will pass this onwards to the client. > Furthermore, since the upstream protocol is HTTP 1.0 but the nginx-client > protocl is HTTP 1.1 (with keepalive), the request will simply not terminate, > because the client can't tell that the server has nothing more to send and > nginx will not break the connection, despite the fact its connection with > the upstream was broken and there's no chance this request will ever be > fulfilled. > > Things get far worse with gzip compression on - nginx will remove the > Content-Length header sent by the client and replace it with chunked > encoding - /incorrect chunked encoding/, that will make the client believe > it has the full entity, even though it has only a part of this. Yes, this is a known problem. Upstream module expects backend to behave properly, and if it misbehaves (or, more importantly, connection is broken for some reason) bad things may happen. Upstream's module code needs carefull auditing to fix this. It's somewhere in my TODO (though not very high). Maxim Dounin From yaniv at aknin.name Fri Sep 30 14:35:59 2011 From: yaniv at aknin.name (Yaniv Aknin) Date: Fri, 30 Sep 2011 17:35:59 +0300 Subject: nginx and upstream Content-Length In-Reply-To: <20110930095907.GJ1137@mdounin.ru> References: <20110930095907.GJ1137@mdounin.ru> Message-ID: Well, I appreciate the time every contributor to nginx put into the project and especially your and Igor's work, and I know I don't dictate the priority of your TODO, but I humbly think this is a far more serious issue than you're portraying. Simply put, this bug can cause nginx to cause an otherwise *noticeable data corruption* to become a *silent data corruption* (including the serious cache poisoning ramifications), and I think there are few bugs less urgent than that. Anyhow, I've said all I have to say on the matter, so unless further information comes up on this, I'll leave this topic alone (at least until I'll get off my bum and come back here with a suggested patch to fix this...). Thank you for your concise, timely and complete reply, - Yaniv On Fri, Sep 30, 2011 at 12:59 PM, Maxim Dounin wrote: > Hello! > > On Fri, Sep 30, 2011 at 11:11:53AM +0300, Yaniv Aknin wrote: > > > In a recent thread on the uwsgi mailing list[1], I began suspecting that > > nginx will not honor an upstream's Content-Length header. i.e., if an > > upstream mentions a Content-Length of 1,000 bytes, but the connection is > > broken after 500 bytes, nginx will still happily serve this entity with a > > 200 OK status. > > Status code 200 is irrelevant - as it's generally not possible to > know if connection will be broken in advance (i.e. before sending > status). > > > This may be a known bug in nginx, I wanted to be certain I indeed > understand > > it correctly and raise the attention to it on the nginx mailing list - > > because I think this is a very serious bug with potentially disastrous > > consequences, as I describe below. > > > > I was able to confirm this both for uwsgi_pass and proxy_pass; if the > > upstream sets a Content-Length and then breaks the connection before that > > length was achieved, nginx will pass this onwards to the client. > > Furthermore, since the upstream protocol is HTTP 1.0 but the nginx-client > > protocl is HTTP 1.1 (with keepalive), the request will simply not > terminate, > > because the client can't tell that the server has nothing more to send > and > > nginx will not break the connection, despite the fact its connection with > > the upstream was broken and there's no chance this request will ever be > > fulfilled. > > > > Things get far worse with gzip compression on - nginx will remove the > > Content-Length header sent by the client and replace it with chunked > > encoding - /incorrect chunked encoding/, that will make the client > believe > > it has the full entity, even though it has only a part of this. > > Yes, this is a known problem. Upstream module expects backend to > behave properly, and if it misbehaves (or, more importantly, > connection is broken for some reason) bad things may happen. > > Upstream's module code needs carefull auditing to fix this. It's > somewhere in my TODO (though not very high). > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zjay1987 at gmail.com Fri Sep 30 14:56:41 2011 From: zjay1987 at gmail.com (li zJay) Date: Fri, 30 Sep 2011 22:56:41 +0800 Subject: nginx won't honor limit_rate In-Reply-To: <20110930091854.GI1137@mdounin.ru> References: <20110928232327.GA1137@mdounin.ru> <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> <20110930091854.GI1137@mdounin.ru> Message-ID: hello! If you want nginx to don't touch disk, use > > proxy_max_temp_file_size 0; > > instead. This will still allow in-memory buffering and wouldn't > touch disk. > Because the client bandwidth is usually slow, in this case, tons of upstream content will be buffer in memory before sent out to client, and then the swap will be used and the server is going down soon. On Fri, Sep 30, 2011 at 5:18 PM, Maxim Dounin wrote: > Hello! > > On Fri, Sep 30, 2011 at 04:22:52PM +0800, li zJay wrote: > > > set "proxy_buffering on", the upstream response may touch the disk > > this suffers a lot when nginx is used as a proxy to file download > servers. > > If you want nginx to don't touch disk, use > > proxy_max_temp_file_size 0; > > instead. This will still allow in-memory buffering and wouldn't > touch disk. > > Maxim Dounin > > > > > On Thu, Sep 29, 2011 at 7:31 AM, mojiz wrote: > > > > > Thanks Max. > > > It worked! > > > > > > Posted at Nginx Forum: > > > http://forum.nginx.org/read.php?2,215989,215991#msg-215991 > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > -- > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomlove at gmail.com Fri Sep 30 15:08:32 2011 From: tomlove at gmail.com (Thomas Love) Date: Fri, 30 Sep 2011 17:08:32 +0200 Subject: nginx and upstream Content-Length In-Reply-To: References: <20110930095907.GJ1137@mdounin.ru> Message-ID: Hi Yaniv Thanks for investigating and reporting on this. Do you know whether the gzip chunked-encoding problem exists for fastcgi_pass as well? Cheers Thomas From nginx-forum at nginx.us Fri Sep 30 15:13:34 2011 From: nginx-forum at nginx.us (mojiz) Date: Fri, 30 Sep 2011 11:13:34 -0400 Subject: nginx won't honor limit_rate In-Reply-To: <20110930091854.GI1137@mdounin.ru> References: <20110930091854.GI1137@mdounin.ru> Message-ID: What exactly do you mean by 'suffer'? I'm using limit_rate to slow the user downloads. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215989,216112#msg-216112 From mdounin at mdounin.ru Fri Sep 30 15:18:14 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Sep 2011 19:18:14 +0400 Subject: nginx won't honor limit_rate In-Reply-To: References: <20110928232327.GA1137@mdounin.ru> <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> <20110930091854.GI1137@mdounin.ru> Message-ID: <20110930151814.GW1137@mdounin.ru> Hello! On Fri, Sep 30, 2011 at 10:56:41PM +0800, li zJay wrote: > hello! > > If you want nginx to don't touch disk, use > > > > proxy_max_temp_file_size 0; > > > > instead. This will still allow in-memory buffering and wouldn't > > touch disk. > > > > Because the client bandwidth is usually slow, in this case, tons of upstream > content will be buffer in memory before sent out to client, and then the > swap will be used and the server is going down soon. The limit on memory usage for proxy buffering is set with proxy_buffers directive, 8 * pagesize by default. Nobody stops you from setting it even lower if you are memory-constrained. The "proxy_buffering off;" is needed when you want response to be immediately passed to clients once it arrives. It's critical for streaming and similar workloads where you can't afford delays. But it's not a switch to limit resource consumption. Instead, it actually implies less effective resource usage: processing of requests without buffering takes more CPU time and may cause suboptimal network utilization. Maxim Dounin > > On Fri, Sep 30, 2011 at 5:18 PM, Maxim Dounin wrote: > > > Hello! > > > > On Fri, Sep 30, 2011 at 04:22:52PM +0800, li zJay wrote: > > > > > set "proxy_buffering on", the upstream response may touch the disk > > > this suffers a lot when nginx is used as a proxy to file download > > servers. > > > > If you want nginx to don't touch disk, use > > > > proxy_max_temp_file_size 0; > > > > instead. This will still allow in-memory buffering and wouldn't > > touch disk. > > > > Maxim Dounin > > > > > > > > On Thu, Sep 29, 2011 at 7:31 AM, mojiz wrote: > > > > > > > Thanks Max. > > > > It worked! > > > > > > > > Posted at Nginx Forum: > > > > http://forum.nginx.org/read.php?2,215989,215991#msg-215991 > > > > > > > > _______________________________________________ > > > > nginx mailing list > > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > > > > > > -- > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > -- > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From igor at sysoev.ru Fri Sep 30 15:41:00 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 30 Sep 2011 19:41:00 +0400 Subject: nginx-1.0.7 Message-ID: <20110930154100.GI72272@nginx.com> Changes with nginx 1.0.7 30 Sep 2011 *) Change: now if total size of all ranges is greater than source response size, then nginx disables ranges and returns just the source response. *) Feature: the "max_ranges" directive. *) Feature: the module ngx_http_mp4_module. *) Feature: the "worker_aio_requests" directive. *) Bugfix: if nginx was built --with-file-aio it could not be run on Linux kernel which did not support AIO. *) Bugfix: in Linux AIO error processing. Thanks to Hagai Avrahami. *) Bugfix: in Linux AIO combined with open_file_cache. *) Bugfix: open_file_cache did not update file info on retest if file was not atomically changed. *) Bugfix: reduced memory consumption for long-lived requests. *) Bugfix: in the "proxy/fastcgi/scgi/uwsgi_ignore_client_abort" directives. *) Bugfix: nginx could not be built on MacOSX 10.7. *) Bugfix: in the "proxy/fastcgi/scgi/uwsgi_ignore_client_abort" directives. *) Bugfix: request body might be processed incorrectly if client used pipelining. *) Bugfix: in the "request_body_in_single_buf" directive. *) Bugfix: in "proxy_set_body" and "proxy_pass_request_body" directives if SSL connection to backend was used. *) Bugfix: nginx hogged CPU if all servers in an upstream were marked as "down". *) Bugfix: a segmentation fault might occur during reconfiguration if ssl_session_cache was defined but not used in previous configuration. *) Bugfix: a segmentation fault might occur in a worker process if many backup servers were used in an upstream. -- Igor Sysoev From yaniv at aknin.name Fri Sep 30 16:07:43 2011 From: yaniv at aknin.name (Yaniv Aknin) Date: Fri, 30 Sep 2011 19:07:43 +0300 Subject: nginx and upstream Content-Length In-Reply-To: References: <20110930095907.GJ1137@mdounin.ru> Message-ID: Sorry, I didn't test FastCGI so can't say for sure. I suspect it will happen there as well, but it's just an assumption. - Yaniv On Fri, Sep 30, 2011 at 6:08 PM, Thomas Love wrote: > Hi Yaniv > > Thanks for investigating and reporting on this. Do you know whether > the gzip chunked-encoding problem exists for fastcgi_pass as well? > > Cheers > Thomas > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zjay1987 at gmail.com Fri Sep 30 16:14:35 2011 From: zjay1987 at gmail.com (li zJay) Date: Sat, 1 Oct 2011 00:14:35 +0800 Subject: nginx won't honor limit_rate In-Reply-To: <20110930151814.GW1137@mdounin.ru> References: <20110928232327.GA1137@mdounin.ru> <5ac045ab558aa2e1c5c87c2eadb4a37a.NginxMailingListEnglish@forum.nginx.org> <20110930091854.GI1137@mdounin.ru> <20110930151814.GW1137@mdounin.ru> Message-ID: Thanks Maxim Dounin! I thought that if proxy_max_temp_file_size is set to 0, all the upstream content have to be buffered in memory, and I make a test and find I'm wrong. On Fri, Sep 30, 2011 at 11:18 PM, Maxim Dounin wrote: > Hello! > > On Fri, Sep 30, 2011 at 10:56:41PM +0800, li zJay wrote: > > > hello! > > > > If you want nginx to don't touch disk, use > > > > > > proxy_max_temp_file_size 0; > > > > > > instead. This will still allow in-memory buffering and wouldn't > > > touch disk. > > > > > > > Because the client bandwidth is usually slow, in this case, tons of > upstream > > content will be buffer in memory before sent out to client, and then the > > swap will be used and the server is going down soon. > > The limit on memory usage for proxy buffering is set with > proxy_buffers directive, 8 * pagesize by default. Nobody stops > you from setting it even lower if you are memory-constrained. > > The "proxy_buffering off;" is needed when you want response to be > immediately passed to clients once it arrives. It's critical for > streaming and similar workloads where you can't afford delays. > But it's not a switch to limit resource consumption. Instead, it > actually implies less effective resource usage: processing of > requests without buffering takes more CPU time and may cause > suboptimal network utilization. > > Maxim Dounin > > > > > On Fri, Sep 30, 2011 at 5:18 PM, Maxim Dounin > wrote: > > > > > Hello! > > > > > > On Fri, Sep 30, 2011 at 04:22:52PM +0800, li zJay wrote: > > > > > > > set "proxy_buffering on", the upstream response may touch the disk > > > > this suffers a lot when nginx is used as a proxy to file download > > > servers. > > > > > > If you want nginx to don't touch disk, use > > > > > > proxy_max_temp_file_size 0; > > > > > > instead. This will still allow in-memory buffering and wouldn't > > > touch disk. > > > > > > Maxim Dounin > > > > > > > > > > > On Thu, Sep 29, 2011 at 7:31 AM, mojiz wrote: > > > > > > > > > Thanks Max. > > > > > It worked! > > > > > > > > > > Posted at Nginx Forum: > > > > > http://forum.nginx.org/read.php?2,215989,215991#msg-215991 > > > > > > > > > > _______________________________________________ > > > > > nginx mailing list > > > > > nginx at nginx.org > > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > _______________________________________________ > > > > nginx mailing list > > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > -- > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- ?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Sep 30 18:37:10 2011 From: nginx-forum at nginx.us (dougconran) Date: Fri, 30 Sep 2011 14:37:10 -0400 Subject: Question regarding Nginx Configuration Message-ID: <2e6ad2d68b975059a0860f81a2f19b41.NginxMailingListEnglish@forum.nginx.org> I have Nginx up and running but I think that the conf file could be improved upon. I have a single server hosting 2 domains (doma and domb). doma is the default virtual host and supports a number of applications all of which use Perl scripts. domb has a separate domain name (obviously!) and supports one application that has a Wordpress/PHP frontend plus a secure Perl application All doma static web pages are held in sub-directories under a root of .../htdocs The domb 'static' Wordpress pages (including all PHP pages) are in .../htdocs/domb & sub-directories All Perl scripts for both doma and domb are in .../cgi-bin sub-directories including .../cgi-bin/domb for the secure domb apps. As I understand it I have to have 3 server blocks:- Block 1 - default port 80 Block 2 - domb port 80 Block 3 - domb port 443 Unfortunately it seems that I have to replicate the location ...htdocs and cgi-bin*.pl$ blocks3 times (once for each server block) and the /*.php$ block twice (for domb 80 and domb 443). This, I think, is because location blocks can only exist within server blocks. Is it possible for location blocks to exist within the main http block at a higher level than the server block (I've tried it and it didn't work for me but that might have been because I had got some other configuration statements wrong)? TIA Doug Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216128,216128#msg-216128 From lists at ruby-forum.com Fri Sep 30 20:13:02 2011 From: lists at ruby-forum.com (Jamie W.) Date: Fri, 30 Sep 2011 22:13:02 +0200 Subject: intercepted 400 errors not displaying custom error page Message-ID: <522f3010f47fced94ec3b41c0dc7646a@ruby-forum.com> I am trying to intercept errors from a Unicorn proxy_pass and display a custom 40x error page that is located on disk. This is what a subscript of my config: proxy_intercept_errors on; error_page 400 403 =404 /404.html; location /404.html { allow all; internal; } When I receive a 403 error from NGINX it is passing to the location and rendering the 404.html error page in my root. When the upstream returns a 400 response NGINX is intercepting it but not rendering the 404.html file, instead it returns the generic NGINX 400 error response page. Thank you in advance! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Sep 30 20:15:41 2011 From: lists at ruby-forum.com (Jamie W.) Date: Fri, 30 Sep 2011 22:15:41 +0200 Subject: intercepted 400 errors not displaying custom error page In-Reply-To: <522f3010f47fced94ec3b41c0dc7646a@ruby-forum.com> References: <522f3010f47fced94ec3b41c0dc7646a@ruby-forum.com> Message-ID: Update: It seems that all response codes I specify in error_page are intercepted by NGINX but do not pass to the /404.html location to render the custom error page. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Sep 30 20:31:06 2011 From: lists at ruby-forum.com (Jamie W.) Date: Fri, 30 Sep 2011 22:31:06 +0200 Subject: intercepted 400 errors not displaying custom error page In-Reply-To: <522f3010f47fced94ec3b41c0dc7646a@ruby-forum.com> References: <522f3010f47fced94ec3b41c0dc7646a@ruby-forum.com> Message-ID: My solution was to enable recursive_error_pages -- Posted via http://www.ruby-forum.com/. From liseen.wan at gmail.com Fri Sep 30 22:06:28 2011 From: liseen.wan at gmail.com (liseen) Date: Sat, 1 Oct 2011 06:06:28 +0800 Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: Hi, It is a bug. the ngx_upstream_get_peer only check the index greater than i; forgot to check i itself. I used my nginx patch for healthcheck, I have used it in production more than half a year. I will upload it to my github in some hours. liseen On Fri, Sep 23, 2011 at 4:34 AM, Sjaak Pieterse wrote: > Hi there, > > i'm trying to use the HttpHealthcheckModule for nginx, but i have some > troubles with it. > > i have two servers in my upstream, when sabotaging the health for one > server i see in the status view of healthcheck that the server is > down(1), but if i go to the website i'm checking i still come out on > it and see a broken page. > > how can i arrange that the server automatically is marked as down when > the check fails? > > sorry for my bad english and maybe noob questions. > > config: > upstream www-health{ > server x.x.x.1 ; > server x.x.x.2 ; > healthcheck_enabled; > healthcheck_delay 10000 ; > healthcheck_timeout 1000; > healthcheck_failcount 2; > #healthcheck_expected 'I_AM_ALIVE'; > #Important: HTTP/1.0 > healthcheck_send "GET / HTTP/1.0" 'Host: health.test.x.com' > 'Conection: close' ; > } > > nginx: nginx version: nginx/1.0.6 > nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) > nginx: TLS SNI support enabled > nginx: configure arguments: --with-http_ssl_module > --add-module=/gnosek-nginx-upstream-fair-2131c73 > --with-http_stub_status_module > --add-module=/cep21-healthcheck_nginx_upstreams-b33a846 > --prefix=/usr/local/nginx-1.0.6 --with-debug > > used: > peckhardt at test-nginx:~/nginx-1.0.6$patch -p1 < > /cep21-healthcheck_nginx_upstreams-5fa4bff/nginx.patch > > hope someone would help me. > > greetings > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From liseen.wan at gmail.com Fri Sep 30 23:16:02 2011 From: liseen.wan at gmail.com (liseen) Date: Sat, 1 Oct 2011 07:16:02 +0800 Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: Hi, Please try: https://github.com/liseen/healthcheck_nginx_upstreams/blob/master/healthcheck.patch patch -p1 < healthcheck.patch ./configure .... if you use healthcheck with upstream hash, please compile with branch support_http_healthchecks of cep21's fork https://github.com/cep21/nginx_upstream_hash/tree/support_http_healthchecks liseen On Sat, Oct 1, 2011 at 6:06 AM, liseen wrote: > Hi, > > It is a bug. > > the ngx_upstream_get_peer only check the index greater than i; forgot to > check i itself. > > I used my nginx patch for healthcheck, I have used it in production more > than half a year. I will upload it to my github in some hours. > > liseen > > On Fri, Sep 23, 2011 at 4:34 AM, Sjaak Pieterse wrote: > >> Hi there, >> >> i'm trying to use the HttpHealthcheckModule for nginx, but i have some >> troubles with it. >> >> i have two servers in my upstream, when sabotaging the health for one >> server i see in the status view of healthcheck that the server is >> down(1), but if i go to the website i'm checking i still come out on >> it and see a broken page. >> >> how can i arrange that the server automatically is marked as down when >> the check fails? >> >> sorry for my bad english and maybe noob questions. >> >> config: >> upstream www-health{ >> server x.x.x.1 ; >> server x.x.x.2 ; >> healthcheck_enabled; >> healthcheck_delay 10000 ; >> healthcheck_timeout 1000; >> healthcheck_failcount 2; >> #healthcheck_expected 'I_AM_ALIVE'; >> #Important: HTTP/1.0 >> healthcheck_send "GET / HTTP/1.0" 'Host: health.test.x.com' >> 'Conection: close' ; >> } >> >> nginx: nginx version: nginx/1.0.6 >> nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) >> nginx: TLS SNI support enabled >> nginx: configure arguments: --with-http_ssl_module >> --add-module=/gnosek-nginx-upstream-fair-2131c73 >> --with-http_stub_status_module >> --add-module=/cep21-healthcheck_nginx_upstreams-b33a846 >> --prefix=/usr/local/nginx-1.0.6 --with-debug >> >> used: >> peckhardt at test-nginx:~/nginx-1.0.6$patch -p1 < >> /cep21-healthcheck_nginx_upstreams-5fa4bff/nginx.patch >> >> hope someone would help me. >> >> greetings >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: