From r at roze.lv Sat Oct 1 01:49:38 2011 From: r at roze.lv (Reinis Rozitis) Date: Sat, 1 Oct 2011 04:49:38 +0300 Subject: Question regarding Nginx Configuration In-Reply-To: <2e6ad2d68b975059a0860f81a2f19b41.NginxMailingListEnglish@forum.nginx.org> References: <2e6ad2d68b975059a0860f81a2f19b41.NginxMailingListEnglish@forum.nginx.org> Message-ID: > Is it possible for location blocks to exist within the main http block at > a higher level than the server block? No, but if you have a lots of repeating configuration/locations in the server blocks you can move those to a seperate file and then use include ( http://wiki.nginx.org/CoreModule#include ) instead. rr From igor at sysoev.ru Sat Oct 1 06:07:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 1 Oct 2011 10:07:02 +0400 Subject: nginx-1.0.8 Message-ID: <20111001060701.GB97776@nginx.com> Changes with nginx 1.0.8 01 Oct 2011 *) Bugfix: nginx could not be built --with-http_mp4_module and without --with-debug option. -- Igor Sysoev From liseen.wan at gmail.com Sat Oct 1 08:34:37 2011 From: liseen.wan at gmail.com (liseen) Date: Sat, 1 Oct 2011 16:34:37 +0800 Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: Hi, On Sat, Oct 1, 2011 at 7:16 AM, liseen wrote: > 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 > if all upstreams' backends are down(healthcheck), cep's upstream_hash will ignore Healthcheck, if it is not you need, Please try: https://github.com/liseen/nginx_upstream_hash If you find something wrong, please open an issue on github. thanks. liseen > > 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: From nginx-forum at nginx.us Sat Oct 1 11:50:06 2011 From: nginx-forum at nginx.us (siloan) Date: Sat, 01 Oct 2011 07:50:06 -0400 Subject: GET issue Message-ID: Hi, i have a application that through sockets sends some data to my web page like touching link.php?name=john&age=32, with apache everything is ok that values are grabbed and inserted in the db but with nginx(all versions since 1.0.4) there is no action although i see in logs that my app is touching that link .. any ideas please? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216153,216153#msg-216153 From nginx-forum at nginx.us Sat Oct 1 12:07:03 2011 From: nginx-forum at nginx.us (dougconran) Date: Sat, 01 Oct 2011 08:07:03 -0400 Subject: Question regarding Nginx Configuration In-Reply-To: <2e6ad2d68b975059a0860f81a2f19b41.NginxMailingListEnglish@forum.nginx.org> References: <2e6ad2d68b975059a0860f81a2f19b41.NginxMailingListEnglish@forum.nginx.org> Message-ID: <14561c79dee2e1efd2bba9a5f8730b96.NginxMailingListEnglish@forum.nginx.org> Yes, I thought of that and it would certainly reduce the amount of duplication. However I do think that there are times when location directives apply to the whole server (the real server, that is, not the virtual host) and it would be nice to be able to use them at the higher level. Maybe that is one for the wishlist? Doug Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216128,216154#msg-216154 From admin at hostmsr.net Sun Oct 2 07:51:10 2011 From: admin at hostmsr.net (Hostmsr.net) Date: Sun, 2 Oct 2011 09:51:10 +0200 Subject: Internal Server Error Message-ID: Hello, I have big problem from seven days All my websites down and this massage appeared Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I send to cpanel support and he said Hello, I went to the URL provided, and see an error related to nginx. Please note that we are unable to provide support for mod_rpaf or nginx, as they are 3rd party products. Once nginx is disabled, if you are still experiencing issues with your sites, please let me know so I can look into this further. when i open the logs grep "Oct 01" /etc/httpd/logs/error_log |grep -v "File does not exist" |tail -50 This errors appeared [Sat Oct 01 18:24:01 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:01 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:02 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:02 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:02 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:02 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:02 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:02 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:03 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:03 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:03 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:03 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:03 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:04 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! [Sat Oct 01 18:24:04 2011] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring! I Tried to restart nginx but this error appeared [alert]: could not open error log file: open() "/var /log/nginx/error.log" failed (30: Read-only file system) the configuration file /etc/nginx/nginx.conf syntax is ok 2011/10/02 09:26:31 [emerg] 20667#0: open() "/var/run/nginx.pid" failed (30: Read-only file system) configuration file /etc/nginx/nginx.conf test failed Can any one help me in my problem ? iam waiting you thanks alot -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Oct 2 12:34:20 2011 From: nginx-forum at nginx.us (tcbarrett) Date: Sun, 02 Oct 2011 08:34:20 -0400 Subject: Best way to burst static file cache In-Reply-To: <2ca1c0cfbd552de1033411ef7ba73187.NginxMailingListEnglish@forum.nginx.org> References: <0668d2360623a0b4f9f9c84c0ab39f30.NginxMailingListEnglish@forum.nginx.org> <2ca1c0cfbd552de1033411ef7ba73187.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3171f852117d68e888e96a1ecee04b50.NginxMailingListEnglish@forum.nginx.org> kaspars Wrote: ------------------------------------------------------- > Well, if you set cache to expire 30 years from now > the browser should honor that, that is if no > Last-Modified is set. I have it set to 30m (30 minutes, right?). If I update, for example, some css files and then a do a hard refresh on a) a Mac then I get the new css or b) Windows 7 then I keep getting the cached css files. Is there any technique to burst this caching. It might not be a 'pure nginx' solution, but anything that could be supported by an nginx config setting? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215835,216179#msg-216179 From igor at sysoev.ru Sun Oct 2 13:15:16 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 2 Oct 2011 17:15:16 +0400 Subject: Question regarding Nginx Configuration In-Reply-To: <14561c79dee2e1efd2bba9a5f8730b96.NginxMailingListEnglish@forum.nginx.org> References: <2e6ad2d68b975059a0860f81a2f19b41.NginxMailingListEnglish@forum.nginx.org> <14561c79dee2e1efd2bba9a5f8730b96.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111002131516.GC26136@nginx.com> On Sat, Oct 01, 2011 at 08:07:03AM -0400, dougconran wrote: > Yes, I thought of that and it would certainly reduce the amount of > duplication. However I do think that there are times when location > directives apply to the whole server (the real server, that is, not the > virtual host) and it would be nice to be able to use them at the higher > level. > > Maybe that is one for the wishlist? Locations, Directories, and other blocks in the global server configuration is one of features I never liked in Apache, so this is reason why they were not implemented in nginx. -- Igor Sysoev From lists at wildgooses.com Sun Oct 2 13:15:46 2011 From: lists at wildgooses.com (Ed W) Date: Sun, 02 Oct 2011 14:15:46 +0100 Subject: Best way to burst static file cache In-Reply-To: <3171f852117d68e888e96a1ecee04b50.NginxMailingListEnglish@forum.nginx.org> References: <0668d2360623a0b4f9f9c84c0ab39f30.NginxMailingListEnglish@forum.nginx.org> <2ca1c0cfbd552de1033411ef7ba73187.NginxMailingListEnglish@forum.nginx.org> <3171f852117d68e888e96a1ecee04b50.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4E886402.2010300@wildgooses.com> On 02/10/2011 13:34, tcbarrett wrote: > kaspars Wrote: > ------------------------------------------------------- >> Well, if you set cache to expire 30 years from now >> the browser should honor that, that is if no >> Last-Modified is set. > I have it set to 30m (30 minutes, right?). If I update, for example, > some css files and then a do a hard refresh on a) a Mac then I get the > new css or b) Windows 7 then I keep getting the cached css files. > > Is there any technique to burst this caching. It might not be a 'pure > nginx' solution, but anything that could be supported by an nginx config > setting? > What everyone else does is set the URLs to be unique and then change the url when the asset is updated. eg a simple example which rails uses and arguably isn't perfect would be: /assets/blah.jpg?12333234 The random string after the ? could be generated in various ways, eg incrementing counter or it could be the epoch time of the file mtime (ie age in seconds) Now you can set expire time to 30 years and when the asset is updated you simply arrange for the url to be updated in the html and a "new" image is pulled down Implementation left to the reader as an exercise... Ed W From kworthington at gmail.com Sun Oct 2 15:11:33 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Sun, 2 Oct 2011 11:11:33 -0400 Subject: nginx-1.0.8 In-Reply-To: <20111001060701.GB97776@nginx.com> References: <20111001060701.GB97776@nginx.com> Message-ID: Hello Nginx Users, I just released Nginx 1.0.8 For Windows http://goo.gl/tq6e3 (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 Sat, Oct 1, 2011 at 2:07 AM, Igor Sysoev wrote: > Changes with nginx 1.0.8 01 Oct > 2011 > > *) Bugfix: nginx could not be built --with-http_mp4_module and without > --with-debug option. > > > -- > 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 at nginxuser.net Sun Oct 2 18:38:18 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 2 Oct 2011 21:38:18 +0300 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: On 29 September 2011 16:33, Sergey Budnevitch wrote: > > 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. > Follow this guide to build from source: http://articles.slicehost.com/2009/2/2/centos-installing-nginx-from-source -------------- next part -------------- An HTML attachment was scrubbed... URL: From gary.wilson at gmail.com Sun Oct 2 22:07:23 2011 From: gary.wilson at gmail.com (Gary Wilson Jr.) Date: Sun, 2 Oct 2011 17:07:23 -0500 Subject: retrying proxy connect timeouts but not read timeouts Message-ID: I've got a proxy + upstream setup with three defined upstream servers. I would like nginx to retry requests when there is an error or when there is a connection timeout (but not a read timeout). However, it appears that proxy_next_upstream only has the granularity of "error" and "timeout". Is there any way to have proxy_next_upstream differentiate between connection timeout and read timeout? If not, is creating a ticket in the bug tracker the proper way to request such a feature? Thanks, Gary From gary.wilson at gmail.com Sun Oct 2 22:11:59 2011 From: gary.wilson at gmail.com (Gary Wilson Jr.) Date: Sun, 2 Oct 2011 17:11:59 -0500 Subject: number of upstream definitions, and a suggestion Message-ID: I currently have maybe a couple hundred upstream definitions but am likely to grow to thousands. Are there any practical or theoretical limits to the number of upstream definitions that can exist in one nginx instance? Anyone out there making use of this many upstream definitions? On a side note, I think it would be cool if upstream identifiers could be combined with port numbers so that a single upstream definition that defined servers could be combined with multiple proxy_pass definitions that only differ by port. For example, a configuration like this: upstream app1 { server server1:port1; server server2:port1; server server3:port1; } upstream app2 { server server1:port2; server server2:port2; server server3:port2; } ... location /app1 { proxy_pass http://app1; } location /app2 { proxy_pass http://app2; } ... Could be replaced by a setup like this: upstream cluster1 { server server1; server server2; server server3; } location /app1 { proxy_pass http://cluster1:port1; } location /app2 { proxy_pass http://cluster1:port2; } ... The latter would require 1 upstream definition and N proxy_pass definitions instead of N upstream definitions (where the list of servers doesn't change, only the port numbers) and N proxy_pass definitions. Thoughts? Gary From nginx-forum at nginx.us Mon Oct 3 13:12:15 2011 From: nginx-forum at nginx.us (dougconran) Date: Mon, 03 Oct 2011 09:12:15 -0400 Subject: Question regarding Nginx Configuration In-Reply-To: <20111002131516.GC26136@nginx.com> References: <20111002131516.GC26136@nginx.com> Message-ID: <3a4daa1f3ab7fc2445a029e7094867ea.NginxMailingListEnglish@forum.nginx.org> Igor Sysoev Wrote: ------------------------------------------------------- > > Locations, Directories, and other blocks in the > global server > configuration is one of features I never liked in > Apache, so > this is reason why they were not implemented in > nginx. > > > -- > Igor Sysoev > I guess that is certainly enough reason not to include them in Nginx - and thank you for making a very good alternative available, I certainly couldn't do any better! My question, originally, was about whether I had correctly understood how to construct the conf file; or whether it could be done more efficiently and I had not understood how to do that. However, my config works and it was a lot easier than Apache - maybe I should just count my blessings. Doug Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216128,216210#msg-216210 From nginx-forum at nginx.us Mon Oct 3 14:01:53 2011 From: nginx-forum at nginx.us (firestorm) Date: Mon, 03 Oct 2011 10:01:53 -0400 Subject: Problem with GZIP In-Reply-To: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> Message-ID: <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> Using firefox?s plg-in firebug I can check gzip support it?s not enabled: There are 8 plain text components that should be sent compressed http://10.128.50.101/css/principal.css http://10.128.50.101/css/blueprint/screen.css http://10.128.50.101/css/learning/learningp.css http://10.128.50.101/css/learning/learningm.css http://10.128.50.101/css/blueprint/plugins/dashboard/buttons.css http://10.128.50.101/css/learning/lear_dashboard.css http://10.128.50.101/sfJqueryReloadedPlugin/css/plugins/jquery.fancybox.css http://10.128.50.101/js/js_c7b7c377449a5aad6e7bad82bfa9d21a.js Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216030,216213#msg-216213 From nginx-forum at nginx.us Mon Oct 3 14:04:16 2011 From: nginx-forum at nginx.us (firestorm) Date: Mon, 03 Oct 2011 10:04:16 -0400 Subject: Problem with GZIP In-Reply-To: <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> Message-ID: <80be4b409a2be09686f3e4baa9009a93.NginxMailingListEnglish@forum.nginx.org> 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:1 f:0 0872B620, pos 0872B620, size: 366 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter: l:0 f:0 s:366 2011/09/29 07:44:01 [debug] 14365#0: *1 http cacheable: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream process upstream 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe read upstream: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe preread: 3873 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 01 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 06 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 01 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 99 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record length: 39168 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #0 086E16B0 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 086E16B0 3864 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 0872C548:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #1 0872C548 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 0872C548 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 0872D550:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #2 0872D550 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 0872D550 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 0872E558:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #3 0872E558 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 0872E558 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 0872F560:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #4 0872F560 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 0872F560 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 08730568:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #5 08730568 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 08730568 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 08731570:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #6 08731570 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 08731570 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 08732578:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #7 08732578 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 08732578 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 08733580:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 1:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #8 08733580 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 08733580 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe downstream ready 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 086E15C8, pos 086E16B0, size: 3864 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 0872C548, pos 0872C548, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 0872D550, pos 0872D550, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 0872E558, pos 0872E558, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 0872F560, pos 0872F560, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 08730568, pos 08730568, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 08731570, pos 08731570, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 08732578, pos 08732578, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf in s:1 t:1 f:0 08733580, pos 08733580, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe length: -1 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write downstream: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 086E16B0 3864 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 0872C548 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 0872D550 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:0872B874, f:1 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" 0872B838 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: B76F1008:270336 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip alloc: n:1 s:5824 a:8192 p:B76F1008 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip alloc: n:32768 s:2 a:65536 p:B76F3008 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip alloc: n:32768 s:2 a:65536 p:B7703008 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip alloc: n:32768 s:2 a:65536 p:B7713008 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip alloc: n:16384 s:4 a:65536 p:B7723008 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BC84 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B840 ni:086E16B0 ai:3864 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 08734588:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:086E16B0 no:08734588 ai:3864 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:086E25C8 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B840 pos:086E16B0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BC8C 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B8B8 ni:0872C548 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:0872C548 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:0872D548 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B8B8 pos:0872C548 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 0872D550 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 0872E558 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 0872F560 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:0872B964, f:1 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" 0872BCD0 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BCE0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B930 ni:0872D550 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:0872D550 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:0872E550 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B930 pos:0872D550 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BCE8 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B9A8 ni:0872E558 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:0872E558 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:0872F558 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872B9A8 pos:0872E558 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 0872F560 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 08730568 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 08731570 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:0872BA54, f:1 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" 0872BCF0 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD00 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BA20 ni:0872F560 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:0872F560 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:08730560 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BA20 pos:0872F560 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD08 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BA98 ni:08730568 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:08730568 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:08731568 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BA98 pos:08730568 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 08731570 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 08732578 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 08733580 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:0872BB44, f:1 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" 0872BD10 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD20 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BB10 ni:08731570 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:08731570 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:08732570 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BB10 pos:08731570 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD28 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BB88 ni:08732578 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:08732578 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:08733578 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BB88 pos:08732578 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write buf ls:1 08733580 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:0872BC34, f:0 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" 0872BC34 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD30 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BC00 ni:08733580 ai:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:08733580 no:08734588 ai:4096 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:08734580 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BC00 pos:08733580 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:00000000, f:0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe read upstream: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 9:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 2536 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 9:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 readv() not ready (11: Resource temporarily unavailable) 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: -2 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08733580, pos 08733580, size: 2536 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08731570, pos 08731570, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08732578, pos 08732578, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872F560, pos 0872F560, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08730568, pos 08730568, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872D550, pos 0872D550, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872E558, pos 0872E558, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 086E15C8, pos 086E15C8, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872C548, pos 0872C548, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe length: -1 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write downstream: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write busy: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write: out:00000000, f:0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe read upstream: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08733580, pos 08733580, size: 2536 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08731570, pos 08731570, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08732578, pos 08732578, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872F560, pos 0872F560, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08730568, pos 08730568, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872D550, pos 0872D550, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872E558, pos 0872E558, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 086E15C8, pos 086E15C8, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872C548, pos 0872C548, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe length: -1 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer del: 12: 3036708358 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer add: 12: 60000:3036709099 2011/09/29 07:44:01 [debug] 14365#0: posted event 00000000 2011/09/29 07:44:01 [debug] 14365#0: worker cycle 2011/09/29 07:44:01 [debug] 14365#0: accept mutex locked 2011/09/29 07:44:01 [debug] 14365#0: epoll timer: 60000 2011/09/29 07:44:01 [debug] 14365#0: epoll: fd:12 ev:0004 d:086F8655 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: timer delta: 11 2011/09/29 07:44:01 [debug] 14365#0: posted events 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: posted event 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream request: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream dummy handler 2011/09/29 07:44:01 [debug] 14365#0: posted event 00000000 2011/09/29 07:44:01 [debug] 14365#0: worker cycle 2011/09/29 07:44:01 [debug] 14365#0: accept mutex locked 2011/09/29 07:44:01 [debug] 14365#0: epoll timer: 59989 2011/09/29 07:44:01 [debug] 14365#0: epoll: fd:12 ev:0005 d:086F8655 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 087115CC 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: timer delta: 40 2011/09/29 07:44:01 [debug] 14365#0: posted events 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: posted event 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 0871E5D4 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream request: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream dummy handler 2011/09/29 07:44:01 [debug] 14365#0: posted event 087115CC 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 087115CC 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream request: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream process upstream 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe read upstream: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 9:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 16 2011/09/29 07:44:01 [debug] 14365#0: *1 readv: 9:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe recv chain: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08733580, pos 08733580, size: 2552 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08731570, pos 08731570, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08732578, pos 08732578, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872F560, pos 0872F560, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 08730568, pos 08730568, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872D550, pos 0872D550, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872E558, pos 0872E558, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 086E15C8, pos 086E15C8, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe buf free s:0 t:1 f:0 0872C548, pos 0872C548, size: 0 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe length: -1 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf #9 08733580 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 01 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 03 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 01 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 08 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record byte: 00 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi record length: 8 2011/09/29 07:44:01 [debug] 14365#0: *1 http fastcgi sent end request 2011/09/29 07:44:01 [debug] 14365#0: *1 input buf 08733580 2536 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 08731570 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 08732578 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 0872F560 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 08730568 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 0872D550 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 0872E558 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086E15C8 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 0872C548 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write downstream: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write downstream flush in 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" 0872BC34 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD40 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BC00 ni:08733580 ai:2536 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:08733580 no:08734588 ai:2536 ao:4096 fl:0 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:08733F68 no:08734588 ai:0 ao:4096 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BC00 pos:08733580 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 pipe write downstream done 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer: 12, old: 3036709099, new: 3036709150 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream exit: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 finalize http upstream request: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 finalize http fastcgi request 2011/09/29 07:44:01 [debug] 14365#0: *1 free rr peer 1 0 2011/09/29 07:44:01 [debug] 14365#0: *1 close http upstream connection: 12 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086DA5B0, unused: 88 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer del: 12: 3036709099 2011/09/29 07:44:01 [debug] 14365#0: *1 reusable connection: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 http upstream temp fd: -1 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/administration.php/sf_guard_group?" BFEEF108 2011/09/29 07:44:01 [debug] 14365#0: *1 http gzip filter 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in: 0872BD7C 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BD48 ni:00000000 ai:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:00000000 no:08734588 ai:0 ao:4096 fl:4 redo:0 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:00000000 no:08735588 ai:0 ao:0 rc:0 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BD48 pos:00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 086E15C8:4096 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate in: ni:00000000 no:086E15C8 ai:0 ao:4096 fl:4 redo:1 2011/09/29 07:44:01 [debug] 14365#0: *1 deflate out: ni:00000000 no:086E1DAD ai:0 ao:2075 rc:1 2011/09/29 07:44:01 [debug] 14365#0: *1 gzip in_buf:0872BD48 pos:00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: B76F1008 2011/09/29 07:44:01 [debug] 14365#0: *1 http chunk: 10 2011/09/29 07:44:01 [debug] 14365#0: *1 http chunk: 4096 2011/09/29 07:44:01 [debug] 14365#0: *1 http chunk: 2029 2011/09/29 07:44:01 [debug] 14365#0: *1 write old buf t:1 f:0 0872B620, pos 0872B620, size: 366 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:1 f:0 0872BE58, pos 0872BE58, size: 6 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:0 f:0 00000000, pos 080CAFE4, size: 10 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:1 f:0 08734588, pos 08734588, size: 4096 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:1 f:0 086E15C8, pos 086E15C8, size: 2029 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:0 f:0 00000000, pos 080BF4DC, size: 7 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter: l:1 f:1 s:6514 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter limit 0 2011/09/29 07:44:01 [debug] 14365#0: *1 writev: 6514 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/administration.php/sf_guard_group?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http finalize request: 0, "/administration.php/sf_guard_group?" a:1, c:1 2011/09/29 07:44:01 [debug] 14365#0: *1 set http keepalive handler 2011/09/29 07:44:01 [debug] 14365#0: *1 http close request 2011/09/29 07:44:01 [debug] 14365#0: *1 http log handler 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 08734588 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 08733580 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086E15C8 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086E05C0, unused: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 0872B540, unused: 1426 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer add: 11: 5000:3036654150 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086E0310 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086DFF08 2011/09/29 07:44:01 [debug] 14365#0: *1 hc free: 00000000 0 2011/09/29 07:44:01 [debug] 14365#0: *1 hc busy: 00000000 0 2011/09/29 07:44:01 [debug] 14365#0: *1 reusable connection: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 08711598 2011/09/29 07:44:01 [debug] 14365#0: posted event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 http keepalive handler 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 086DFF08:1024 2011/09/29 07:44:01 [debug] 14365#0: *1 recv: fd:11 -1 of 1024 2011/09/29 07:44:01 [debug] 14365#0: *1 recv() not ready (11: Resource temporarily unavailable) 2011/09/29 07:44:01 [debug] 14365#0: posted event 00000000 2011/09/29 07:44:01 [debug] 14365#0: worker cycle 2011/09/29 07:44:01 [debug] 14365#0: accept mutex locked 2011/09/29 07:44:01 [debug] 14365#0: epoll timer: 5000 2011/09/29 07:44:01 [debug] 14366#0: timer delta: 499 2011/09/29 07:44:01 [debug] 14366#0: posted events 00000000 2011/09/29 07:44:01 [debug] 14366#0: worker cycle 2011/09/29 07:44:01 [debug] 14366#0: accept mutex lock failed: 0 2011/09/29 07:44:01 [debug] 14366#0: epoll timer: 500 2011/09/29 07:44:01 [debug] 14367#0: timer delta: 500 2011/09/29 07:44:01 [debug] 14367#0: posted events 00000000 2011/09/29 07:44:01 [debug] 14367#0: worker cycle 2011/09/29 07:44:01 [debug] 14367#0: accept mutex lock failed: 0 2011/09/29 07:44:01 [debug] 14367#0: epoll timer: 500 2011/09/29 07:44:01 [debug] 14368#0: timer delta: 500 2011/09/29 07:44:01 [debug] 14368#0: posted events 00000000 2011/09/29 07:44:01 [debug] 14368#0: worker cycle 2011/09/29 07:44:01 [debug] 14368#0: accept mutex lock failed: 0 2011/09/29 07:44:01 [debug] 14368#0: epoll timer: 500 2011/09/29 07:44:01 [debug] 14365#0: epoll: fd:11 ev:0005 d:086F85F0 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 0871E5A0 2011/09/29 07:44:01 [debug] 14365#0: timer delta: 197 2011/09/29 07:44:01 [debug] 14365#0: posted events 0871E5A0 2011/09/29 07:44:01 [debug] 14365#0: posted event 0871E5A0 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 0871E5A0 2011/09/29 07:44:01 [debug] 14365#0: *1 http empty handler 2011/09/29 07:44:01 [debug] 14365#0: posted event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 http keepalive handler 2011/09/29 07:44:01 [debug] 14365#0: *1 recv: fd:11 441 of 1024 2011/09/29 07:44:01 [debug] 14365#0: *1 reusable connection: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 086E0310:680 2011/09/29 07:44:01 [debug] 14365#0: *1 posix_memalign: 086E05C0:4096 @16 2011/09/29 07:44:01 [debug] 14365#0: *1 http process request line 2011/09/29 07:44:01 [debug] 14365#0: *1 http request line: "GET /css/blueprint/print.css HTTP/1.1" 2011/09/29 07:44:01 [debug] 14365#0: *1 http uri: "/css/blueprint/print.css" 2011/09/29 07:44:01 [debug] 14365#0: *1 http args: "" 2011/09/29 07:44:01 [debug] 14365#0: *1 http exten: "css" 2011/09/29 07:44:01 [debug] 14365#0: *1 http process request header line 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Host: 10.128.50.101" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Accept: text/css,*/*;q=0.1" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Accept-Encoding: gzip, deflate" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Connection: keep-alive" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Referer: http://10.128.50.101/administration.php/sf_guard_group" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header: "Cookie: zera=vmlib90drktmrpmo3gdra6hi12; has_js=1" 2011/09/29 07:44:01 [debug] 14365#0: *1 http header done 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer del: 11: 3036654150 2011/09/29 07:44:01 [debug] 14365#0: *1 generic phase: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 rewrite phase: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 test location: "/404.html" 2011/09/29 07:44:01 [debug] 14365#0: *1 test location: "/sf/" 2011/09/29 07:44:01 [debug] 14365#0: *1 test location: ~ ".+\.(js|htc|ico|gif|jpg|png|css)$" 2011/09/29 07:44:01 [debug] 14365#0: *1 using configuration ".+\.(js|htc|ico|gif|jpg|png|css)$" 2011/09/29 07:44:01 [debug] 14365#0: *1 http cl:-1 max:1048576 2011/09/29 07:44:01 [debug] 14365#0: *1 rewrite phase: 3 2011/09/29 07:44:01 [debug] 14365#0: *1 post rewrite phase: 4 2011/09/29 07:44:01 [debug] 14365#0: *1 generic phase: 5 2011/09/29 07:44:01 [debug] 14365#0: *1 generic phase: 6 2011/09/29 07:44:01 [debug] 14365#0: *1 generic phase: 7 2011/09/29 07:44:01 [debug] 14365#0: *1 access phase: 8 2011/09/29 07:44:01 [debug] 14365#0: *1 access phase: 9 2011/09/29 07:44:01 [debug] 14365#0: *1 post access phase: 10 2011/09/29 07:44:01 [debug] 14365#0: *1 content phase: 11 2011/09/29 07:44:01 [debug] 14365#0: *1 content phase: 12 2011/09/29 07:44:01 [debug] 14365#0: *1 content phase: 13 2011/09/29 07:44:01 [debug] 14365#0: *1 content phase: 14 2011/09/29 07:44:01 [debug] 14365#0: *1 content phase: 15 2011/09/29 07:44:01 [debug] 14365#0: *1 content phase: 16 2011/09/29 07:44:01 [debug] 14365#0: *1 http filename: "/var/www/appname/web/css/blueprint/print.css" 2011/09/29 07:44:01 [debug] 14365#0: *1 add cleanup: 086E0BEC 2011/09/29 07:44:01 [debug] 14365#0: *1 http static fd: 12 2011/09/29 07:44:01 [debug] 14365#0: *1 http set discard body 2011/09/29 07:44:01 [debug] 14365#0: *1 HTTP/1.1 200 OK Server: nginx/1.1.4 Date: Thu, 29 Sep 2011 11:44:01 GMT Content-Type: text/css Content-Length: 1285 Last-Modified: Wed, 28 Sep 2011 15:47:21 GMT Connection: keep-alive Expires: Thu, 31 Dec 2037 23:55:55 GMT Cache-Control: max-age=315360000 Accept-Ranges: bytes 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:1 f:0 086E0CFC, pos 086E0CFC, size: 289 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter: l:0 f:0 s:289 2011/09/29 07:44:01 [debug] 14365#0: *1 http output filter "/css/blueprint/print.css?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: "/css/blueprint/print.css?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http postpone filter "/css/blueprint/print.css?" BFEEF03C 2011/09/29 07:44:01 [debug] 14365#0: *1 write old buf t:1 f:0 086E0CFC, pos 086E0CFC, size: 289 file: 0, size: 0 2011/09/29 07:44:01 [debug] 14365#0: *1 write new buf t:0 f:1 00000000, pos 00000000, size: 0 file: 0, size: 1285 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter: l:1 f:0 s:1574 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter limit 0 2011/09/29 07:44:01 [debug] 14365#0: *1 writev: 289 2011/09/29 07:44:01 [debug] 14365#0: *1 sendfile: @0 1285 2011/09/29 07:44:01 [debug] 14365#0: *1 sendfile: 1285, @0 1285:1285 2011/09/29 07:44:01 [debug] 14365#0: *1 http write filter 00000000 2011/09/29 07:44:01 [debug] 14365#0: *1 http copy filter: 0 "/css/blueprint/print.css?" 2011/09/29 07:44:01 [debug] 14365#0: *1 http finalize request: 0, "/css/blueprint/print.css?" a:1, c:1 2011/09/29 07:44:01 [debug] 14365#0: *1 set http keepalive handler 2011/09/29 07:44:01 [debug] 14365#0: *1 http close request 2011/09/29 07:44:01 [debug] 14365#0: *1 http log handler 2011/09/29 07:44:01 [debug] 14365#0: *1 run cleanup: 086E0BEC 2011/09/29 07:44:01 [debug] 14365#0: *1 file cleanup: fd:12 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086E05C0, unused: 1631 2011/09/29 07:44:01 [debug] 14365#0: *1 event timer add: 11: 5000:3036654347 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086E0310 2011/09/29 07:44:01 [debug] 14365#0: *1 free: 086DFF08 2011/09/29 07:44:01 [debug] 14365#0: *1 hc free: 00000000 0 2011/09/29 07:44:01 [debug] 14365#0: *1 hc busy: 00000000 0 2011/09/29 07:44:01 [debug] 14365#0: *1 reusable connection: 1 2011/09/29 07:44:01 [debug] 14365#0: *1 post event 08711598 2011/09/29 07:44:01 [debug] 14365#0: posted event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 delete posted event 08711598 2011/09/29 07:44:01 [debug] 14365#0: *1 http keepalive handler 2011/09/29 07:44:01 [debug] 14365#0: *1 malloc: 086DFF08:1024 2011/09/29 07:44:01 [debug] 14365#0: *1 recv: fd:11 -1 of 1024 2011/09/29 07:44:01 [debug] 14365#0: *1 recv() not ready (11: Resource temporarily unavailable) 2011/09/29 07:44:01 [debug] 14365#0: posted event 00000000 2011/09/29 07:44:01 [debug] 14365#0: worker cycle 2011/09/29 07:44:01 [debug] 14365#0: accept mutex locked 2011/09/29 07:44:01 [debug] 14365#0: epoll timer: 5000 2011/09/29 07:44:01 [debug] 14365#0: epoll: fd:6 ev:0001 d:086F8528 2011/09/29 07:44:01 [debug] 14365#0: post event 08711530 2011/09/29 07:44:01 [debug] 14365#0: timer delta: 10 2011/09/29 07:44:01 [debug] 14365#0: posted event 08711530 2011/09/29 07:44:01 [debug] 14365#0: delete posted event 08711530 2011/09/29 07:44:01 [debug] 14365#0: accept on 0.0.0.0:80, ready: 0 2011/09/29 07:44:01 [debug] 14365#0: posix_memalign: 086E0310:256 @16 2011/09/29 07:44:01 [debug] 14365#0: *4 accept: 10.35.9.129 fd:12 2011/09/29 07:44:01 [debug] 14365#0: *4 event timer add: 12: 60000:3036709357 2011/09/29 07:44:01 [debug] 14365#0: *4 epoll add event: fd:12 op:1 ev:80000001 2011/09/29 07:44:01 [debug] 14365#0: posted event 00000000 2011/09/29 07:44:01 [debug] 14365#0: posted events 00000000 2011/09/29 07:44:01 [debug] 14365#0: worker cycle 2011/09/29 07:44:01 [debug] 14365#0: accept mutex locked 2011/09/29 07:44:01 [debug] 14365#0: epoll timer: 4990 2011/09/29 07:44:01 [debug] 14365#0: epoll: fd:6 ev:0001 d:086F8528 2011/09/29 07:44:01 [debug] 14365#0: post event 08711530 2011/09/29 07:44:01 [debug] 14365#0: timer delta: 8 2011/09/29 07:44:01 [debug] 14365#0: posted event 08711530 2011/09/29 07:44:01 [debug] 14365#0: delete posted event 08711530 2011/09/29 07:44:01 [debug] 14365#0: accept on 0.0.0.0:80, ready: 0 2011/09/29 07:44:01 [debug] 14365#0: posix_memalign: 086E0440:256 @16 2011/09/29 07:44:01 [debug] 14365#0: *5 accept: 10.35.9.129 fd:13 2011/09/29 07:44:01 [debug] 14365#0: *5 event timer add: 13: 60000:3036709365 2011/09/29 07:44:01 [debug] 14365#0: *5 epoll add event: fd:13 op:1 ev:80000001 2011/09/29 07:44:01 [debug] 14365#0: posted event 00000000 2011/09/29 07:44:01 [debug] 14365#0: posted events 00000000 2011/09/29 07:44:01 [debug] 14365#0: worker cycle 2011/09/29 07:44:01 [debug] 14365#0: accept mutex locked 2011/09/29 07:44:01 [debug] 14365#0: epoll timer: 4982 2011/09/29 07:44:01 [debug] 14365#0: epoll: fd:12 ev:0001 d:086F8654 2011/09/29 07:44:01 [debug] 14365#0: *4 post event 087115CC 2011/09/29 07:44:01 [debug] 14365#0: timer delta: 5 2011/09/29 07:44:01 [debug] 14365#0: posted events 087115CC 2011/09/29 07:44:01 [debug] 14365#0: posted event 087115CC 2011/09/29 07:44:01 [debug] 14365#0: *4 delete posted event 087115CC 2011/09/29 07:44:01 [debug] 14365#0: *4 malloc: 086E0548:680 2011/09/29 07:44:01 [debug] 14365#0: *4 malloc: 086E07F8:1024 2011/09/29 07:44:01 [debug] 14365#0: *4 posix_memalign: 086E0C00:4096 @16 2011/09/29 07:44:01 [debug] 14365#0: *4 http process request line 2011/09/29 07:44:01 [debug] 14365#0: *4 recv: fd:12 458 of 1024 2011/09/29 07:44:01 [debug] 14365#0: *4 http request line: "GET /css/administration/modules/dashboard.css HTTP/1.1" 2011/09/29 07:44:01 [debug] 14365#0: *4 http uri: "/css/administration/modules/dashboard.css" 2011/09/29 07:44:01 [debug] 14365#0: *4 http args: "" 2011/09/29 07:44:01 [debug] 14365#0: *4 http exten: "css" 2011/09/29 07:44:01 [debug] 14365#0: *4 http process request header line 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Host: 10.128.50.101" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Accept: text/css,*/*;q=0.1" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Accept-Encoding: gzip, deflate" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Connection: keep-alive" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Referer: http://10.128.50.101/administration.php/sf_guard_group" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header: "Cookie: zera=vmlib90drktmrpmo3gdra6hi12; has_js=1" 2011/09/29 07:44:01 [debug] 14365#0: *4 http header done 2011/09/29 07:44:01 [debug] 14365#0: *4 event timer del: 12: 3036709357 2011/09/29 07:44:01 [debug] 14365#0: *4 generic phase: 0 2011/09/29 07:44:01 [debug] 14365#0: *4 rewrite phase: 1 2011/09/29 07:44:01 [debug] 14365#0: *4 test location: "/404.html" 2011/09/29 07:44:01 [debug] 14365#0: *4 test location: "/sf/" 2011/09/29 07:44:01 [debug] 14365#0: *4 test location: ~ ".+\.(js|htc|ico|gif|jpg|png|css)$" 2011/09/29 07:44:01 [debug] 14365#0: *4 using configuration ".+\.(js|htc|ico|gif|jpg|png|css)$" 2011/09/29 07:44:01 [debug] 14365#0: *4 http cl:-1 max:1048576 2011/09/29 07:44:01 [debug] 14365#0: *4 rewrite phase: 3 2011/09/29 07:44:01 [debug] 14365#0: *4 post rewrite phase: 4 2011/09/29 07:44:01 [debug] 14365#0: *4 generic phase: 5 2011/09/29 07:44:01 [debug] 14365#0: *4 generic phase: 6 2011/09/29 07:44:01 [debug] 14365#0: *4 generic phase: 7 2011/09/29 07:44:01 [debug] 14365#0: *4 access phase: 8 2011/09/29 07:44:01 [debug] 14365#0: *4 access phase: 9 2011/09/29 07:44:01 [debug] 14365#0: *4 post access phase: 10 2011/09/29 07:44:01 [debug] 14365#0: *4 content phase: 11 2011/09/29 07:44:01 [debug] 14365#0: *4 content phase: 12 2011/09/29 07:44:01 [debug] 14365#0: *4 content phase: 13 2011/09/29 07:44:01 [debug] 14365#0: *4 content phase: 14 2011/09/29 07:44:01 [debug] 14365#0: *4 content phase: 15 2011/09/29 07:44:01 [debug] 14365#0: *4 content phase: 16 2011/09/29 07:44:01 [debug] 14365#0: *4 http filename: "/var/www/appname/web/css/administration/modules/dashboard.css" 2011/09/29 07:44:01 [debug] 14365#0: *4 add cleanup: 086E123C 2011/09/29 07:44:01 [debug] 14365#0: *4 http static fd: 14 2011/09/29 07:44:01 [debug] 14365#0: *4 http set discard body 2011/09/29 07:44:01 [debug] 14365#0: *4 HTTP/1.1 200 OK Server: nginx/1.1.4 Date: Thu, 29 Sep 2011 11:44:01 GMT Content-Type: text/css Content-Length: 3785 Last-Modified: Wed, 28 Sep 2011 15:47:21 GMT Connection: keep-alive Expires: Thu, 31 Dec 2037 23:55:55 GMT Cache-Control: max-age=315360000 Accept-Ranges: bytes Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216030,216214#msg-216214 From sjaak23 at gmail.com Mon Oct 3 14:39:32 2011 From: sjaak23 at gmail.com (Sjaak Pieterse) Date: Mon, 3 Oct 2011 16:39:32 +0200 Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: Hey Liseen, Thank you for teh fix, it's working now for standard round robin, for upstream_hash it's not working but that's no problem for us we are not using that in production. what we often use is gnosek-nginx-upstream-fair, to make it work with that, can you tell how to handle? this is what i've done to make it work for now: peckhardt at test-nginx:~/nginx-1.0.6$ patch -p1 < ../liseen-healthcheck_nginx_upstreams-17298cf/healthcheck.patch patching file src/http/ngx_http_upstream.c Hunk #1 succeeded at 4270 (offset 11 lines). patching file src/http/ngx_http_upstream.h patching file src/http/ngx_http_upstream_round_robin.c Hunk #2 succeeded at 25 with fuzz 2 (offset 9 lines). Hunk #3 succeeded at 33 (offset 9 lines). Hunk #4 succeeded at 68 (offset 9 lines). Hunk #5 succeeded at 416 (offset 7 lines). Hunk #6 succeeded at 448 (offset 7 lines). Hunk #7 succeeded at 465 (offset 7 lines). Hunk #8 succeeded at 506 (offset 7 lines). Hunk #9 succeeded at 523 (offset 7 lines). Hunk #10 succeeded at 617 (offset 7 lines). patching file src/http/ngx_http_upstream_round_robin.h peckhardt at test-nginx:~/nginx-1.0.6$sudo ./configure --with-http_ssl_module --add-module=/home/peckhardt/gnosek-nginx-upstream-fair-2131c73 --with-http_stub_status_module --add-module=/home/peckhardt/liseen-healthcheck_nginx_upstreams-17298cf --add-module=/home/peckhardt/liseen-nginx_upstream_hash-43fab03 --prefix=/usr/local/nginx-1.0.6 --with-debug peckhardt at test-nginx:~/nginx-1.0.6$sudo su peckhardt at test-nginx:~/nginx-1.0.6$make install clean nginx config: ########### test healthcheck ###### upstream www-health{ server 213.154.235.185 ; server 213.136.14.13 ; #hash $request_uri; #hash_again 1; 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'; } 2011/10/1 liseen : > Hi, > > On Sat, Oct 1, 2011 at 7:16 AM, liseen wrote: >> >> 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 > > if all upstreams' backends are down(healthcheck), ?cep's upstream_hash will > ignore Healthcheck, ?if it is not you need, Please try: > ? https://github.com/liseen/nginx_upstream_hash > If you find something wrong, ?please open an issue on github. thanks. > > liseen > >> >> >> >> 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 >>> >> > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From francis at daoine.org Mon Oct 3 14:53:45 2011 From: francis at daoine.org (Francis Daly) Date: Mon, 3 Oct 2011 15:53:45 +0100 Subject: Problem with GZIP In-Reply-To: <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111003145345.GJ12179@craic.sysops.org> On Mon, Oct 03, 2011 at 10:01:53AM -0400, firestorm wrote: Hi there, > Using firefox?s plg-in firebug I can check gzip support it?s not > enabled: > > There are 8 plain text components that should be sent compressed > http://10.128.50.101/css/principal.css Your config says gzip_types text/plain application/xml; Your output log says Content-Type: text/css Copy one big-enough file to a .txt-ending name -- for example copy dashboard.css to dashboard.txt -- and then try to access that file and see if it is gzipped. If it is, then include the right content types in your gzip_types config and it should Just Work. If it isn't, then more investigation is needed. Good luck, f -- Francis Daly francis at daoine.org From r at roze.lv Mon Oct 3 14:58:57 2011 From: r at roze.lv (Reinis Rozitis) Date: Mon, 3 Oct 2011 17:58:57 +0300 Subject: Problem with GZIP In-Reply-To: <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> Message-ID: <195530C36EB54104AC8B713A338CDDFA@DD21> > Using firefox?s plg-in firebug I can check gzip support it?s not enabled: > http://10.128.50.101/css/blueprint/screen.css Your configuration ( http://forum.nginx.org/read.php?2,216030,216213#msg-216213 ) is missing text/css from gzip_types. Which is returned by nginx so the gzip module doesn't do anything: 2011/09/29 07:44:01 [debug] 14365#0: *4 http filename: "/var/www/appname/web/css/administration/modules/dashboard.css" 2011/09/29 07:44:01 [debug] 14365#0: *4 HTTP/1.1 200 OK Server: nginx/1.1.4 Date: Thu, 29 Sep 2011 11:44:01 GMT Content-Type: text/css ^^^^^^^ The line probably should be (add or remove additional document types if needed): gzip_types text/plain text/css text/xml application/x-javascript; p.s. Also the IE regex can be simplified: gzip_disable msie6; rr From nginx-forum at nginx.us Mon Oct 3 15:09:47 2011 From: nginx-forum at nginx.us (firestorm) Date: Mon, 03 Oct 2011 11:09:47 -0400 Subject: Problem with GZIP In-Reply-To: <80be4b409a2be09686f3e4baa9009a93.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> <80be4b409a2be09686f3e4baa9009a93.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6d8b8e58e55a92e5d88a5b26e1712c8b.NginxMailingListEnglish@forum.nginx.org> My configuration now is: 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 application/x-javascript text/css; #gzip_disable msie6; and the problem remains. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216030,216219#msg-216219 From liseen.wan at gmail.com Mon Oct 3 17:53:13 2011 From: liseen.wan at gmail.com (liseen) Date: Tue, 4 Oct 2011 01:53:13 +0800 Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: Hi, sjaak On Mon, Oct 3, 2011 at 10:39 PM, Sjaak Pieterse wrote: > Hey Liseen, > > Thank you for teh fix, it's working now for standard round robin, for > upstream_hash it's not working but that's no problem for us we are not > using that in production. > The fail test also add one time to hash_again. Can you set hash_again 10(greater than or equal servers's number), try again and tell me the result? The upstream_hash module has worked for some time. what we often use is gnosek-nginx-upstream-fair, to make it work with > that, can you tell how to handle? > Patch the upstream-fair module like round_robin and upstream_hash module. Maybe these should be a module that contains all of the following features: RR, Hash, Fair, Health check. Hope some body will provide such module. I don't like patching code. > > > > this is what i've done to make it work for now: > > peckhardt at test-nginx:~/nginx-1.0.6$ patch -p1 < > ../liseen-healthcheck_nginx_upstreams-17298cf/healthcheck.patch > patching file src/http/ngx_http_upstream.c > Hunk #1 succeeded at 4270 (offset 11 lines). > patching file src/http/ngx_http_upstream.h > patching file src/http/ngx_http_upstream_round_robin.c > Hunk #2 succeeded at 25 with fuzz 2 (offset 9 lines). > Hunk #3 succeeded at 33 (offset 9 lines). > Hunk #4 succeeded at 68 (offset 9 lines). > Hunk #5 succeeded at 416 (offset 7 lines). > Hunk #6 succeeded at 448 (offset 7 lines). > Hunk #7 succeeded at 465 (offset 7 lines). > Hunk #8 succeeded at 506 (offset 7 lines). > Hunk #9 succeeded at 523 (offset 7 lines). > Hunk #10 succeeded at 617 (offset 7 lines). > patching file src/http/ngx_http_upstream_round_robin.h > > peckhardt at test-nginx:~/nginx-1.0.6$sudo ./configure > --with-http_ssl_module > --add-module=/home/peckhardt/gnosek-nginx-upstream-fair-2131c73 > --with-http_stub_status_module > --add-module=/home/peckhardt/liseen-healthcheck_nginx_upstreams-17298cf > --add-module=/home/peckhardt/liseen-nginx_upstream_hash-43fab03 > --prefix=/usr/local/nginx-1.0.6 --with-debug > > peckhardt at test-nginx:~/nginx-1.0.6$sudo su > peckhardt at test-nginx:~/nginx-1.0.6$make install clean > > nginx config: > ########### test healthcheck ###### > upstream www-health{ > server 213.154.235.185 ; > server 213.136.14.13 ; > #hash $request_uri; > #hash_again 1; > 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'; > } > > > > 2011/10/1 liseen : > > Hi, > > > > On Sat, Oct 1, 2011 at 7:16 AM, liseen wrote: > >> > >> 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 > > > > if all upstreams' backends are down(healthcheck), cep's upstream_hash > will > > ignore Healthcheck, if it is not you need, Please try: > > https://github.com/liseen/nginx_upstream_hash > > If you find something wrong, please open an issue on github. thanks. > > > > liseen > > > >> > >> > >> > >> 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 > >>> > >> > > > > > > _______________________________________________ > > 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 andrew.george.hammond at gmail.com Mon Oct 3 19:04:22 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Mon, 3 Oct 2011 12:04:22 -0700 Subject: upload module parameters issue Message-ID: Hello all, I am trying to implement resumable uploads using the nginx upload module to a django script. I am running a deb-src build of the nginx 1.0.6 PPA with the following config, which includes version 2.2.0 of the upload module (renamed to nginx-upload-resume for consistency). ahammond at ws-trans02:~$ nginx -V 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=/home/ahammond/nginx/nginx-1.0.6/debian/modules/nginx-echo --add-module=/home/ahammond/nginx/nginx-1.0.6/debian/modules/nginx-upstream-fair --add-module=/home/ahammond/nginx/nginx-1.0.6/debian/modules/nginx-upload-resume My config is pretty simple. Uploads connect to the rspool location via a proxy for resumable uploading, and then upload pass sends them to a fastcgi that goes to a django script. Details follow. ahammond at ws-trans02:/etc/nginx$ cat sites-enabled/rspool.conf upstream transactions { server localhost:10000; } server { listen 80; include common.conf; root /nutricate/static; client_max_body_size 50m; location /rspool/ { gzip off; upload_resumable on; upload_pass @rspool_upload; upload_pass_args on; upload_pass_form_field "^unique_id$|^entity_id$|.*"; include upload_resume_params; } location @rspool_upload { gzip off; fastcgi_pass transactions; include fastcgi_params; fastcgi_intercept_errors off; break; } } ahammond at ws-trans02:/etc/nginx$ cat common.conf error_page 500 /500.html; error_page 502 /502.html; error_page 503 /503.html; error_page 504 /504.html; location = /50x.html { root html; } ahammond at ws-trans02:/etc/nginx$ cat 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_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; #fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_NAME ''; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; # weird django requirements fastcgi_param FCGI $server_name; fastcgi_param PATH_INFO $fastcgi_script_name; ahammond at ws-trans02:/etc/nginx$ cat upload_resume_params upload_store /var/lib/nginx/resumable_download 1; upload_store_access user:r group:r; 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; upload_aggregate_form_field "${upload_field_name}_sha1" $upload_file_sha1; upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size; upload_cleanup 400 404 499 500-505; I upload to the system using the following (see https://github.com/SmartReceipt/py_lightweight_uploader): ahammond at lappy386:~/src/py_lightweight_uploader (master)$ ./py_lightweight_uploader.py -vv http://testsrv/rspool/?a=b\&c=d ric.log 2011-10-03 11:24:41,805 root DEBUG py_lightweight_uploader.py:278: Starting theLightweightUploader thread 2011-10-03 11:24:41,806 root DEBUG py_lightweight_uploader.py:117: Upload queue is empty. 2011-10-03 11:24:41,806 root INFO py_lightweight_uploader.py:71: Queueing ric.log for upload to http://209.114.46.109/rspool/?a=b&c=d, id: 60890468-1330-4748-866e-e4426584e83f 2011-10-03 11:24:41,917 root DEBUG py_lightweight_uploader.py:179: guessing file type: text/plain 2011-10-03 11:24:41,917 root DEBUG py_lightweight_uploader.py:222: Sending ric.log bytes 0-51199/210000 2011-10-03 11:24:42,303 root DEBUG py_lightweight_uploader.py:225: Got response: 0-51199/210000 2011-10-03 11:24:42,303 root DEBUG py_lightweight_uploader.py:127: Uploaded a chunk, continuing to upload ric.log 2011-10-03 11:24:42,303 root DEBUG py_lightweight_uploader.py:222: Sending ric.log bytes 51199-102398/210000 2011-10-03 11:24:42,496 root DEBUG py_lightweight_uploader.py:225: Got response: 0-102398/210000 2011-10-03 11:24:42,497 root DEBUG py_lightweight_uploader.py:127: Uploaded a chunk, continuing to upload ric.log 2011-10-03 11:24:42,497 root DEBUG py_lightweight_uploader.py:222: Sending ric.log bytes 102398-153597/210000 2011-10-03 11:24:42,720 root DEBUG py_lightweight_uploader.py:225: Got response: 0-153597/210000 2011-10-03 11:24:42,720 root DEBUG py_lightweight_uploader.py:127: Uploaded a chunk, continuing to upload ric.log 2011-10-03 11:24:42,720 root DEBUG py_lightweight_uploader.py:222: Sending ric.log bytes 153597-204796/210000 2011-10-03 11:24:42,900 root DEBUG py_lightweight_uploader.py:225: Got response: 0-204796/210000 2011-10-03 11:24:42,901 root DEBUG py_lightweight_uploader.py:127: Uploaded a chunk, continuing to upload ric.log 2011-10-03 11:24:42,901 root DEBUG py_lightweight_uploader.py:222: Sending ric.log bytes 204796-210000/210000 2011-10-03 11:24:43,034 root DEBUG py_lightweight_uploader.py:225: Got response: k-thanks 2011-10-03 11:24:43,034 root INFO py_lightweight_uploader.py:124: Completed uploading ric.log 2011-10-03 11:24:43,034 root DEBUG py_lightweight_uploader.py:117: Upload queue is empty. Which produces the following nginx access log, ahammond at ws-trans02:/var/log/nginx$ cat access.log 10.178.51.115 - - [03/Oct/2011:10:58:45 -0700] "POST /rspool/?a=b&c=d HTTP/1.0" 201 158 "-" "-" "-" 10.178.51.115 - - [03/Oct/2011:10:58:46 -0700] "POST /rspool/?a=b&c=d HTTP/1.0" 201 160 "-" "-" "-" 10.178.51.115 - - [03/Oct/2011:10:58:46 -0700] "POST /rspool/?a=b&c=d HTTP/1.0" 201 160 "-" "-" "-" 10.178.51.115 - - [03/Oct/2011:10:58:46 -0700] "POST /rspool/?a=b&c=d HTTP/1.0" 201 160 "-" "-" "-" 10.178.51.115 - - [03/Oct/2011:10:58:46 -0700] "POST /rspool/?a=b&c=d HTTP/1.0" 200 144 "-" "-" "-" and the following debug logfile (sorry for the length, I'm an nginx newbie and don't want to cut out important stuff). ahammond at ws-trans02:/var/log/nginx$ cat -n error.log 1 2011/10/03 11:24:40 [debug] 8111#0: post event 00007F2538837010 2 2011/10/03 11:24:40 [debug] 8111#0: delete posted event 00007F2538837010 3 2011/10/03 11:24:40 [debug] 8111#0: accept on 0.0.0.0:80, ready: 0 4 2011/10/03 11:24:40 [debug] 8111#0: posix_memalign: 0000000000F2F8A0:256 @16 5 2011/10/03 11:24:40 [debug] 8111#0: *43 accept: 10.178.51.115 fd:7 6 2011/10/03 11:24:40 [debug] 8111#0: *43 event timer add: 7: 60000:1317666340718 7 2011/10/03 11:24:40 [debug] 8111#0: *43 epoll add event: fd:7 op:1 ev:80000001 8 2011/10/03 11:24:40 [debug] 8111#0: *43 post event 00007F25388370E0 9 2011/10/03 11:24:40 [debug] 8111#0: *43 delete posted event 00007F25388370E0 10 2011/10/03 11:24:40 [debug] 8111#0: *43 malloc: 0000000000F3D730:1296 11 2011/10/03 11:24:40 [debug] 8111#0: *43 posix_memalign: 0000000000F5CCC0:256 @16 12 2011/10/03 11:24:40 [debug] 8111#0: *43 malloc: 0000000000F3DC50:1024 13 2011/10/03 11:24:40 [debug] 8111#0: *43 posix_memalign: 0000000000F3E060:4096 @16 14 2011/10/03 11:24:40 [debug] 8111#0: *43 http process request line 15 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 1024 of 1024 16 2011/10/03 11:24:40 [debug] 8111#0: *43 http request line: "POST /rspool/?a=b&c=d HTTP/1.0" 17 2011/10/03 11:24:40 [debug] 8111#0: *43 http uri: "/rspool/" 18 2011/10/03 11:24:40 [debug] 8111#0: *43 http args: "a=b&c=d" 19 2011/10/03 11:24:40 [debug] 8111#0: *43 http exten: "" 20 2011/10/03 11:24:40 [debug] 8111#0: *43 http process request header line 21 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Host: 209.114.46.109" 22 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "X-Real-IP: 98.173.193.68" 23 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "X-Forwarded-For: 98.173.193.68" 24 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Connection: close" 25 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Accept-Encoding: identity" 26 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Content-Length: 51200" 27 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Session-ID: 14367198" 28 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "X-Content-Range: bytes 0-51199/210000" 29 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Content-Type: text/plain" 30 2011/10/03 11:24:40 [debug] 8111#0: *43 http header: "Content-Disposition: attachment; filename="ric.log"" 31 2011/10/03 11:24:40 [debug] 8111#0: *43 http header done 32 2011/10/03 11:24:40 [debug] 8111#0: *43 event timer del: 7: 1317666340718 33 2011/10/03 11:24:40 [debug] 8111#0: *43 generic phase: 0 34 2011/10/03 11:24:40 [debug] 8111#0: *43 rewrite phase: 1 35 2011/10/03 11:24:40 [debug] 8111#0: *43 test location: "/rspool/" 36 2011/10/03 11:24:40 [debug] 8111#0: *43 using configuration "/rspool/" 37 2011/10/03 11:24:40 [debug] 8111#0: *43 http cl:51200 max:52428800 38 2011/10/03 11:24:40 [debug] 8111#0: *43 rewrite phase: 3 39 2011/10/03 11:24:40 [debug] 8111#0: *43 post rewrite phase: 4 40 2011/10/03 11:24:40 [debug] 8111#0: *43 generic phase: 5 41 2011/10/03 11:24:40 [debug] 8111#0: *43 generic phase: 6 42 2011/10/03 11:24:40 [debug] 8111#0: *43 generic phase: 7 43 2011/10/03 11:24:40 [debug] 8111#0: *43 access phase: 8 44 2011/10/03 11:24:40 [debug] 8111#0: *43 access phase: 9 45 2011/10/03 11:24:40 [debug] 8111#0: *43 post access phase: 10 46 2011/10/03 11:24:40 [debug] 8111#0: *43 session id 14367198 47 2011/10/03 11:24:40 [debug] 8111#0: *43 partial content, range 0-51199/210000 48 2011/10/03 11:24:40 [debug] 8111#0: *43 posix_memalign: 0000000000F34400:4096 @16 49 2011/10/03 11:24:40 [debug] 8111#0: *43 malloc: 0000000000F35410:4096 50 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body preread 701 51 2011/10/03 11:24:40 [debug] 8111#0: *43 malloc: 0000000000F36420:8192 52 2011/10/03 11:24:40 [debug] 8111#0: *43 http read client request body 53 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 8192 of 8192 54 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 8192 55 2011/10/03 11:24:40 [debug] 8111#0: *43 add cleanup: 0000000000F347D8 56 2011/10/03 11:24:40 [debug] 8111#0: *43 hashed path: /var/lib/nginx/resumable_download/8/14367198 57 2011/10/03 11:24:40 [debug] 8111#0: *43 hashed path of state file: /var/lib/nginx/resumable_download/8/14367198.state 58 2011/10/03 11:24:40 [debug] 8111#0: *43 http script var: "" 59 2011/10/03 11:24:40 [debug] 8111#0: *43 http script copy: "_name" 60 2011/10/03 11:24:40 [debug] 8111#0: *43 http script var: "ric.log" 61 2011/10/03 11:24:40 [debug] 8111#0: *43 http script var: "" 62 2011/10/03 11:24:40 [debug] 8111#0: *43 http script copy: "_content_type" 63 2011/10/03 11:24:40 [debug] 8111#0: *43 http script var: "text/plain" 64 2011/10/03 11:24:40 [debug] 8111#0: *43 posix_memalign: 0000000000F62730:4096 @16 65 2011/10/03 11:24:40 [debug] 8111#0: *43 http script var: "" 66 2011/10/03 11:24:40 [debug] 8111#0: *43 http script copy: "_path" 67 2011/10/03 11:24:40 [debug] 8111#0: *43 http script var: "/var/lib/nginx/resumable_download/8/14367198" 68 2011/10/03 11:24:40 [info] 8111#0: *43 started uploading part 0-51199/210000 of file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198" (field "", content type "text/plain"), client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 69 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F3DD93, 701, 0 70 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 8192, 701 71 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 8192 of 8192 72 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 8192 73 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 8192, 8893 74 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 8192 of 8192 75 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 8192 76 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 8192, 17085 77 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 8192 of 8192 78 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 8192 79 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 8192, 25277 80 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 8192 of 8192 81 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 8192 82 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 8192, 33469 83 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 2904 of 8192 84 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 2904 85 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body rest 6635 86 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 5288 of 5288 87 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 5288 88 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 8192, 41661 89 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 1347 of 1347 90 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body recv 1347 91 2011/10/03 11:24:40 [debug] 8111#0: *43 http client request body rest 0 92 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F36420, 1347, 49853 93 2011/10/03 11:24:40 [debug] 8111#0: *43 a 0-51199/210000 94 2011/10/03 11:24:40 [debug] 8111#0: *43 write: 14, 0000000000F34850, 15, 0 95 2011/10/03 11:24:40 [info] 8111#0: *43 finished uploading part 0-51199/210000 of a file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198", client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 96 2011/10/03 11:24:40 [debug] 8111#0: *43 xslt filter header 97 2011/10/03 11:24:40 [debug] 8111#0: *43 HTTP/1.1 201 Created 98 Server: nginx/1.0.6 99 Date: Mon, 03 Oct 2011 18:24:40 GMT 100 Content-Length: 14 101 Connection: close 102 Range: 0-51199/210000 103 104 2011/10/03 11:24:40 [debug] 8111#0: *43 write new buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 144 file: 0, size: 0 105 2011/10/03 11:24:40 [debug] 8111#0: *43 http write filter: l:0 f:0 s:144 106 2011/10/03 11:24:40 [debug] 8111#0: *43 http output filter "/rspool/?a=b&c=d" 107 2011/10/03 11:24:40 [debug] 8111#0: *43 http copy filter: "/rspool/?a=b&c=d" 108 2011/10/03 11:24:40 [debug] 8111#0: *43 image filter 109 2011/10/03 11:24:40 [debug] 8111#0: *43 xslt filter body 110 2011/10/03 11:24:40 [debug] 8111#0: *43 http postpone filter "/rspool/?a=b&c=d" 00007FFF96ECBAE0 111 2011/10/03 11:24:40 [debug] 8111#0: *43 write old buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 144 file: 0, size: 0 112 2011/10/03 11:24:40 [debug] 8111#0: *43 write new buf t:0 f:0 0000000000F34628, pos 0000000000F34628, size: 14 file: 0, size: 0 113 2011/10/03 11:24:40 [debug] 8111#0: *43 http write filter: l:1 f:1 s:158 114 2011/10/03 11:24:40 [debug] 8111#0: *43 http write filter limit 0 115 2011/10/03 11:24:40 [debug] 8111#0: *43 writev: 158 116 2011/10/03 11:24:40 [debug] 8111#0: *43 http write filter 0000000000000000 117 2011/10/03 11:24:40 [debug] 8111#0: *43 http copy filter: 0 "/rspool/?a=b&c=d" 118 2011/10/03 11:24:40 [debug] 8111#0: *43 http finalize request: 0, "/rspool/?a=b&c=d" a:1, c:2 119 2011/10/03 11:24:40 [debug] 8111#0: *43 http request count:2 blk:0 120 2011/10/03 11:24:40 [debug] 8111#0: *43 http finalize request: -4, "/rspool/?a=b&c=d" a:1, c:1 121 2011/10/03 11:24:40 [debug] 8111#0: *43 event timer add: 7: 5000:1317666285719 122 2011/10/03 11:24:40 [debug] 8111#0: *43 http lingering close handler 123 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 -1 of 4096 124 2011/10/03 11:24:40 [debug] 8111#0: *43 recv() not ready (11: Resource temporarily unavailable) 125 2011/10/03 11:24:40 [debug] 8111#0: *43 lingering read: -2 126 2011/10/03 11:24:40 [debug] 8111#0: *43 event timer: 7, old: 1317666285719, new: 1317666285719 127 2011/10/03 11:24:40 [debug] 8111#0: *43 post event 00007F25388370E0 128 2011/10/03 11:24:40 [debug] 8111#0: *43 delete posted event 00007F25388370E0 129 2011/10/03 11:24:40 [debug] 8111#0: *43 http lingering close handler 130 2011/10/03 11:24:40 [debug] 8111#0: *43 recv: fd:7 0 of 4096 131 2011/10/03 11:24:40 [debug] 8111#0: *43 lingering read: 0 132 2011/10/03 11:24:40 [debug] 8111#0: *43 http request count:1 blk:0 133 2011/10/03 11:24:40 [debug] 8111#0: *43 http close request 134 2011/10/03 11:24:40 [debug] 8111#0: *43 http log handler 135 2011/10/03 11:24:40 [debug] 8111#0: *43 run cleanup: 0000000000F347D8 136 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F36420 137 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F35410 138 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F3E060, unused: 0 139 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F34400, unused: 0 140 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F62730, unused: 2843 141 2011/10/03 11:24:40 [debug] 8111#0: *43 close http connection: 7 142 2011/10/03 11:24:40 [debug] 8111#0: *43 event timer del: 7: 1317666285719 143 2011/10/03 11:24:40 [debug] 8111#0: *43 reusable connection: 0 144 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F3DC50 145 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F3D730 146 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F2F8A0, unused: 8 147 2011/10/03 11:24:40 [debug] 8111#0: *43 free: 0000000000F5CCC0, unused: 128 148 2011/10/03 11:24:40 [debug] 8111#0: post event 00007F2538837010 149 2011/10/03 11:24:40 [debug] 8111#0: delete posted event 00007F2538837010 150 2011/10/03 11:24:40 [debug] 8111#0: accept on 0.0.0.0:80, ready: 0 151 2011/10/03 11:24:40 [debug] 8111#0: posix_memalign: 0000000000F2F8A0:256 @16 152 2011/10/03 11:24:40 [debug] 8111#0: *44 accept: 10.178.51.115 fd:7 153 2011/10/03 11:24:40 [debug] 8111#0: *44 event timer add: 7: 60000:1317666340906 154 2011/10/03 11:24:40 [debug] 8111#0: *44 epoll add event: fd:7 op:1 ev:80000001 155 2011/10/03 11:24:40 [debug] 8111#0: *44 post event 00007F25388370E0 156 2011/10/03 11:24:40 [debug] 8111#0: *44 delete posted event 00007F25388370E0 157 2011/10/03 11:24:40 [debug] 8111#0: *44 malloc: 0000000000F3D730:1296 158 2011/10/03 11:24:40 [debug] 8111#0: *44 posix_memalign: 0000000000F5CCC0:256 @16 159 2011/10/03 11:24:40 [debug] 8111#0: *44 malloc: 0000000000F3DC50:1024 160 2011/10/03 11:24:40 [debug] 8111#0: *44 posix_memalign: 0000000000F3E060:4096 @16 161 2011/10/03 11:24:40 [debug] 8111#0: *44 http process request line 162 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 1024 of 1024 163 2011/10/03 11:24:40 [debug] 8111#0: *44 http request line: "POST /rspool/?a=b&c=d HTTP/1.0" 164 2011/10/03 11:24:40 [debug] 8111#0: *44 http uri: "/rspool/" 165 2011/10/03 11:24:40 [debug] 8111#0: *44 http args: "a=b&c=d" 166 2011/10/03 11:24:40 [debug] 8111#0: *44 http exten: "" 167 2011/10/03 11:24:40 [debug] 8111#0: *44 http process request header line 168 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Host: 209.114.46.109" 169 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "X-Real-IP: 98.173.193.68" 170 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "X-Forwarded-For: 98.173.193.68" 171 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Connection: close" 172 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Accept-Encoding: identity" 173 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Content-Length: 51200" 174 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Session-ID: 14367198" 175 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "X-Content-Range: bytes 51199-102398/210000" 176 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Content-Type: text/plain" 177 2011/10/03 11:24:40 [debug] 8111#0: *44 http header: "Content-Disposition: attachment; filename="ric.log"" 178 2011/10/03 11:24:40 [debug] 8111#0: *44 http header done 179 2011/10/03 11:24:40 [debug] 8111#0: *44 event timer del: 7: 1317666340906 180 2011/10/03 11:24:40 [debug] 8111#0: *44 generic phase: 0 181 2011/10/03 11:24:40 [debug] 8111#0: *44 rewrite phase: 1 182 2011/10/03 11:24:40 [debug] 8111#0: *44 test location: "/rspool/" 183 2011/10/03 11:24:40 [debug] 8111#0: *44 using configuration "/rspool/" 184 2011/10/03 11:24:40 [debug] 8111#0: *44 http cl:51200 max:52428800 185 2011/10/03 11:24:40 [debug] 8111#0: *44 rewrite phase: 3 186 2011/10/03 11:24:40 [debug] 8111#0: *44 post rewrite phase: 4 187 2011/10/03 11:24:40 [debug] 8111#0: *44 generic phase: 5 188 2011/10/03 11:24:40 [debug] 8111#0: *44 generic phase: 6 189 2011/10/03 11:24:40 [debug] 8111#0: *44 generic phase: 7 190 2011/10/03 11:24:40 [debug] 8111#0: *44 access phase: 8 191 2011/10/03 11:24:40 [debug] 8111#0: *44 access phase: 9 192 2011/10/03 11:24:40 [debug] 8111#0: *44 post access phase: 10 193 2011/10/03 11:24:40 [debug] 8111#0: *44 session id 14367198 194 2011/10/03 11:24:40 [debug] 8111#0: *44 partial content, range 51199-102398/210000 195 2011/10/03 11:24:40 [debug] 8111#0: *44 posix_memalign: 0000000000F34400:4096 @16 196 2011/10/03 11:24:40 [debug] 8111#0: *44 malloc: 0000000000F35410:4096 197 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body preread 696 198 2011/10/03 11:24:40 [debug] 8111#0: *44 malloc: 0000000000F36420:8192 199 2011/10/03 11:24:40 [debug] 8111#0: *44 http read client request body 200 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 8192 of 8192 201 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 8192 202 2011/10/03 11:24:40 [debug] 8111#0: *44 add cleanup: 0000000000F347D8 203 2011/10/03 11:24:40 [debug] 8111#0: *44 hashed path: /var/lib/nginx/resumable_download/8/14367198 204 2011/10/03 11:24:40 [debug] 8111#0: *44 hashed path of state file: /var/lib/nginx/resumable_download/8/14367198.state 205 2011/10/03 11:24:40 [debug] 8111#0: *44 http script var: "" 206 2011/10/03 11:24:40 [debug] 8111#0: *44 http script copy: "_name" 207 2011/10/03 11:24:40 [debug] 8111#0: *44 http script var: "ric.log" 208 2011/10/03 11:24:40 [debug] 8111#0: *44 http script var: "" 209 2011/10/03 11:24:40 [debug] 8111#0: *44 http script copy: "_content_type" 210 2011/10/03 11:24:40 [debug] 8111#0: *44 http script var: "text/plain" 211 2011/10/03 11:24:40 [debug] 8111#0: *44 posix_memalign: 0000000000F62730:4096 @16 212 2011/10/03 11:24:40 [debug] 8111#0: *44 http script var: "" 213 2011/10/03 11:24:40 [debug] 8111#0: *44 http script copy: "_path" 214 2011/10/03 11:24:40 [debug] 8111#0: *44 http script var: "/var/lib/nginx/resumable_download/8/14367198" 215 2011/10/03 11:24:40 [info] 8111#0: *44 started uploading part 51199-102398/210000 of file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198" (field "", content type "text/plain"), client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 216 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F3DD98, 696, 51199 217 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 8192, 51895 218 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 8192 of 8192 219 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 8192 220 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 8192, 60087 221 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 8192 of 8192 222 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 8192 223 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 8192, 68279 224 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 8192 of 8192 225 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 8192 226 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 8192, 76471 227 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 8192 of 8192 228 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 8192 229 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 8192, 84663 230 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 8192 of 8192 231 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 8192 232 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 8192, 92855 233 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 1352 of 1352 234 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body recv 1352 235 2011/10/03 11:24:40 [debug] 8111#0: *44 http client request body rest 0 236 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F36420, 1352, 101047 237 2011/10/03 11:24:40 [debug] 8111#0: *44 read: 14, 0000000000F34C8F, 15, 0 238 2011/10/03 11:24:40 [debug] 8111#0: *44 a 0-102398/210000 239 2011/10/03 11:24:40 [debug] 8111#0: *44 write: 14, 0000000000F34850, 16, 0 240 2011/10/03 11:24:40 [info] 8111#0: *44 finished uploading part 51199-102398/210000 of a file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198", client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 241 2011/10/03 11:24:40 [debug] 8111#0: *44 xslt filter header 242 2011/10/03 11:24:40 [debug] 8111#0: *44 HTTP/1.1 201 Created 243 Server: nginx/1.0.6 244 Date: Mon, 03 Oct 2011 18:24:40 GMT 245 Content-Length: 15 246 Connection: close 247 Range: 0-102398/210000 248 249 2011/10/03 11:24:40 [debug] 8111#0: *44 write new buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 145 file: 0, size: 0 250 2011/10/03 11:24:40 [debug] 8111#0: *44 http write filter: l:0 f:0 s:145 251 2011/10/03 11:24:40 [debug] 8111#0: *44 http output filter "/rspool/?a=b&c=d" 252 2011/10/03 11:24:40 [debug] 8111#0: *44 http copy filter: "/rspool/?a=b&c=d" 253 2011/10/03 11:24:40 [debug] 8111#0: *44 image filter 254 2011/10/03 11:24:40 [debug] 8111#0: *44 xslt filter body 255 2011/10/03 11:24:40 [debug] 8111#0: *44 http postpone filter "/rspool/?a=b&c=d" 00007FFF96ECBAE0 256 2011/10/03 11:24:40 [debug] 8111#0: *44 write old buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 145 file: 0, size: 0 257 2011/10/03 11:24:40 [debug] 8111#0: *44 write new buf t:0 f:0 0000000000F34628, pos 0000000000F34628, size: 15 file: 0, size: 0 258 2011/10/03 11:24:40 [debug] 8111#0: *44 http write filter: l:1 f:1 s:160 259 2011/10/03 11:24:40 [debug] 8111#0: *44 http write filter limit 0 260 2011/10/03 11:24:40 [debug] 8111#0: *44 writev: 160 261 2011/10/03 11:24:40 [debug] 8111#0: *44 http write filter 0000000000000000 262 2011/10/03 11:24:40 [debug] 8111#0: *44 http copy filter: 0 "/rspool/?a=b&c=d" 263 2011/10/03 11:24:40 [debug] 8111#0: *44 http finalize request: 0, "/rspool/?a=b&c=d" a:1, c:2 264 2011/10/03 11:24:40 [debug] 8111#0: *44 http request count:2 blk:0 265 2011/10/03 11:24:40 [debug] 8111#0: *44 http finalize request: -4, "/rspool/?a=b&c=d" a:1, c:1 266 2011/10/03 11:24:40 [debug] 8111#0: *44 event timer add: 7: 5000:1317666285906 267 2011/10/03 11:24:40 [debug] 8111#0: *44 http lingering close handler 268 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 -1 of 4096 269 2011/10/03 11:24:40 [debug] 8111#0: *44 recv() not ready (11: Resource temporarily unavailable) 270 2011/10/03 11:24:40 [debug] 8111#0: *44 lingering read: -2 271 2011/10/03 11:24:40 [debug] 8111#0: *44 event timer: 7, old: 1317666285906, new: 1317666285906 272 2011/10/03 11:24:40 [debug] 8111#0: *44 post event 00007F25388370E0 273 2011/10/03 11:24:40 [debug] 8111#0: *44 delete posted event 00007F25388370E0 274 2011/10/03 11:24:40 [debug] 8111#0: *44 http lingering close handler 275 2011/10/03 11:24:40 [debug] 8111#0: *44 recv: fd:7 0 of 4096 276 2011/10/03 11:24:40 [debug] 8111#0: *44 lingering read: 0 277 2011/10/03 11:24:40 [debug] 8111#0: *44 http request count:1 blk:0 278 2011/10/03 11:24:40 [debug] 8111#0: *44 http close request 279 2011/10/03 11:24:40 [debug] 8111#0: *44 http log handler 280 2011/10/03 11:24:40 [debug] 8111#0: *44 run cleanup: 0000000000F347D8 281 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F36420 282 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F35410 283 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F3E060, unused: 0 284 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F34400, unused: 0 285 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F62730, unused: 2843 286 2011/10/03 11:24:40 [debug] 8111#0: *44 close http connection: 7 287 2011/10/03 11:24:40 [debug] 8111#0: *44 event timer del: 7: 1317666285906 288 2011/10/03 11:24:40 [debug] 8111#0: *44 reusable connection: 0 289 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F3DC50 290 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F3D730 291 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F2F8A0, unused: 8 292 2011/10/03 11:24:40 [debug] 8111#0: *44 free: 0000000000F5CCC0, unused: 128 293 2011/10/03 11:24:41 [debug] 8111#0: post event 00007F2538837010 294 2011/10/03 11:24:41 [debug] 8111#0: delete posted event 00007F2538837010 295 2011/10/03 11:24:41 [debug] 8111#0: accept on 0.0.0.0:80, ready: 0 296 2011/10/03 11:24:41 [debug] 8111#0: posix_memalign: 0000000000F2F8A0:256 @16 297 2011/10/03 11:24:41 [debug] 8111#0: *45 accept: 10.178.51.115 fd:7 298 2011/10/03 11:24:41 [debug] 8111#0: *45 event timer add: 7: 60000:1317666341135 299 2011/10/03 11:24:41 [debug] 8111#0: *45 epoll add event: fd:7 op:1 ev:80000001 300 2011/10/03 11:24:41 [debug] 8111#0: *45 post event 00007F25388370E0 301 2011/10/03 11:24:41 [debug] 8111#0: *45 delete posted event 00007F25388370E0 302 2011/10/03 11:24:41 [debug] 8111#0: *45 malloc: 0000000000F3D730:1296 303 2011/10/03 11:24:41 [debug] 8111#0: *45 posix_memalign: 0000000000F5CCC0:256 @16 304 2011/10/03 11:24:41 [debug] 8111#0: *45 malloc: 0000000000F3DC50:1024 305 2011/10/03 11:24:41 [debug] 8111#0: *45 posix_memalign: 0000000000F3E060:4096 @16 306 2011/10/03 11:24:41 [debug] 8111#0: *45 http process request line 307 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 1024 of 1024 308 2011/10/03 11:24:41 [debug] 8111#0: *45 http request line: "POST /rspool/?a=b&c=d HTTP/1.0" 309 2011/10/03 11:24:41 [debug] 8111#0: *45 http uri: "/rspool/" 310 2011/10/03 11:24:41 [debug] 8111#0: *45 http args: "a=b&c=d" 311 2011/10/03 11:24:41 [debug] 8111#0: *45 http exten: "" 312 2011/10/03 11:24:41 [debug] 8111#0: *45 http process request header line 313 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Host: 209.114.46.109" 314 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "X-Real-IP: 98.173.193.68" 315 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "X-Forwarded-For: 98.173.193.68" 316 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Connection: close" 317 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Accept-Encoding: identity" 318 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Content-Length: 51200" 319 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Session-ID: 14367198" 320 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "X-Content-Range: bytes 102398-153597/210000" 321 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Content-Type: text/plain" 322 2011/10/03 11:24:41 [debug] 8111#0: *45 http header: "Content-Disposition: attachment; filename="ric.log"" 323 2011/10/03 11:24:41 [debug] 8111#0: *45 http header done 324 2011/10/03 11:24:41 [debug] 8111#0: *45 event timer del: 7: 1317666341135 325 2011/10/03 11:24:41 [debug] 8111#0: *45 generic phase: 0 326 2011/10/03 11:24:41 [debug] 8111#0: *45 rewrite phase: 1 327 2011/10/03 11:24:41 [debug] 8111#0: *45 test location: "/rspool/" 328 2011/10/03 11:24:41 [debug] 8111#0: *45 using configuration "/rspool/" 329 2011/10/03 11:24:41 [debug] 8111#0: *45 http cl:51200 max:52428800 330 2011/10/03 11:24:41 [debug] 8111#0: *45 rewrite phase: 3 331 2011/10/03 11:24:41 [debug] 8111#0: *45 post rewrite phase: 4 332 2011/10/03 11:24:41 [debug] 8111#0: *45 generic phase: 5 333 2011/10/03 11:24:41 [debug] 8111#0: *45 generic phase: 6 334 2011/10/03 11:24:41 [debug] 8111#0: *45 generic phase: 7 335 2011/10/03 11:24:41 [debug] 8111#0: *45 access phase: 8 336 2011/10/03 11:24:41 [debug] 8111#0: *45 access phase: 9 337 2011/10/03 11:24:41 [debug] 8111#0: *45 post access phase: 10 338 2011/10/03 11:24:41 [debug] 8111#0: *45 session id 14367198 339 2011/10/03 11:24:41 [debug] 8111#0: *45 partial content, range 102398-153597/210000 340 2011/10/03 11:24:41 [debug] 8111#0: *45 posix_memalign: 0000000000F34400:4096 @16 341 2011/10/03 11:24:41 [debug] 8111#0: *45 malloc: 0000000000F35410:4096 342 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body preread 695 343 2011/10/03 11:24:41 [debug] 8111#0: *45 malloc: 0000000000F36420:8192 344 2011/10/03 11:24:41 [debug] 8111#0: *45 http read client request body 345 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 8192 of 8192 346 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 8192 347 2011/10/03 11:24:41 [debug] 8111#0: *45 add cleanup: 0000000000F347D8 348 2011/10/03 11:24:41 [debug] 8111#0: *45 hashed path: /var/lib/nginx/resumable_download/8/14367198 349 2011/10/03 11:24:41 [debug] 8111#0: *45 hashed path of state file: /var/lib/nginx/resumable_download/8/14367198.state 350 2011/10/03 11:24:41 [debug] 8111#0: *45 http script var: "" 351 2011/10/03 11:24:41 [debug] 8111#0: *45 http script copy: "_name" 352 2011/10/03 11:24:41 [debug] 8111#0: *45 http script var: "ric.log" 353 2011/10/03 11:24:41 [debug] 8111#0: *45 http script var: "" 354 2011/10/03 11:24:41 [debug] 8111#0: *45 http script copy: "_content_type" 355 2011/10/03 11:24:41 [debug] 8111#0: *45 http script var: "text/plain" 356 2011/10/03 11:24:41 [debug] 8111#0: *45 posix_memalign: 0000000000F62730:4096 @16 357 2011/10/03 11:24:41 [debug] 8111#0: *45 http script var: "" 358 2011/10/03 11:24:41 [debug] 8111#0: *45 http script copy: "_path" 359 2011/10/03 11:24:41 [debug] 8111#0: *45 http script var: "/var/lib/nginx/resumable_download/8/14367198" 360 2011/10/03 11:24:41 [info] 8111#0: *45 started uploading part 102398-153597/210000 of file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198" (field "", content type "text/plain"), client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 361 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F3DD99, 695, 102398 362 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 8192, 103093 363 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 8192 of 8192 364 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 8192 365 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 8192, 111285 366 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 8192 of 8192 367 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 8192 368 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 8192, 119477 369 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 8192 of 8192 370 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 8192 371 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 8192, 127669 372 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 8192 of 8192 373 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 8192 374 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 8192, 135861 375 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 8192 of 8192 376 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 8192 377 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 8192, 144053 378 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 1353 of 1353 379 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body recv 1353 380 2011/10/03 11:24:41 [debug] 8111#0: *45 http client request body rest 0 381 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F36420, 1353, 152245 382 2011/10/03 11:24:41 [debug] 8111#0: *45 read: 14, 0000000000F34C8F, 16, 0 383 2011/10/03 11:24:41 [debug] 8111#0: *45 a 0-153597/210000 384 2011/10/03 11:24:41 [debug] 8111#0: *45 write: 14, 0000000000F34850, 16, 0 385 2011/10/03 11:24:41 [info] 8111#0: *45 finished uploading part 102398-153597/210000 of a file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198", client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 386 2011/10/03 11:24:41 [debug] 8111#0: *45 xslt filter header 387 2011/10/03 11:24:41 [debug] 8111#0: *45 HTTP/1.1 201 Created 388 Server: nginx/1.0.6 389 Date: Mon, 03 Oct 2011 18:24:41 GMT 390 Content-Length: 15 391 Connection: close 392 Range: 0-153597/210000 393 394 2011/10/03 11:24:41 [debug] 8111#0: *45 write new buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 145 file: 0, size: 0 395 2011/10/03 11:24:41 [debug] 8111#0: *45 http write filter: l:0 f:0 s:145 396 2011/10/03 11:24:41 [debug] 8111#0: *45 http output filter "/rspool/?a=b&c=d" 397 2011/10/03 11:24:41 [debug] 8111#0: *45 http copy filter: "/rspool/?a=b&c=d" 398 2011/10/03 11:24:41 [debug] 8111#0: *45 image filter 399 2011/10/03 11:24:41 [debug] 8111#0: *45 xslt filter body 400 2011/10/03 11:24:41 [debug] 8111#0: *45 http postpone filter "/rspool/?a=b&c=d" 00007FFF96ECBAE0 401 2011/10/03 11:24:41 [debug] 8111#0: *45 write old buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 145 file: 0, size: 0 402 2011/10/03 11:24:41 [debug] 8111#0: *45 write new buf t:0 f:0 0000000000F34628, pos 0000000000F34628, size: 15 file: 0, size: 0 403 2011/10/03 11:24:41 [debug] 8111#0: *45 http write filter: l:1 f:1 s:160 404 2011/10/03 11:24:41 [debug] 8111#0: *45 http write filter limit 0 405 2011/10/03 11:24:41 [debug] 8111#0: *45 writev: 160 406 2011/10/03 11:24:41 [debug] 8111#0: *45 http write filter 0000000000000000 407 2011/10/03 11:24:41 [debug] 8111#0: *45 http copy filter: 0 "/rspool/?a=b&c=d" 408 2011/10/03 11:24:41 [debug] 8111#0: *45 http finalize request: 0, "/rspool/?a=b&c=d" a:1, c:2 409 2011/10/03 11:24:41 [debug] 8111#0: *45 http request count:2 blk:0 410 2011/10/03 11:24:41 [debug] 8111#0: *45 http finalize request: -4, "/rspool/?a=b&c=d" a:1, c:1 411 2011/10/03 11:24:41 [debug] 8111#0: *45 event timer add: 7: 5000:1317666286135 412 2011/10/03 11:24:41 [debug] 8111#0: *45 http lingering close handler 413 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 -1 of 4096 414 2011/10/03 11:24:41 [debug] 8111#0: *45 recv() not ready (11: Resource temporarily unavailable) 415 2011/10/03 11:24:41 [debug] 8111#0: *45 lingering read: -2 416 2011/10/03 11:24:41 [debug] 8111#0: *45 event timer: 7, old: 1317666286135, new: 1317666286135 417 2011/10/03 11:24:41 [debug] 8111#0: *45 post event 00007F25388370E0 418 2011/10/03 11:24:41 [debug] 8111#0: *45 delete posted event 00007F25388370E0 419 2011/10/03 11:24:41 [debug] 8111#0: *45 http lingering close handler 420 2011/10/03 11:24:41 [debug] 8111#0: *45 recv: fd:7 0 of 4096 421 2011/10/03 11:24:41 [debug] 8111#0: *45 lingering read: 0 422 2011/10/03 11:24:41 [debug] 8111#0: *45 http request count:1 blk:0 423 2011/10/03 11:24:41 [debug] 8111#0: *45 http close request 424 2011/10/03 11:24:41 [debug] 8111#0: *45 http log handler 425 2011/10/03 11:24:41 [debug] 8111#0: *45 run cleanup: 0000000000F347D8 426 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F36420 427 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F35410 428 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F3E060, unused: 0 429 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F34400, unused: 0 430 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F62730, unused: 2843 431 2011/10/03 11:24:41 [debug] 8111#0: *45 close http connection: 7 432 2011/10/03 11:24:41 [debug] 8111#0: *45 event timer del: 7: 1317666286135 433 2011/10/03 11:24:41 [debug] 8111#0: *45 reusable connection: 0 434 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F3DC50 435 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F3D730 436 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F2F8A0, unused: 8 437 2011/10/03 11:24:41 [debug] 8111#0: *45 free: 0000000000F5CCC0, unused: 128 438 2011/10/03 11:24:41 [debug] 8111#0: post event 00007F2538837010 439 2011/10/03 11:24:41 [debug] 8111#0: delete posted event 00007F2538837010 440 2011/10/03 11:24:41 [debug] 8111#0: accept on 0.0.0.0:80, ready: 0 441 2011/10/03 11:24:41 [debug] 8111#0: posix_memalign: 0000000000F2F8A0:256 @16 442 2011/10/03 11:24:41 [debug] 8111#0: *46 accept: 10.178.51.115 fd:7 443 2011/10/03 11:24:41 [debug] 8111#0: *46 event timer add: 7: 60000:1317666341316 444 2011/10/03 11:24:41 [debug] 8111#0: *46 epoll add event: fd:7 op:1 ev:80000001 445 2011/10/03 11:24:41 [debug] 8111#0: *46 post event 00007F25388370E0 446 2011/10/03 11:24:41 [debug] 8111#0: *46 delete posted event 00007F25388370E0 447 2011/10/03 11:24:41 [debug] 8111#0: *46 malloc: 0000000000F3D730:1296 448 2011/10/03 11:24:41 [debug] 8111#0: *46 posix_memalign: 0000000000F5CCC0:256 @16 449 2011/10/03 11:24:41 [debug] 8111#0: *46 malloc: 0000000000F3DC50:1024 450 2011/10/03 11:24:41 [debug] 8111#0: *46 posix_memalign: 0000000000F3E060:4096 @16 451 2011/10/03 11:24:41 [debug] 8111#0: *46 http process request line 452 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 1024 of 1024 453 2011/10/03 11:24:41 [debug] 8111#0: *46 http request line: "POST /rspool/?a=b&c=d HTTP/1.0" 454 2011/10/03 11:24:41 [debug] 8111#0: *46 http uri: "/rspool/" 455 2011/10/03 11:24:41 [debug] 8111#0: *46 http args: "a=b&c=d" 456 2011/10/03 11:24:41 [debug] 8111#0: *46 http exten: "" 457 2011/10/03 11:24:41 [debug] 8111#0: *46 http process request header line 458 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Host: 209.114.46.109" 459 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "X-Real-IP: 98.173.193.68" 460 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "X-Forwarded-For: 98.173.193.68" 461 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Connection: close" 462 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Accept-Encoding: identity" 463 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Content-Length: 51200" 464 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Session-ID: 14367198" 465 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "X-Content-Range: bytes 153597-204796/210000" 466 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Content-Type: text/plain" 467 2011/10/03 11:24:41 [debug] 8111#0: *46 http header: "Content-Disposition: attachment; filename="ric.log"" 468 2011/10/03 11:24:41 [debug] 8111#0: *46 http header done 469 2011/10/03 11:24:41 [debug] 8111#0: *46 event timer del: 7: 1317666341316 470 2011/10/03 11:24:41 [debug] 8111#0: *46 generic phase: 0 471 2011/10/03 11:24:41 [debug] 8111#0: *46 rewrite phase: 1 472 2011/10/03 11:24:41 [debug] 8111#0: *46 test location: "/rspool/" 473 2011/10/03 11:24:41 [debug] 8111#0: *46 using configuration "/rspool/" 474 2011/10/03 11:24:41 [debug] 8111#0: *46 http cl:51200 max:52428800 475 2011/10/03 11:24:41 [debug] 8111#0: *46 rewrite phase: 3 476 2011/10/03 11:24:41 [debug] 8111#0: *46 post rewrite phase: 4 477 2011/10/03 11:24:41 [debug] 8111#0: *46 generic phase: 5 478 2011/10/03 11:24:41 [debug] 8111#0: *46 generic phase: 6 479 2011/10/03 11:24:41 [debug] 8111#0: *46 generic phase: 7 480 2011/10/03 11:24:41 [debug] 8111#0: *46 access phase: 8 481 2011/10/03 11:24:41 [debug] 8111#0: *46 access phase: 9 482 2011/10/03 11:24:41 [debug] 8111#0: *46 post access phase: 10 483 2011/10/03 11:24:41 [debug] 8111#0: *46 session id 14367198 484 2011/10/03 11:24:41 [debug] 8111#0: *46 partial content, range 153597-204796/210000 485 2011/10/03 11:24:41 [debug] 8111#0: *46 posix_memalign: 0000000000F34400:4096 @16 486 2011/10/03 11:24:41 [debug] 8111#0: *46 malloc: 0000000000F35410:4096 487 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body preread 695 488 2011/10/03 11:24:41 [debug] 8111#0: *46 malloc: 0000000000F36420:8192 489 2011/10/03 11:24:41 [debug] 8111#0: *46 http read client request body 490 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 8192 of 8192 491 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 8192 492 2011/10/03 11:24:41 [debug] 8111#0: *46 add cleanup: 0000000000F347D8 493 2011/10/03 11:24:41 [debug] 8111#0: *46 hashed path: /var/lib/nginx/resumable_download/8/14367198 494 2011/10/03 11:24:41 [debug] 8111#0: *46 hashed path of state file: /var/lib/nginx/resumable_download/8/14367198.state 495 2011/10/03 11:24:41 [debug] 8111#0: *46 http script var: "" 496 2011/10/03 11:24:41 [debug] 8111#0: *46 http script copy: "_name" 497 2011/10/03 11:24:41 [debug] 8111#0: *46 http script var: "ric.log" 498 2011/10/03 11:24:41 [debug] 8111#0: *46 http script var: "" 499 2011/10/03 11:24:41 [debug] 8111#0: *46 http script copy: "_content_type" 500 2011/10/03 11:24:41 [debug] 8111#0: *46 http script var: "text/plain" 501 2011/10/03 11:24:41 [debug] 8111#0: *46 posix_memalign: 0000000000F62730:4096 @16 502 2011/10/03 11:24:41 [debug] 8111#0: *46 http script var: "" 503 2011/10/03 11:24:41 [debug] 8111#0: *46 http script copy: "_path" 504 2011/10/03 11:24:41 [debug] 8111#0: *46 http script var: "/var/lib/nginx/resumable_download/8/14367198" 505 2011/10/03 11:24:41 [info] 8111#0: *46 started uploading part 153597-204796/210000 of file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198" (field "", content type "text/plain"), client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 506 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F3DD99, 695, 153597 507 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 8192, 154292 508 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 8192 of 8192 509 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 8192 510 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 8192, 162484 511 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 8192 of 8192 512 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 8192 513 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 8192, 170676 514 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 8192 of 8192 515 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 8192 516 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 8192, 178868 517 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 8192 of 8192 518 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 8192 519 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 8192, 187060 520 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 8192 of 8192 521 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 8192 522 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 8192, 195252 523 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 1353 of 1353 524 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body recv 1353 525 2011/10/03 11:24:41 [debug] 8111#0: *46 http client request body rest 0 526 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F36420, 1353, 203444 527 2011/10/03 11:24:41 [debug] 8111#0: *46 read: 14, 0000000000F34C8F, 16, 0 528 2011/10/03 11:24:41 [debug] 8111#0: *46 a 0-204796/210000 529 2011/10/03 11:24:41 [debug] 8111#0: *46 write: 14, 0000000000F34850, 16, 0 530 2011/10/03 11:24:41 [info] 8111#0: *46 finished uploading part 153597-204796/210000 of a file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198", client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 531 2011/10/03 11:24:41 [debug] 8111#0: *46 xslt filter header 532 2011/10/03 11:24:41 [debug] 8111#0: *46 HTTP/1.1 201 Created 533 Server: nginx/1.0.6 534 Date: Mon, 03 Oct 2011 18:24:41 GMT 535 Content-Length: 15 536 Connection: close 537 Range: 0-204796/210000 538 539 2011/10/03 11:24:41 [debug] 8111#0: *46 write new buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 145 file: 0, size: 0 540 2011/10/03 11:24:41 [debug] 8111#0: *46 http write filter: l:0 f:0 s:145 541 2011/10/03 11:24:41 [debug] 8111#0: *46 http output filter "/rspool/?a=b&c=d" 542 2011/10/03 11:24:41 [debug] 8111#0: *46 http copy filter: "/rspool/?a=b&c=d" 543 2011/10/03 11:24:41 [debug] 8111#0: *46 image filter 544 2011/10/03 11:24:41 [debug] 8111#0: *46 xslt filter body 545 2011/10/03 11:24:41 [debug] 8111#0: *46 http postpone filter "/rspool/?a=b&c=d" 00007FFF96ECBAE0 546 2011/10/03 11:24:41 [debug] 8111#0: *46 write old buf t:1 f:0 0000000000F62A70, pos 0000000000F62A70, size: 145 file: 0, size: 0 547 2011/10/03 11:24:41 [debug] 8111#0: *46 write new buf t:0 f:0 0000000000F34628, pos 0000000000F34628, size: 15 file: 0, size: 0 548 2011/10/03 11:24:41 [debug] 8111#0: *46 http write filter: l:1 f:1 s:160 549 2011/10/03 11:24:41 [debug] 8111#0: *46 http write filter limit 0 550 2011/10/03 11:24:41 [debug] 8111#0: *46 writev: 160 551 2011/10/03 11:24:41 [debug] 8111#0: *46 http write filter 0000000000000000 552 2011/10/03 11:24:41 [debug] 8111#0: *46 http copy filter: 0 "/rspool/?a=b&c=d" 553 2011/10/03 11:24:41 [debug] 8111#0: *46 http finalize request: 0, "/rspool/?a=b&c=d" a:1, c:2 554 2011/10/03 11:24:41 [debug] 8111#0: *46 http request count:2 blk:0 555 2011/10/03 11:24:41 [debug] 8111#0: *46 http finalize request: -4, "/rspool/?a=b&c=d" a:1, c:1 556 2011/10/03 11:24:41 [debug] 8111#0: *46 event timer add: 7: 5000:1317666286316 557 2011/10/03 11:24:41 [debug] 8111#0: *46 http lingering close handler 558 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 -1 of 4096 559 2011/10/03 11:24:41 [debug] 8111#0: *46 recv() not ready (11: Resource temporarily unavailable) 560 2011/10/03 11:24:41 [debug] 8111#0: *46 lingering read: -2 561 2011/10/03 11:24:41 [debug] 8111#0: *46 event timer: 7, old: 1317666286316, new: 1317666286316 562 2011/10/03 11:24:41 [debug] 8111#0: *46 post event 00007F25388370E0 563 2011/10/03 11:24:41 [debug] 8111#0: *46 delete posted event 00007F25388370E0 564 2011/10/03 11:24:41 [debug] 8111#0: *46 http lingering close handler 565 2011/10/03 11:24:41 [debug] 8111#0: *46 recv: fd:7 0 of 4096 566 2011/10/03 11:24:41 [debug] 8111#0: *46 lingering read: 0 567 2011/10/03 11:24:41 [debug] 8111#0: *46 http request count:1 blk:0 568 2011/10/03 11:24:41 [debug] 8111#0: *46 http close request 569 2011/10/03 11:24:41 [debug] 8111#0: *46 http log handler 570 2011/10/03 11:24:41 [debug] 8111#0: *46 run cleanup: 0000000000F347D8 571 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F36420 572 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F35410 573 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F3E060, unused: 0 574 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F34400, unused: 0 575 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F62730, unused: 2843 576 2011/10/03 11:24:41 [debug] 8111#0: *46 close http connection: 7 577 2011/10/03 11:24:41 [debug] 8111#0: *46 event timer del: 7: 1317666286316 578 2011/10/03 11:24:41 [debug] 8111#0: *46 reusable connection: 0 579 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F3DC50 580 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F3D730 581 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F2F8A0, unused: 8 582 2011/10/03 11:24:41 [debug] 8111#0: *46 free: 0000000000F5CCC0, unused: 128 583 2011/10/03 11:24:41 [debug] 8111#0: post event 00007F2538837010 584 2011/10/03 11:24:41 [debug] 8111#0: delete posted event 00007F2538837010 585 2011/10/03 11:24:41 [debug] 8111#0: accept on 0.0.0.0:80, ready: 0 586 2011/10/03 11:24:41 [debug] 8111#0: posix_memalign: 0000000000F2F8A0:256 @16 587 2011/10/03 11:24:41 [debug] 8111#0: *47 accept: 10.178.51.115 fd:7 588 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer add: 7: 60000:1317666341381 589 2011/10/03 11:24:41 [debug] 8111#0: *47 epoll add event: fd:7 op:1 ev:80000001 590 2011/10/03 11:24:41 [debug] 8111#0: *47 post event 00007F25388370E0 591 2011/10/03 11:24:41 [debug] 8111#0: *47 delete posted event 00007F25388370E0 592 2011/10/03 11:24:41 [debug] 8111#0: *47 malloc: 0000000000F3D730:1296 593 2011/10/03 11:24:41 [debug] 8111#0: *47 posix_memalign: 0000000000F5CCC0:256 @16 594 2011/10/03 11:24:41 [debug] 8111#0: *47 malloc: 0000000000F3DC50:1024 595 2011/10/03 11:24:41 [debug] 8111#0: *47 posix_memalign: 0000000000F3E060:4096 @16 596 2011/10/03 11:24:41 [debug] 8111#0: *47 http process request line 597 2011/10/03 11:24:41 [debug] 8111#0: *47 recv: fd:7 1024 of 1024 598 2011/10/03 11:24:41 [debug] 8111#0: *47 http request line: "POST /rspool/?a=b&c=d HTTP/1.0" 599 2011/10/03 11:24:41 [debug] 8111#0: *47 http uri: "/rspool/" 600 2011/10/03 11:24:41 [debug] 8111#0: *47 http args: "a=b&c=d" 601 2011/10/03 11:24:41 [debug] 8111#0: *47 http exten: "" 602 2011/10/03 11:24:41 [debug] 8111#0: *47 http process request header line 603 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Host: 209.114.46.109" 604 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "X-Real-IP: 98.173.193.68" 605 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "X-Forwarded-For: 98.173.193.68" 606 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Connection: close" 607 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Accept-Encoding: identity" 608 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Content-Length: 5204" 609 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Session-ID: 14367198" 610 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "X-Content-Range: bytes 204796-210000/210000" 611 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Content-Type: text/plain" 612 2011/10/03 11:24:41 [debug] 8111#0: *47 http header: "Content-Disposition: attachment; filename="ric.log"" 613 2011/10/03 11:24:41 [debug] 8111#0: *47 http header done 614 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer del: 7: 1317666341381 615 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 0 616 2011/10/03 11:24:41 [debug] 8111#0: *47 rewrite phase: 1 617 2011/10/03 11:24:41 [debug] 8111#0: *47 test location: "/rspool/" 618 2011/10/03 11:24:41 [debug] 8111#0: *47 using configuration "/rspool/" 619 2011/10/03 11:24:41 [debug] 8111#0: *47 http cl:5204 max:52428800 620 2011/10/03 11:24:41 [debug] 8111#0: *47 rewrite phase: 3 621 2011/10/03 11:24:41 [debug] 8111#0: *47 post rewrite phase: 4 622 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 5 623 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 6 624 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 7 625 2011/10/03 11:24:41 [debug] 8111#0: *47 access phase: 8 626 2011/10/03 11:24:41 [debug] 8111#0: *47 access phase: 9 627 2011/10/03 11:24:41 [debug] 8111#0: *47 post access phase: 10 628 2011/10/03 11:24:41 [debug] 8111#0: *47 session id 14367198 629 2011/10/03 11:24:41 [debug] 8111#0: *47 partial content, range 204796-210000/210000 630 2011/10/03 11:24:41 [debug] 8111#0: *47 posix_memalign: 0000000000F34400:4096 @16 631 2011/10/03 11:24:41 [debug] 8111#0: *47 malloc: 0000000000F35410:4096 632 2011/10/03 11:24:41 [debug] 8111#0: *47 http client request body preread 696 633 2011/10/03 11:24:41 [debug] 8111#0: *47 malloc: 0000000000F36420:4508 634 2011/10/03 11:24:41 [debug] 8111#0: *47 http read client request body 635 2011/10/03 11:24:41 [debug] 8111#0: *47 recv: fd:7 4508 of 4508 636 2011/10/03 11:24:41 [debug] 8111#0: *47 http client request body recv 4508 637 2011/10/03 11:24:41 [debug] 8111#0: *47 http client request body rest 0 638 2011/10/03 11:24:41 [debug] 8111#0: *47 add cleanup: 0000000000F347D8 639 2011/10/03 11:24:41 [debug] 8111#0: *47 hashed path: /var/lib/nginx/resumable_download/8/14367198 640 2011/10/03 11:24:41 [debug] 8111#0: *47 hashed path of state file: /var/lib/nginx/resumable_download/8/14367198.state 641 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "" 642 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "_name" 643 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "ric.log" 644 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "" 645 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "_content_type" 646 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "text/plain" 647 2011/10/03 11:24:41 [debug] 8111#0: *47 posix_memalign: 0000000000F375D0:4096 @16 648 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "" 649 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "_path" 650 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "/var/lib/nginx/resumable_download/8/14367198" 651 2011/10/03 11:24:41 [info] 8111#0: *47 started uploading part 204796-210000/210000 of file "ric.log" to "/var/lib/nginx/resumable_download/8/14367198" (field "", content type "text/plain"), client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 652 2011/10/03 11:24:41 [debug] 8111#0: *47 write: 14, 0000000000F3DD98, 696, 204796 653 2011/10/03 11:24:41 [debug] 8111#0: *47 write: 14, 0000000000F36420, 4508, 205492 654 2011/10/03 11:24:41 [error] 8111#0: *47 file offset at the end of a part 210000 does not match the end specified range 204796-210000/210000, client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" 655 2011/10/03 11:24:41 [debug] 8111#0: *47 test location: "@rspool_upload" 656 2011/10/03 11:24:41 [debug] 8111#0: *47 using location: @rspool_upload "/rspool/?a=b&c=d" 657 2011/10/03 11:24:41 [debug] 8111#0: *47 rewrite phase: 3 658 2011/10/03 11:24:41 [debug] 8111#0: *47 post rewrite phase: 4 659 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 5 660 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 6 661 2011/10/03 11:24:41 [debug] 8111#0: *47 generic phase: 7 662 2011/10/03 11:24:41 [debug] 8111#0: *47 access phase: 8 663 2011/10/03 11:24:41 [debug] 8111#0: *47 access phase: 9 664 2011/10/03 11:24:41 [debug] 8111#0: *47 post access phase: 10 665 2011/10/03 11:24:41 [debug] 8111#0: *47 http init upstream, client timer: 0 666 2011/10/03 11:24:41 [debug] 8111#0: *47 epoll add event: fd:7 op:3 ev:80000005 667 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "QUERY_STRING" 668 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "a=b&c=d" 669 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "QUERY_STRING: a=b&c=d" 670 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "REQUEST_METHOD" 671 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "POST" 672 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "REQUEST_METHOD: POST" 673 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "CONTENT_TYPE" 674 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "multipart/form-data; boundary=00000000000000000040" 675 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "CONTENT_TYPE: multipart/form-data; boundary=00000000000000000040" 676 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "CONTENT_LENGTH" 677 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "28" 678 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "CONTENT_LENGTH: 28" 679 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SCRIPT_FILENAME" 680 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "/rspool/" 681 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SCRIPT_FILENAME: /rspool/" 682 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SCRIPT_NAME" 683 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SCRIPT_NAME: " 684 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "REQUEST_URI" 685 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "/rspool/?a=b&c=d" 686 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "REQUEST_URI: /rspool/?a=b&c=d" 687 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "DOCUMENT_URI" 688 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "/rspool/" 689 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "DOCUMENT_URI: /rspool/" 690 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "DOCUMENT_ROOT" 691 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "/nutricate/static" 692 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "DOCUMENT_ROOT: /nutricate/static" 693 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SERVER_PROTOCOL" 694 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "HTTP/1.0" 695 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SERVER_PROTOCOL: HTTP/1.0" 696 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "GATEWAY_INTERFACE" 697 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "CGI/1.1" 698 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1" 699 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SERVER_SOFTWARE" 700 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "nginx/" 701 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "1.0.6" 702 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SERVER_SOFTWARE: nginx/1.0.6" 703 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "REMOTE_ADDR" 704 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "10.178.51.115" 705 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "REMOTE_ADDR: 10.178.51.115" 706 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "REMOTE_PORT" 707 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "60461" 708 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "REMOTE_PORT: 60461" 709 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SERVER_ADDR" 710 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "10.178.34.181" 711 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SERVER_ADDR: 10.178.34.181" 712 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SERVER_PORT" 713 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "80" 714 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SERVER_PORT: 80" 715 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "SERVER_NAME" 716 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: " account.nutricateonline.com" 717 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "SERVER_NAME: account.nutricateonline.com" 718 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "REDIRECT_STATUS" 719 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "200" 720 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "REDIRECT_STATUS: 200" 721 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "FCGI" 722 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: " account.nutricateonline.com" 723 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "FCGI: account.nutricateonline.com" 724 2011/10/03 11:24:41 [debug] 8111#0: *47 http script copy: "PATH_INFO" 725 2011/10/03 11:24:41 [debug] 8111#0: *47 http script var: "/rspool/" 726 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "PATH_INFO: /rspool/" 727 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_HOST: 209.114.46.109" 728 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_X_REAL_IP: 98.173.193.68" 729 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_X_FORWARDED_FOR: 98.173.193.68" 730 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_CONNECTION: close" 731 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_ACCEPT_ENCODING: identity" 732 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_CONTENT_LENGTH: 28" 733 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_SESSION_ID: 14367198" 734 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_X_CONTENT_RANGE: bytes 204796-210000/210000" 735 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_CONTENT_TYPE: multipart/form-data; boundary=00000000000000000040" 736 2011/10/03 11:24:41 [debug] 8111#0: *47 fastcgi param: "HTTP_CONTENT_DISPOSITION: attachment; filename="ric.log"" 737 2011/10/03 11:24:41 [debug] 8111#0: *47 http cleanup add: 0000000000F38418 738 2011/10/03 11:24:41 [debug] 8111#0: *47 get rr peer, try: 1 739 2011/10/03 11:24:41 [debug] 8111#0: *47 socket 14 740 2011/10/03 11:24:41 [debug] 8111#0: *47 epoll add connection: fd:14 ev:80000005 741 2011/10/03 11:24:41 [debug] 8111#0: *47 connect to 127.0.0.1:10000, fd:14 #48 742 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream connect: -2 743 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer add: 14: 60000:1317666341381 744 2011/10/03 11:24:41 [debug] 8111#0: *47 http finalize request: -4, "/rspool/?a=b&c=d" a:1, c:3 745 2011/10/03 11:24:41 [debug] 8111#0: *47 http request count:3 blk:0 746 2011/10/03 11:24:41 [debug] 8111#0: *47 http finalize request: -4, "/rspool/?a=b&c=d" a:1, c:2 747 2011/10/03 11:24:41 [debug] 8111#0: *47 http request count:2 blk:0 748 2011/10/03 11:24:41 [debug] 8111#0: *47 post event 00007F25388020E0 749 2011/10/03 11:24:41 [debug] 8111#0: *47 post event 00007F2538802148 750 2011/10/03 11:24:41 [debug] 8111#0: *47 delete posted event 00007F2538802148 751 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream request: "/rspool/?a=b&c=d" 752 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream send request handler 753 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream send request 754 2011/10/03 11:24:41 [debug] 8111#0: *47 chain writer buf fl:0 s:928 755 2011/10/03 11:24:41 [debug] 8111#0: *47 chain writer buf fl:0 s:28 756 2011/10/03 11:24:41 [debug] 8111#0: *47 chain writer buf fl:0 s:12 757 2011/10/03 11:24:41 [debug] 8111#0: *47 chain writer in: 0000000000F38480 758 2011/10/03 11:24:41 [debug] 8111#0: *47 writev: 968 759 2011/10/03 11:24:41 [debug] 8111#0: *47 chain writer out: 0000000000000000 760 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer del: 14: 1317666341381 761 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer add: 14: 60000:1317666341383 762 2011/10/03 11:24:41 [debug] 8111#0: *47 delete posted event 00007F25388020E0 763 2011/10/03 11:24:41 [debug] 8111#0: *47 http run request: "/rspool/?a=b&c=d" 764 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream check client, write event:1, "/rspool/" 765 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream recv(): -1 (11: Resource temporarily unavailable) 766 2011/10/03 11:24:41 [debug] 8111#0: *47 post event 00007F2538837148 767 2011/10/03 11:24:41 [debug] 8111#0: *47 post event 00007F2538802148 768 2011/10/03 11:24:41 [debug] 8111#0: *47 delete posted event 00007F2538802148 769 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream request: "/rspool/?a=b&c=d" 770 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream dummy handler 771 2011/10/03 11:24:41 [debug] 8111#0: *47 delete posted event 00007F2538837148 772 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream request: "/rspool/?a=b&c=d" 773 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream process header 774 2011/10/03 11:24:41 [debug] 8111#0: *47 malloc: 0000000000F62730:4096 775 2011/10/03 11:24:41 [debug] 8111#0: *47 posix_memalign: 0000000000F63740:4096 @16 776 2011/10/03 11:24:41 [debug] 8111#0: *47 recv: fd:14 96 of 4096 777 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 778 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 06 779 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 780 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 781 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 782 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 3A 783 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 06 784 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 785 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record length: 58 786 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi parser: 0 787 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi header: "Status: 200 OK" 788 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi parser: 0 789 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi header: "Content-Type: text/html; charset=utf-8" 790 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi parser: 1 791 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi header done 792 2011/10/03 11:24:41 [debug] 8111#0: *47 xslt filter header 793 2011/10/03 11:24:41 [debug] 8111#0: *47 HTTP/1.1 200 OK 794 Server: nginx/1.0.6 795 Date: Mon, 03 Oct 2011 18:24:41 GMT 796 Content-Type: text/html; charset=utf-8 797 Connection: close 798 799 2011/10/03 11:24:41 [debug] 8111#0: *47 write new buf t:1 f:0 0000000000F638E0, pos 0000000000F638E0, size: 136 file: 0, size: 0 800 2011/10/03 11:24:41 [debug] 8111#0: *47 http write filter: l:0 f:0 s:136 801 2011/10/03 11:24:41 [debug] 8111#0: *47 http cacheable: 0 802 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream process upstream 803 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe read upstream: 1 804 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe preread: 30 805 2011/10/03 11:24:41 [debug] 8111#0: *47 readv: 1:4000 806 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe recv chain: 16 807 2011/10/03 11:24:41 [debug] 8111#0: *47 readv: 1:3984 808 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe recv chain: 0 809 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe buf free s:0 t:1 f:0 0000000000F62730, pos 0000000000F62772, size: 46 file: 0, size: 0 810 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 811 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 06 812 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 813 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 814 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 815 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 08 816 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 817 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 818 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record length: 8 819 2011/10/03 11:24:41 [debug] 8111#0: *47 input buf #0 0000000000F62780 820 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 821 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 06 822 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 823 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 824 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 825 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 826 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 827 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 828 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record length: 0 829 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi closed stdout 830 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 831 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 03 832 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 833 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 01 834 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 835 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 08 836 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 837 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record byte: 00 838 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi record length: 8 839 2011/10/03 11:24:41 [debug] 8111#0: *47 http fastcgi sent end request 840 2011/10/03 11:24:41 [debug] 8111#0: *47 input buf 0000000000F62780 8 841 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe write downstream: 1 842 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe write downstream flush in 843 2011/10/03 11:24:41 [debug] 8111#0: *47 http output filter "/rspool/?a=b&c=d" 844 2011/10/03 11:24:41 [debug] 8111#0: *47 http copy filter: "/rspool/?a=b&c=d" 845 2011/10/03 11:24:41 [debug] 8111#0: *47 image filter 846 2011/10/03 11:24:41 [debug] 8111#0: *47 xslt filter body 847 2011/10/03 11:24:41 [debug] 8111#0: *47 http postpone filter "/rspool/?a=b&c=d" 0000000000F63A68 848 2011/10/03 11:24:41 [debug] 8111#0: *47 write old buf t:1 f:0 0000000000F638E0, pos 0000000000F638E0, size: 136 file: 0, size: 0 849 2011/10/03 11:24:41 [debug] 8111#0: *47 write new buf t:1 f:0 0000000000F62730, pos 0000000000F62780, size: 8 file: 0, size: 0 850 2011/10/03 11:24:41 [debug] 8111#0: *47 http write filter: l:0 f:0 s:144 851 2011/10/03 11:24:41 [debug] 8111#0: *47 http copy filter: 0 "/rspool/?a=b&c=d" 852 2011/10/03 11:24:41 [debug] 8111#0: *47 pipe write downstream done 853 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer: 14, old: 1317666341383, new: 1317666341450 854 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream exit: 0000000000000000 855 2011/10/03 11:24:41 [debug] 8111#0: *47 finalize http upstream request: 0 856 2011/10/03 11:24:41 [debug] 8111#0: *47 finalize http fastcgi request 857 2011/10/03 11:24:41 [debug] 8111#0: *47 free rr peer 1 0 858 2011/10/03 11:24:41 [debug] 8111#0: *47 close http upstream connection: 14 859 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer del: 14: 1317666341383 860 2011/10/03 11:24:41 [debug] 8111#0: *47 reusable connection: 0 861 2011/10/03 11:24:41 [debug] 8111#0: *47 http upstream temp fd: -1 862 2011/10/03 11:24:41 [debug] 8111#0: *47 http output filter "/rspool/?a=b&c=d" 863 2011/10/03 11:24:41 [debug] 8111#0: *47 http copy filter: "/rspool/?a=b&c=d" 864 2011/10/03 11:24:41 [debug] 8111#0: *47 image filter 865 2011/10/03 11:24:41 [debug] 8111#0: *47 xslt filter body 866 2011/10/03 11:24:41 [debug] 8111#0: *47 http postpone filter "/rspool/?a=b&c=d" 00007FFF96ECBB50 867 2011/10/03 11:24:41 [debug] 8111#0: *47 write old buf t:1 f:0 0000000000F638E0, pos 0000000000F638E0, size: 136 file: 0, size: 0 868 2011/10/03 11:24:41 [debug] 8111#0: *47 write old buf t:1 f:0 0000000000F62730, pos 0000000000F62780, size: 8 file: 0, size: 0 869 2011/10/03 11:24:41 [debug] 8111#0: *47 write new buf t:0 f:0 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0 870 2011/10/03 11:24:41 [debug] 8111#0: *47 http write filter: l:1 f:0 s:144 871 2011/10/03 11:24:41 [debug] 8111#0: *47 http write filter limit 0 872 2011/10/03 11:24:41 [debug] 8111#0: *47 writev: 144 873 2011/10/03 11:24:41 [debug] 8111#0: *47 http write filter 0000000000000000 874 2011/10/03 11:24:41 [debug] 8111#0: *47 http copy filter: 0 "/rspool/?a=b&c=d" 875 2011/10/03 11:24:41 [debug] 8111#0: *47 http finalize request: 0, "/rspool/?a=b&c=d" a:1, c:1 876 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer add: 7: 5000:1317666286450 877 2011/10/03 11:24:41 [debug] 8111#0: *47 http lingering close handler 878 2011/10/03 11:24:41 [debug] 8111#0: *47 recv: fd:7 -1 of 4096 879 2011/10/03 11:24:41 [debug] 8111#0: *47 recv() not ready (11: Resource temporarily unavailable) 880 2011/10/03 11:24:41 [debug] 8111#0: *47 lingering read: -2 881 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer: 7, old: 1317666286450, new: 1317666286450 882 2011/10/03 11:24:41 [debug] 8111#0: *47 post event 00007F25388370E0 883 2011/10/03 11:24:41 [debug] 8111#0: *47 delete posted event 00007F25388370E0 884 2011/10/03 11:24:41 [debug] 8111#0: *47 http lingering close handler 885 2011/10/03 11:24:41 [debug] 8111#0: *47 recv: fd:7 0 of 4096 886 2011/10/03 11:24:41 [debug] 8111#0: *47 lingering read: 0 887 2011/10/03 11:24:41 [debug] 8111#0: *47 http request count:1 blk:0 888 2011/10/03 11:24:41 [debug] 8111#0: *47 http close request 889 2011/10/03 11:24:41 [debug] 8111#0: *47 http log handler 890 2011/10/03 11:24:41 [debug] 8111#0: *47 run cleanup: 0000000000F347D8 891 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F62730 892 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F36420 893 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F35410 894 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F3E060, unused: 0 895 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F34400, unused: 4 896 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F375D0, unused: 8 897 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F63740, unused: 2939 898 2011/10/03 11:24:41 [debug] 8111#0: *47 close http connection: 7 899 2011/10/03 11:24:41 [debug] 8111#0: *47 event timer del: 7: 1317666286450 900 2011/10/03 11:24:41 [debug] 8111#0: *47 reusable connection: 0 901 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F3DC50 902 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F3D730 903 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F2F8A0, unused: 8 904 2011/10/03 11:24:41 [debug] 8111#0: *47 free: 0000000000F5CCC0, unused: 112 Please note that despite the error message on line 680, the uploaded file is byte-for-byte identical to the source file. Error message follows: 2011/10/03 10:58:46 [error] 8111#0: *35 file offset at the end of a part 210000 does not match the end specified range 204796-210000/210000, client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" I am uploading to the following django script. All it currently does is log it's calling parameters. def index(request, **kwargs): obj = ResumableSpoolerUpload() return obj.run(request, **kwargs) class ResumableSpoolerUpload(View): def __init__(self): pass def run(self, request, **kwargs): self.request = request print "--------------------------------------------" print datetime.now().isoformat() print "request.path %r" % request.path print "kwargs %r" % kwargs print "request.GET %r" % request.GET print "request.POST %r" % request.POST print "request.FILES %r" % request.FILES print "request.META %r" % request.META return HttpResponse('k-thanks') When I check the output of the django script (which, right now simply logs everything it was called with), I do not see any of the upload variables: 2011-10-03T09:48:49.150461 request.path u'/rspool/' kwargs {'full_url': u'rspool/'} request.GET request.POST request.FILES request.META {'wsgi.multiprocess': True, 'REDIRECT_STATUS': '200', 'SERVER_SOFTWARE': 'nginx/1.0.6', 'SCRIPT_NAME': u'', 'REQUEST_METHOD': 'POST', 'PATH_INFO': u'/rspool/', 'SERVER_PROTOCOL': 'HTTP/1.0', 'QUERY_STRING': 'a=b&c=d', 'HTTP_X_REAL_IP': '98.173.193.68', 'CONTENT_LENGTH': '28', 'HTTP_CONNECTION': 'close', 'SERVER_NAME': ' account.nutricateonline.com', 'REMOTE_PORT': '36801', 'wsgi.url_scheme': 'http', 'SERVER_PORT': '80', 'SERVER_ADDR': '10.178.34.181', 'DOCUMENT_ROOT': '/nutricate/static', 'HTTP_SESSION_ID': '60833313', 'HTTP_CONTENT_LENGTH': '28', 'SCRIPT_FILENAME': '/rspool/', 'DOCUMENT_URI': '/rspool/', 'FCGI': 'account.nutricateonline.com', 'wsgi.input': , 'HTTP_HOST': '209.114.46.109', 'wsgi.multithread': False, 'HTTP_CONTENT_DISPOSITION': 'attachment; filename="ric.log"', 'HTTP_CONTENT_TYPE': 'multipart/form-data; boundary=00000000000000000020', 'REQUEST_URI': '/rspool/?a=b&c=d', 'wsgi.version': (1, 0), 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_X_FORWARDED_FOR': '98.173.193.68', 'wsgi.errors': , 'REMOTE_ADDR': '10.178.51.115', 'HTTP_X_CONTENT_RANGE': 'bytes 204796-210000/210000', 'wsgi.run_once': False, 'CONTENT_TYPE': 'multipart/form-data; boundary=00000000000000000020', 'HTTP_ACCEPT_ENCODING': 'identity'} I think that having request.FILES empty is correct. The two parameters in the GET dictionary are from the command line (also correct). However I think the upload parameters should be represented somewhere. Can anyone suggest next steps? Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Mon Oct 3 19:24:53 2011 From: francis at daoine.org (Francis Daly) Date: Mon, 3 Oct 2011 20:24:53 +0100 Subject: Problem with GZIP In-Reply-To: <6d8b8e58e55a92e5d88a5b26e1712c8b.NginxMailingListEnglish@forum.nginx.org> References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> <80be4b409a2be09686f3e4baa9009a93.NginxMailingListEnglish@forum.nginx.org> <6d8b8e58e55a92e5d88a5b26e1712c8b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111003192453.GK12179@craic.sysops.org> On Mon, Oct 03, 2011 at 11:09:47AM -0400, firestorm wrote: Hi there, > and the problem remains. It works for me. So there is some difference in our configurations. I've copied your original gzip* configuration, and added "expires max" to the relevant location, since the logs suggest you are using that too. While testing, I suggest you simplify the configuration until you find what changes makes it go from not-working to working, or the other way around. With the following nginx: $ sbin/nginx -V nginx: nginx version: nginx/1.1.4 nginx: built by gcc 4.4.5 (Debian 4.4.5-8) nginx: configure arguments: --with-debug and the following nginx.conf: $ cat conf/nginx.conf events { worker_connections 1024; debug_connection 127.0.0.1; } http { include mime.types; 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; server { listen 8000; location / { expires max; } } } I can see the result of the following commands: $ curl -v --compressed http://localhost:8000/a.txt >/dev/null * About to connect() to localhost port 8000 (#0) * Trying 127.0.0.1... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected * Connected to localhost (127.0.0.1) port 8000 (#0) > GET /a.txt HTTP/1.1 > User-Agent: curl/7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6 > Host: localhost:8000 > Accept: */* > Accept-Encoding: deflate, gzip > < HTTP/1.1 200 OK < Server: nginx/1.1.4 < Date: Mon, 03 Oct 2011 19:14:08 GMT < Content-Type: text/plain < Last-Modified: Mon, 03 Oct 2011 19:03:51 GMT < Transfer-Encoding: chunked < Connection: keep-alive < Expires: Thu, 31 Dec 2037 23:55:55 GMT < Cache-Control: max-age=315360000 < Content-Encoding: gzip < { [data not shown] 100 1028 0 1028 0 0 51451 0 --:--:-- --:--:-- --:--:-- 57111* Connection #0 to host localhost left intact * Closing connection #0 which shows that my text/plain was compressed ("Content-Encoding: gzip" in the response headers); and $ curl -v --compressed http://localhost:8000/a.css >/dev/null * About to connect() to localhost port 8000 (#0) * Trying 127.0.0.1... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected * Connected to localhost (127.0.0.1) port 8000 (#0) > GET /a.css HTTP/1.1 > User-Agent: curl/7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6 > Host: localhost:8000 > Accept: */* > Accept-Encoding: deflate, gzip > < HTTP/1.1 200 OK < Server: nginx/1.1.4 < Date: Mon, 03 Oct 2011 19:15:36 GMT < Content-Type: text/css < Content-Length: 2726 < Last-Modified: Mon, 03 Oct 2011 19:03:51 GMT < Connection: keep-alive < Expires: Thu, 31 Dec 2037 23:55:55 GMT < Cache-Control: max-age=315360000 < Accept-Ranges: bytes < { [data not shown] 100 2726 100 2726 0 0 487k 0 --:--:-- --:--:-- --:--:-- 887k* Connection #0 to host localhost left intact * Closing connection #0 which shows that my text/css output was not compressed. When I add text/css to the gzip_types line and reload, then my text/css output shows as compressed. Get that much working on your system, to prove that your test system is right, and then add back the desired final configuration in stages. Good luck with it, f -- Francis Daly francis at daoine.org From francis at daoine.org Mon Oct 3 23:23:41 2011 From: francis at daoine.org (Francis Daly) Date: Tue, 4 Oct 2011 00:23:41 +0100 Subject: upload module parameters issue In-Reply-To: References: <21793226c760e08d8926eb9b18c5d323.NginxMailingListEnglish@forum.nginx.org> <240321c88d3afafaedd78f6cafce2e87.NginxMailingListEnglish@forum.nginx.org> <20111003145345.GJ12179@craic.sysops.org> Message-ID: <20111003232341.GL12179@craic.sysops.org> On Mon Oct 3 19:04:22 UTC 2011, Andrew Hammond wrote: Hi there, > 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; > upload_aggregate_form_field "${upload_field_name}_sha1" $upload_file_sha1; > upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size; Note that "resumable" can apply to a single file, without any $upload_field_name set, so you'll get things like "_name" and "_content_type" in your final post content. > I upload to the system using the following (see > https://github.com/SmartReceipt/py_lightweight_uploader): One important off-by-one error there: --- py_lightweight_uploader.py 2011-10-03 23:37:18.000000000 +0100 +++ py_lightweight_uploader.py 2011-10-03 23:40:24.000000000 +0100 @@ -188,7 +188,7 @@ @property def next_content_range(self): plus_chunk = self.last_byte_uploaded + self.chunk_size - 1 - top_bound = plus_chunk if plus_chunk < self.total_file_size else self.total_file_size + top_bound = plus_chunk if plus_chunk < self.total_file_size else self.total_file_size - 1 return 'bytes %d-%d/%d' % (self.last_byte_uploaded, top_bound, self.total_file_size) @property > Please note that despite the error message on line 680, the uploaded file is > byte-for-byte identical to the source file. Error message follows: > > 2011/10/03 10:58:46 [error] 8111#0: *35 file offset at the end of a part > 210000 does not match the end specified range 204796-210000/210000, client: > 10.178.51.115, server: account.nutricateonline.com, request: "POST > /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109" The range is expected to be 204796-209999/210000, as patched above. > I think that having request.FILES empty is correct. The two parameters in > the GET dictionary are from the command line (also correct). However I think > the upload parameters should be represented somewhere. Can anyone suggest > next steps? They'll be in the POST dictionary when the client is right. Note that you are also double-sending the last byte of each chunk -- make chunk_size be 1 or 2 and send a small file, and you'll see the problem. The receiving side can handle the double-send, so it's an inefficiency rather than a protocol error. But with 50kB chunks, that last range should really be 204800-209999/210000. Good luck with it, f -- Francis Daly francis at daoine.org From andrew.george.hammond at gmail.com Tue Oct 4 00:35:05 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Mon, 3 Oct 2011 17:35:05 -0700 Subject: upload module parameters issue Message-ID: Thanks very much, that really helped! > On Mon Oct 3 19:04:22 UTC 2011, Andrew Hammond wrote: > > Hi there, > > >* 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;*> >* upload_aggregate_form_field "${upload_field_name}_sha1" $upload_file_sha1;*> >* upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size;*> > Note that "resumable" can apply to a single file, without any > $upload_field_name set, so you'll get things like "_name" and > "_content_type" in your final post content. What would be the right way to get the $upload_field_name populated? Or should I even worry about that? I don't imagine that my usage will care about it (I'm going to be including the module and uploading a single file at a time), however I'd like the library code to not suck too much for the next guy. > >* I upload to the system using the following (see*> >* https://github.com/SmartReceipt/py_lightweight_uploader):*> > One important off-by-one error there: > > --- py_lightweight_uploader.py 2011-10-03 23:37:18.000000000 +0100 > +++ py_lightweight_uploader.py 2011-10-03 23:40:24.000000000 +0100 > @@ -188,7 +188,7 @@ > @property > def next_content_range(self): > plus_chunk = self.last_byte_uploaded + self.chunk_size - 1 > - top_bound = plus_chunk if plus_chunk < self.total_file_size else self.total_file_size > + top_bound = plus_chunk if plus_chunk < self.total_file_size else self.total_file_size - 1 > return 'bytes %d-%d/%d' % (self.last_byte_uploaded, top_bound, self.total_file_size) > > @property > > >* Please note that despite the error message on line 680, the uploaded file is*> >* byte-for-byte identical to the source file. Error message follows:*> >* *> >* 2011/10/03 10:58:46 [error] 8111#0: *35 file offset at the end of a part*> >* 210000 does not match the end specified range 204796-210000/210000, client:*> >* 10.178.51.115, server: account.nutricateonline.com, request: "POST*> >* /rspool/?a=b&c=d HTTP/1.0", host: "209.114.46.109"*> > The range is expected to be 204796-209999/210000, as patched above. Patch applied, thanks! I also updated my UTs to reflect this change (and the 50kb default chunk size). > >* I think that having request.FILES empty is correct. The two parameters in*> >* the GET dictionary are from the command line (also correct). However I think*> >* the upload parameters should be represented somewhere. Can anyone suggest*> >* next steps?*> > They'll be in the POST dictionary when the client is right. Yup, they're there now. Perfect! > Note that you are also double-sending the last byte of each chunk -- > make chunk_size be 1 or 2 and send a small file, and you'll see the > problem. The receiving side can handle the double-send, so it's an > inefficiency rather than a protocol error. I'll root this bug out later, for now it appears to be working end-to-end. > But with 50kB chunks, that last range should really be > 204800-209999/210000. > > Good luck with it, > > f > -- > Francis Daly francis at daoine.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.premont at restena.lu Tue Oct 4 07:22:31 2011 From: bruno.premont at restena.lu (Bruno =?UTF-8?B?UHLDqW1vbnQ=?=) Date: Tue, 4 Oct 2011 09:22:31 +0200 Subject: [PATCH] Add IPv6 support to GeoIP module Message-ID: <20111004092231.10a846bd@pluto.restena.lu> Hello all, geoip module currently only supports a single country and a single city MaxMind database that must cover IPv4 address range. Below patch allows setting up to two city and country databases, one for IPv4 and one for IPv6. It then looks-up the requesting IP address in the appropriate database. Please review and consider applying, Bruno diff -NurpP nginx-1.0.4.orig/src/http/modules/ngx_http_geoip_module.c nginx-1.0.4/src/http/modules/ngx_http_geoip_module.c --- nginx-1.0.4.orig/src/http/modules/ngx_http_geoip_module.c 2011-05-16 15:50:58.000000000 +0200 +++ nginx-1.0.4/src/http/modules/ngx_http_geoip_module.c 2011-09-30 10:30:18.785083263 +0200 @@ -16,6 +16,9 @@ typedef struct { GeoIP *country; GeoIP *org; GeoIP *city; + GeoIP *country_v6; + GeoIP *org_v6; + GeoIP *city_v6; } ngx_http_geoip_conf_t; @@ -26,8 +29,13 @@ typedef struct { typedef const char *(*ngx_http_geoip_variable_handler_pt)(GeoIP *, u_long addr); +typedef const char *(*ngx_http_geoip_variable_handler6_pt)(GeoIP *, struct in6_addr addr); -static ngx_int_t ngx_http_geoip_country_variable(ngx_http_request_t *r, +static ngx_int_t ngx_http_geoip_country_code_variable(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data); +static ngx_int_t ngx_http_geoip_country_code3_variable(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data); +static ngx_int_t ngx_http_geoip_country_name_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data); static ngx_int_t ngx_http_geoip_org_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data); @@ -113,16 +121,16 @@ ngx_module_t ngx_http_geoip_module = { static ngx_http_variable_t ngx_http_geoip_vars[] = { { ngx_string("geoip_country_code"), NULL, - ngx_http_geoip_country_variable, - (uintptr_t) GeoIP_country_code_by_ipnum, 0, 0 }, + ngx_http_geoip_country_code_variable, + 0, 0, 0 }, { ngx_string("geoip_country_code3"), NULL, - ngx_http_geoip_country_variable, - (uintptr_t) GeoIP_country_code3_by_ipnum, 0, 0 }, + ngx_http_geoip_country_code3_variable, + 0, 0, 0 }, { ngx_string("geoip_country_name"), NULL, - ngx_http_geoip_country_variable, - (uintptr_t) GeoIP_country_name_by_ipnum, 0, 0 }, + ngx_http_geoip_country_name_variable, + 0, 0, 0 }, { ngx_string("geoip_org"), NULL, ngx_http_geoip_org_variable, @@ -180,117 +188,146 @@ static ngx_http_variable_t ngx_http_geo }; -static u_long -ngx_http_geoip_addr(ngx_http_request_t *r) +static ngx_int_t +ngx_http_geoip_get_char(ngx_http_request_t *r, ngx_http_variable_value_t *v, + GeoIP *src, ngx_http_geoip_variable_handler_pt handler, + GeoIP *src_v6, ngx_http_geoip_variable_handler6_pt handler_v6) { - struct sockaddr_in *sin; -#if (NGX_HAVE_INET6) - u_char *p; - u_long addr; - struct sockaddr_in6 *sin6; -#endif - + const char *ret = NULL; switch (r->connection->sockaddr->sa_family) { - case AF_INET: - sin = (struct sockaddr_in *) r->connection->sockaddr; - return ntohl(sin->sin_addr.s_addr); - + if (src) { + struct sockaddr_in *sin = (struct sockaddr_in *) r->connection->sockaddr; + ret = handler(src, ntohl(sin->sin_addr.s_addr)); + } + break; #if (NGX_HAVE_INET6) - case AF_INET6: - sin6 = (struct sockaddr_in6 *) r->connection->sockaddr; - - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - p = sin6->sin6_addr.s6_addr; - addr = p[12] << 24; - addr += p[13] << 16; - addr += p[14] << 8; - addr += p[15]; - - return addr; + if (src_v6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) r->connection->sockaddr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + u_char *p = sin6->sin6_addr.s6_addr; + ret = src ? handler(src, (p[12] << 24) + (p[13] << 16) + (p[14] << 8) + p[15]) : NULL; + } else + ret = handler_v6(src_v6, sin6->sin6_addr); } - + break; #endif } - return INADDR_NONE; + if (ret == NULL) { + goto not_found; + } + + v->len = ngx_strlen(ret); + v->valid = 1; + v->no_cacheable = 0; + v->not_found = 0; + v->data = (u_char *) ret; + + return NGX_OK; + +not_found: + + v->not_found = 1; + + return NGX_OK; } static ngx_int_t -ngx_http_geoip_country_variable(ngx_http_request_t *r, +ngx_http_geoip_country_code_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) { - ngx_http_geoip_variable_handler_pt handler = - (ngx_http_geoip_variable_handler_pt) data; - - const char *val; ngx_http_geoip_conf_t *gcf; gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); - if (gcf->country == NULL) { - goto not_found; + if (gcf->country == NULL && gcf->country_v6 == NULL) { + v->not_found = 1; + + return NGX_OK; } - val = handler(gcf->country, ngx_http_geoip_addr(r)); + return ngx_http_geoip_get_char(r, v, gcf->country, &GeoIP_country_code_by_ipnum, +#if (NGX_HAVE_INET6) + gcf->country_v6, &GeoIP_country_code_by_ipnum_v6 +#else + NULL, NULL +#endif + ); +} - if (val == NULL) { - goto not_found; - } - v->len = ngx_strlen(val); - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = (u_char *) val; +static ngx_int_t +ngx_http_geoip_country_code3_variable(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) +{ + ngx_http_geoip_conf_t *gcf; - return NGX_OK; + gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); -not_found: + if (gcf->country == NULL && gcf->country_v6 == NULL) { + v->not_found = 1; - v->not_found = 1; + return NGX_OK; + } - return NGX_OK; + return ngx_http_geoip_get_char(r, v, gcf->country, &GeoIP_country_code3_by_ipnum, +#if (NGX_HAVE_INET6) + gcf->country_v6, &GeoIP_country_code3_by_ipnum_v6 +#else + NULL, NULL +#endif + ); } static ngx_int_t -ngx_http_geoip_org_variable(ngx_http_request_t *r, +ngx_http_geoip_country_name_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) { - ngx_http_geoip_variable_handler_pt handler = - (ngx_http_geoip_variable_handler_pt) data; - - const char *val; ngx_http_geoip_conf_t *gcf; gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); - if (gcf->org == NULL) { - goto not_found; + if (gcf->country == NULL && gcf->country_v6 == NULL) { + v->not_found = 1; + + return NGX_OK; } - val = handler(gcf->org, ngx_http_geoip_addr(r)); + return ngx_http_geoip_get_char(r, v, gcf->country, &GeoIP_country_name_by_ipnum, +#if (NGX_HAVE_INET6) + gcf->country_v6, &GeoIP_country_name_by_ipnum_v6 +#else + NULL, NULL +#endif + ); +} - if (val == NULL) { - goto not_found; - } - v->len = ngx_strlen(val); - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = (u_char *) val; +static ngx_int_t +ngx_http_geoip_org_variable(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) +{ + ngx_http_geoip_conf_t *gcf; - return NGX_OK; + gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); -not_found: + if (gcf->org == NULL && gcf->org_v6 == NULL) { + v->not_found = 1; - v->not_found = 1; + return NGX_OK; + } - return NGX_OK; + return ngx_http_geoip_get_char(r, v, gcf->org, (ngx_http_geoip_variable_handler_pt)&GeoIP_name_by_ipnum, +#if (NGX_HAVE_INET6) + gcf->org_v6, (ngx_http_geoip_variable_handler6_pt)&GeoIP_name_by_ipnum_v6 +#else + NULL, NULL +#endif + ); } @@ -451,8 +488,26 @@ ngx_http_geoip_get_city_record(ngx_http_ gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); - if (gcf->city) { - return GeoIP_record_by_ipnum(gcf->city, ngx_http_geoip_addr(r)); + switch (r->connection->sockaddr->sa_family) { + case AF_INET: + if (gcf->city) { + struct sockaddr_in *sin = (struct sockaddr_in *) r->connection->sockaddr; + return GeoIP_record_by_ipnum(gcf->city, ntohl(sin->sin_addr.s_addr)); + } + return NULL; +#if (NGX_HAVE_INET6) + case AF_INET6: + if (gcf->city_v6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) r->connection->sockaddr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + u_char *p = sin6->sin6_addr.s6_addr; + return gcf->city ? GeoIP_record_by_ipnum(gcf->city, + (p[12] << 24) + (p[13] << 16) + (p[14] << 8) + p[15]) : NULL; + } else + return GeoIP_record_by_ipnum_v6(gcf->city_v6, sin6->sin6_addr); + } + return NULL; +#endif } return NULL; @@ -505,18 +560,19 @@ static char * ngx_http_geoip_country(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_geoip_conf_t *gcf = conf; + GeoIP *tmp; ngx_str_t *value; - if (gcf->country) { + if (gcf->country && gcf->country_v6) { return "is duplicate"; } value = cf->args->elts; - gcf->country = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE); + tmp = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE); - if (gcf->country == NULL) { + if (tmp == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "GeoIP_open(\"%V\") failed", &value[1]); @@ -525,7 +581,7 @@ ngx_http_geoip_country(ngx_conf_t *cf, n if (cf->args->nelts == 3) { if (ngx_strcmp(value[2].data, "utf8") == 0) { - GeoIP_set_charset (gcf->country, GEOIP_CHARSET_UTF8); + GeoIP_set_charset (tmp, GEOIP_CHARSET_UTF8); } else { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, @@ -534,18 +590,33 @@ ngx_http_geoip_country(ngx_conf_t *cf, n } } - switch (gcf->country->databaseType) { + switch (tmp->databaseType) { case GEOIP_COUNTRY_EDITION: case GEOIP_PROXY_EDITION: case GEOIP_NETSPEED_EDITION: + if (gcf->country) { + GeoIP_delete(tmp); + return "is duplicate"; + } else + gcf->country = tmp; + return NGX_CONF_OK; +#if (NGX_HAVE_INET6) + case GEOIP_COUNTRY_EDITION_V6: + if (gcf->country_v6) { + GeoIP_delete(tmp); + return "is duplicate"; + } else + gcf->country_v6 = tmp; return NGX_CONF_OK; +#endif default: ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid GeoIP database \"%V\" type:%d", - &value[1], gcf->country->databaseType); + &value[1], tmp->databaseType); + GeoIP_delete(tmp); return NGX_CONF_ERROR; } } @@ -555,18 +626,19 @@ static char * ngx_http_geoip_org(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_geoip_conf_t *gcf = conf; + GeoIP *tmp; ngx_str_t *value; - if (gcf->org) { + if (gcf->org && gcf->org_v6) { return "is duplicate"; } value = cf->args->elts; - gcf->org = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE); + tmp = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE); - if (gcf->org == NULL) { + if (tmp == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "GeoIP_open(\"%V\") failed", &value[1]); @@ -575,7 +647,7 @@ ngx_http_geoip_org(ngx_conf_t *cf, ngx_c if (cf->args->nelts == 3) { if (ngx_strcmp(value[2].data, "utf8") == 0) { - GeoIP_set_charset (gcf->org, GEOIP_CHARSET_UTF8); + GeoIP_set_charset (tmp, GEOIP_CHARSET_UTF8); } else { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, @@ -584,19 +656,37 @@ ngx_http_geoip_org(ngx_conf_t *cf, ngx_c } } - switch (gcf->org->databaseType) { + switch (tmp->databaseType) { case GEOIP_ISP_EDITION: case GEOIP_ORG_EDITION: case GEOIP_DOMAIN_EDITION: case GEOIP_ASNUM_EDITION: + if (gcf->org) { + GeoIP_delete(tmp); + return "is duplicate"; + } else + gcf->org = tmp; + return NGX_CONF_OK; +#if (NGX_HAVE_INET6) + case GEOIP_ISP_EDITION_V6: + case GEOIP_ORG_EDITION_V6: + case GEOIP_DOMAIN_EDITION_V6: + case GEOIP_ASNUM_EDITION_V6: + if (gcf->org_v6) { + GeoIP_delete(tmp); + return "is duplicate"; + } else + gcf->org_v6 = tmp; return NGX_CONF_OK; +#endif default: ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid GeoIP database \"%V\" type:%d", - &value[1], gcf->org->databaseType); + &value[1], tmp->databaseType); + GeoIP_delete(tmp); return NGX_CONF_ERROR; } } @@ -606,18 +696,19 @@ static char * ngx_http_geoip_city(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_geoip_conf_t *gcf = conf; + GeoIP *tmp; ngx_str_t *value; - if (gcf->city) { + if (gcf->city && gcf->city_v6) { return "is duplicate"; } value = cf->args->elts; - gcf->city = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE); + tmp = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE); - if (gcf->city == NULL) { + if (tmp == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "GeoIP_open(\"%V\") failed", &value[1]); @@ -626,7 +717,7 @@ ngx_http_geoip_city(ngx_conf_t *cf, ngx_ if (cf->args->nelts == 3) { if (ngx_strcmp(value[2].data, "utf8") == 0) { - GeoIP_set_charset (gcf->city, GEOIP_CHARSET_UTF8); + GeoIP_set_charset (tmp, GEOIP_CHARSET_UTF8); } else { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, @@ -635,17 +726,32 @@ ngx_http_geoip_city(ngx_conf_t *cf, ngx_ } } - switch (gcf->city->databaseType) { + switch (tmp->databaseType) { case GEOIP_CITY_EDITION_REV0: case GEOIP_CITY_EDITION_REV1: + if (gcf->city) { + GeoIP_delete(tmp); + return "is duplicate"; + } else + gcf->city = tmp; + return NGX_CONF_OK; +#if (NGX_HAVE_INET6) + case GEOIP_CITY_EDITION_REV0_V6: + case GEOIP_CITY_EDITION_REV1_V6: + if (gcf->city_v6) { + GeoIP_delete(tmp); + return "is duplicate"; + } else + gcf->city_v6 = tmp; return NGX_CONF_OK; +#endif default: ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid GeoIP City database \"%V\" type:%d", - &value[1], gcf->city->databaseType); + &value[1], tmp->databaseType); return NGX_CONF_ERROR; } } @@ -659,12 +765,21 @@ ngx_http_geoip_cleanup(void *data) if (gcf->country) { GeoIP_delete(gcf->country); } + if (gcf->country_v6) { + GeoIP_delete(gcf->country_v6); + } if (gcf->org) { GeoIP_delete(gcf->org); } + if (gcf->org_v6) { + GeoIP_delete(gcf->org_v6); + } if (gcf->city) { GeoIP_delete(gcf->city); } + if (gcf->city_v6) { + GeoIP_delete(gcf->city_v6); + } } From sjaak23 at gmail.com Tue Oct 4 07:39:59 2011 From: sjaak23 at gmail.com (Sjaak Pieterse) Date: Tue, 4 Oct 2011 09:39:59 +0200 Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: Hi Liseen, setting hash_again greater than the number of servers works, equal not. i think i will get in the code some day to patch the upstream_fair, but than i need some free time. thnx for the help. grt 2011/10/3 liseen : > Hi, sjaak > > On Mon, Oct 3, 2011 at 10:39 PM, Sjaak Pieterse wrote: >> >> Hey Liseen, >> >> Thank you for teh fix, it's working now for standard round robin, for >> upstream_hash it's not working but that's no problem for us we are not >> using that in production. > > The fail test also add one time to hash_again. ?Can you set hash_again > 10(greater ?than or equal servers's number), try again and ?tell me the > result? ? The upstream_hash module ?has ?worked ?for some time. >> >> what we often use is gnosek-nginx-upstream-fair, to make it work with >> that, can you tell how to handle? > > Patch the upstream-fair module like round_robin and upstream_hash module. > Maybe these should be a module that contains all of the following features: > ?RR, Hash, Fair, Health check. ?Hope some body will provide such module. I > don't like patching code. > >> >> >> this is what i've done to make it work for now: >> >> peckhardt at test-nginx:~/nginx-1.0.6$ patch -p1 < >> ../liseen-healthcheck_nginx_upstreams-17298cf/healthcheck.patch >> patching file src/http/ngx_http_upstream.c >> Hunk #1 succeeded at 4270 (offset 11 lines). >> patching file src/http/ngx_http_upstream.h >> patching file src/http/ngx_http_upstream_round_robin.c >> Hunk #2 succeeded at 25 with fuzz 2 (offset 9 lines). >> Hunk #3 succeeded at 33 (offset 9 lines). >> Hunk #4 succeeded at 68 (offset 9 lines). >> Hunk #5 succeeded at 416 (offset 7 lines). >> Hunk #6 succeeded at 448 (offset 7 lines). >> Hunk #7 succeeded at 465 (offset 7 lines). >> Hunk #8 succeeded at 506 (offset 7 lines). >> Hunk #9 succeeded at 523 (offset 7 lines). >> Hunk #10 succeeded at 617 (offset 7 lines). >> patching file src/http/ngx_http_upstream_round_robin.h >> >> peckhardt at test-nginx:~/nginx-1.0.6$sudo ./configure >> --with-http_ssl_module >> --add-module=/home/peckhardt/gnosek-nginx-upstream-fair-2131c73 >> --with-http_stub_status_module >> --add-module=/home/peckhardt/liseen-healthcheck_nginx_upstreams-17298cf >> --add-module=/home/peckhardt/liseen-nginx_upstream_hash-43fab03 >> --prefix=/usr/local/nginx-1.0.6 --with-debug >> >> peckhardt at test-nginx:~/nginx-1.0.6$sudo su >> peckhardt at test-nginx:~/nginx-1.0.6$make install clean >> >> nginx config: >> ########### test healthcheck ###### >> ? ?upstream www-health{ >> ? ? ? ?server 213.154.235.185 ; >> ? ? ? ?server 213.136.14.13 ; >> ? ?#hash $request_uri; >> ? ?#hash_again 1; >> ? ?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'; >> ? ?} >> >> >> >> 2011/10/1 liseen : >> > Hi, >> > >> > On Sat, Oct 1, 2011 at 7:16 AM, liseen wrote: >> >> >> >> 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 >> > >> > if all upstreams' backends are down(healthcheck), ?cep's upstream_hash >> > will >> > ignore Healthcheck, ?if it is not you need, Please try: >> > ? https://github.com/liseen/nginx_upstream_hash >> > If you find something wrong, ?please open an issue on github. thanks. >> > >> > liseen >> > >> >> >> >> >> >> >> >> 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 >> >>> >> >> >> > >> > >> > _______________________________________________ >> > 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 nginx-forum at nginx.us Tue Oct 4 08:12:59 2011 From: nginx-forum at nginx.us (csg) Date: Tue, 04 Oct 2011 04:12:59 -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: <2f24ee713daf9e5840e6afeca7f71e87.NginxMailingListEnglish@forum.nginx.org> Hi Maxim and Igor! in the meantime we served around 15 million requests successfully without any issue on production. As a long term fix would it be possible for get Maxims' patch merged into to the official code base. As this is a change in behavior I would understand if it doesn't get merged into the stable branch, but merging this into the development branch would be excellent. # 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) { Many thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215830,216240#msg-216240 From pasik at iki.fi Tue Oct 4 08:28:55 2011 From: pasik at iki.fi (Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=) Date: Tue, 4 Oct 2011 11:28:55 +0300 Subject: Plans to integrate HeadersMore module? Message-ID: <20111004082855.GF12984@reaktio.net> Hello, Any plans to integrate the HeadersMore module (http://wiki.nginx.org/HttpHeadersMoreModule) to standard nginx? It's a very handy tool.. especially when you need to modify headers for responses like 401. Just trying to minimize the amount of custom-rpm-building for me ;) Thanks, -- Pasi From mr_ax at hotmail.com Tue Oct 4 10:11:41 2011 From: mr_ax at hotmail.com (Mr.Hackman 191) Date: Tue, 4 Oct 2011 17:11:41 +0700 Subject: How to install nginx-1.0.8 and config to play streaming and mp4 Message-ID: How to install nginx-1.0.8 and config to play streaming and mp4 i try to compile but i can not play mp4 in jw player Thank -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Oct 4 10:59:44 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 04 Oct 2011 11:59:44 +0100 Subject: $https variable? In-Reply-To: <7473606372f371777d0c7915f4012213.NginxMailingListEnglish@forum.nginx.org> References: <7473606372f371777d0c7915f4012213.NginxMailingListEnglish@forum.nginx.org> Message-ID: <874nzp3tun.wl%appa@perusio.net> On 28 Set 2011 12h25 WEST, nginx-forum at nginx.us wrote: > 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? map $scheme $php_https { default ''; https on; } fastcgi_param HTTPS $php_https; --- appa From francis at daoine.org Tue Oct 4 17:06:19 2011 From: francis at daoine.org (Francis Daly) Date: Tue, 4 Oct 2011 18:06:19 +0100 Subject: upload module parameters issue In-Reply-To: References: Message-ID: <20111004170619.GM12179@craic.sysops.org> On Mon, Oct 03, 2011 at 05:35:05PM -0700, Andrew Hammond wrote: Hi there, > Thanks very much, that really helped! > > Note that "resumable" can apply to a single file, without any > > $upload_field_name set, so you'll get things like "_name" and > > "_content_type" in your final post content. > > What would be the right way to get the $upload_field_name populated? > Or should I even worry about that? I don't imagine that my usage will > care about it (I'm going to be including the module and uploading a > single file at a time), however I'd like the library code to not suck > too much for the next guy. I'd say "don't worry about it". To upload multiple files, you use a form, which will set $upload_field_name for each file. Resumable upload with a single file just needs a single set of variables, so an empty prefix is fine. All the best, f -- Francis Daly francis at daoine.org From andrew.george.hammond at gmail.com Tue Oct 4 20:49:12 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Tue, 4 Oct 2011 13:49:12 -0700 Subject: upload module parameters issue In-Reply-To: <20111004170619.GM12179@craic.sysops.org> References: <20111004170619.GM12179@craic.sysops.org> Message-ID: On Tue, Oct 4, 2011 at 10:06 AM, Francis Daly wrote: > On Mon, Oct 03, 2011 at 05:35:05PM -0700, Andrew Hammond wrote: > > Hi there, > > > Thanks very much, that really helped! > > > > Note that "resumable" can apply to a single file, without any > > > $upload_field_name set, so you'll get things like "_name" and > > > "_content_type" in your final post content. > > > > What would be the right way to get the $upload_field_name populated? > > Or should I even worry about that? I don't imagine that my usage will > > care about it (I'm going to be including the module and uploading a > > single file at a time), however I'd like the library code to not suck > > too much for the next guy. > > I'd say "don't worry about it". > Done. I refactored the code to clean it up a little and correct that overlap bug. It's on github and can be forked if anyone wants to go further. My last (I think) issue is that I'm seeing most, but not all of the upload form fields get set. The sha1, md5 and crc32 aggregates below are blanks. request.POST I see that libssl is installed on the server. I don't see any entries in the error log that would make me think there is anything failing here. I have the following in the nginx config: upload_set_form_field upload_name $upload_file_name; upload_set_form_field upload_content_type $upload_content_type; upload_set_form_field upload_path $upload_tmp_path; upload_aggregate_form_field upload_sha1 $upload_file_sha1; upload_aggregate_form_field upload_size $upload_file_size; upload_aggregate_form_field upload_crc32 $upload_file_crc32; upload_aggregate_form_field upload_md5 $upload_file_md5; I based the above on the documentation and example config. What am I missing here? Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.thegreat at ambix.net Tue Oct 4 15:41:44 2011 From: alex.thegreat at ambix.net (Alex) Date: Tue, 4 Oct 2011 09:41:44 -0600 Subject: Nginx does not Cache Google Adsense and Some other widgets - help Message-ID: Nginx 1.0.x I have set up my cache like this: proxy_cache_key $host$uri$is_args$args; proxy_cache_methods POST; proxy_cache STATIC; proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; The URLs that are not being cached are of this form: URI?id=parameter&h=parameter or URI? id=parameter&h=parameter&w=parameter Any ideas how I can configure the cache key so that uris with those parameters get cached too? Thanks, Alex From lists at ruby-forum.com Wed Oct 5 01:28:06 2011 From: lists at ruby-forum.com (dhaval deshpande) Date: Wed, 05 Oct 2011 03:28:06 +0200 Subject: Passing variables via passenger_set_cgi_param Message-ID: Hi, My nginx location configuration looks like this location ~* ^/z/(\d+)$ { set $mID $1; set $tag_type 'z'; access_log /opt/nginx/logs/bright_tag.log bright_tag_log; if ($arg_uid ~* '.+') { access_log /opt/nginx/logs/product_uid.log prod_log; } if ($arg_orderNumber ~* '.+') { access_log /opt/nginx/logs/conversion.log conv_log; } if ($arg_prodID ~* '.+') { access_log /opt/nginx/logs/product_uid.log prod_log; } root html/bright_tag/public; passenger_enabled on; passenger_set_cgi_param UID $uid_set$uid_got; } When I hit the uri /z/123, I am able to access UID parameter in my sinatra application. But when I hit this uri /z/123?prodID=25, Nginx does not pass UID parameter to my application. I googled around for a while about this issue but everything was in vain. Can anyone give some suggestions regarding this? Thanks, Dhaval. -- Posted via http://www.ruby-forum.com/. From r at roze.lv Wed Oct 5 11:05:13 2011 From: r at roze.lv (Reinis Rozitis) Date: Wed, 5 Oct 2011 14:05:13 +0300 Subject: Nginx does not Cache Google Adsense and Some other widgets - help In-Reply-To: References: Message-ID: > Nginx does not Cache Google Adsense To understand this correctly - theese requests aren't coming directly from google servers (otherways unleast you put nginx as a proxy above google it won't be able to cache anything)? > The URLs that are not being cached are of this form: > URI?id=parameter&h=parameter or URI? > id=parameter&h=parameter&w=parameter Can you show what the full request headers look like (for example with: wget -S url)? You have: proxy_cache_valid 200 1d; which means that only 200 responses are cached and not for example 301 or 302 .. (you can try to remove '200' and see if the response is cached then). rr From mdounin at mdounin.ru Wed Oct 5 11:05:28 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 5 Oct 2011 15:05:28 +0400 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20111004092231.10a846bd@pluto.restena.lu> References: <20111004092231.10a846bd@pluto.restena.lu> Message-ID: <20111005110528.GT1137@mdounin.ru> Hello! On Tue, Oct 04, 2011 at 09:22:31AM +0200, Bruno Pr?mont wrote: > Hello all, > > > geoip module currently only supports a single country and a single city > MaxMind database that must cover IPv4 address range. > > Below patch allows setting up to two city and country databases, one > for IPv4 and one for IPv6. It then looks-up the requesting IP address in > the appropriate database. > > Please review and consider applying, Please take a look at this patch instead (this one is sitting in my TODO queue, waiting for more thoughtfull review and likely commit): http://mailman.nginx.org/pipermail/nginx-devel/2011-June/000971.html Do you have any problems with Gregor Kali?nik's patch? How your patch is different? Maxim Dounin From nginx-forum at nginx.us Wed Oct 5 11:26:47 2011 From: nginx-forum at nginx.us (csg) Date: Wed, 05 Oct 2011 07:26:47 -0400 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20111005110528.GT1137@mdounin.ru> References: <20111005110528.GT1137@mdounin.ru> Message-ID: Most IPv6 stuff was introduced with newer versions of the GeoIP library (IIRC something around 1.4.7), so you might either want to autodetect GeoIP's capabilities or embed the relevant stuff into #if LIBGEOIP_VERSION >= 1004007 ... #endif directives. Otherwise you might break builds against older versions of the library. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216238,216265#msg-216265 From gregor at unimatrix-one.org Wed Oct 5 11:31:36 2011 From: gregor at unimatrix-one.org (Gregor =?utf-8?q?Kali=C5=A1nik?=) Date: Wed, 5 Oct 2011 13:31:36 +0200 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: References: <20111005110528.GT1137@mdounin.ru> Message-ID: <201110051331.42057.gregor@unimatrix-one.org> Hi. On Wednesday 05 of October 2011 13:26:47 csg wrote: > Most IPv6 stuff was introduced with newer versions of the GeoIP library > (IIRC something around 1.4.7), so you might either want to autodetect > GeoIP's capabilities or embed the relevant stuff into > > #if LIBGEOIP_VERSION >= 1004007 > ... > #endif > > directives. Otherwise you might break builds against older versions of > the library. My patch does config checking if some GeoIPv6 specific constant exists. And I've tested agains older and newer versions of GeoIP. And it build without any problems. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From bruno.premont at restena.lu Wed Oct 5 11:56:35 2011 From: bruno.premont at restena.lu (Bruno =?UTF-8?B?UHLDqW1vbnQ=?=) Date: Wed, 5 Oct 2011 13:56:35 +0200 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20111005110528.GT1137@mdounin.ru> References: <20111004092231.10a846bd@pluto.restena.lu> <20111005110528.GT1137@mdounin.ru> Message-ID: <20111005135635.713333c9@pluto.restena.lu> Hallo, On Wed, 5 Oct 2011 15:05:28 Maxim Dounin wrote: > On Tue, Oct 04, 2011 at 09:22:31AM +0200, Bruno Pr?mont wrote: > > geoip module currently only supports a single country and a single city > > MaxMind database that must cover IPv4 address range. > > > > Below patch allows setting up to two city and country databases, one > > for IPv4 and one for IPv6. It then looks-up the requesting IP address in > > the appropriate database. > > > > Please review and consider applying, > > Please take a look at this patch instead (this one is sitting in > my TODO queue, waiting for more thoughtfull review and likely > commit): > > http://mailman.nginx.org/pipermail/nginx-devel/2011-June/000971.html > > Do you have any problems with Gregor Kali?nik's patch? I didn't stumble on Gregor's patch before writing mine and your reference made me aware of it. > How your patch is different? The difference between both patches is that mine accepts to load two databases, one for IPv4 and one for IPv6. From a short test with geoiplookup6 it seems that MaxMind's IPv6 country database includes the IPv4 database and thus can answer for mapped IPv4 addresses (which I didn't know). So as long as that remains true Gregor's patch looks more simple (while covering feature-test of geoip lib which mine doesn't) and provides the same features. If IPv6 database once stops including knowledge about IPv4 addresses lookup would start failing (but that hopefully would only happen when IPv4 gets irrelevant). Thanks, Bruno From nginx-forum at nginx.us Wed Oct 5 12:52:10 2011 From: nginx-forum at nginx.us (Giang) Date: Wed, 05 Oct 2011 08:52:10 -0400 Subject: Please help me In-Reply-To: <6e854cb19c7c2550cde5346387005244.NginxMailingListEnglish@forum.nginx.org> References: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> <6e854cb19c7c2550cde5346387005244.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3aae1b4ed549355adc6cc4b041a02cee.NginxMailingListEnglish@forum.nginx.org> Thank you for your help. But there is some issues. The Browsers didn't recognize my SSL :( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214981,216272#msg-216272 From mdounin at mdounin.ru Wed Oct 5 12:52:10 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 5 Oct 2011 16:52:10 +0400 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20111005135635.713333c9@pluto.restena.lu> References: <20111004092231.10a846bd@pluto.restena.lu> <20111005110528.GT1137@mdounin.ru> <20111005135635.713333c9@pluto.restena.lu> Message-ID: <20111005125209.GU1137@mdounin.ru> Hello! On Wed, Oct 05, 2011 at 01:56:35PM +0200, Bruno Pr?mont wrote: > Hallo, > > On Wed, 5 Oct 2011 15:05:28 Maxim Dounin wrote: > > On Tue, Oct 04, 2011 at 09:22:31AM +0200, Bruno Pr?mont wrote: > > > geoip module currently only supports a single country and a single city > > > MaxMind database that must cover IPv4 address range. > > > > > > Below patch allows setting up to two city and country databases, one > > > for IPv4 and one for IPv6. It then looks-up the requesting IP address in > > > the appropriate database. > > > > > > Please review and consider applying, > > > > Please take a look at this patch instead (this one is sitting in > > my TODO queue, waiting for more thoughtfull review and likely > > commit): > > > > http://mailman.nginx.org/pipermail/nginx-devel/2011-June/000971.html > > > > Do you have any problems with Gregor Kali?nik's patch? > > I didn't stumble on Gregor's patch before writing mine and your > reference made me aware of it. > > > How your patch is different? > > The difference between both patches is that mine accepts to load two > databases, one for IPv4 and one for IPv6. > > From a short test with geoiplookup6 it seems that MaxMind's IPv6 country > database includes the IPv4 database and thus can answer for mapped IPv4 > addresses (which I didn't know). > > So as long as that remains true Gregor's patch looks more simple (while > covering feature-test of geoip lib which mine doesn't) and provides the > same features. > > > If IPv6 database once stops including knowledge about IPv4 addresses > lookup would start failing (but that hopefully would only happen when > IPv4 gets irrelevant). IPv6 database can't really drop ipv4 mapped addresses, as it's just part of ipv6 address space and may appear even if you aren't using ipv4 at all. (This isn't really good for security reasons, but that's completely different story.) So you are happy with Gregor's patch, right? Let's focus on it then. Maxim Dounin From igor at sysoev.ru Wed Oct 5 13:36:37 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 5 Oct 2011 17:36:37 +0400 Subject: Please help me In-Reply-To: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> References: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111005133636.GB37372@nginx.com> On Thu, Sep 08, 2011 at 10:20:44AM -0400, Giang wrote: > 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 { - location /admin { + location ^~ /admin { > rewrite ^/ https://$http_host$request_uri permanent; > } > } -- Igor Sysoev From igor at sysoev.ru Wed Oct 5 13:37:23 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 5 Oct 2011 17:37:23 +0400 Subject: Please help me In-Reply-To: <6e854cb19c7c2550cde5346387005244.NginxMailingListEnglish@forum.nginx.org> References: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> <6e854cb19c7c2550cde5346387005244.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111005133723.GC37372@nginx.com> On Thu, Sep 08, 2011 at 01:36:09PM -0400, magicbear wrote: > 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; > } It's better to move /admin rewrite inside "location ^~ /admin". -- Igor Sysoev From igor at sysoev.ru Wed Oct 5 13:37:54 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 5 Oct 2011 17:37:54 +0400 Subject: Please help me In-Reply-To: <3aae1b4ed549355adc6cc4b041a02cee.NginxMailingListEnglish@forum.nginx.org> References: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> <6e854cb19c7c2550cde5346387005244.NginxMailingListEnglish@forum.nginx.org> <3aae1b4ed549355adc6cc4b041a02cee.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111005133754.GD37372@nginx.com> On Wed, Oct 05, 2011 at 08:52:10AM -0400, Giang wrote: > Thank you for your help. But there is some issues. The Browsers didn't > recognize my SSL :( http://nginx.org/en/docs/http/configuring_https_servers.html#chains -- Igor Sysoev From nginx-forum at nginx.us Wed Oct 5 13:41:19 2011 From: nginx-forum at nginx.us (Samael) Date: Wed, 05 Oct 2011 09:41:19 -0400 Subject: Please help me In-Reply-To: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> References: <2465b534c9c4d1f868de438e1e9e3ded.NginxMailingListEnglish@forum.nginx.org> Message-ID: <263ecacfce0e822d09786c1d90591ee7.NginxMailingListEnglish@forum.nginx.org> And I have no idea why would you enable sslv2 and even sslv3. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214981,216277#msg-216277 From alex.thegreat at ambix.net Wed Oct 5 14:14:22 2011 From: alex.thegreat at ambix.net (Alex) Date: Wed, 5 Oct 2011 08:14:22 -0600 Subject: Nginx does not Cache Google Adsense and Some other widgets - help In-Reply-To: References: Message-ID: <846CC5CE-03CB-4D84-B26D-8127A51AC0AB@ambix.net> Dear RR: Thank you for your insights. In regards to the wget -S url, this is what I get: --2011-10-05 18:09:32-- http://myWebDomain.com/contentAsset/resize-image/7e061df4-0fc3-481f-b75d-7ce3ff2e8cac/?w=175 Resolving myWebDomain.com... IP ADDRESS Connecting to myWebDomain.com|IP ADDRESS|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 404 Not Found Server: nginx Date: Wed, 05 Oct 2011 14:09:32 GMT Content-Type: text/html;charset=UTF-8 Connection: close Vary: Accept-Encoding Set-Cookie: JSESSIONID=5AB2FF5CF72E237DCEC48FAE19AE09F4; Path=/ Set-Cookie: SHARED_SESSION_ID=GZ3W4CP2F07E; Expires=Thu, 06- Oct-2011 14:09:32 GMT; Path=/ 2011-10-05 18:09:32 ERROR 404: Not Found. Note the address "contentAsset/resize-image/7e061df4-0fc3-481f- b75d-7ce3ff2e8cac/?w=175" is inside an image tag. If I disable the cache, it works fine. I tried to set proxy_cache_valid any 1d; and proxy_cache_valid 200 404 1d; Then, clear the cache, and restarted nginx and it still stays the same. On Oct 5, 2011, at 5:05 AM, Reinis Rozitis wrote: >> Nginx does not Cache Google Adsense > > To understand this correctly - theese requests aren't coming > directly from google servers (otherways unleast you put nginx as a > proxy above google it won't be able to cache anything)? > > > >> The URLs that are not being cached are of this form: >> URI?id=parameter&h=parameter or URI? >> id=parameter&h=parameter&w=parameter > > Can you show what the full request headers look like (for example > with: wget -S url)? > > You have: proxy_cache_valid 200 1d; > > which means that only 200 responses are cached and not for example > 301 or 302 .. (you can try to remove '200' and see if the response > is cached then). > > > > rr > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From igor at sysoev.ru Wed Oct 5 14:52:11 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 5 Oct 2011 18:52:11 +0400 Subject: nginx-1.1.5 Message-ID: <20111005145211.GF37372@nginx.com> Changes with nginx 1.1.5 05 Oct 2011 *) Feature: the "uwsgi_buffering" and "scgi_buffering" directives. Thanks to Peter Smit. *) Bugfix: non-cacheable responses might be cached if "proxy_cache_bypass" directive was used. Thanks to John Ferlito. *) Bugfix: in HTTP/1.1 support in the ngx_http_proxy_module. *) Bugfix: cached responses with an empty body were returned incorrectly; the bug had appeared in 0.8.31. *) Bugfix: 201 responses of the ngx_http_dav_module were incorrect; the bug had appeared in 0.8.32. *) Bugfix: in the "return" directive. *) Bugfix: the "ssl_session_cache builtin" directive caused segmentation fault; the bug had appeared in 1.1.1. -- Igor Sysoev From lists at ruby-forum.com Wed Oct 5 15:50:50 2011 From: lists at ruby-forum.com (dhaval deshpande) Date: Wed, 05 Oct 2011 17:50:50 +0200 Subject: Passing variables via passenger_set_cgi_param In-Reply-To: References: Message-ID: <43ae3b07fb4c76a8554d62c085a038f4@ruby-forum.com> ok never mind. I figured out myself. dhaval deshpande wrote in post #1025082: > Hi, > My nginx location configuration looks like this > > location ~* ^/z/(\d+)$ { > set $mID $1; > set $tag_type 'z'; > > access_log /opt/nginx/logs/bright_tag.log > bright_tag_log; > if ($arg_uid ~* '.+') { > access_log /opt/nginx/logs/product_uid.log > prod_log; > } > > > if ($arg_orderNumber ~* '.+') { > access_log /opt/nginx/logs/conversion.log > conv_log; > } > > if ($arg_prodID ~* '.+') { > access_log /opt/nginx/logs/product_uid.log > prod_log; > } > > root html/bright_tag/public; > passenger_enabled on; > passenger_set_cgi_param UID $uid_set$uid_got; > } > > When I hit the uri /z/123, I am able to access UID parameter in my > sinatra application. But when I hit this uri /z/123?prodID=25, Nginx > does not pass UID parameter to my application. I googled around for a > while about this issue but everything was in vain. Can anyone give some > suggestions regarding this? > > Thanks, > Dhaval. -- Posted via http://www.ruby-forum.com/. From r at roze.lv Wed Oct 5 17:14:40 2011 From: r at roze.lv (Reinis Rozitis) Date: Wed, 5 Oct 2011 20:14:40 +0300 Subject: Nginx does not Cache Google Adsense and Some other widgets - help In-Reply-To: <846CC5CE-03CB-4D84-B26D-8127A51AC0AB@ambix.net> References: <846CC5CE-03CB-4D84-B26D-8127A51AC0AB@ambix.net> Message-ID: <75A0A8D97A6643D0AF1AAB29A271F9AE@DD21> > --2011-10-05 18:09:32-- http://myWebDomain.com/contentAsset/resize-image/7e061df4-0fc3-481f-b75d-7ce3ff2e8cac/?w=175 > HTTP/1.1 404 Not Found > Server: nginx > Content-Type: text/html;charset=UTF-8 > Vary: Accept-Encoding > Set-Cookie: JSESSIONID=5AB2FF5CF72E237DCEC48FAE19AE09F4; Path=/ > Set-Cookie: SHARED_SESSION_ID=GZ3W4CP2F07E; Expires=Thu, 06- Oct-2011 14:09:32 GMT; Path=/ > 2011-10-05 18:09:32 ERROR 404: Not Found. Without the full nginx config (and the application specifics (looks like some java app/tomcat?) you are trying to proxy/cache) it is hard to understand what is going wrong. While you are getting a 404 response nginx cache should not influence if the object exists or not on the backend (unless the backend is using something dynamic (like active sessionid/cookie) for the embedded object/image serving). Is it possible to get the request/headers for the object directly from the backend (without nginx)? Also can you show the proxy_cache_path for STATIC zone and/or check if nginx actually creates any cache file there? In the end you could also enable/check the nginx error_log in more verbose mode. But if it was intended to cache the 404 responses it is clear why nginx didn't it before since proxy_cache_valid didn't have 404 specified. rr From nginx-forum at nginx.us Wed Oct 5 18:19:19 2011 From: nginx-forum at nginx.us (chicagoben) Date: Wed, 05 Oct 2011 14:19:19 -0400 Subject: Windows NGINX 1.0.8 Crash when using -s stop or -s quit Message-ID: <2a167052fe38f0430edcc2b2be9a9a77.NginxMailingListEnglish@forum.nginx.org> I sent this message to the mailing list but I haven't seen it show up anywhere. I apologize if somehow this becomes a duplicate. Windows 7 64-bit NGINX 1.0.8 (32-bit) I run nginx with 1 worker process. When I do nginx -s stop or nginx -s quit, I get a popup about an unhandled win32 exception in nginx.exe. If there is no debugger on the machine I do not see anything, but my development machine sees this *almost* every time I try to stop nginx. Has anyone else seen this or does anyone have guidance for what I can do to try to prevent this exception? Thanks, Ben Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216290,216290#msg-216290 From nginx-forum at nginx.us Thu Oct 6 02:54:03 2011 From: nginx-forum at nginx.us (danzel) Date: Wed, 05 Oct 2011 22:54:03 -0400 Subject: ruby p290p; nginx 1.0.;8 unicorn url redirect Message-ID: <2857d1b38443c73538d25222027d2cd0.NginxMailingListEnglish@forum.nginx.org> Hi, Sorry to bother you, I find this odd problem. When using ruby p180 + nginx 1.0.8 + unicorn, the url redirection works perfectly but with ruby p290, the page always redirects to the first entry on our vhost file. Any inputs will be greatly appreciated. Thanks Guys! Here is my entry on my vhost.conf: server { listen 80; server_name games.example.com; rewrite ^(.*) http://www.example.com/games permanent; } my nginx.conf: user www-data; worker_processes 2; worker_rlimit_nofile 30000; daemon off; error_log /mnt/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 2048; } http { include /etc/nginx/mime.types; default_type application/octet-stream; access_log /mnt/log/nginx/access.log; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; gzip on; gzip_http_version 1.0; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_vary on; gzip_buffers 16 8k; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; server_names_hash_bucket_size 64; include /etc/nginx/conf.d/*.conf; } my unicorn.conf: include /etc/nginx/conf.d/unicorn/upstream.conf; # HTTP server # server { listen 80; server_name ip-10-138-105-254; log_format aws '$proxy_add_x_forwarded_for - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'; access_log /mnt/log/nginx/ip-10-138-105-254.access.log aws; root /var/www/friendster-neutron/current/public; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; include /etc/nginx/conf.d/unicorn/server.conf; client_max_body_size 100m; error_page 413 /413.html; recursive_error_pages on; if ($request_filename ~ "version.txt") { break; } if ($request_filename ~ "/status/check") { break; } if (-f $document_root/system/maintenance) { return 503; } # rewrite asset urls to remove the SHA rewrite "^/[0-9a-f]{40}/(.*)" /$1 last; error_page 503 @503; location @503 { error_page 405 = /maintenance.html; if (-f $request_filename) { break; } rewrite ^(.*)$ /maintenance.html break; } location ~ ^/(images|javascripts|assets|stylesheets)/ { add_header Cache-Control public; expires modified +720h; } location ~ \.(html|ico)$ { add_header Cache-Control public; expires modified +720h; } my unicorn/server.conf try_files $uri @app; location @app { proxy_pass http://app_server; } unicorn/upstream.conf upstream app_server { server unix:/tmp/unicorn.sock fail_timeout=0; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216297,216297#msg-216297 From nginx-forum at nginx.us Thu Oct 6 04:23:19 2011 From: nginx-forum at nginx.us (danzel) Date: Thu, 06 Oct 2011 00:23:19 -0400 Subject: ruby p290p; nginx 1.0.;8 unicorn url redirect In-Reply-To: <2857d1b38443c73538d25222027d2cd0.NginxMailingListEnglish@forum.nginx.org> References: <2857d1b38443c73538d25222027d2cd0.NginxMailingListEnglish@forum.nginx.org> Message-ID: <65fd22e660c241298aee45b768058c09.NginxMailingListEnglish@forum.nginx.org> taken out ruby and rvm system wide and unicorn config on the nginx but nginx still redirects. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216297,216299#msg-216299 From micahfsu at gmail.com Thu Oct 6 03:32:52 2011 From: micahfsu at gmail.com (seminal) Date: Wed, 5 Oct 2011 20:32:52 -0700 (PDT) Subject: too many redirects Message-ID: <1317871972059-6864778.post@n2.nabble.com> I'm following the wiki's guidelines with: server { server_name mike.example.com; rewrite ^ http://www.example.com$request_uri? permanent; } I'm getting a "this page has too many redirects error". So I tried: location = example.com { rewrite example.com www.example.com permanent; } This worked after I had gone to www.example.com but if I clear the cache and first go to example.com (like a first-time user) I get a "DNS lookup failed." Any suggestions, thanks. -- View this message in context: http://nginx.2469901.n2.nabble.com/too-many-redirects-tp6864778p6864778.html Sent from the nginx mailing list archive at Nabble.com. From igor at sysoev.ru Thu Oct 6 06:34:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 6 Oct 2011 10:34:56 +0400 Subject: too many redirects In-Reply-To: <1317871972059-6864778.post@n2.nabble.com> References: <1317871972059-6864778.post@n2.nabble.com> Message-ID: <20111006063456.GB56093@nginx.com> On Wed, Oct 05, 2011 at 08:32:52PM -0700, seminal wrote: > I'm following the wiki's guidelines with: > > server { > server_name mike.example.com; > rewrite ^ http://www.example.com$request_uri? permanent; > } > > I'm getting a "this page has too many redirects error". So I tried: > > location = example.com { rewrite example.com www.example.com permanent; } This location has no sense from nginx point of view. > This worked after I had gone to www.example.com but if I clear the cache and > first go to example.com (like a first-time user) I get a "DNS lookup > failed." > > Any suggestions, thanks. server { server_name example.com; rewrite ^ http://www.example.com$request_uri? permanent; } server { server_name www.example.com; ... } -- Igor Sysoev From nginx-forum at nginx.us Thu Oct 6 06:42:25 2011 From: nginx-forum at nginx.us (danzel) Date: Thu, 06 Oct 2011 02:42:25 -0400 Subject: ruby p290p; nginx 1.0.;8 unicorn url redirect In-Reply-To: <2857d1b38443c73538d25222027d2cd0.NginxMailingListEnglish@forum.nginx.org> References: <2857d1b38443c73538d25222027d2cd0.NginxMailingListEnglish@forum.nginx.org> Message-ID: <79734c1ffdcc81c38bbd8730234f78eb.NginxMailingListEnglish@forum.nginx.org> another update: using server_name localhost; or private ipaddress, it always redirect but using public hostname the nginx is functioning well. Anyway how to bypass this one? thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216297,216302#msg-216302 From kworthington at gmail.com Thu Oct 6 12:16:51 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Thu, 6 Oct 2011 08:16:51 -0400 Subject: nginx-1.1.5 In-Reply-To: <20111005145211.GF37372@nginx.com> References: <20111005145211.GF37372@nginx.com> Message-ID: Hello Nginx Users, I just released Nginx 1.1.5 For Windows http://goo.gl/mTvwg (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, Oct 5, 2011 at 10:52 AM, Igor Sysoev wrote: > Changes with nginx 1.1.5 05 Oct > 2011 > > *) Feature: the "uwsgi_buffering" and "scgi_buffering" directives. > Thanks to Peter Smit. > > *) Bugfix: non-cacheable responses might be cached if > "proxy_cache_bypass" directive was used. > Thanks to John Ferlito. > > *) Bugfix: in HTTP/1.1 support in the ngx_http_proxy_module. > > *) Bugfix: cached responses with an empty body were returned > incorrectly; the bug had appeared in 0.8.31. > > *) Bugfix: 201 responses of the ngx_http_dav_module were incorrect; the > bug had appeared in 0.8.32. > > *) Bugfix: in the "return" directive. > > *) Bugfix: the "ssl_session_cache builtin" directive caused segmentation > fault; the bug had appeared in 1.1.1. > > > -- > 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 alex.thegreat at ambix.net Thu Oct 6 14:09:35 2011 From: alex.thegreat at ambix.net (Alex) Date: Thu, 6 Oct 2011 08:09:35 -0600 Subject: Nginx does not Cache Google Adsense and Some other widgets - help In-Reply-To: <75A0A8D97A6643D0AF1AAB29A271F9AE@DD21> References: <846CC5CE-03CB-4D84-B26D-8127A51AC0AB@ambix.net> <75A0A8D97A6643D0AF1AAB29A271F9AE@DD21> Message-ID: Dear RR: The application uses tomcat. It is a java 2EE cms called dotCMS. Here are the headers without NGINX: HTTP request sent, awaiting response... HTTP/1.1 200 OK Date: Wed, 05 Oct 2011 17:53:05 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips- rhel5 mod_bwlimited/1.4 mod_jk/1.2.31 Set-Cookie: JSESSIONID=0B54F628C20BD330D58B871703A27128; Path=/ Expires: Thu, 04 Oct 2012 17:53:05 +0000 Cache-Control: public, max-age=31536000 Last-Modified: Wed, 05 Oct 2011 13:38:53 GMT ETag: dot:null:1317821933000:64442 Content-Length: 64442 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: image/png Length: 64442 (63K) [image/png] My config file is here http://pastebin.com/Ubi0pjyq Yes, the CACHE is created. This is what I see in the cache directory. 0 1 2 3 4 5 6 7 8 9 a b c d e f tmp I appreciate your help! Alex On Oct 5, 2011, at 11:14 AM, Reinis Rozitis wrote: >> --2011-10-05 18:09:32-- http://myWebDomain.com/contentAsset/resize-image/7e061df4-0fc3-481f-b75d-7ce3ff2e8cac/?w=175 >> HTTP/1.1 404 Not Found >> Server: nginx >> Content-Type: text/html;charset=UTF-8 >> Vary: Accept-Encoding >> Set-Cookie: JSESSIONID=5AB2FF5CF72E237DCEC48FAE19AE09F4; Path=/ >> Set-Cookie: SHARED_SESSION_ID=GZ3W4CP2F07E; Expires=Thu, 06- >> Oct-2011 14:09:32 GMT; Path=/ >> 2011-10-05 18:09:32 ERROR 404: Not Found. > > > Without the full nginx config (and the application specifics (looks > like some java app/tomcat?) you are trying to proxy/cache) it is > hard to understand what is going wrong. > > While you are getting a 404 response nginx cache should not > influence if the object exists or not on the backend (unless the > backend is using something dynamic (like active sessionid/cookie) > for the embedded object/image serving). > > Is it possible to get the request/headers for the object directly > from the backend (without nginx)? > > > Also can you show the proxy_cache_path for STATIC zone and/or check > if nginx actually creates any cache file there? > > In the end you could also enable/check the nginx error_log in more > verbose mode. > > > But if it was intended to cache the 404 responses it is clear why > nginx didn't it before since proxy_cache_valid didn't have 404 > specified. > > rr > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu Oct 6 14:11:56 2011 From: nginx-forum at nginx.us (ahu) Date: Thu, 06 Oct 2011 10:11:56 -0400 Subject: FRiCKLE Labs & yo.se pres. ngx_cache_purge In-Reply-To: <07864ADE7B1B46B19DA043DF075AD211@nightmare> References: <07864ADE7B1B46B19DA043DF075AD211@nightmare> Message-ID: <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> I need some help on "FASTCGI(PHP) CACHE PURGE". I successfully configured my nginx to support purge fastcgi cache with Ctrl+F5,while I found that I can not purge the cache by request a uri like below: http://myserver.com/purge/test.php OR http://myserver.com/purge/myserver.com/test.php It always returns a 404 error :( HOW CAN I DO IT? Please help me~ Here is the key part of my nginx.conf: ---------------------------------------------------------- http { include mime.types; default_type application/octet-stream; ... fastcgi_cache_path /tmp/fastcgi_cache levels=1:2 keys_zone=TEST:10m inactive=5m; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 16k; fastcgi_buffers 16 16k; fastcgi_busy_buffers_size 16k; fastcgi_temp_file_write_size 16k; fastcgi_cache TEST; fastcgi_cache_valid 200 302 1h; fastcgi_cache_valid 301 1d; fastcgi_cache_valid any 1m; fastcgi_cache_min_uses 1; fastcgi_cache_use_stale error timeout invalid_header http_500; fastcgi_cache_key $host$uri$is_args$args; ... server { listen 80; server_name myserver.com; root /home/wwwroot; index index.html index.htm index.php; if ($request_method = 'PURGE') { rewrite ^(.*)$ /purge$1 last; } if ($http_cache_control ~ "no-cache") { set $http_cache_control 'max-age=604800'; rewrite ^(.*)$ /purge$1 last; } location ~ /purge(/.*) { #allow 127.0.0.1; #deny all; fastcgi_cache_purge TEST $host$1$is_args$args; } location ~ .*\.(php|php5)?$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; include fcgi.conf; } ... 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; } } ---------------------------------------------------------- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,39564,216317#msg-216317 From mat999 at gmail.com Thu Oct 6 14:38:33 2011 From: mat999 at gmail.com (SplitIce) Date: Fri, 7 Oct 2011 01:38:33 +1100 Subject: FRiCKLE Labs & yo.se pres. ngx_cache_purge In-Reply-To: <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> References: <07864ADE7B1B46B19DA043DF075AD211@nightmare> <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> Message-ID: This is an interesting feature, would be awsome if this got included in the core. Can it be made to work based of DELETE (method) requests I wonder? On Fri, Oct 7, 2011 at 1:11 AM, ahu wrote: > I need some help on "FASTCGI(PHP) CACHE PURGE". > > I successfully configured my nginx to support purge fastcgi cache with > Ctrl+F5,while I found that I can not purge the cache by request a uri > like below: > > http://myserver.com/purge/test.php > OR > http://myserver.com/purge/myserver.com/test.php > > It always returns a 404 error :( > > HOW CAN I DO IT? Please help me~ > > Here is the key part of my nginx.conf: > > ---------------------------------------------------------- > http { > include mime.types; > default_type application/octet-stream; > > ... > > fastcgi_cache_path /tmp/fastcgi_cache levels=1:2 keys_zone=TEST:10m > inactive=5m; > fastcgi_connect_timeout 300; > fastcgi_send_timeout 300; > fastcgi_read_timeout 300; > fastcgi_buffer_size 16k; > fastcgi_buffers 16 16k; > fastcgi_busy_buffers_size 16k; > fastcgi_temp_file_write_size 16k; > fastcgi_cache TEST; > fastcgi_cache_valid 200 302 1h; > fastcgi_cache_valid 301 1d; > fastcgi_cache_valid any 1m; > fastcgi_cache_min_uses 1; > fastcgi_cache_use_stale error timeout invalid_header http_500; > fastcgi_cache_key $host$uri$is_args$args; > > ... > > server { > listen 80; > server_name myserver.com; > root /home/wwwroot; > index index.html index.htm index.php; > > if ($request_method = 'PURGE') { > rewrite ^(.*)$ /purge$1 last; > } > > if ($http_cache_control ~ "no-cache") { > set $http_cache_control 'max-age=604800'; > rewrite ^(.*)$ /purge$1 last; > } > > location ~ /purge(/.*) { > #allow 127.0.0.1; > #deny all; > fastcgi_cache_purge TEST > $host$1$is_args$args; > } > > location ~ .*\.(php|php5)?$ { > fastcgi_pass unix:/tmp/php-cgi.sock; > fastcgi_index index.php; > fastcgi_split_path_info ^(.+\.php)(.*)$; > include fcgi.conf; > } > > ... > > 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; > } > > } > ---------------------------------------------------------- > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,39564,216317#msg-216317 > > _______________________________________________ > 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 Oct 6 15:52:46 2011 From: nginx-forum at nginx.us (Usu) Date: Thu, 06 Oct 2011 11:52:46 -0400 Subject: Does "set_real_ip_from" support IPv4 only? Message-ID: <6a23f34dd1bb0390808e8ce5e8cc13d0.NginxMailingListEnglish@forum.nginx.org> Hi, I'm confused, I get this error by entering an IPv6 address in the set_real_ip_from directive: nginx: [emerg] "set_real_ip_from" supports IPv4 only in /usr/local/nginx/conf/nginx.conf:65 But according to the changelog, that directive should support IPv6 since nginx 0.8.22: Changes with nginx 0.8.22 03 Nov 2009 [...] *) Feature: the "set_real_ip_from" directive supports IPv6 addresses in request headers. [...] My nginx version: 1.0.8 Is the changelog referring to something else or is this a bug? Thank you, Andrea Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216320,216320#msg-216320 From mdounin at mdounin.ru Thu Oct 6 16:05:25 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 6 Oct 2011 20:05:25 +0400 Subject: Does "set_real_ip_from" support IPv4 only? In-Reply-To: <6a23f34dd1bb0390808e8ce5e8cc13d0.NginxMailingListEnglish@forum.nginx.org> References: <6a23f34dd1bb0390808e8ce5e8cc13d0.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111006160525.GF1137@mdounin.ru> Hello! On Thu, Oct 06, 2011 at 11:52:46AM -0400, Usu wrote: > Hi, > > I'm confused, I get this error by entering an IPv6 address in the > set_real_ip_from directive: > > nginx: [emerg] "set_real_ip_from" supports IPv4 only in > /usr/local/nginx/conf/nginx.conf:65 > > But according to the changelog, that directive should support IPv6 since > nginx 0.8.22: > > Changes with nginx 0.8.22 03 Nov > 2009 > [...] > *) Feature: the "set_real_ip_from" directive supports IPv6 addresses > in > request headers. > [...] > > My nginx version: 1.0.8 > > Is the changelog referring to something else or is this a bug? It supports ipv6 in *request headers* (that is, it will accept ipv6 in X-Real-IP/X-Forwarded-For headers), while you are trying to use ipv6 in set_real_ip_from directive. This is not (yet) supported. Maxim Dounin From nginx-forum at nginx.us Thu Oct 6 16:13:22 2011 From: nginx-forum at nginx.us (Usu) Date: Thu, 06 Oct 2011 12:13:22 -0400 Subject: Does "set_real_ip_from" support IPv4 only? In-Reply-To: <20111006160525.GF1137@mdounin.ru> References: <20111006160525.GF1137@mdounin.ru> Message-ID: <47d2d41854fbcd0f521a2e683361d487.NginxMailingListEnglish@forum.nginx.org> I figured that might be the problem but I wasn't sure. Thank you for the quick reply! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216320,216322#msg-216322 From nginx-forum at nginx.us Thu Oct 6 16:21:37 2011 From: nginx-forum at nginx.us (ahu) Date: Thu, 06 Oct 2011 12:21:37 -0400 Subject: How to solve the problem of "405 not allowed"? In-Reply-To: References: Message-ID: <0f5a7655c4c4966f79b764d0c974d75a.NginxMailingListEnglish@forum.nginx.org> I find this problem occurs when enable fastcgi cache with php sometime.The nginx just treat php files as static files :( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2414,216323#msg-216323 From nginx-forum at nginx.us Thu Oct 6 16:31:11 2011 From: nginx-forum at nginx.us (ramindeja) Date: Thu, 06 Oct 2011 12:31:11 -0400 Subject: Enquiry regarding Sticky Module's hash functions In-Reply-To: References: Message-ID: <1cf1631c18f096afcbc4dfadf31c6b61.NginxMailingListEnglish@forum.nginx.org> Hi, We are using NGINX as a load-balancer and we would like to learn more about the MD5 hash function. We need to replicate this function in our Java application. We are using the sticky module that hashes the IP. When we tried to hash the same IP:PORT using MD5 in Java , we never got the same result. What inputs should we use for the MD5 function. Thanks in advance, RaminDeja Posted at Nginx Forum: http://forum.nginx.org/read.php?2,207455,216324#msg-216324 From nginx-forum at nginx.us Thu Oct 6 16:35:24 2011 From: nginx-forum at nginx.us (ahu) Date: Thu, 06 Oct 2011 12:35:24 -0400 Subject: How to solve the problem of "405 not allowed"? In-Reply-To: <0f5a7655c4c4966f79b764d0c974d75a.NginxMailingListEnglish@forum.nginx.org> References: <0f5a7655c4c4966f79b764d0c974d75a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <63d620952a4a8185eb9a41fd44e226f0.NginxMailingListEnglish@forum.nginx.org> ahu Wrote: ------------------------------------------------------- > I find this problem occurs when enable fastcgi > cache with php sometime.The nginx just treat php > files as static files :( p.s. I use nginx 1.1.5 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2414,216325#msg-216325 From jerome at loyet.net Thu Oct 6 16:39:00 2011 From: jerome at loyet.net (=?ISO-8859-1?B?Suly9G1lIExveWV0?=) Date: Thu, 6 Oct 2011 18:39:00 +0200 Subject: Enquiry regarding Sticky Module's hash functions In-Reply-To: <1cf1631c18f096afcbc4dfadf31c6b61.NginxMailingListEnglish@forum.nginx.org> References: <1cf1631c18f096afcbc4dfadf31c6b61.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2011/10/6 ramindeja > > Hi, Hi, > > We are using NGINX as a load-balancer and we would like to learn more > about the MD5 hash function. We need to replicate this function in our > Java application. > > We are using the sticky module that hashes the IP. Are you talking of this module: http://code.google.com/p/nginx-sticky-module/ ? > When we tried to hash > the same IP:PORT using MD5 in Java , we never got the same result. What > inputs should we use for the MD5 function. If you are using nginx-sticky-module, you won't be able to recreate the same MD5 easily because the module uses internal nginx data to create the hash. You can look in ngx_http_sticky_module.c on line 146 (http://code.google.com/p/nginx-sticky-module/source/browse/trunk/ngx_http_sticky_module.c#146). You'll find out that the md5 hash is made from the sockaddr internal structure which discribe each backend server and I'm not sure you'll be able to reconstruct the very same structure on your java side. what is your need ? there is maybe another way to achieve your goal. ++ jerome > > Thanks in advance, > RaminDeja > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,207455,216324#msg-216324 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu Oct 6 18:30:41 2011 From: nginx-forum at nginx.us (atadmin) Date: Thu, 06 Oct 2011 14:30:41 -0400 Subject: Nginx setting up >25.000 concurrent connections per second Message-ID: Hi, I a preparing a new web environment with high requirements: 100.000 concurrents connections per second (sometimes). Every server will execute a php script through php5-fpm. I am testing where are the limits of nginx (without any php) and how to setup the machine for optimize it. I will explain my tests and results: Test: 10 servers 4 CPUs, 4 Gb ram, 16Gb HD. Local Network: 1Gb (Datacenter network) 1 Server has a debian squeeze with basic installation (from netinstall iso) and nginx from debian repositories (0.7.67-3) I changed only 2 options for nginx config (i tested with others): worker_processes 4; worker_connections 10240; I add this lines to /etc/security/limits.conf (restart nginx) www-data soft nproc 100000 www-data soft nofile 100000 and for discard I/O issues i mounted /var/log/nginx in ram: mount -t tmpfs -o nodev,nosuid,noexec,nodiratime,size=2500M none /var/log/nginx/ Created static file: echo "HOLA">/var/www/a.txt >From the rest of 9 servers with the same basic installation i installed apache2-utils and changed: ulimit -n 100000. After just try this command: ab -n 500000 -c 200 http://192.168.1.11/a.txt Really i tested with few server and more with a lot of diferents values for ab tool, but i can not get better results: # awk '{ print $4 }' /var/log/nginx/localhost.access.log |awk -F: '{ print $2 ":" $3 ":" $4 }'|sort|uniq -c [...] 22345 19:57:58 21088 19:57:59 19010 19:58:00 20211 19:58:01 22469 19:58:02 23121 19:58:03 22682 19:58:04 23105 19:58:05 24537 19:58:06 22313 19:58:07 22406 19:58:08 22804 19:58:09 23823 19:58:10 22280 19:58:11 24634 19:58:12 22722 19:58:13 22429 19:58:14 24271 19:58:15 20265 19:58:16 20678 19:58:17 23136 19:58:18 22203 19:58:19 22521 19:58:20 24254 19:58:21 23216 19:58:22 22587 19:58:23 18365 19:58:24 22221 19:58:25 22123 19:58:26 24464 19:58:27 [...] Also i tried changing a lot of things in /etc/sysctl.conf (sysctl -p and restart nginx) but i didn't see better results. For example: net.ipv4.tcp_keepalive_time = 300 # Avoid a smurf attack net.ipv4.icmp_echo_ignore_broadcasts = 1 # Turn on protection for bad icmp error messages net.ipv4.icmp_ignore_bogus_error_responses = 1 # Turn on syncookies for SYN flood attack protection net.ipv4.tcp_syncookies = 0 # Turn on and log spoofed, source routed, and redirect packets net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 # No source routed packets here net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 # Turn on reverse path filtering net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 # Make sure no one can alter the routing tables net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 # Don't act as a router net.ipv4.ip_forward = 1 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 # Turn on execshild kernel.exec-shield = 1 kernel.randomize_va_space = 1 # Tuen IPv6 net.ipv6.conf.default.router_solicitations = 0 net.ipv6.conf.default.accept_ra_rtr_pref = 0 net.ipv6.conf.default.accept_ra_pinfo = 0 net.ipv6.conf.default.accept_ra_defrtr = 0 net.ipv6.conf.default.autoconf = 0 net.ipv6.conf.default.dad_transmits = 0 net.ipv6.conf.default.max_addresses = 1 # Optimization for port usefor LBs # Increase system file descriptor limit fs.file-max = 655350 # Allow for more PIDs (to reduce rollover problems); may break some programs 32768 kernel.pid_max = 65536 # Increase system IP port limits net.ipv4.ip_local_port_range = 1500 65000 # Increase TCP max buffer size setable using setsockopt() net.ipv4.tcp_rmem = 4096 87380 33554432 net.ipv4.tcp_wmem = 4096 65536 33554432 # Increase Linux auto tuning TCP buffer limits # min, default, and max number of bytes to use # set max to at least 4MB, or higher if you use very high BDP paths # Tcp Windows etc net.core.rmem_max = 33554432 net.core.wmem_max = 33554432 net.core.rmem_default=65536 net.core.wmem_default=65536 net.core.netdev_max_backlog = 5000 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_sack = 1 net.ipv4.tcp_no_metrics_save = 1 With last kernels and autoptimize is not necessary change anything about tcp buffers (but i think for this requirements yes). I was monitoring the machine while tests, CPU usage by nginx is around 30%, RAM nothing important, and few I/O traffic, Load <0.50. Could somebody help me for find where is the bottleneck? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216332,216332#msg-216332 From ktm at rice.edu Thu Oct 6 18:38:43 2011 From: ktm at rice.edu (ktm at rice.edu) Date: Thu, 6 Oct 2011 13:38:43 -0500 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: Message-ID: <20111006183843.GD10975@staff-mud-56-27.rice.edu> On Thu, Oct 06, 2011 at 02:30:41PM -0400, atadmin wrote: > Hi, > > I a preparing a new web environment with high requirements: 100.000 > concurrents connections per second (sometimes). Every server will > execute a php script through php5-fpm. > I am testing where are the limits of nginx (without any php) and how to > setup the machine for optimize it. I will explain my tests and results: > > Test: > > 10 servers 4 CPUs, 4 Gb ram, 16Gb HD. > Local Network: 1Gb (Datacenter network) > > 1 Server has a debian squeeze with basic installation (from netinstall > iso) and nginx from debian repositories (0.7.67-3) > > I changed only 2 options for nginx config (i tested with others): > > worker_processes 4; > worker_connections 10240; > > I add this lines to /etc/security/limits.conf (restart nginx) > > www-data soft nproc 100000 > www-data soft nofile 100000 > > and for discard I/O issues i mounted /var/log/nginx in ram: > > mount -t tmpfs -o nodev,nosuid,noexec,nodiratime,size=2500M none > /var/log/nginx/ > > Created static file: > echo "HOLA">/var/www/a.txt > > From the rest of 9 servers with the same basic installation i installed > apache2-utils and changed: ulimit -n 100000. After just try this > command: > > ab -n 500000 -c 200 http://192.168.1.11/a.txt > > > Really i tested with few server and more with a lot of diferents values > for ab tool, but i can not get better results: > > # awk '{ print $4 }' /var/log/nginx/localhost.access.log |awk -F: '{ > print $2 ":" $3 ":" $4 }'|sort|uniq -c > [...] > 22345 19:57:58 > 21088 19:57:59 > 19010 19:58:00 > 20211 19:58:01 > 22469 19:58:02 > 23121 19:58:03 > 22682 19:58:04 > 23105 19:58:05 > 24537 19:58:06 > 22313 19:58:07 > 22406 19:58:08 > 22804 19:58:09 > 23823 19:58:10 > 22280 19:58:11 > 24634 19:58:12 > 22722 19:58:13 > 22429 19:58:14 > 24271 19:58:15 > 20265 19:58:16 > 20678 19:58:17 > 23136 19:58:18 > 22203 19:58:19 > 22521 19:58:20 > 24254 19:58:21 > 23216 19:58:22 > 22587 19:58:23 > 18365 19:58:24 > 22221 19:58:25 > 22123 19:58:26 > 24464 19:58:27 > [...] > > Also i tried changing a lot of things in /etc/sysctl.conf (sysctl -p and > restart nginx) but i didn't see better results. > > For example: > > net.ipv4.tcp_keepalive_time = 300 > # Avoid a smurf attack > net.ipv4.icmp_echo_ignore_broadcasts = 1 > > # Turn on protection for bad icmp error messages > net.ipv4.icmp_ignore_bogus_error_responses = 1 > > # Turn on syncookies for SYN flood attack protection > net.ipv4.tcp_syncookies = 0 > > # Turn on and log spoofed, source routed, and redirect packets > net.ipv4.conf.all.log_martians = 1 > net.ipv4.conf.default.log_martians = 1 > > # No source routed packets here > net.ipv4.conf.all.accept_source_route = 0 > net.ipv4.conf.default.accept_source_route = 0 > > # Turn on reverse path filtering > net.ipv4.conf.all.rp_filter = 1 > net.ipv4.conf.default.rp_filter = 1 > > # Make sure no one can alter the routing tables > net.ipv4.conf.all.accept_redirects = 0 > net.ipv4.conf.default.accept_redirects = 0 > net.ipv4.conf.all.secure_redirects = 0 > net.ipv4.conf.default.secure_redirects = 0 > > # Don't act as a router > net.ipv4.ip_forward = 1 > net.ipv4.conf.all.send_redirects = 0 > net.ipv4.conf.default.send_redirects = 0 > > # Turn on execshild > kernel.exec-shield = 1 > kernel.randomize_va_space = 1 > > # Tuen IPv6 > net.ipv6.conf.default.router_solicitations = 0 > net.ipv6.conf.default.accept_ra_rtr_pref = 0 > net.ipv6.conf.default.accept_ra_pinfo = 0 > net.ipv6.conf.default.accept_ra_defrtr = 0 > net.ipv6.conf.default.autoconf = 0 > net.ipv6.conf.default.dad_transmits = 0 > net.ipv6.conf.default.max_addresses = 1 > > # Optimization for port usefor LBs > # Increase system file descriptor limit > fs.file-max = 655350 > > # Allow for more PIDs (to reduce rollover problems); may break some > programs 32768 > kernel.pid_max = 65536 > > # Increase system IP port limits > net.ipv4.ip_local_port_range = 1500 65000 > > # Increase TCP max buffer size setable using setsockopt() > net.ipv4.tcp_rmem = 4096 87380 33554432 > net.ipv4.tcp_wmem = 4096 65536 33554432 > > # Increase Linux auto tuning TCP buffer limits > # min, default, and max number of bytes to use > # set max to at least 4MB, or higher if you use very high BDP paths > # Tcp Windows etc > net.core.rmem_max = 33554432 > net.core.wmem_max = 33554432 > net.core.rmem_default=65536 > net.core.wmem_default=65536 > net.core.netdev_max_backlog = 5000 > net.ipv4.tcp_window_scaling = 1 > net.ipv4.tcp_timestamps = 1 > net.ipv4.tcp_sack = 1 > net.ipv4.tcp_no_metrics_save = 1 > > With last kernels and autoptimize is not necessary change anything about > tcp buffers (but i think for this requirements yes). > > I was monitoring the machine while tests, CPU usage by nginx is around > 30%, RAM nothing important, and few I/O traffic, Load <0.50. > > Could somebody help me for find where is the bottleneck? > > Thanks. > Could you be bottle-necked in your testing tool "ab"? Ken From Richard.Kearsley at m247.com Thu Oct 6 18:42:30 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 6 Oct 2011 18:42:30 +0000 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: <20111006183843.GD10975@staff-mud-56-27.rice.edu> References: <20111006183843.GD10975@staff-mud-56-27.rice.edu> Message-ID: >Could you be bottle-necked in your testing tool "ab"? > >Ken It could definitely be (or network latency) - try doing the same benchmark from a few hosts at once :) From nginx-forum at nginx.us Thu Oct 6 19:00:42 2011 From: nginx-forum at nginx.us (atadmin) Date: Thu, 06 Oct 2011 15:00:42 -0400 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: Message-ID: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> Hi, I have the same result with 4 servers that 9 servers executing ab in the same time. I tested it before until i configured 9 servers client. With 1 server i can get between 12000 - 14500 concurrent connections. # ab -n 500000 -c 200 http://192.168.1.11/a.txt This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.1.11 (be patient) Completed 50000 requests Completed 100000 requests Completed 150000 requests Completed 200000 requests Completed 250000 requests Completed 300000 requests Completed 350000 requests Completed 400000 requests Completed 450000 requests Completed 500000 requests Finished 500000 requests Server Software: nginx/0.7.67 Server Hostname: 192.168.1.11 Server Port: 80 Document Path: /a.txt Document Length: 5 bytes Concurrency Level: 200 Time taken for tests: 34.309 seconds Complete requests: 500000 Failed requests: 0 Write errors: 0 Total transferred: 107500000 bytes HTML transferred: 2500000 bytes Requests per second: 14573.44 [#/sec] (mean) Time per request: 13.724 [ms] (mean) Time per request: 0.069 [ms] (mean, across all concurrent requests) Transfer rate: 3059.85 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 4 73.8 2 3006 Processing: 0 10 5.2 9 225 Waiting: 0 9 5.2 8 224 Total: 1 14 73.9 11 3021 Percentage of the requests served within a certain time (ms) 50% 11 66% 13 75% 14 80% 15 90% 17 95% 19 98% 21 99% 24 100% 3021 (longest request) Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216332,216336#msg-216336 From al-nginx at none.at Thu Oct 6 19:17:59 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Thu, 06 Oct 2011 21:17:59 +0200 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> Message-ID: <920c9feb8914fb4ae3fd144c0295867d@none.at> Hi, On 06.10.2011 21:00, atadmin wrote: > Hi, > > I have the same result with 4 servers that 9 servers executing ab in > the > same time. I tested it before until i configured 9 servers client. > With > 1 server i can get between 12000 - 14500 concurrent connections. Maybe you use the wrong tool? http://kristianlyng.wordpress.com/2010/10/23/275k-req/ Here a statement from http://haproxy.1wt.eu/news.html ### Oct 23th, 2010 : new httperf results : 572000 reqs/s This morning I came across this interesting post from Kristian Lyngstol about the performance tests he ran on the Varnish cache. What struck me was the number of requests per second Kristian managed to reach : 275000, not less. I'm not surprized at all that Varnish can withstand such high rates, it's known for being very fast. My surprize came from the fact that Kristian managed to find fast enough tools to run this test. My old injector is limited to around 100k requests per second on my machines, as it does not support keep-alive, and Apache's ab to around 150k with keep-alive enabled. And when I managed to reach 2 millions requests per second, I was feeding a constant stream of pipelined requests with netcat, which is particularly inconvenient to use. Kristian said he used httperf. I tried it in the past but did not manage to get good numbers out of it. He said he found some "httperf secrets", so that made me want to try again. First tests were limited to approximately 50000 requests per second with httperf at 100% CPU. Something close to my memories. But reading the man, I found that httperf can work in a session-based mode with the "--wsess" parameter, where it also support HTTP pipelining. Hmmm nice, we'll be less sensible to packet round-trips :-) So I tried again with haproxy simply doing redirects. Performance was still limited to 50000 requests per second. In fact, there appears to be a default limit of 50000 requests per second when "--rate" is not specified. I set it to 1 million and ran the test again. Result: about 158000 requests per second at 100% CPU and with haproxy at 44%. Since my machine is a Core2 Quad at 3 GHz, I fired 3 httperf against one haproxy process. The load reached a max of 572000 requests/s with an average around 450000 requests per second. This time, haproxy and all 3 httperf were using 100% CPU. What an improvement! These tests mean nothing at all for real world uses of course, because when you have many clients, they won't send you massive amounts of pipelined requests. However it's very nice to be able to stress-test the HTTP engine for regression testing. And this will be an invaluable measurement tool to test the end-to-end keep-alive when it's finished. I still have to figure out the meaning of some options and how to make the process less verbose. Right now it fills a screen with many zeroes, making it hard to extract the useful numbers. I'm grateful to Kristian to have made me revisit httperf ! ### > # ab -n 500000 -c 200 http://192.168.1.11/a.txt > This is ApacheBench, Version 2.3 <$Revision: 655654 $> > Copyright 1996 Adam Twiss, Zeus Technology Ltd, > http://www.zeustech.net/ > Licensed to The Apache Software Foundation, http://www.apache.org/ > > Benchmarking 192.168.1.11 (be patient) > Completed 50000 requests > Completed 100000 requests > Completed 150000 requests > Completed 200000 requests > Completed 250000 requests > Completed 300000 requests > Completed 350000 requests > Completed 400000 requests > Completed 450000 requests > Completed 500000 requests > Finished 500000 requests > > > Server Software: nginx/0.7.67 > Server Hostname: 192.168.1.11 > Server Port: 80 > > Document Path: /a.txt > Document Length: 5 bytes > > Concurrency Level: 200 > Time taken for tests: 34.309 seconds > Complete requests: 500000 > Failed requests: 0 > Write errors: 0 > Total transferred: 107500000 bytes > HTML transferred: 2500000 bytes > Requests per second: 14573.44 [#/sec] (mean) > Time per request: 13.724 [ms] (mean) > Time per request: 0.069 [ms] (mean, across all concurrent > requests) > Transfer rate: 3059.85 [Kbytes/sec] received > > Connection Times (ms) > min mean[+/-sd] median max > Connect: 0 4 73.8 2 3006 > Processing: 0 10 5.2 9 225 > Waiting: 0 9 5.2 8 224 > Total: 1 14 73.9 11 3021 > > Percentage of the requests served within a certain time (ms) > 50% 11 > 66% 13 > 75% 14 > 80% 15 > 90% 17 > 95% 19 > 98% 21 > 99% 24 > 100% 3021 (longest request) > > > Thanks. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,216332,216336#msg-216336 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu Oct 6 20:37:41 2011 From: nginx-forum at nginx.us (ramindeja) Date: Thu, 06 Oct 2011 16:37:41 -0400 Subject: Enquiry regarding Sticky Module's hash functions In-Reply-To: References: Message-ID: <4ab9c0d0848d0b3c8d4d61d1e8191b1d.NginxMailingListEnglish@forum.nginx.org> Merci J?r?me, we resolved the solution by writing the following class. It's not super but does the job: import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class IPEncryptor { public static String MD5(String ip) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md; md = MessageDigest.getInstance("MD5"); byte[] md5hash = new byte[32]; byte[] ipParts = parseIP(ip); md.update(ipParts, 0, ipParts.length); md5hash = md.digest(); return convertToHex(md5hash); } private static String convertToHex(byte[] data) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < data.length; i++) { int halfbyte = (data[i] >>> 4) & 0x0F; int two_halfs = 0; do { if ((0 <= halfbyte) && (halfbyte <= 9)) buf.append((char) ('0' + halfbyte)); else buf.append((char) ('a' + (halfbyte - 10))); halfbyte = data[i] & 0x0F; } while(two_halfs++ < 1); } return buf.toString(); } // Parses the input private static byte[] parseIP(String address) { String[] addressParts = address.split(":"); String[] ipParts = addressParts[0].split("\\."); int portHiByte = Integer.parseInt(addressParts[1]) / 256; int portLoByte = Integer.parseInt(addressParts[1]) % 256; int i = 0; int j = 0; byte[] ip = new byte[16]; ip[i++] = 0; ip[i++] = 2; ip[i++] = (byte)portHiByte; ip[i++] = (byte)portLoByte; for (j = 0; j < ipParts.length; j++, i++) { ip[i] = (byte)Integer.parseInt(ipParts[j]); } // pad the rest with ZEROs for (; i < ip.length; ++i) { ip[i] = 0; } return ip; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,207455,216339#msg-216339 From nginx-forum at nginx.us Thu Oct 6 20:53:59 2011 From: nginx-forum at nginx.us (atadmin) Date: Thu, 06 Oct 2011 16:53:59 -0400 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> Hi, I had some problems with httperf, i will try tomorrow, but i tested with siege and 11 machines as clients and i get similar results: 22683 22:50:51 25653 22:50:52 27049 22:50:53 26246 22:50:54 26658 22:50:55 25725 22:50:56 26432 22:50:57 26940 22:50:58 27058 22:50:59 27236 22:51:00 27231 22:51:01 27361 22:51:02 26762 22:51:03 27004 22:51:04 27093 22:51:05 27097 22:51:06 26784 22:51:07 24799 22:51:08 24071 22:51:09 24034 22:51:10 26038 22:51:11 27025 22:51:12 26998 22:51:13 26963 22:51:14 27212 22:51:15 27244 22:51:16 27563 22:51:17 27101 22:51:18 25057 22:51:19 25334 22:51:20 25873 22:51:21 28045 22:51:22 27228 22:51:23 26752 22:51:24 26876 22:51:25 Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216332,216340#msg-216340 From brad at teambrad.net Fri Oct 7 00:09:15 2011 From: brad at teambrad.net (Bradley Falzon) Date: Fri, 7 Oct 2011 10:39:15 +1030 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: Message-ID: On Fri, Oct 7, 2011 at 5:00 AM, atadmin wrote: > > # Turn on syncookies for SYN flood attack protection > net.ipv4.tcp_syncookies = 0 > I've never tested the performance benefit (and the costs) of having sync cookies enabled or not, but that command there suggests you have turned sync cookies off (you probably want it enabled - again it comes at a cost I haven't personally investigated). Also, you have mentioned the state of iptables connection tracking yet. That could be a problem if you believe the bottleneck is the server and haven't checked that already. You probably want to disable nf_conntrack and rewrite your iptables rules (or just disable firewalling completely). -- Bradley Falzon brad at teambrad.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From magicbearmo at gmail.com Fri Oct 7 01:10:02 2011 From: magicbearmo at gmail.com (MagicBear) Date: Fri, 7 Oct 2011 09:10:02 +0800 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: Message-ID: here is my server results. using 3 of ab, each open 10000 concurrent connections. cat logger | sed 's/||/ /g' | awk '{print $3}'| sed 's/\.[0-9]\+//g' | sort | uniq -c 66776 1317949624 91383 1317949625 92828 1317949626 93364 1317949627 91456 1317949628 93498 1317949629 92916 1317949630 91795 1317949631 91921 1317949632 92935 1317949633 93000 1317949634 89737 1317949635 91141 1317949636 93217 1317949637 93490 1317949638 93069 1317949639 88566 1317949640 93721 1317949641 93860 1317949642 90619 1317949643 93118 1317949644 93011 1317949645 94501 1317949646 93367 1317949647 92656 1317949648 91941 1317949649 using 60% of cpu. Server Environment: 4x AMD Quad-Core 8360 SE (total 16 cores) 32G DDR2 SATA3 SSD (r/w 550MB/s) 4x1Gbps Ethernet 2011/10/7 Bradley Falzon : > On Fri, Oct 7, 2011 at 5:00 AM, atadmin wrote: >> >> # Turn on syncookies for SYN flood attack protection >> net.ipv4.tcp_syncookies = 0 > > I've never tested the performance benefit (and the costs) of having sync > cookies enabled or not, but that command there suggests you have turned sync > cookies off (you probably want it enabled - again it comes at a cost I > haven't personally investigated). > > Also, you have mentioned the state of iptables connection tracking yet. That > could be a problem if you believe the bottleneck is the server and haven't > checked that already. You probably want to disable nf_conntrack and rewrite > your iptables rules (or just disable firewalling completely). > > -- > Bradley Falzon > brad at teambrad.net > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- MagicBear From magicbearmo at gmail.com Fri Oct 7 01:11:28 2011 From: magicbearmo at gmail.com (MagicBear) Date: Fri, 7 Oct 2011 09:11:28 +0800 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: Message-ID: and here is my sysctl # Avoid a smurf attack net.ipv4.icmp_echo_ignore_broadcasts = 1 # Turn on protection for bad icmp error messages net.ipv4.icmp_ignore_bogus_error_responses = 1 # Turn on and log spoofed, source routed, and redirect packets #net.ipv4.conf.all.log_martians = 1 #net.ipv4.conf.default.log_martians = 1 # No source routed packets here net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 # Turn on reverse path filtering net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 # Make sure no one can alter the routing tables net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 # Don't act as a router net.ipv4.ip_forward = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.core.somaxconn=32768 net.ipv4.ip_local_port_range=4096 65535 net.core.netdev_max_backlog = 32768 net.ipv4.tcp_max_syn_backlog = 32768 net.ipv4.tcp_max_orphans = 262144 #for GigaEthernet net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_mem = 50576 64768 98152 net.core.netdev_max_backlog = 2500 net.ipv4.netfilter.ip_conntrack_max = 1048576 net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=1200 net.nf_conntrack_max=237680 net.netfilter.nf_conntrack_max=237680 net.netfilter.nf_conntrack_tcp_timeout_established=1200 # fs.file-max = 131072 # Setting the Minimum System Page Cache vm.min_free_kbytes=1024 #Managing the Swap Space vm.swappiness=10 nginx config worker_processes 8; worker_rlimit_nofile 131072; events { worker_connections 65536; use epoll; } 2011/10/7 MagicBear : > here is my server results. > using 3 of ab, each open 10000 concurrent connections. > > cat logger | sed ?'s/||/ /g' | awk '{print $3}'| sed 's/\.[0-9]\+//g' > | sort | uniq -c > ?66776 1317949624 > ?91383 1317949625 > ?92828 1317949626 > ?93364 1317949627 > ?91456 1317949628 > ?93498 1317949629 > ?92916 1317949630 > ?91795 1317949631 > ?91921 1317949632 > ?92935 1317949633 > ?93000 1317949634 > ?89737 1317949635 > ?91141 1317949636 > ?93217 1317949637 > ?93490 1317949638 > ?93069 1317949639 > ?88566 1317949640 > ?93721 1317949641 > ?93860 1317949642 > ?90619 1317949643 > ?93118 1317949644 > ?93011 1317949645 > ?94501 1317949646 > ?93367 1317949647 > ?92656 1317949648 > ?91941 1317949649 > > using 60% of cpu. > Server Environment: > 4x AMD Quad-Core 8360 SE ?(total 16 cores) > 32G DDR2 > SATA3 SSD (r/w 550MB/s) > 4x1Gbps Ethernet > > 2011/10/7 Bradley Falzon : >> On Fri, Oct 7, 2011 at 5:00 AM, atadmin wrote: >>> >>> # Turn on syncookies for SYN flood attack protection >>> net.ipv4.tcp_syncookies = 0 >> >> I've never tested the performance benefit (and the costs) of having sync >> cookies enabled or not, but that command there suggests you have turned sync >> cookies off (you probably want it enabled - again it comes at a cost I >> haven't personally investigated). >> >> Also, you have mentioned the state of iptables connection tracking yet. That >> could be a problem if you believe the bottleneck is the server and haven't >> checked that already. You probably want to disable nf_conntrack and rewrite >> your iptables rules (or just disable firewalling completely). >> >> -- >> Bradley Falzon >> brad at teambrad.net >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > > -- > MagicBear > -- MagicBear From magicbearmo at gmail.com Fri Oct 7 01:20:40 2011 From: magicbearmo at gmail.com (MagicBear) Date: Fri, 7 Oct 2011 09:20:40 +0800 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: Message-ID: increase the worker number to 12, and I get such results, I think that may be the maximum. cat logger | sed 's/||/ /g' | awk '{print $3}'| sed 's/\.[0-9]\+//g' | sort | uniq -c 58423 1317950330 85703 1317950331 116036 1317950332 115995 1317950333 116070 1317950334 120604 1317950335 119080 1317950336 118695 1317950337 118231 1317950338 114383 1317950339 104594 1317950340 103047 1317950341 105614 1317950342 100386 1317950343 90679 1317950344 94728 1317950345 100741 1317950346 100206 1317950347 100959 1317950348 99431 1317950349 104943 1317950350 104868 1317950351 100532 1317950352 101507 1317950353 106315 1317950354 110642 1317950355 108740 1317950356 105454 1317950357 104623 1317950358 101233 1317950359 2011/10/7 MagicBear : > and here is my sysctl > > # Avoid a smurf attack > net.ipv4.icmp_echo_ignore_broadcasts = 1 > > # Turn on protection for bad icmp error messages > net.ipv4.icmp_ignore_bogus_error_responses = 1 > > # Turn on and log spoofed, source routed, and redirect packets > #net.ipv4.conf.all.log_martians = 1 > #net.ipv4.conf.default.log_martians = 1 > > # No source routed packets here > net.ipv4.conf.all.accept_source_route = 0 > net.ipv4.conf.default.accept_source_route = 0 > > # Turn on reverse path filtering > net.ipv4.conf.all.rp_filter = 1 > net.ipv4.conf.default.rp_filter = 1 > > # Make sure no one can alter the routing tables > net.ipv4.conf.all.accept_redirects = 0 > net.ipv4.conf.default.accept_redirects = 0 > net.ipv4.conf.all.secure_redirects = 0 > net.ipv4.conf.default.secure_redirects = 0 > > # Don't act as a router > net.ipv4.ip_forward = 0 > net.ipv4.conf.all.send_redirects = 0 > net.ipv4.conf.default.send_redirects = 0 > > net.core.somaxconn=32768 > > net.ipv4.ip_local_port_range=4096 65535 > > net.core.netdev_max_backlog = 32768 > net.ipv4.tcp_max_syn_backlog = 32768 > net.ipv4.tcp_max_orphans = 262144 > > #for GigaEthernet > net.core.rmem_max = 16777216 > net.core.wmem_max = 16777216 > net.ipv4.tcp_rmem = 4096 87380 16777216 > net.ipv4.tcp_wmem = 4096 65536 16777216 > net.ipv4.tcp_syncookies = 1 > > net.ipv4.tcp_mem = 50576 ? 64768 ? 98152 > net.core.netdev_max_backlog = 2500 > net.ipv4.netfilter.ip_conntrack_max = 1048576 > net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=1200 > > net.nf_conntrack_max=237680 > net.netfilter.nf_conntrack_max=237680 > net.netfilter.nf_conntrack_tcp_timeout_established=1200 > > # fs.file-max = 131072 > # Setting the Minimum System Page Cache > vm.min_free_kbytes=1024 > #Managing the Swap Space > vm.swappiness=10 > > > > > > > nginx config > worker_processes ?8; > > worker_rlimit_nofile 131072; > events { > ? ?worker_connections ?65536; > ? ?use epoll; > } > > > > 2011/10/7 MagicBear : >> here is my server results. >> using 3 of ab, each open 10000 concurrent connections. >> >> cat logger | sed ?'s/||/ /g' | awk '{print $3}'| sed 's/\.[0-9]\+//g' >> | sort | uniq -c >> ?66776 1317949624 >> ?91383 1317949625 >> ?92828 1317949626 >> ?93364 1317949627 >> ?91456 1317949628 >> ?93498 1317949629 >> ?92916 1317949630 >> ?91795 1317949631 >> ?91921 1317949632 >> ?92935 1317949633 >> ?93000 1317949634 >> ?89737 1317949635 >> ?91141 1317949636 >> ?93217 1317949637 >> ?93490 1317949638 >> ?93069 1317949639 >> ?88566 1317949640 >> ?93721 1317949641 >> ?93860 1317949642 >> ?90619 1317949643 >> ?93118 1317949644 >> ?93011 1317949645 >> ?94501 1317949646 >> ?93367 1317949647 >> ?92656 1317949648 >> ?91941 1317949649 >> >> using 60% of cpu. >> Server Environment: >> 4x AMD Quad-Core 8360 SE ?(total 16 cores) >> 32G DDR2 >> SATA3 SSD (r/w 550MB/s) >> 4x1Gbps Ethernet >> >> 2011/10/7 Bradley Falzon : >>> On Fri, Oct 7, 2011 at 5:00 AM, atadmin wrote: >>>> >>>> # Turn on syncookies for SYN flood attack protection >>>> net.ipv4.tcp_syncookies = 0 >>> >>> I've never tested the performance benefit (and the costs) of having sync >>> cookies enabled or not, but that command there suggests you have turned sync >>> cookies off (you probably want it enabled - again it comes at a cost I >>> haven't personally investigated). >>> >>> Also, you have mentioned the state of iptables connection tracking yet. That >>> could be a problem if you believe the bottleneck is the server and haven't >>> checked that already. You probably want to disable nf_conntrack and rewrite >>> your iptables rules (or just disable firewalling completely). >>> >>> -- >>> Bradley Falzon >>> brad at teambrad.net >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >> >> >> >> -- >> MagicBear >> > > > > -- > MagicBear > -- MagicBear From piotr.sikora at frickle.com Fri Oct 7 04:20:13 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Fri, 7 Oct 2011 06:20:13 +0200 Subject: [ANNOUNCE] ngx_cache_purge 1.4 Message-ID: <2D61460301634AE3BDAAF29306DADF8D@Desktop> Version 1.4 is now available at: http://labs.frickle.com/nginx_ngx_cache_purge/ GitHub repository is available at: http://github.com/FRiCKLE/ngx_cache_purge/ Changes: 2011-10-05 VERSION 1.4 * Add AIO support. Requested by Emin Hasanov. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From piotr.sikora at frickle.com Fri Oct 7 04:21:17 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Fri, 7 Oct 2011 06:21:17 +0200 Subject: FRiCKLE Labs & yo.se pres. ngx_cache_purge In-Reply-To: <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> References: <07864ADE7B1B46B19DA043DF075AD211@nightmare> <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <08F239EA506D47CF9F99CD517A76F232@Desktop> Hi, assuming that you didn't change order of locations during copy & paste (which _is_ important) then accessing "http://myserver.com/purge/test.php" should purge content which is normally available under "http://myserver.com/test.php". If that's not the case, then please try debugging it (http://nginx.org/en/docs/debugging_log.html) with ngx_cache_purge-1.4 (just released) and look for cache-related entries. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From agentzh at gmail.com Fri Oct 7 05:17:34 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 7 Oct 2011 13:17:34 +0800 Subject: [ANN] ngx_openresty 1.0.6.22 released In-Reply-To: References: Message-ID: Hi, folks! I'm happy to announce that the stable release of ngx_openresty, 1.0.6.22, has just been released: http://openresty.org/#Download Here goes the complete change log for this release, as compared to the last stable release, 1.0.6.12: - added new option -jN (e.g., -j8, -j10, and etc.) to OpenResty's ./configure script to allow parallel build of the dependencies like LuaJIT; thanks @Lance. - upgraded LuaNginxModule to v0.3.1rc8. - exposes the CRC-32 API of the Nginx core to the Lua land, in the form of the ngx.crc32_short and ngx.crc32_long methods. thanks @Lance. - now ngx.exec() supports lua table as the second args argument value. thanks sexybabes. - implemented the ngx.headers_sent API to check if response headers are sent (by ngx_lua). thanks @hugozhu. - now we also return the Last-Modified header (if any) for the subrequest response object. thanks @cyberty and sexybabes. - fixed an issue in ngx.redirect, ngx.exit, and ngx.exec: these function calls would be intercepted by Lua pcall/xpcall because they used lua exceptions; now they use lua yield just as ngx.location.capture. thanks @hugozhu for reporting this. OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well as most of their external dependencies. By taking adantage of various well-designed Nginx modules, OpenResty effectively turns the nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing nginx C modules and Lua modules and construct extremely high-performance web applications that is capable to handle 10K+ connections. OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis. You can find more details on the homepage of ngx_openresty here: http://openresty.org Have fun! -agentzh -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Oct 7 05:28:55 2011 From: nginx-forum at nginx.us (ahu) Date: Fri, 07 Oct 2011 01:28:55 -0400 Subject: FRiCKLE Labs & yo.se pres. ngx_cache_purge In-Reply-To: <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> References: <07864ADE7B1B46B19DA043DF075AD211@nightmare> <2bfbb04c07ca37e99fcf7070049ea3bb.NginxMailingListEnglish@forum.nginx.org> Message-ID: Wow~ All things go right after I installed the ngx_cache_purge-1.4 ! Thanks very much! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,39564,216354#msg-216354 From nginx-forum at nginx.us Fri Oct 7 06:44:07 2011 From: nginx-forum at nginx.us (atadmin) Date: Fri, 07 Oct 2011 02:44:07 -0400 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9ebce5c0f933a0671b10c1a2e998cfa3.NginxMailingListEnglish@forum.nginx.org> Bradley Falzon, I tested with this flag enable and disables and the result is the same, now is disables because was the las test. Iptables is not enabled for the test. magicbear, could you please tell me which SO and version are you using? And parameters for ab command? Did you do any change for client test servers (like ulimit, etc)? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216332,216356#msg-216356 From gunt.fl at gmail.com Thu Oct 6 17:34:44 2011 From: gunt.fl at gmail.com (=?ISO-8859-1?Q?Ing=2E_Gunther_Fl=FCtsch?=) Date: Thu, 6 Oct 2011 11:34:44 -0600 Subject: nginx - hotlinking Message-ID: Hi Igor Sysoev, Could you please help how to stop badguys from hotlinking my images. I try a lot of code and nothing happens I don't know which file to edit I use this code in sudo nano /usr/local/nginx/sites-available/ elestandard.com # Stop deep linking or hot linking location /uploads/ { valid_referers none blocked www.example.com example.com; if ($invalid_referer) { return 403; } } But I'm always have an error. I'll appreciate your help. thank you very much! -- Gunther Flutsch -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at teambrad.net Fri Oct 7 10:44:39 2011 From: brad at teambrad.net (Bradley Falzon) Date: Fri, 7 Oct 2011 21:14:39 +1030 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: <9ebce5c0f933a0671b10c1a2e998cfa3.NginxMailingListEnglish@forum.nginx.org> References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> <9ebce5c0f933a0671b10c1a2e998cfa3.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Fri, Oct 7, 2011 at 5:14 PM, atadmin wrote: > I tested with this flag enable and disables and the result is the same, > now is disables because was the las test. Iptables is not enabled for > the test. > > Just confirming you actively removed the nf_conntrack modules. My boxes have logged conntrack rules warnings in syslog, so if you're not seeing them, then it's probably not your problem anyway. My box with connection track is still tracking even though my iptables is stopped: [root at bf1 ~]# service iptables stop iptables: Flushing firewall rules: [ OK ] iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Unloading modules: [ OK ] [root at bf1 ~]# lsmod | grep nf_conn nf_conntrack_ipv6 19655 2 nf_conntrack 79643 2 nf_conntrack_ipv6,xt_state ipv6 321509 28 ip6t_REJECT,nf_conntrack_ipv6 [root at bf1 ~]# cat /proc/sys/net/netfilter/nf_conntrack_count 2 My box with connection track removed: [brad at cache1 ~]$ cat /proc/sys/net/netfilter/nf_conntrack_count cat: /proc/sys/net/netfilter/nf_conntrack_count: No such file or directory Connection tracking probably isn't your issue, but for completeness sake, just confirming. -- Bradley Falzon brad at teambrad.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennisml at conversis.de Fri Oct 7 11:19:45 2011 From: dennisml at conversis.de (Dennis Jacobfeuerborn) Date: Fri, 07 Oct 2011 13:19:45 +0200 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> <9ebce5c0f933a0671b10c1a2e998cfa3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4E8EE051.20303@conversis.de> On 10/07/2011 12:44 PM, Bradley Falzon wrote: > On Fri, Oct 7, 2011 at 5:14 PM, atadmin > wrote: > > I tested with this flag enable and disables and the result is the same, > now is disables because was the las test. Iptables is not enabled for > the test. > > > Just confirming you actively removed the nf_conntrack modules. My boxes > have logged conntrack rules warnings in syslog, so if you're not seeing > them, then it's probably not your problem anyway. > > My box with connection track is still tracking even though my iptables is > stopped: > [root at bf1 ~]# service iptables stop > iptables: Flushing firewall rules: [ OK ] > iptables: Setting chains to policy ACCEPT: filter [ OK ] > iptables: Unloading modules: [ OK ] > [root at bf1 ~]# lsmod | grep nf_conn > nf_conntrack_ipv6 19655 2 > nf_conntrack 79643 2 nf_conntrack_ipv6,xt_state > ipv6 321509 28 ip6t_REJECT,nf_conntrack_ipv6 > [root at bf1 ~]# cat /proc/sys/net/netfilter/nf_conntrack_count > 2 Given the ipv6 references above have you also done a "service ip6tables stop"? Regards, Dennis From b.yordanov at exsisto.com Fri Oct 7 11:32:53 2011 From: b.yordanov at exsisto.com (Boyko Yordanov) Date: Fri, 7 Oct 2011 14:32:53 +0300 Subject: nginx not starting because of bad/missing path to access_log Message-ID: <5DEBE994-ABC4-48F5-9365-707FE12C0A91@exsisto.com> Hi, Just want to point this case where nginx won't start and eventually suggest a feature to avoid this situation. nginx vhost is configured with the following directive: access_log /domhome/some-random-domain.com/logs/access_log main; where /domhome/some-random-domain.com/logs/access_log is in fact a symlink: # ls -la /domhome/some-random-domain.com/logs/access_log lrwxrwxrwx 1 root root 46 Oct 2 05:31 /domhome/some-random-domain.com/logs/access_log -> /domhome/some-random-domain.com/logs/2011/10/access_log The case is that if some folder in the path does not exist, e.g. the folder 2011 is missing, or 10 is missing, then nginx won't be able to follow the symlink and create the access_log. It will just refuse to start with the following error in the log: 2011/10/07 13:21:12 [emerg] 9105#0: open() "/domhome/some-random-domain.com/logs/access_log" failed (2: No such file or directory) Can this behavior be adjusted, so that nginx creates all the folders in the path and create the access_log itself, and start normally as expected? Or is this inappropriate, and if so, why? Thanks, Boyko From brad at teambrad.net Fri Oct 7 12:28:37 2011 From: brad at teambrad.net (Bradley Falzon) Date: Fri, 7 Oct 2011 22:58:37 +1030 Subject: Nginx setting up >25.000 concurrent connections per second In-Reply-To: <4E8EE051.20303@conversis.de> References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> <9ebce5c0f933a0671b10c1a2e998cfa3.NginxMailingListEnglish@forum.nginx.org> <4E8EE051.20303@conversis.de> Message-ID: On Fri, Oct 7, 2011 at 9:49 PM, Dennis Jacobfeuerborn wrote: > Given the ipv6 references above have you also done a "service ip6tables > stop"? > You were correct, stopping ip6tables then took out the module. Cheers, sorry to go off topic / hijack. -- Bradley Falzon brad at teambrad.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik.widlund at qbrick.com Fri Oct 7 16:04:33 2011 From: fredrik.widlund at qbrick.com (Fredrik Widlund) Date: Fri, 7 Oct 2011 18:04:33 +0200 Subject: SV: Nginx setting up >25.000 concurrent connections per second In-Reply-To: References: <942e9676d30c784e03dde68e0476a588.NginxMailingListEnglish@forum.nginx.org> <1d8c9daeaef5a1ef67ab03b111fe13f5.NginxMailingListEnglish@forum.nginx.org> <9ebce5c0f933a0671b10c1a2e998cfa3.NginxMailingListEnglish@forum.nginx.org> <4E8EE051.20303@conversis.de>, Message-ID: <51E298B774DF2448B20A97428357E8BA02863DF5E2@STOMBX02.excanto.com> Maybe relevant: http://lonewolfer.wordpress.com/2011/10/06/benchmarking-the-benchmarks-part-1/ Kind regards, Fredrik Widlund ________________________________________ Fr?n: nginx-bounces at nginx.org [nginx-bounces at nginx.org] för Bradley Falzon [brad at teambrad.net] Skickat: den 7 oktober 2011 14:28 Till: nginx at nginx.org ?mne: Re: Nginx setting up >25.000 concurrent connections per second On Fri, Oct 7, 2011 at 9:49 PM, Dennis Jacobfeuerborn > wrote: Given the ipv6 references above have you also done a "service ip6tables stop"? You were correct, stopping ip6tables then took out the module. Cheers, sorry to go off topic / hijack. -- Bradley Falzon brad at teambrad.net From fud.theturtle at gmail.com Fri Oct 7 17:35:45 2011 From: fud.theturtle at gmail.com (Chris Zimmerman) Date: Fri, 7 Oct 2011 13:35:45 -0400 Subject: nginx - hotlinking In-Reply-To: References: Message-ID: Try posting your full config, it must be matching another location perhaps. Otherwise it looks fine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at akins.org Fri Oct 7 20:42:19 2011 From: brian at akins.org (Brian Akins) Date: Fri, 7 Oct 2011 16:42:19 -0400 Subject: nginx not starting because of bad/missing path to access_log In-Reply-To: <5DEBE994-ABC4-48F5-9365-707FE12C0A91@exsisto.com> References: <5DEBE994-ABC4-48F5-9365-707FE12C0A91@exsisto.com> Message-ID: On Fri, Oct 7, 2011 at 7:32 AM, Boyko Yordanov wrote: > > Can this behavior be adjusted, so that nginx creates all the folders in the > path and create the access_log itself, and start normally as expected? Or is > this inappropriate, and if so, why? > > Do that in your init script or use some config management tools to do it for you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.george.hammond at gmail.com Sat Oct 8 00:19:21 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Fri, 7 Oct 2011 17:19:21 -0700 Subject: upload_resume sha1, md5 and crc32 aggregates missing Message-ID: I'm seeing most, but not all of the upload form fields get set. However, the sha1, md5 and crc32 aggregates below are blanks: request.POST I see that libssl is installed on the server. I don't see any entries in the error log that would make me think there is anything failing here. I have the following in the nginx config: upload_set_form_field upload_name $upload_file_name; upload_set_form_field upload_content_type $upload_content_type; upload_set_form_field upload_path $upload_tmp_path; upload_aggregate_form_field upload_sha1 $upload_file_sha1; upload_aggregate_form_field upload_size $upload_file_size; upload_aggregate_form_field upload_crc32 $upload_file_crc32; upload_aggregate_form_field upload_md5 $upload_file_md5; I based the above on the documentation and example config. What am I missing here? I'm using nginx 1.0.8 deb-src build from the PPA with the latest version of the upload_resume module included. Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From nbubingo at gmail.com Sat Oct 8 02:36:04 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Sat, 8 Oct 2011 10:36:04 +0800 Subject: Nginx Substitutions Filter problem In-Reply-To: <4E85834D.3060105@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> <4E85834D.3060105@martronic.ch> Message-ID: Yes, You are right. I'll add this to the documents. There will be too much error log if I add this for each request. ? 2011?9?30? ??4:52?Martronic SA ??? > 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 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Sat Oct 8 02:45:09 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 8 Oct 2011 10:45:09 +0800 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> <4E85834D.3060105@martronic.ch> Message-ID: 2011/10/8 ??? : > Yes, You are right. I'll add this to the documents. There will be too much > error log if I add this for each request. > You can just log at the debug level maybe? ;) Regards, -agentzh From nbubingo at gmail.com Sat Oct 8 05:54:39 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Sat, 8 Oct 2011 13:54:39 +0800 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> <4E85834D.3060105@martronic.ch> Message-ID: Thanks. I have added the log. Hope this can be helpful. ? 2011?10?8? ??10:45?agentzh ??? > 2011/10/8 ??? : > > Yes, You are right. I'll add this to the documents. There will be too > much > > error log if I add this for each request. > > > > You can just log at the debug level maybe? ;) > > Regards, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik.widlund at qbrick.com Sat Oct 8 10:48:25 2011 From: fredrik.widlund at qbrick.com (Fredrik Widlund) Date: Sat, 8 Oct 2011 12:48:25 +0200 Subject: Benchmarks Message-ID: Hi, Some more benchmarks of Nginx compared to Apache, Cherokee, Lighttpd and G-WAN. Non keep-alive so far. If you have any pointers about how to improve further, please let me know. http://lonewolfer.wordpress.com/2011/10/08/benchmarking-the-benchmarks-part-2/ Regards, Fredrik -------------- next part -------------- An HTML attachment was scrubbed... URL: From ian at ianhobson.co.uk Sat Oct 8 15:51:14 2011 From: ian at ianhobson.co.uk (Ian Hobson) Date: Sat, 08 Oct 2011 16:51:14 +0100 Subject: nginx/push module problem - ideas please. Message-ID: <4E907172.8060209@ianhobson.co.uk> Hi All, This problem has been bugging me for weeks, and driving me up the wall. I cannot seen to get to the bottom of it. The application is a chat room, for chat between a coach and a client. Both have similar code. The coach has a few extra bits to help him ask the right sort of questions, and update summary data, that the client does not have. The javascript used for the communication is common to both. In both client and coach there are two HTTP message pairs going on all the time. Sending - POSTs the new messages to a PHP script, which replies with 200 and a zero length message (so the screen is not updated). Receiving - uses GET from the subscribe address (push module), to receive each message and them immediately requests the next message. The PHP script logs each message and uses CURL to write to the publish address, before it returns the empty result. Thus you only get to see your own messages once they return to you via the long polling module. The start-up code sends an "I have entered the room" message, which is broadcast to both. The on-unload event sends an "I've left" message, that is broadcast to any remaining people. The problem is that sometimes we get a strange lop-sides set of connections. Coach logs in using Firefox (on one machine) Client logs in using Chrome on the same machine. (We wish to demo the software using screen sharing software). Coach sends a message, which arrives on both windows. wait 3 minutes (during which time the "Client has left" message is not seen) Client sends a message - which is logged and returns to him, but is not seen by the coach. Coach sends a message, which is logged and seen by both. Client sends another message which is logged, and seen by the client but not by the coach. Refresh the client page, this will show the logged messages which show the logging was correct. It will also cause the client to "Enter the room" a second time, without leaving it. All will now work properly. We have seen this lop-sides behaviour in reverse - the client is missing messages sent by the coach, but receives his own back. So far, we have only had reports of problems on the one machine. It is behind a NAT firewall, which appears to be working properly. We have checked for viruses. Other information. Cannot create these problems on the test system, its a "live-only" feature. Nginx was upgraded from nginx 0.7.67 to 1.0.6 recently, and problem appeared shortly afterwards. The push module is 0.69 in both builds. Cannot reproduce except on the one machine, which is nearly new, and running Windows 7 Home edition. Server is running Ubuntu 11.04 LTS (under XEN on live and VBox on test). All ideas gratefully received. Regards Ian From valery+nginxen at grid.net.ru Sat Oct 8 15:55:35 2011 From: valery+nginxen at grid.net.ru (Valery Kholodkov) Date: Sat, 8 Oct 2011 16:55:35 +0100 (BST) Subject: upload_resume sha1, md5 and crc32 aggregates missing In-Reply-To: Message-ID: <2711360.314.1318089335939.JavaMail.root@zone.mtgsy.net> These aggregates are not available for resumable uploads, as hashes of the last part will not make sense anyway. ----- Andrew Hammond wrote: > I'm seeing most, but not all of the upload form fields get set. However, the > sha1, md5 and crc32 aggregates below are blanks: > > request.POST u'upload_name': [u'py_lightweight_uploader.py'], > u'upload_size': [u'11345'], > u'upload_sha1': [u''], > u'upload_content_type': [u'text/x-python'], > u'upload_path': [u'/var/lib/nginx/resumable_download/7/64565707'], > u'upload_md5': [u''], > u'upload_crc32': [u'']}> > > I see that libssl is installed on the server. I don't see any entries in the > error log that would make me think there is anything failing here. I have > the following in the nginx config: > > upload_set_form_field upload_name $upload_file_name; > upload_set_form_field upload_content_type $upload_content_type; > upload_set_form_field upload_path $upload_tmp_path; > upload_aggregate_form_field upload_sha1 $upload_file_sha1; > upload_aggregate_form_field upload_size $upload_file_size; > upload_aggregate_form_field upload_crc32 $upload_file_crc32; > upload_aggregate_form_field upload_md5 $upload_file_md5; > > I based the above on the documentation and example config. What am I missing > here? I'm using nginx 1.0.8 deb-src build from the PPA with the latest > version of the upload_resume module included. -- Regards, Valery Kholodkov From davide.damico at contactlab.com Sat Oct 8 20:47:56 2011 From: davide.damico at contactlab.com (Davide D'Amico) Date: Sat, 8 Oct 2011 22:47:56 +0200 Subject: nginx-1.0.x+mod_push vs node.js Message-ID: Hi, I'd like to know if anyone is using nginx-1.0.x with mod_push in production to keep persistent connections on a website. I'm little scary about the huge number of active connections my servers can mantain (10000 or 20000). I'm using a DELL R200 with FreeBSD 8.2-amd64 with SAS HD and 8GB Ram, using these sysctl: kern.ipc.nmbclusters=262144 kern.ipc.somaxconn=65535 kern.maxfiles=524288 kern.maxfilesperproc=131072 kern.threads.max_threads_per_proc=16384 If yes, did you evaluate pros and cons on nginx vs node.js or comet? Thanks in advance, d. From nginx-forum at nginx.us Sun Oct 9 06:31:07 2011 From: nginx-forum at nginx.us (George) Date: Sun, 09 Oct 2011 02:31:07 -0400 Subject: Benchmarks In-Reply-To: References: Message-ID: thanks for sharing, trying installing weighttp myself but fails to install on centos 6.0 64bit [root at centos6 weighttp-master]# yum list libevent* Loaded plugins: fastestmirror, refresh-packagekit Loading mirror speeds from cached hostfile * base: centos.vr-zone.com * extras: centos.vr-zone.com * rpmforge: apt.sw.be * updates: centos.vr-zone.com Installed Packages libevent.x86_64 1.4.13-1.el6 @anaconda-CentOS-201106060106.x86_64/6.0 libevent-devel.x86_64 1.4.13-1.el6 @base [root at centos6 weighttp-master]# python -V Python 2.7.2 [root at centos6 weighttp-master]# ./waf configure -vv Checking for program gcc,cc : ok /usr/bin/gcc Checking for program cpp : ok /usr/bin/cpp Checking for program ar : ok /usr/bin/ar Checking for program ranlib : ok /usr/bin/ranlib Checking for gcc : ok Checking for library ev : 16:29:51 runner system command -> ['/usr/bin/gcc', '-std=gnu99', '-Wall', '-Wshadow', '-W', '-pedantic', '-g', '-g2', '-O2', '-Wmissing-declarations', '-Wdeclaration-after-statement', '-Wno-pointer-sign', '-Wcast-align', '-Winline', '-Wsign-compare', '-Wnested-externs', '-Wpointer-arith', '-Wbad-function-cast', '-Wmissing-prototypes', '-fPIC', '-fno-strict-aliasing', '../test.c', '-c', '-o', 'default/test_1.o'] 16:29:51 runner system command -> ['/usr/bin/gcc', 'default/test_1.o', '-o', '/usr/local/src/weighttp-master/build/.conf_check_0/testbuild/default/testprog', '-Wl,-Bdynamic', '-lev'] not found error: Traceback (most recent call last): File "/usr/local/src/weighttp-master/.waf-1.5.9-d1e0349fc8937631a656fb8ea7e99063/wafadmin/Tools/config_c.py", line 348, in run_c_code bld.compile() File "/usr/local/src/weighttp-master/.waf-1.5.9-d1e0349fc8937631a656fb8ea7e99063/wafadmin/Build.py", line 169, in compile raise BuildError(self,self.task_manager.tasks_done) BuildError: Build failed -> task failed (err #1): {task: cc_link test_1.o -> testprog} File "./waf", line 148, in Scripting.prepare(t, cwd, VERSION, wafdir) File "/usr/local/src/weighttp-master/.waf-1.5.9-d1e0349fc8937631a656fb8ea7e99063/wafadmin/Scripting.py", line 104, in prepare error(str(e)) any ideas or tips ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216392,216413#msg-216413 From igor at sysoev.ru Sun Oct 9 06:43:58 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 9 Oct 2011 10:43:58 +0400 Subject: Benchmarks In-Reply-To: References: Message-ID: <20111009064358.GA10942@nginx.com> On Sat, Oct 08, 2011 at 12:48:25PM +0200, Fredrik Widlund wrote: > Hi, > > Some more benchmarks of Nginx compared to Apache, Cherokee, Lighttpd and G-WAN. Non keep-alive so far. If you have any pointers about how to improve further, please let me know. > > http://lonewolfer.wordpress.com/2011/10/08/benchmarking-the-benchmarks-part-2/ The worker_cpu_affinity is broken. Try to set events { accept_mutex off; ... } -- Igor Sysoev From nginx-forum at nginx.us Sun Oct 9 07:34:23 2011 From: nginx-forum at nginx.us (codetr) Date: Sun, 09 Oct 2011 03:34:23 -0400 Subject: upstream sent too many data while reading Message-ID: hi; I use 1.1.5 my error.log upstream sent too many data while reading upstream how to fix it .. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216416#msg-216416 From nginx-forum at nginx.us Sun Oct 9 14:26:37 2011 From: nginx-forum at nginx.us (fzuslide) Date: Sun, 09 Oct 2011 10:26:37 -0400 Subject: Content-length Missing when response proxy_pass a special backend Message-ID: <942dec41437f2daf519dd4323d62d3fd.NginxMailingListEnglish@forum.nginx.org> I have 2 backends in my applications.There are pure backend response example: First backend: kwfs yangqingchang at yqc:~$ curl -X GET -I http://192.168.1.118:8080/kwfs/AAChTwAAADcAAwAc HTTP/1.1 200 OK Server: QWS/1.0 Content-Type: application/octet-stream Connection: keep-alive Cache-Control: max-age=604800 Date: Sun, 09 Oct 2011 13:35:57 GMT Content-Length: 1239 Second backend: account yangqingchang at yqc:~$ curl -X GET -I http://192.168.60.99:18000/account/visualconfirm/?page=register HTTP/1.1 200 OK Content-Length: 1044 Etag: "f91a3c56177d3edf13a96e0772410d23b531cef5" Content-Type: image/jpeg Server: TornadoServer/1.0 After kwfs response across nginx, "Transfer-Encoding: chunked" appeared in it's headers , and "Content-Length" was replaced. First proxy: kwfs yangqingchang at yqc:~$ curl -X GET -I http://192.168.60.96:8000/kwfs/AAChTwAAADcAAwAC HTTP/1.1 200 OK Date: Sun, 09 Oct 2011 13:58:07 GMT Content-Type: application/octet-stream Transfer-Encoding: chunked Connection: keep-alive Server: QWS/1.0 Cache-Control: max-age=604800 Second proxy: account yangqingchang at yqc:~$ curl -X GET -I http://192.168.60.96:8000/account/visualconfirm/?page=register HTTP/1.1 200 OK Date: Sun, 09 Oct 2011 13:59:07 GMT Content-Type: image/jpeg Connection: keep-alive Content-Length: 1014 Etag: "bb6c20817a926b5ad761ec7a229f0f6d20adf1cb" Server: TornadoServer/1.0 I need the "Content-Length" for calculating the downloading process in client. But I really don't know with same config, why "Content-length" missing when a special response proxy_pass by nginx, and another is ok. Could anybody tell me why? Thanks a lot :) My config: server { listen 192.168.60.96:8000; client_max_body_size 2M; location /kwfs { proxy_redirect off; proxy_pass_header Server; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.1.118:8080; } location /account { proxy_redirect off; proxy_pass_header Server; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.60.99:18000; } } My nginx : nginx -V nginx version: nginx/0.7.65 built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx-0.7.65 --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module --with-http_realip_module --with-openssl=/home/yangqingchang/Downloads/openssl-0.9.8l --with-pcre=/home/yangqingchang/Downloads/pcre-8.01 --add-module=/home/yangqingchang/Downloads/nginx_upload_module-2.0.12 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216427,216427#msg-216427 From mdounin at mdounin.ru Sun Oct 9 20:43:47 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Oct 2011 00:43:47 +0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <20111009204347.GZ1137@mdounin.ru> Hello! On Sun, Oct 09, 2011 at 03:34:23AM -0400, codetr wrote: > hi; > > I use 1.1.5 my error.log > > upstream sent too many data while reading upstream > > how to fix it .. Your backend tries to send more data than advertized in Content-Length header. Fixing backend may be a good idea. Maxim Dounin From mdounin at mdounin.ru Sun Oct 9 20:55:25 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Oct 2011 00:55:25 +0400 Subject: Content-length Missing when response proxy_pass a special backend In-Reply-To: <942dec41437f2daf519dd4323d62d3fd.NginxMailingListEnglish@forum.nginx.org> References: <942dec41437f2daf519dd4323d62d3fd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111009205524.GA1137@mdounin.ru> Hello! On Sun, Oct 09, 2011 at 10:26:37AM -0400, fzuslide wrote: [...] > Content-Type: application/octet-stream > Transfer-Encoding: chunked [...] > Content-Type: image/jpeg > Connection: keep-alive > Content-Length: 1014 [...] > I need the "Content-Length" for calculating the downloading process in > client. > But I really don't know with same config, why "Content-length" missing > when a special response proxy_pass by nginx, and another is ok. > Could anybody tell me why? Thanks a lot :) nginx removes Content-Length header (and uses chunked if possible) if resulting length after processing isn't known. This happens e.g. if you use gzip, ssi, sub or addition modules. > My config: > > server { > listen 192.168.60.96:8000; [...] > } You have to provide full config (i.e. what's on http level?). Best guess without seeing your config is that you have ssi or something similar enabled for "application/octet-stream", but not for "image/jpeg". Maxim Dounin From nginx-forum at nginx.us Sun Oct 9 22:47:52 2011 From: nginx-forum at nginx.us (codetr) Date: Sun, 09 Oct 2011 18:47:52 -0400 Subject: upstream sent too many data while reading In-Reply-To: <20111009204347.GZ1137@mdounin.ru> References: <20111009204347.GZ1137@mdounin.ru> Message-ID: <530a225d61c77998db3b836e8f0fad14.NginxMailingListEnglish@forum.nginx.org> How do I make it Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216444#msg-216444 From nginx-forum at nginx.us Mon Oct 10 04:03:56 2011 From: nginx-forum at nginx.us (fzuslide) Date: Mon, 10 Oct 2011 00:03:56 -0400 Subject: Content-length Missing when response proxy_pass a special backend In-Reply-To: <20111009205524.GA1137@mdounin.ru> References: <20111009205524.GA1137@mdounin.ru> Message-ID: <46ebbd1a8e56072d3cc5bf3a78272f1e.NginxMailingListEnglish@forum.nginx.org> Hi, Maxim, Thanks for your replies. I got the reason when my partner check his code. Trouble shooting: If the backend did not set "Content-Length" or "Chunked" in headers , nginx will use chunked as default, but curl and firefox will use "Content-Length" as default. This makes me lose direction for the problem, lol. So if backend set "Content-Length" in his response headers, everything is ok! Btw, If I want use gzip for downloading, is there any method support use "Content-Length" ? I look up GzipStaticModule document, there is not introduction for this. With kind Regards! fzuslide Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216427,216449#msg-216449 From jg at internetx.de Mon Oct 10 11:43:34 2011 From: jg at internetx.de (Juergen Gotteswinter) Date: Mon, 10 Oct 2011 13:43:34 +0200 Subject: rewrites Message-ID: <4E92DA66.6070304@internetx.com> Hi, i need to translate this htaccess to nginx: RewriteCond %{QUERY_STRING} !^/?url RewriteCond %{QUERY_STRING} !^/?auto RewriteRule ^(.*)$ /?url=$1 [L] is this the right solution? if ($args !~ "^/?url"){ set $rule_0 1$rule_0; } if ($args !~ "^/?auto"){ set $rule_0 2$rule_0; } if ($rule_0 = "21"){ rewrite ^/(.*)$ /?url=$1 last; } cheers, juergen From nginx-forum at nginx.us Mon Oct 10 15:31:54 2011 From: nginx-forum at nginx.us (codetr) Date: Mon, 10 Oct 2011 11:31:54 -0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <4d7055a40a0e6ed542ff4817a86a34fb.NginxMailingListEnglish@forum.nginx.org> pls help me my system reverse proxy nginx use to nginx 1.1.5 WHM 11.30.4 (build 6) CENTOS 4.9 x86_64 virtuozzo Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216463#msg-216463 From mdounin at mdounin.ru Mon Oct 10 16:08:10 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Oct 2011 20:08:10 +0400 Subject: upstream sent too many data while reading In-Reply-To: <530a225d61c77998db3b836e8f0fad14.NginxMailingListEnglish@forum.nginx.org> References: <20111009204347.GZ1137@mdounin.ru> <530a225d61c77998db3b836e8f0fad14.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111010160810.GN1137@mdounin.ru> Hello! On Sun, Oct 09, 2011 at 06:47:52PM -0400, codetr wrote: > How do I make it Log line in question contains request and backend server responsible for request processing. The problem is not in nginx, it's in your backend. You have to find out problematic code in your backend and fix it. As I already said, problem is that your backend sent response with Content-Length which doesn't match length of actual data sent. Most likely it's some script which incorrectly calculates Content-Length. Maxim Dounin From nginx-forum at nginx.us Mon Oct 10 18:02:59 2011 From: nginx-forum at nginx.us (codetr) Date: Mon, 10 Oct 2011 14:02:59 -0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <8d502259549b3fd9055cf854654c03eb.NginxMailingListEnglish@forum.nginx.org> So why, at the same time each day nginx closes Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216469#msg-216469 From igor at sysoev.ru Mon Oct 10 18:22:09 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 10 Oct 2011 22:22:09 +0400 Subject: rewrites In-Reply-To: <4E92DA66.6070304@internetx.com> References: <4E92DA66.6070304@internetx.com> Message-ID: <20111010182209.GA84117@nginx.com> On Mon, Oct 10, 2011 at 01:43:34PM +0200, Juergen Gotteswinter wrote: > Hi, > > i need to translate this htaccess to nginx: > > > RewriteCond %{QUERY_STRING} !^/?url > RewriteCond %{QUERY_STRING} !^/?auto > RewriteRule ^(.*)$ /?url=$1 [L] > > > is this the right solution? > > if ($args !~ "^/?url"){ > set $rule_0 1$rule_0; > } > if ($args !~ "^/?auto"){ > set $rule_0 2$rule_0; > } > if ($rule_0 = "21"){ > rewrite ^/(.*)$ /?url=$1 last; > } Are you sure, that your requests are somethig like "/some/page?/?auto=1" ? Could you explain what you want to get ? -- Igor Sysoev From mdounin at mdounin.ru Mon Oct 10 18:30:28 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Oct 2011 22:30:28 +0400 Subject: upstream sent too many data while reading In-Reply-To: <8d502259549b3fd9055cf854654c03eb.NginxMailingListEnglish@forum.nginx.org> References: <8d502259549b3fd9055cf854654c03eb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111010183028.GO1137@mdounin.ru> Hello! On Mon, Oct 10, 2011 at 02:02:59PM -0400, codetr wrote: > So why, at the same time each day nginx closes ENOPARSE Sorry, I cannot parse what you are trying to say. Maxim Dounin From nginx-forum at nginx.us Mon Oct 10 19:09:07 2011 From: nginx-forum at nginx.us (codetr) Date: Mon, 10 Oct 2011 15:09:07 -0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <1815d1efce73d3d3fb0a70c62abcb8bf.NginxMailingListEnglish@forum.nginx.org> nginx closes every night; I could not find the cause .. my nginx.conf user nobody; # no need for more workers in the proxy mode worker_processes 4; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; worker_rlimit_nofile 8192; events { worker_connections 2048; # you might need to increase this setting for busy servers use epoll; # Linux kernels 2.4.x change to rtsig } http { server_names_hash_max_size 8192; server_names_hash_bucket_size 256; include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 70; server_tokens off; gzip on; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/plain application/x-javascript text/xml text/css; ignore_invalid_headers on; client_header_timeout 10; client_body_timeout 10; send_timeout 10; connection_pool_size 256; client_header_buffer_size 4k; large_client_header_buffers 4 32k; request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; include "/usr/local/nginx/conf/vhost.conf"; } Is there a line or the wrong value? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216478#msg-216478 From mdounin at mdounin.ru Mon Oct 10 19:24:34 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Oct 2011 23:24:34 +0400 Subject: upstream sent too many data while reading In-Reply-To: <1815d1efce73d3d3fb0a70c62abcb8bf.NginxMailingListEnglish@forum.nginx.org> References: <1815d1efce73d3d3fb0a70c62abcb8bf.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111010192434.GP1137@mdounin.ru> Hello! On Mon, Oct 10, 2011 at 03:09:07PM -0400, codetr wrote: > nginx closes every night; I could not find the cause .. > > my nginx.conf > > user nobody; > # no need for more workers in the proxy mode > worker_processes 4; > > error_log /var/log/nginx/error.log; Try using error_log /var/log/nginx/error.log notice; here, it will instruct nginx to log at "notice" level. This includes system events like controlling signal. I.e. on getting SIGINT nginx will log something like this: 2011/10/10 23:19:32 [notice] 24178#0: signal 2 (SIGINT) received, exiting 2011/10/10 23:19:32 [notice] 24178#0: exit I suspect the cause is some broken log-rotation script which kills nginx instead of instructing it to reopen logs. (This is completely unrelated to "upstream sent too many data" messages though.) Maxim Dounin From nginx-forum at nginx.us Mon Oct 10 20:18:03 2011 From: nginx-forum at nginx.us (locojohn) Date: Mon, 10 Oct 2011 16:18:03 -0400 Subject: rewrites In-Reply-To: <4E92DA66.6070304@internetx.com> References: <4E92DA66.6070304@internetx.com> Message-ID: if ($args !~ ^(url|auto)) { rewrite ^(.*)$ http://$server_name/?url=$uri$is_args$args break; } Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216459,216481#msg-216481 From andrew.george.hammond at gmail.com Mon Oct 10 21:59:24 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Mon, 10 Oct 2011 14:59:24 -0700 Subject: upload_resume sha1, md5 and crc32 aggregates missing In-Reply-To: <2711360.314.1318089335939.JavaMail.root@zone.mtgsy.net> References: <2711360.314.1318089335939.JavaMail.root@zone.mtgsy.net> Message-ID: The documentation says they are supported (and for the entire uploaded file): http://www.grid.net.ru/nginx/upload.en.html#upload_aggregate_form_field * and following additional special variables: * * - $upload_file_md5 -- MD5 checksum of the file - $upload_file_md5_uc -- MD5 checksum of the file in uppercase letters - $upload_file_sha1 -- SHA1 checksum of the file - $upload_file_sha1_uc -- SHA1 checksum of the file in uppercase letters - $upload_file_crc32 -- hexdecimal value of CRC32 of the file * *The value of a field specified by this directive is evaluated after successful upload of the file, thus these variables are valid only at the end of processing of one part of original request body.* Since I'm seeing the following in my error log, I believe the upload was successful... so the variables should be valid, right? 2011/10/10 14:56:07 [debug] 9844#0: *91 http script var: "/var/lib/nginx/upload_resume/3/34313583" 2011/10/10 14:56:07 [info] 9844#0: *91 started uploading part 204800-209999/210000 of file "test_trans" to "/var/lib/nginx/upload_resume/3/34313583" (field "", content type "application/octet-stream"), client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023D3DB7, 665, 204800 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CC420, 4535, 205465 2011/10/10 14:56:07 [debug] 9844#0: *91 read: 17, 00000000023CAC77, 16, 0 2011/10/10 14:56:07 [debug] 9844#0: *91 a 0-209999/210000 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CA838, 16, 0 2011/10/10 14:56:07 [info] 9844#0: *91 removed state file "/var/lib/nginx/upload_resume/3/34313583.state", client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" 2011/10/10 14:56:07 [info] 9844#0: *91 finished uploading file "test_trans" to "/var/lib/nginx/upload_resume/3/34313583", client: 10.178.51.115, server: account.nutricateonline.com, request: "POST /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" I'd love to get this sorted out. Anyone? Andrew On Sat, Oct 8, 2011 at 8:55 AM, Valery Kholodkov wrote: > > These aggregates are not available for resumable uploads, as hashes of the > last part will not make sense anyway. > > ----- Andrew Hammond wrote: > > I'm seeing most, but not all of the upload form fields get set. However, > the > > sha1, md5 and crc32 aggregates below are blanks: > > > > request.POST > u'upload_name': [u'py_lightweight_uploader.py'], > > u'upload_size': [u'11345'], > > u'upload_sha1': [u''], > > u'upload_content_type': [u'text/x-python'], > > u'upload_path': [u'/var/lib/nginx/resumable_download/7/64565707'], > > u'upload_md5': [u''], > > u'upload_crc32': [u'']}> > > > > I see that libssl is installed on the server. I don't see any entries in > the > > error log that would make me think there is anything failing here. I have > > the following in the nginx config: > > > > upload_set_form_field upload_name $upload_file_name; > > upload_set_form_field upload_content_type $upload_content_type; > > upload_set_form_field upload_path $upload_tmp_path; > > upload_aggregate_form_field upload_sha1 $upload_file_sha1; > > upload_aggregate_form_field upload_size $upload_file_size; > > upload_aggregate_form_field upload_crc32 $upload_file_crc32; > > upload_aggregate_form_field upload_md5 $upload_file_md5; > > > > I based the above on the documentation and example config. What am I > missing > > here? I'm using nginx 1.0.8 deb-src build from the PPA with the latest > > version of the upload_resume module included. > > -- > Regards, > Valery Kholodkov > > _______________________________________________ > 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 Oct 11 06:33:25 2011 From: nginx-forum at nginx.us (codetr) Date: Tue, 11 Oct 2011 02:33:25 -0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <2ee8cb331461320e254de2018410b59f.NginxMailingListEnglish@forum.nginx.org> Hello Again; this log.. nginx closes every night at the same time 2011/10/11 03:24:37 [notice] 1824#0: signal 15 (SIGTERM) received, exiting 2011/10/11 03:24:37 [notice] 1820#0: signal 15 (SIGTERM) received, exiting 2011/10/11 03:24:37 [notice] 1819#0: signal 15 (SIGTERM) received, exiting 2011/10/11 03:24:37 [notice] 1819#0: exiting 2011/10/11 03:24:37 [notice] 1818#0: signal 15 (SIGTERM) received, exiting 2011/10/11 03:24:37 [notice] 1823#0: signal 15 (SIGTERM) received, exiting 2011/10/11 03:24:37 [notice] 1823#0: exiting 2011/10/11 03:24:37 [notice] 1824#0: exiting 2011/10/11 03:24:37 [notice] 1820#0: exiting 2011/10/11 03:24:37 [notice] 1824#0: exit 2011/10/11 03:24:37 [notice] 1820#0: exit 2011/10/11 03:24:37 [notice] 1823#0: exit 2011/10/11 03:24:37 [notice] 1819#0: exit 2011/10/11 03:24:37 [notice] 1818#0: signal 17 (SIGCHLD) received 2011/10/11 03:24:37 [notice] 1818#0: worker process 1819 exited with code 0 2011/10/11 03:24:37 [notice] 1818#0: worker process 1820 exited with code 0 2011/10/11 03:24:37 [notice] 1818#0: worker process 1823 exited with code 0 2011/10/11 03:24:37 [notice] 1818#0: worker process 1824 exited with code 0 2011/10/11 03:24:37 [notice] 1818#0: exit Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216487#msg-216487 From mdounin at mdounin.ru Tue Oct 11 06:42:50 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 11 Oct 2011 10:42:50 +0400 Subject: upstream sent too many data while reading In-Reply-To: <2ee8cb331461320e254de2018410b59f.NginxMailingListEnglish@forum.nginx.org> References: <2ee8cb331461320e254de2018410b59f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111011064250.GQ1137@mdounin.ru> Hello! On Tue, Oct 11, 2011 at 02:33:25AM -0400, codetr wrote: > Hello Again; > > this log.. nginx closes every night at the same time > > 2011/10/11 03:24:37 [notice] 1824#0: signal 15 (SIGTERM) received, > exiting > 2011/10/11 03:24:37 [notice] 1820#0: signal 15 (SIGTERM) received, > exiting > 2011/10/11 03:24:37 [notice] 1819#0: signal 15 (SIGTERM) received, > exiting > 2011/10/11 03:24:37 [notice] 1819#0: exiting > 2011/10/11 03:24:37 [notice] 1818#0: signal 15 (SIGTERM) received, > exiting > 2011/10/11 03:24:37 [notice] 1823#0: signal 15 (SIGTERM) received, > exiting Something sent SIGTERM to all nginx processes, and nginx exited cleanly due to explicit request to do so. Check your scripts to find out which one does it. (Looks like it's 'killall nginx' somewhere.) Maxim Dounin From nginx-forum at nginx.us Tue Oct 11 06:58:06 2011 From: nginx-forum at nginx.us (codetr) Date: Tue, 11 Oct 2011 02:58:06 -0400 Subject: upstream sent too many data while reading In-Reply-To: <2ee8cb331461320e254de2018410b59f.NginxMailingListEnglish@forum.nginx.org> References: <2ee8cb331461320e254de2018410b59f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2d969b077836b7386b3fe767bde01b6b.NginxMailingListEnglish@forum.nginx.org> # killall nginx and # service nginx restart installed on my system mod_rpaf-0.6 pcre 8.13 2011/10/11 09:52:45 [notice] 32588#0: signal 15 (SIGTERM) received, exiting 2011/10/11 09:52:45 [notice] 32589#0: signal 15 (SIGTERM) received, exiting 2011/10/11 09:52:45 [notice] 32589#0: exiting 2011/10/11 09:52:45 [notice] 32591#0: signal 15 (SIGTERM) received, exiting 2011/10/11 09:52:45 [notice] 32591#0: exiting 2011/10/11 09:52:45 [notice] 32589#0: exit 2011/10/11 09:52:45 [notice] 32591#0: exit 2011/10/11 09:52:45 [notice] 32593#0: signal 15 (SIGTERM) received, exiting 2011/10/11 09:52:45 [notice] 32593#0: exiting 2011/10/11 09:52:45 [notice] 32593#0: exit 2011/10/11 09:52:45 [notice] 32588#0: signal 17 (SIGCHLD) received 2011/10/11 09:52:45 [notice] 32588#0: worker process 32591 exited with code 0 2011/10/11 09:52:45 [notice] 32588#0: signal 29 (SIGIO) received 2011/10/11 09:52:45 [notice] 32592#0: signal 15 (SIGTERM) received, exiting 2011/10/11 09:52:45 [notice] 32592#0: exiting 2011/10/11 09:52:45 [notice] 32588#0: signal 17 (SIGCHLD) received 2011/10/11 09:52:45 [notice] 32588#0: worker process 32589 exited with code 0 2011/10/11 09:52:45 [notice] 32588#0: signal 29 (SIGIO) received 2011/10/11 09:52:45 [notice] 32588#0: signal 17 (SIGCHLD) received 2011/10/11 09:52:45 [notice] 32592#0: exit 2011/10/11 09:52:45 [notice] 32588#0: worker process 32593 exited with code 0 2011/10/11 09:52:45 [notice] 32588#0: signal 29 (SIGIO) received 2011/10/11 09:52:45 [notice] 32588#0: signal 17 (SIGCHLD) received 2011/10/11 09:52:45 [notice] 32588#0: worker process 32592 exited with code 0 2011/10/11 09:52:45 [notice] 32588#0: exit 2011/10/11 09:53:08 [notice] 3282#0: using the "epoll" event method 2011/10/11 09:53:08 [notice] 3282#0: nginx/1.1.5 2011/10/11 09:53:08 [notice] 3282#0: built by gcc 3.4.6 20060404 (Red Hat 3.4.6-11) 2011/10/11 09:53:08 [notice] 3282#0: OS: Linux 2.6.18-028stab092.1 2011/10/11 09:53:08 [notice] 3282#0: getrlimit(RLIMIT_NOFILE): 1024:1024 2011/10/11 09:53:08 [notice] 3283#0: start worker processes 2011/10/11 09:53:08 [notice] 3283#0: start worker process 3284 2011/10/11 09:53:08 [notice] 3283#0: start worker process 3285 2011/10/11 09:53:08 [notice] 3283#0: start worker process 3286 2011/10/11 09:53:08 [notice] 3283#0: start worker process 3288 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216489#msg-216489 From valery+nginxen at grid.net.ru Tue Oct 11 09:14:14 2011 From: valery+nginxen at grid.net.ru (Valery Kholodkov) Date: Tue, 11 Oct 2011 10:14:14 +0100 (BST) Subject: upload_resume sha1, md5 and crc32 aggregates missing In-Reply-To: Message-ID: <19755009.461.1318324454956.JavaMail.root@zone.mtgsy.net> My fault, I'll change it to "not available for resumable uploads". Note: body part != file segment. ----- Andrew Hammond wrote: > The documentation says they are supported (and for the entire uploaded > file): > > http://www.grid.net.ru/nginx/upload.en.html#upload_aggregate_form_field > * > > and following additional special variables: > * > * > > - $upload_file_md5 -- MD5 checksum of the file > - $upload_file_md5_uc -- MD5 checksum of the file in uppercase letters > - $upload_file_sha1 -- SHA1 checksum of the file > - $upload_file_sha1_uc -- SHA1 checksum of the file in uppercase letters > - $upload_file_crc32 -- hexdecimal value of CRC32 of the file > > * > *The value of a field specified by this directive is evaluated after > successful upload of the file, thus these variables are valid only at the > end of processing of one part of original request body.* > > Since I'm seeing the following in my error log, I believe the upload was > successful... so the variables should be valid, right? > > 2011/10/10 14:56:07 [debug] 9844#0: *91 http script var: > "/var/lib/nginx/upload_resume/3/34313583" > 2011/10/10 14:56:07 [info] 9844#0: *91 started uploading part > 204800-209999/210000 of file "test_trans" to > "/var/lib/nginx/upload_resume/3/34313583" (field "", content type > "application/octet-stream"), client: 10.178.51.115, server: > account.nutricateonline.com, request: "POST /rspool/?id=test&sha1=00000000 > HTTP/1.0", host: "209.114.46.109" > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023D3DB7, 665, > 204800 > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CC420, 4535, > 205465 > 2011/10/10 14:56:07 [debug] 9844#0: *91 read: 17, 00000000023CAC77, 16, 0 > 2011/10/10 14:56:07 [debug] 9844#0: *91 a 0-209999/210000 > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CA838, 16, 0 > 2011/10/10 14:56:07 [info] 9844#0: *91 removed state file > "/var/lib/nginx/upload_resume/3/34313583.state", client: 10.178.51.115, > server: account.nutricateonline.com, request: "POST > /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" > 2011/10/10 14:56:07 [info] 9844#0: *91 finished uploading file "test_trans" > to "/var/lib/nginx/upload_resume/3/34313583", client: 10.178.51.115, server: > account.nutricateonline.com, request: "POST /rspool/?id=test&sha1=00000000 > HTTP/1.0", host: "209.114.46.109" > > I'd love to get this sorted out. Anyone? > > Andrew > > > On Sat, Oct 8, 2011 at 8:55 AM, Valery Kholodkov > wrote: > > > > > These aggregates are not available for resumable uploads, as hashes of the > > last part will not make sense anyway. > > > > ----- Andrew Hammond wrote: > > > I'm seeing most, but not all of the upload form fields get set. However, > > the > > > sha1, md5 and crc32 aggregates below are blanks: > > > > > > request.POST > > u'upload_name': [u'py_lightweight_uploader.py'], > > > u'upload_size': [u'11345'], > > > u'upload_sha1': [u''], > > > u'upload_content_type': [u'text/x-python'], > > > u'upload_path': [u'/var/lib/nginx/resumable_download/7/64565707'], > > > u'upload_md5': [u''], > > > u'upload_crc32': [u'']}> > > > > > > I see that libssl is installed on the server. I don't see any entries in > > the > > > error log that would make me think there is anything failing here. I have > > > the following in the nginx config: > > > > > > upload_set_form_field upload_name $upload_file_name; > > > upload_set_form_field upload_content_type $upload_content_type; > > > upload_set_form_field upload_path $upload_tmp_path; > > > upload_aggregate_form_field upload_sha1 $upload_file_sha1; > > > upload_aggregate_form_field upload_size $upload_file_size; > > > upload_aggregate_form_field upload_crc32 $upload_file_crc32; > > > upload_aggregate_form_field upload_md5 $upload_file_md5; > > > > > > I based the above on the documentation and example config. What am I > > missing > > > here? I'm using nginx 1.0.8 deb-src build from the PPA with the latest > > > version of the upload_resume module included. > > > > -- > > Regards, > > Valery Kholodkov > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > -- -- Regards, Valery Kholodkov From keith at scott-land.net Tue Oct 11 09:39:43 2011 From: keith at scott-land.net (keith) Date: Tue, 11 Oct 2011 10:39:43 +0100 Subject: Cheap SharePoint -> Wordpress fail-over help request Message-ID: <4E940EDF.9040205@scott-land.net> We have nginx setup as a reverse proxy and on one of the backend servers we have a Sharepoint website that we want to failover to a Wordpress website hosted on another server if there's a problem with Sharepoint website. I've googled and red through books etc but can't we an example for this. I think i need "try_files" and some type of error code checking but havent been able to figure it out. Could someone advice ? Below is the type of thing that I think I am after. Thanks for looking. Keith upstream primaryserver { server 10.1.1.1:80; } upstream secondaryserver { server 10.1.1.2:80; } server { listen 80; server_name _; server_name_in_redirect off; location / { try_files @sharepoint @wordpress; } location @sharepoint { proxy_pass http://primaryserver; proxy_set_header Host $host; proxy_connect_timeout 3; proxy_next_upstream error timeout; } location @wordpress { proxy_pass http://secondaryserver; proxy_set_header Host $host; proxy_connect_timeout 3; proxy_next_upstream error timeout; } } From igor at sysoev.ru Tue Oct 11 09:50:27 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 11 Oct 2011 13:50:27 +0400 Subject: Cheap SharePoint -> Wordpress fail-over help request In-Reply-To: <4E940EDF.9040205@scott-land.net> References: <4E940EDF.9040205@scott-land.net> Message-ID: <20111011095027.GF5321@nginx.com> On Tue, Oct 11, 2011 at 10:39:43AM +0100, keith wrote: > We have nginx setup as a reverse proxy and on one of the backend servers > we have a Sharepoint website that we want to failover to a Wordpress > website hosted on another server if there's a problem with Sharepoint > website. I've googled and red through books etc but can't we an example > for this. I think i need "try_files" and some type of error code > checking but havent been able to figure it out. Could someone advice ? > Below is the type of thing that I think I am after. > > Thanks for looking. > Keith > > upstream primaryserver { server 10.1.1.1:80; } > upstream secondaryserver { server 10.1.1.2:80; } > > server > { > listen 80; > server_name _; > server_name_in_redirect off; > > location / > { > try_files @sharepoint @wordpress; > } > location @sharepoint > { > proxy_pass http://primaryserver; > proxy_set_header Host $host; > proxy_connect_timeout 3; > proxy_next_upstream error timeout; > } > > location @wordpress > { > proxy_pass http://secondaryserver; > proxy_set_header Host $host; > proxy_connect_timeout 3; > proxy_next_upstream error timeout; > } > > } "try_files" tries files, but not proxied requests. There are two way to fallback to backup servers: 1) upstream sharepoint { server primaryserver; server secondaryserver backup; } server { location / { proxy_pass http://sharepoint; proxy_set_header Host $host; proxy_connect_timeout 3; } } 2) server { location / { proxy_pass http://primaryserver; proxy_set_header Host $host; proxy_connect_timeout 3; proxy_intercept_errors on; error_page 502 504 @wordpress; } location @wordpress { proxy_pass http://secondaryserver; proxy_set_header Host $host; proxy_connect_timeout 3; } } -- Igor Sysoev From mat999 at gmail.com Tue Oct 11 09:50:56 2011 From: mat999 at gmail.com (SplitIce) Date: Tue, 11 Oct 2011 20:50:56 +1100 Subject: Cheap SharePoint -> Wordpress fail-over help request In-Reply-To: <4E940EDF.9040205@scott-land.net> References: <4E940EDF.9040205@scott-land.net> Message-ID: Try files refers to local files so that wont work. You need a failover in the upstream. On Tue, Oct 11, 2011 at 8:39 PM, keith wrote: > We have nginx setup as a reverse proxy and on one of the backend servers we > have a Sharepoint website that we want to failover to a Wordpress website > hosted on another server if there's a problem with Sharepoint website. I've > googled and red through books etc but can't we an example for this. I think > i need "try_files" and some type of error code checking but havent been able > to figure it out. Could someone advice ? Below is the type of thing that I > think I am after. > > Thanks for looking. > Keith > > upstream primaryserver { server 10.1.1.1:80; } > upstream secondaryserver { server 10.1.1.2:80; } > > server > { > listen 80; > server_name _; > server_name_in_redirect off; > > location / > { > try_files @sharepoint @wordpress; > } > location @sharepoint > { > proxy_pass http://primaryserver; > proxy_set_header Host $host; > proxy_connect_timeout 3; > proxy_next_upstream error timeout; > } > > location @wordpress > { > proxy_pass http://secondaryserver; > proxy_set_header Host $host; > proxy_connect_timeout 3; > proxy_next_upstream error timeout; > } > > } > > ______________________________**_________________ > 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 Oct 11 12:20:37 2011 From: nginx-forum at nginx.us (Giang) Date: Tue, 11 Oct 2011 08:20:37 -0400 Subject: Please help me In-Reply-To: <20111005133636.GB37372@nginx.com> References: <20111005133636.GB37372@nginx.com> Message-ID: Thank you all for helping me. I didn't clearly about why browsers didn't recognize my SSL. If I remove: location / { rewrite ^/ http://$http_host$request_uri permanent; } The SSL was working fine, I think there were some objects still linking using http. Is there any help to solve the problem? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214981,216507#msg-216507 From keith at scott-land.net Tue Oct 11 13:24:27 2011 From: keith at scott-land.net (keith) Date: Tue, 11 Oct 2011 14:24:27 +0100 Subject: Cheap SharePoint -> Wordpress fail-over help request In-Reply-To: <20111011095027.GF5321@nginx.com> References: <4E940EDF.9040205@scott-land.net> <20111011095027.GF5321@nginx.com> Message-ID: <4E94438B.7040507@scott-land.net> On 11/10/2011 10:50, Igor Sysoev wrote: > On Tue, Oct 11, 2011 at 10:39:43AM +0100, keith wrote: >> We have nginx setup as a reverse proxy and on one of the backend servers >> we have a Sharepoint website that we want to failover to a Wordpress >> website hosted on another server if there's a problem with Sharepoint >> website. I've googled and red through books etc but can't we an example >> for this. I think i need "try_files" and some type of error code >> checking but havent been able to figure it out. Could someone advice ? >> Below is the type of thing that I think I am after. >> >> Thanks for looking. >> Keith >> >> upstream primaryserver { server 10.1.1.1:80; } >> upstream secondaryserver { server 10.1.1.2:80; } >> >> server >> { >> listen 80; >> server_name _; >> server_name_in_redirect off; >> >> location / >> { >> try_files @sharepoint @wordpress; >> } >> location @sharepoint >> { >> proxy_pass http://primaryserver; >> proxy_set_header Host $host; >> proxy_connect_timeout 3; >> proxy_next_upstream error timeout; >> } >> >> location @wordpress >> { >> proxy_pass http://secondaryserver; >> proxy_set_header Host $host; >> proxy_connect_timeout 3; >> proxy_next_upstream error timeout; >> } >> >> } > "try_files" tries files, but not proxied requests. > There are two way to fallback to backup servers: > > 1) > upstream sharepoint { > server primaryserver; > server secondaryserver backup; > } > > server { > location / { > proxy_pass http://sharepoint; > proxy_set_header Host $host; > proxy_connect_timeout 3; > } > } > > 2) > server { > location / { > proxy_pass http://primaryserver; > proxy_set_header Host $host; > proxy_connect_timeout 3; > proxy_intercept_errors on; > error_page 502 504 @wordpress; > } > > location @wordpress { > proxy_pass http://secondaryserver; > proxy_set_header Host $host; > proxy_connect_timeout 3; > } > } > > Cheers Igor, Option 2 seems to be working for us !! So thanks for the quick answers. I think we just need to setup the correct error codes now. Below is the current configuration that seems to be working. upstream primaryserver { server 10.0.0.xx:80; } upstream secondaryserver { server 10.0.0.xx:80; } server { listen 80; server_name www.somewebsites.com; server_name_in_redirect off; location / { proxy_pass http://primaryserver; proxy_set_header Host $host; proxy_connect_timeout 3; proxy_intercept_errors on; error_page 400 403 502 504 @wordpress; } location @wordpress { proxy_pass http://secondaryserver; proxy_set_header Host $host; proxy_connect_timeout 3; } } From nginx-forum at nginx.us Tue Oct 11 14:11:14 2011 From: nginx-forum at nginx.us (etrader) Date: Tue, 11 Oct 2011 10:11:14 -0400 Subject: Python on Nginx Message-ID: The instruction given on http://wiki.nginx.org/PythonFlup is to install nginx supporting python. But I have a working Nginx with php-fpm supporting PHP. Now I want to add support of python too. Thus, my config is slightly different. I successfully installed Python 2.6, Django and python-flup. Everything went good, but python does not work on web (when visiting test.py, it downloads the file instead of running the script). How should modify the nginx config to support python? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216514,216514#msg-216514 From nginx-forum at nginx.us Tue Oct 11 14:53:26 2011 From: nginx-forum at nginx.us (suttles) Date: Tue, 11 Oct 2011 10:53:26 -0400 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: References: Message-ID: <6f780abb3c77b809b9dc2a01ccbae2df.NginxMailingListEnglish@forum.nginx.org> I have similar problem. I can get the index.php to display in the document root, but when I type www.mydomain.com/administrator it will not pull the index.php, but if I type www.mydomain.com/administrator/index.php, it will bring the page up. So is this a configuration file issue or a rewrite issue. I need to resolve this due to the fact I have some joomla installs that have a root joomla install and then a subdirectory of joomla installed and I must be able to get the server to respond to the sub-directory index.php files. I am new to NGINX and let me say it is awesome, but I still have a lot to learn. Thx Suttles Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215921,216516#msg-216516 From nginx-forum at nginx.us Tue Oct 11 15:02:34 2011 From: nginx-forum at nginx.us (davidcie) Date: Tue, 11 Oct 2011 11:02:34 -0400 Subject: max clients != worker processes * worker connections Message-ID: <96582fa33e21af661eeb981962ee6437.NginxMailingListEnglish@forum.nginx.org> Hello, I relise that it may have been hammered on quite a few times already, but I cannot understand the results I'm getting. I have a rather basic setup on Ubuntu Server 11.04, where nginx (run as root) spawns 2 worker_processes and serves a basic HTML page. Each of these processes should have its worker_connections set to 8192. There's no limit_zone defined. worker_rlimit_nofile is set to 65536, keepalive_timeout 5. Verifying max load, I run ab from another server on the subnet. It works fine with "ab -kc 8000 -n 16000 http://10.1.1.10/". However, when I do "ab -kc 10000 -n 16000 http://10.1.1.10/", ab shows about 3486 failed requests in its results (Length: 1743, Exceptions: 1743), while nginx's error.log features numerous "2011/10/11 16:49:24 [alert] 12081#0: 8192 worker_connections are not enough" errors. Testing a number of settings, it seems that there's a close to 1-1 relationship between worker_connections and the maximum concurrency parameter to ab that doesn't produce errors. I tried setting worker_processes to some high number (like 16), but it seems to have no effect whatsoever. Can you please let me know why this setup might not be serving the "promised" ;-) worker_processes * worker_connections connections? Is it possible that new connections are not being evenly distributed to the two processes? Apologies if this is some basic error on our side, we're still learing (and admiring) nginx and are more used to IIS! Kind regards, Dawid Ciecierski Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216517,216517#msg-216517 From simohayha.bobo at gmail.com Tue Oct 11 15:16:31 2011 From: simohayha.bobo at gmail.com (Simon Liu) Date: Tue, 11 Oct 2011 23:16:31 +0800 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: <6f780abb3c77b809b9dc2a01ccbae2df.NginxMailingListEnglish@forum.nginx.org> References: <6f780abb3c77b809b9dc2a01ccbae2df.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks! You should set index directive. example: "index index.html index.php" On Tue, Oct 11, 2011 at 10:53 PM, suttles wrote: > I have similar problem. I can get the index.php to display in the > document root, but when I type www.mydomain.com/administrator it will > not pull the index.php, but if I type > www.mydomain.com/administrator/index.php, it will bring the page up. So > is this a configuration file issue or a rewrite issue. I need to resolve > this due to the fact I have some joomla installs that have a root joomla > install and then a subdirectory of joomla installed and I must be able > to get the server to respond to the sub-directory index.php files. > > I am new to NGINX and let me say it is awesome, but I still have a lot > to learn. > > Thx > Suttles > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215921,216516#msg-216516 > > _______________________________________________ > 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 nginx-forum at nginx.us Tue Oct 11 15:21:42 2011 From: nginx-forum at nginx.us (suttles) Date: Tue, 11 Oct 2011 11:21:42 -0400 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: References: Message-ID: <40912f10ec2d2d44787dff8cff7ff147.NginxMailingListEnglish@forum.nginx.org> I have the variable set, or at least I think I do. Here is my config for the vhost. server { client_max_body_size 20M; listen 1192; # .domain.com will match both domain.com and anything.domain.com server_name rentavault.net; # It is best to place the root of the server block at the server level, and not the location level # any location block path will be relative to this root. root /home/www/rentavault_net; # It's always good to set logs, note however you cannot turn off the error log # setting error_log off; will simply create a file called 'off'. access_log /home/www/rentavault_net/logs/access_log.log main; error_log /home/www/rentavault_net/logs/error_log.log info; # This can also go in the http { } level index index.php index.html; location / { # if you're just using wordpress and don't want extra rewrites # then replace the word @rewrites with /index.php try_files $uri $uri/ @rewrites; } location ~ ^/cgi-bin/(awredir|awstats)\.pl { gzip off; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root/cgi-bin/cgi-bin.php; fastcgi_param X_SCRIPT_FILENAME /home/www/rentavault_net/$fastcgi_script_name; fastcgi_param X_SCRIPT_NAME $fastcgi_script_name; include fastcgi_params; } This config will not let me access the sub directory without index.php in the path of the browser. Very frustrating. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215921,216519#msg-216519 From mdounin at mdounin.ru Tue Oct 11 15:38:10 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 11 Oct 2011 19:38:10 +0400 Subject: max clients != worker processes * worker connections In-Reply-To: <96582fa33e21af661eeb981962ee6437.NginxMailingListEnglish@forum.nginx.org> References: <96582fa33e21af661eeb981962ee6437.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111011153810.GW1137@mdounin.ru> Hello! On Tue, Oct 11, 2011 at 11:02:34AM -0400, davidcie wrote: > Hello, > > I relise that it may have been hammered on quite a few times already, > but I cannot understand the results I'm getting. I have a rather basic > setup on Ubuntu Server 11.04, where nginx (run as root) spawns 2 > worker_processes and serves a basic HTML page. Each of these processes > should have its worker_connections set to 8192. There's no limit_zone > defined. worker_rlimit_nofile is set to 65536, keepalive_timeout 5. > > Verifying max load, I run ab from another server on the subnet. It works > fine with "ab -kc 8000 -n 16000 http://10.1.1.10/". However, when I do > "ab -kc 10000 -n 16000 http://10.1.1.10/", ab shows about 3486 failed > requests in its results (Length: 1743, Exceptions: 1743), while nginx's > error.log features numerous "2011/10/11 16:49:24 [alert] 12081#0: 8192 > worker_connections are not enough" errors. > > Testing a number of settings, it seems that there's a close to 1-1 > relationship between worker_connections and the maximum concurrency > parameter to ab that doesn't produce errors. I tried setting > worker_processes to some high number (like 16), but it seems to have no > effect whatsoever. > > Can you please let me know why this setup might not be serving the > "promised" ;-) worker_processes * worker_connections connections? Is it > possible that new connections are not being evenly distributed to the > two processes? Apologies if this is some basic error on our side, we're > still learing (and admiring) nginx and are more used to IIS! With small html page it's very likely that one worker process will be able to hold accept mutex exclusively. Upon aproaching worker_connections limit it will stop using accept mutex, but it may take some time (up to accept_mutex_delay, default 500ms) for other workers to come into play. Additionally, the worker will still try to accept() connections until it sees other worker locked accept mutex (and this may take some additional time). With real load you should get much better distribution of client connections between workers. In extreme use cases like the above you may try using events { accept_mutex off; ... } to achieve better connection distribution between workers. This implies some CPU overhead though, especially when using many worker processes (OS will wake up each worker on any new connection instead of only one holding accept mutex). Maxim Dounin From zzz at zzz.org.ua Tue Oct 11 15:39:08 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 11 Oct 2011 18:39:08 +0300 Subject: max clients != worker processes * worker connections In-Reply-To: <96582fa33e21af661eeb981962ee6437.NginxMailingListEnglish@forum.nginx.org> References: <96582fa33e21af661eeb981962ee6437.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 10/11/11, davidcie wrote: > Can you please let me know why this setup might not be serving the > "promised" ;-) worker_processes * worker_connections connections? > Is it possible that new connections are not being evenly distributed to the > two processes? They aren't supposed to be evenly distributed. Whoever gets cpu time first is likely to accept as many connections as possible. Unless you have blocking or cpu intensive requests in which case it won't have enough time to call another accept but other worker will. And it's actually not specific to nginx. I think any non-blocking server behaves like this. Although you can try setting accept_mutex or something to influence this. From zzz at zzz.org.ua Tue Oct 11 15:43:27 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 11 Oct 2011 18:43:27 +0300 Subject: max clients != worker processes * worker connections In-Reply-To: <20111011153810.GW1137@mdounin.ru> References: <96582fa33e21af661eeb981962ee6437.NginxMailingListEnglish@forum.nginx.org> <20111011153810.GW1137@mdounin.ru> Message-ID: On 10/11/11, Maxim Dounin wrote: Sorry, haven't noticed Maxim's answer. From nginx at nginxuser.net Tue Oct 11 16:03:32 2011 From: nginx at nginxuser.net (Nginx User) Date: Tue, 11 Oct 2011 19:03:32 +0300 Subject: So is "rewrite_by_lua" also evil? Message-ID: I have the following simplified setup ... server { ... location @proxy { include /etc/nginx/firewall.default; proxy_pass http://127.0.0.1:8080; ... } location ~ ^.+\.php$ { content_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @proxy; } } Basically, everything that cannot be found by nginx, as well as php requests, are sent to the proxy Now, note the filter.default file in the @proxy location. I use this to run some tests on these requests for security and my logs show them catching all sorts of exploit attempts. Anyway, when I have the following (simplified) in firewall.default .... if ($http_user_agent ~* libwww ) { return 403; } ... everything is fine. When a php request is made, libwww user agents are denied and others get the php output. When I use the following (simplified) rewrite_by_lua equivalent instead .... rewrite_by_lua ' if ngx.var.http_user_agent == "libwww" then ngx.exit(ngx.HTTP_FORBIDDEN) end '; The php file is downloaded. Obviously I don't have the "libwww" when testing so I suppose the lua "if" block is skipped at which point the physical php file is found and sent to the user as is and the proxy_pass directive is not run. Looks similar to the sort of unexpected behaviour from the rewrite module's "if". Any ideas what gives? Why isn't rewrite_by_lua behaving like the rewrite module? Thanks From francis at daoine.org Tue Oct 11 18:09:32 2011 From: francis at daoine.org (Francis Daly) Date: Tue, 11 Oct 2011 19:09:32 +0100 Subject: Python on Nginx In-Reply-To: References: Message-ID: <20111011180932.GA14165@craic.sysops.org> On Tue, Oct 11, 2011 at 10:11:14AM -0400, etrader wrote: Hi there, > The instruction given on http://wiki.nginx.org/PythonFlup is to install > nginx supporting python. But I have a working Nginx with php-fpm > supporting PHP. Now I want to add support of python too. Thus, my config > is slightly different. nginx doesn't know (or care) that you are using php or python or anything else. All it knows is how you have configured different location{} blocks. Each request is handled by one location, so you must make sure that you have the right configuration in the location that your request matches. > How should modify the nginx config to support python? If you are currently using php-fpm, you probably have something like location [something that matches urls that should be handled by php] { fastcgi_pass [your php-fastcgi server]; } So now that you are adding a separate fastcgi server that is associated with python, you'll want to add a new location block like location [something that matches urls that should be handled by python] { fastcgi_pass [your python-fastcgi server]; } The details depend on what you're trying to do. The documentation on "location", or the debug log, should show you which location is being used for each request -- if it's not the right one, you'll need to adjust the config. Good luck with it, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Tue Oct 11 18:43:32 2011 From: nginx-forum at nginx.us (etrader) Date: Tue, 11 Oct 2011 14:43:32 -0400 Subject: Python on Nginx In-Reply-To: References: Message-ID: <2c33ba685537f0f9924589b91724da33.NginxMailingListEnglish@forum.nginx.org> My server is as server { server_name .domain.com; listen 80; root /home/domain.com; index index.html index.php; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /opt/nginx/conf/fastcgi_params; } } You mean to add another location as location ~ \.py$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.py; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /opt/nginx/conf/fastcgi_params; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216514,216533#msg-216533 From francis at daoine.org Tue Oct 11 18:59:50 2011 From: francis at daoine.org (Francis Daly) Date: Tue, 11 Oct 2011 19:59:50 +0100 Subject: Python on Nginx In-Reply-To: <2c33ba685537f0f9924589b91724da33.NginxMailingListEnglish@forum.nginx.org> References: <2c33ba685537f0f9924589b91724da33.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111011185950.GA14610@craic.sysops.org> On Tue, Oct 11, 2011 at 02:43:32PM -0400, etrader wrote: > You mean to add another location as > location ~ \.py$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.py; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > include /opt/nginx/conf/fastcgi_params; > } If all of your python urls end in .py, yes. Although you probably don't want 127.0.0.1:9000, since that's your php-fastcgi server. You'll want whatever your python-fastcgi server address is: probably 127.0.0.1:8080, if you followed http://wiki.nginx.org/PythonFlup f -- Francis Daly francis at daoine.org From me at keithfernie.co.uk Tue Oct 11 19:06:32 2011 From: me at keithfernie.co.uk (Keith Fernie) Date: Tue, 11 Oct 2011 20:06:32 +0100 Subject: Python on Nginx In-Reply-To: <20111011185950.GA14610@craic.sysops.org> References: <2c33ba685537f0f9924589b91724da33.NginxMailingListEnglish@forum.nginx.org> <20111011185950.GA14610@craic.sysops.org> Message-ID: This is what I'm using with Debian Squeeze & fcgiwrap installed, not just for python. location ~ (\.cgi|\.py|\.sh|\.pl|\.lua)$ { gzip off; root /var/www/$server_name; autoindex on; fastcgi_pass unix:/var/run/fcgiwrap.socket; include /etc/nginx/fastcgi_params; fastcgi_param DOCUMENT_ROOT /var/www/$server_name; fastcgi_param SCRIPT_FILENAME /var/www/$server_name$fastcgi_script_name; } Also I chmod +x the python scripts and add #! /usr/bin/python to the beginning of the python script. Change the path if python is located elsewhere. On Tue, 11 Oct 2011 19:59:50 +0100, Francis Daly wrote: > On Tue, Oct 11, 2011 at 02:43:32PM -0400, etrader wrote: > >> You mean to add another location as >> location ~ \.py$ { >> fastcgi_pass 127.0.0.1:9000; >> fastcgi_index index.py; >> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; >> include /opt/nginx/conf/fastcgi_params; >> } > > If all of your python urls end in .py, yes. > > Although you probably don't want 127.0.0.1:9000, since that's > your php-fastcgi server. You'll want whatever your python-fastcgi > server address is: probably 127.0.0.1:8080, if you followed > http://wiki.nginx.org/PythonFlup > > f From mike503 at gmail.com Tue Oct 11 19:29:40 2011 From: mike503 at gmail.com (Michael Shadle) Date: Tue, 11 Oct 2011 12:29:40 -0700 Subject: NGINX gets $3 million in series A funding! Awesome! Message-ID: http://nginx.net/nginx-venture-funding.html Great job, Igor. NGINX is hitting prime time. >From Michael Dell's investment firm, no less! From david.yu.ftw at gmail.com Tue Oct 11 19:31:03 2011 From: david.yu.ftw at gmail.com (David Yu) Date: Wed, 12 Oct 2011 03:31:03 +0800 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: References: Message-ID: Congrats! Keep nginx rockin. On Wed, Oct 12, 2011 at 3:29 AM, Michael Shadle wrote: > http://nginx.net/nginx-venture-funding.html > > Great job, Igor. NGINX is hitting prime time. > > From Michael Dell's investment firm, no less! > > _______________________________________________ > 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 cliff at develix.com Tue Oct 11 19:32:54 2011 From: cliff at develix.com (Cliff Wells) Date: Tue, 11 Oct 2011 12:32:54 -0700 Subject: Python on Nginx In-Reply-To: References: <2c33ba685537f0f9924589b91724da33.NginxMailingListEnglish@forum.nginx.org> <20111011185950.GA14610@craic.sysops.org> Message-ID: <1318361574.2248.3.camel@portable-evil> On Tue, 2011-10-11 at 20:06 +0100, Keith Fernie wrote: > This is what I'm using with Debian Squeeze & fcgiwrap installed, not just > for python. fcgiwrap is a completely different beast and doesn't apply one whit to running Django. You need to follow the directions you linked to at http://wiki.nginx.org/PythonFlup 1. Set up a location for your PHP applications 2. Set up a *different* location for your Django application and use the directions from the wiki for getting it configured. Cliff From al-nginx at none.at Tue Oct 11 19:46:26 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Tue, 11 Oct 2011 21:46:26 +0200 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: References: Message-ID: Hey Igor, that's so cool congratulations ;-) ;-) Aleks On 11.10.2011 21:29, Michael Shadle wrote: > http://nginx.net/nginx-venture-funding.html > > Great job, Igor. NGINX is hitting prime time. > > From Michael Dell's investment firm, no less! > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mailinglist at modernbiztonsag.org Tue Oct 11 21:24:34 2011 From: mailinglist at modernbiztonsag.org (mailinglist at modernbiztonsag.org) Date: Tue, 11 Oct 2011 23:24:34 +0200 Subject: log if body_size greater than Message-ID: <840c190f871ffe1c90a105821b649357.squirrel@admin.modernbiztonsag.org> Dear Users, I'm reading through the docs and I've found that the rewrite module has some basic comparison operators. Is there a way or trick to implement some conditional processing at other parts of the configuration? My situation is that I'm serving a lot of files through nginx and I would like to be able to log the request if the file is bigger than a given size. I was thinking about using the $body_size to log the actual size but I cannot implement the condition checking with the tools I know. Is there a way to achieve this with the current features of nginx? Best regards, Mate From bernat at luffy.cx Tue Oct 11 21:58:22 2011 From: bernat at luffy.cx (Vincent Bernat) Date: Tue, 11 Oct 2011 23:58:22 +0200 Subject: ssl benchmarks with and without nginx In-Reply-To: <20110919222014.GH1137@mdounin.ru> (Maxim Dounin's message of "Tue, 20 Sep 2011 02:20:14 +0400") References: <20110919195619.GB6932@none.at> <20110919222014.GH1137@mdounin.ru> Message-ID: OoO En cette nuit nuageuse du mardi 20 septembre 2011, vers 00:20, mdounin at mdounin.ru (Maxim Dounin) disait?: >> 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. Meantime, I have done and published another round of tests where I still had the same issues for nginx. Aleksandar pointed me to your post. I have modified my nginx configuration as you say and the latency issues are now gone. I have updated my latest post with this correction and new data. nginx now performs like stud (and even better since stud has another kind of latency issue). http://vincent.bernat.im/en/blog/2011-ssl-benchmark-round2.html > 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. The problem with stunnel was a bug in OpenSSL (for which stunnel implements a slow workaround). Upgrading to a recent version of OpenSSL allows stunnel to perform well. -- Vincent Bernat ? http://vincent.bernat.im panic("Attempted to kill the idle task!"); 2.2.16 /usr/src/linux/kernel/exit.c From agentzh at gmail.com Wed Oct 12 00:15:56 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 12 Oct 2011 08:15:56 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Wed, Oct 12, 2011 at 12:03 AM, Nginx User wrote: > Anyway, when I have the following (simplified) in firewall.default .... > > if ($http_user_agent ~* libwww ) { > ? ? ? ?return 403; > } > > ... everything is fine. When a php request is made, libwww user agents > are denied and others get the php output. > You're using the "~*" operator here and that means "case insensitive match", see http://wiki.nginx.org/HttpCoreModule#location > When I use the following (simplified) rewrite_by_lua equivalent instead .... > > rewrite_by_lua ' > ? ? ? ?if ngx.var.http_user_agent == "libwww" then > ? ? ? ? ? ? ? ?ngx.exit(ngx.HTTP_FORBIDDEN) > ? ? ? ?end > '; > Note that you're using "==" here in Lua which is exact string comparison :) > The php file is downloaded. Obviously I don't have the "libwww" when > testing so I suppose the lua "if" block is skipped at which point the > physical php file is found and sent to the user as is and the > proxy_pass directive is not run. > Which version of ngx_lua are you using? Please show me your "nginx -V" output? And which OS are you using? I've tested your example with ngx_lua git master HEAD on Slackware Linux x86_64 and do not have any issues :) Also, enabling --with-debug in your nginx build and show me the relevant sections of your error.log on the debug error log level will be helpful too :) Regards, -agentzh From mike503 at gmail.com Wed Oct 12 01:01:46 2011 From: mike503 at gmail.com (Michael Shadle) Date: Tue, 11 Oct 2011 18:01:46 -0700 Subject: Getting 502 bad gateway on uploading a file Message-ID: Trying to upload a small .png to Drupal. PHP 5.3.8, CentOS 5.6 x64, nginx 1.1.3 Everything else seems to work fine, but can't seem to get any deeper information as to why anything is getting messed up. Not sure if the debug log has any hints or not. (note I also tried nginx 1.0.8) - does this debug log help with anything? or is this "probably PHP"? http://pastebin.com/E1kDBegW Thanks From matthieu.tourne at gmail.com Wed Oct 12 02:53:36 2011 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Tue, 11 Oct 2011 19:53:36 -0700 Subject: Nginx crash - possibly keepalives Message-ID: Hi all, After turning on keepalives, we've been seeing one crash pretty consistently. We're running nginx 1.1.5 and here is the backtrace : (gdb) bt #0 ngx_write_chain_to_file (file=0x173dbd0, cl=0x0, offset=26779, pool=0x162b850) at src/os/unix/ngx_files.c:162 #1 0x000000000040ea3e in ngx_write_chain_to_temp_file (tf=0x173dbd0, chain=0x0) at src/core/ngx_file.c:35 #2 0x000000000041c534 in ngx_event_pipe_write_chain_to_temp_file (p=0x173d048) at src/event/ngx_event_pipe.c:771 #3 0x000000000041cd3d in ngx_event_pipe_read_upstream (p=0x173d048, do_write=0) at src/event/ngx_event_pipe.c:234 #4 ngx_event_pipe (p=0x173d048, do_write=0) at src/event/ngx_event_pipe.c:50 #5 0x000000000043e1b6 in ngx_http_upstream_process_upstream (r=0x1ae4bb0, u=0x1afb4f8) at src/http/ngx_http_upstream.c:2704 #6 0x000000000043e612 in ngx_http_upstream_handler (ev=0x689b) at src/http/ngx_http_upstream.c:936 #7 0x000000000041b1f6 in ngx_event_process_posted (cycle=, posted=0x0) at src/event/ngx_event_posted.c:39 #8 0x000000000041b0c6 in ngx_process_events_and_timers (cycle=0x151bbf0) at src/event/ngx_event.c:272 #9 0x0000000000420bc3 in ngx_worker_process_cycle (cycle=0x151bbf0, data=) at src/os/unix/ngx_process_cycle.c:801 #10 0x000000000041f4cc in ngx_spawn_process (cycle=0x151bbf0, proc=0x420aeb , data=, name=0x470dc9 "worker process", respawn=5) at src/os/unix/ngx_process.c:196 #11 0x0000000000421359 in ngx_reap_children (cycle=0x151bbf0) at src/os/unix/ngx_process_cycle.c:617 #12 ngx_master_process_cycle (cycle=0x151bbf0) at src/os/unix/ngx_process_cycle.c:180 #13 0x000000000040700a in main (argc=, argv=) at src/core/nginx.c:405 It seems that p->in is NULL in ngx_event_pipe_write_chain_to_temp_file() but I can't figure out why. It's using the proxy module as an upstream. Let me know I could provide more info to help! Matthieu. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Oct 12 02:58:03 2011 From: nginx-forum at nginx.us (suttles) Date: Tue, 11 Oct 2011 22:58:03 -0400 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: References: Message-ID: Great job. for a Great Project. Congradulations Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216537,216550#msg-216550 From amoiz.shine at gmail.com Wed Oct 12 03:03:49 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Wed, 12 Oct 2011 11:03:49 +0800 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: References: Message-ID: <1318388629.2061.4.camel@sharl-desktop> ? 2011-10-11?? 12:29 -0700?Michael Shadle??? > http://nginx.net/nginx-venture-funding.html > > Great job, Igor. NGINX is hitting prime time. > > From Michael Dell's investment firm, no less! > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx is NGINX.net the official site of nginx project? then how about nginx.ORG? -- 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 simohayha.bobo at gmail.com Wed Oct 12 03:40:55 2011 From: simohayha.bobo at gmail.com (Simon Liu) Date: Wed, 12 Oct 2011 11:40:55 +0800 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: <40912f10ec2d2d44787dff8cff7ff147.NginxMailingListEnglish@forum.nginx.org> References: <40912f10ec2d2d44787dff8cff7ff147.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks! You should add fastcgi_index index.php. On Tue, Oct 11, 2011 at 11:21 PM, suttles wrote: > I have the variable set, or at least I think I do. Here is my config for > the vhost. > > server { > client_max_body_size 20M; > listen 1192; > # .domain.com will match both domain.com and > anything.domain.com > server_name rentavault.net; > > # It is best to place the root of the server block at the server > level, and not the location level > # any location block path will be relative to this root. > root /home/www/rentavault_net; > > # It's always good to set logs, note however you cannot turn off > the error log > # setting error_log off; will simply create a file called > 'off'. > access_log /home/www/rentavault_net/logs/access_log.log main; > error_log /home/www/rentavault_net/logs/error_log.log info; > > # This can also go in the http { } level > index index.php index.html; > > location / { > # if you're just using wordpress and don't want extra > rewrites > # then replace the word @rewrites with /index.php > try_files $uri $uri/ @rewrites; > } > location ~ ^/cgi-bin/(awredir|awstats)\.pl { > gzip off; > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME > $document_root/cgi-bin/cgi-bin.php; > fastcgi_param X_SCRIPT_FILENAME > /home/www/rentavault_net/$fastcgi_script_name; > fastcgi_param X_SCRIPT_NAME $fastcgi_script_name; > include fastcgi_params; > } > > This config will not let me access the sub directory without index.php > in the path of the browser. Very frustrating. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,215921,216519#msg-216519 > > _______________________________________________ > 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 nginx at nginxuser.net Wed Oct 12 04:12:33 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 12 Oct 2011 07:12:33 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: Hi On 12 October 2011 03:15, agentzh wrote: > On Wed, Oct 12, 2011 at 12:03 AM, Nginx User wrote: >> Anyway, when I have the following (simplified) in firewall.default .... >> >> if ($http_user_agent ~* libwww ) { >> ? ? ? ?return 403; >> } >> >> ... everything is fine. When a php request is made, libwww user agents >> are denied and others get the php output. >> > > You're using the "~*" operator here and that means "case insensitive > match", see http://wiki.nginx.org/HttpCoreModule#location > >> When I use the following (simplified) rewrite_by_lua equivalent instead .... >> >> rewrite_by_lua ' >> ? ? ? ?if ngx.var.http_user_agent == "libwww" then >> ? ? ? ? ? ? ? ?ngx.exit(ngx.HTTP_FORBIDDEN) >> ? ? ? ?end >> '; >> > > Note that you're using "==" here in Lua which is exact string comparison :) > It is a simplified config. I actually run lua's string.find first and test for a hit. I know ngx.re.match with the "i" modifier would be better but it does not work ... maybe I need to update lua module version. I thought I'll look into that later. Anyway, the exact implementation will cause the "if" block to be skipped. >> The php file is downloaded. Obviously I don't have the "libwww" when >> testing so I suppose the lua "if" block is skipped at which point the >> physical php file is found and sent to the user as is and the >> proxy_pass directive is not run. >> > > Which version of ngx_lua are you using? Please show me your "nginx -V" > output? And which OS are you using? I've tested your example with > ngx_lua git master HEAD on Slackware Linux x86_64 and do not have any > issues :) Centos 5.7 i386. lua module is 0.2.0 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 disabled nginx: configure arguments: --user=nginx --group=nginx --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_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 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/nginx-upstream-fair --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/ngx_cache_purge-1.3 --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/ngx-headers-more --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/ngx-devel-kit --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/ngx-echo-module --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/ngx-lua-module --add-module=/usr/src/redhat/BUILD/nginx-1.0.6/ngx_auth_request-module --without-http_autoindex_module --without-http_empty_gif_module --without-http_memcached_module --without-http_scgi_module --without-http_split_clients_module --without-http_ssi_module --without-http_upstream_ip_hash_module --without-http_uwsgi_module > > Also, enabling --with-debug in your nginx build and show me the > relevant sections of your error.log on the debug error log level will > be helpful too :) I'll get this later. Thanks From agentzh at gmail.com Wed Oct 12 04:20:16 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 12 Oct 2011 12:20:16 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Wed, Oct 12, 2011 at 12:12 PM, Nginx User wrote: > It is a simplified config. I actually run lua's string.find first and > test for a hit. > I know ngx.re.match with the "i" modifier would be better but it does > not work The ngx.re API was first introduced in the v0.2.1rc11 release. There's no wonder that it does not work for you because you're using v0.2.0 :) > ... maybe I need to update lua module version. I thought I'll > look into that later. Surely you need. Please do that before other attempts :) >> Which version of ngx_lua are you using? Please show me your "nginx -V" >> output? And which OS are you using? I've tested your example with >> ngx_lua git master HEAD on Slackware Linux x86_64 and do not have any >> issues :) > > Centos 5.7 i386. > lua module is 0.2.0 > Sigh, your ngx_lua module is way too old :) There's a bunch of important fixes regarding ngx.exec() and ngx.exit() since the ngx_lua v0.2.0 release. The latest version is v0.3.1rc9 and please try it out. >> Also, enabling --with-debug in your nginx build and show me the >> relevant sections of your error.log on the debug error log level will >> be helpful too :) > > I'll get this later. > Please upgrade your ngx_lua module to the latest version before doing this :) Regards, -agentzh From nginx at nginxuser.net Wed Oct 12 04:48:43 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 12 Oct 2011 07:48:43 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 12 October 2011 07:20, agentzh wrote: > Sigh, your ngx_lua module is way too old :) > > There's a bunch of important fixes regarding ngx.exec() and ngx.exit() > since the ngx_lua v0.2.0 release. > > The latest version is v0.3.1rc9 and please try it out. OK thanks. I need to do a build for Nginx 1.0.8 and update my 3rd party modules with new nginx builds. I don't install the rc versions of 3rd party modules though. I only use full releases which means 0.3.0 in this case ... expect if 0.3.1 is released in the interim of course. Anyway, nice to know ngx_lua is not "evil" (as long as it is 0.2.1+!) Thanks From igor at sysoev.ru Wed Oct 12 05:56:09 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 12 Oct 2011 09:56:09 +0400 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: <1318388629.2061.4.camel@sharl-desktop> References: <1318388629.2061.4.camel@sharl-desktop> Message-ID: <20111012055609.GK27996@nginx.com> On Wed, Oct 12, 2011 at 11:03:49AM +0800, Sharl.Jimh.Tsin wrote: > ? 2011-10-11?? 12:29 -0700?Michael Shadle??? > > http://nginx.net/nginx-venture-funding.html > > > > Great job, Igor. NGINX is hitting prime time. > > > > From Michael Dell's investment firm, no less! > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > is NGINX.net the official site of nginx project? > > then how about nginx.ORG? nginx.com is NGINX, Inc. site. nginx.org is nginx project site since Dec 2009. nginx.net for some time was just a mirror of nginx.com and should be redirected to nginx.com except some links. -- Igor Sysoev From delta.yeh at gmail.com Wed Oct 12 08:29:07 2011 From: delta.yeh at gmail.com (Delta Yeh) Date: Wed, 12 Oct 2011 16:29:07 +0800 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: <20111012055609.GK27996@nginx.com> References: <1318388629.2061.4.camel@sharl-desktop> <20111012055609.GK27996@nginx.com> Message-ID: VC: 1 $ for each domain powerby nginx Igor: 3million VC:....,OK. 2011/10/12 Igor Sysoev : > On Wed, Oct 12, 2011 at 11:03:49AM +0800, Sharl.Jimh.Tsin wrote: >> ? 2011-10-11?? 12:29 -0700?Michael Shadle??? >> > http://nginx.net/nginx-venture-funding.html >> > >> > Great job, Igor. NGINX is hitting prime time. >> > >> > From Michael Dell's investment firm, no less! >> > >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> is NGINX.net the official site of nginx project? >> >> then how about nginx.ORG? > > nginx.com is NGINX, Inc. site. > nginx.org is nginx project site since Dec 2009. > nginx.net for some time was just a mirror of nginx.com > and should be redirected to nginx.com except some links. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed Oct 12 08:40:00 2011 From: nginx-forum at nginx.us (davidcie) Date: Wed, 12 Oct 2011 04:40:00 -0400 Subject: max clients != worker processes * worker connections In-Reply-To: <20111011153810.GW1137@mdounin.ru> References: <20111011153810.GW1137@mdounin.ru> Message-ID: This is an excellent explanation - thank you for such an in-depth look into the inner workings of nginx. I will consider sligthly decreasing accept_mutex_delay for our high traffic site, and stop worrying about benchmark results too much. Thanks again, "problem" solved :-) Best regards, Dawd Ciecierski Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216520,216566#msg-216566 From amoiz.shine at gmail.com Wed Oct 12 08:41:28 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Wed, 12 Oct 2011 16:41:28 +0800 Subject: NGINX gets $3 million in series A funding! Awesome! In-Reply-To: References: <1318388629.2061.4.camel@sharl-desktop> <20111012055609.GK27996@nginx.com> Message-ID: <1318408888.2061.6.camel@sharl-desktop> ? 2011-10-12?? 16:29 +0800?Delta Yeh??? > VC: 1 $ for each domain powerby nginx > Igor: 3million > VC:....,OK. > > > 2011/10/12 Igor Sysoev : > > On Wed, Oct 12, 2011 at 11:03:49AM +0800, Sharl.Jimh.Tsin wrote: > >> ? 2011-10-11?? 12:29 -0700?Michael Shadle??? > >> > http://nginx.net/nginx-venture-funding.html > >> > > >> > Great job, Igor. NGINX is hitting prime time. > >> > > >> > From Michael Dell's investment firm, no less! > >> > > >> > _______________________________________________ > >> > nginx mailing list > >> > nginx at nginx.org > >> > http://mailman.nginx.org/mailman/listinfo/nginx > >> > >> is NGINX.net the official site of nginx project? > >> > >> then how about nginx.ORG? > > > > nginx.com is NGINX, Inc. site. > > nginx.org is nginx project site since Dec 2009. > > nginx.net for some time was just a mirror of nginx.com > > and should be redirected to nginx.com except some links. > > > > > > -- > > 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 seems that i provide 3 count personally :) -- 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 Pekka.Panula at sofor.fi Wed Oct 12 08:44:25 2011 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Wed, 12 Oct 2011 11:44:25 +0300 Subject: Best Practice question about log handling/storage Message-ID: Hi How should we share nginx web access logs for later analyzing for eg. awstats. Do you setup nfs server for nginx server or should we put out separate nfs server where nginx should save logs. How do you do it? We dont want lockups/singlepoint of failures, like when you have nfs server where nginx saves logs and that nfs server goes down so goes nginx because nfs connection is broken and it cant write/read from nfs server. 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 Wed Oct 12 09:09:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 12 Oct 2011 13:09:48 +0400 Subject: Python on Nginx In-Reply-To: <20111011180932.GA14165@craic.sysops.org> References: <20111011180932.GA14165@craic.sysops.org> Message-ID: <20111012090948.GF34233@nginx.com> On Tue, Oct 11, 2011 at 07:09:32PM +0100, Francis Daly wrote: > On Tue, Oct 11, 2011 at 10:11:14AM -0400, etrader wrote: > > Hi there, > > > The instruction given on http://wiki.nginx.org/PythonFlup is to install > > nginx supporting python. But I have a working Nginx with php-fpm > > supporting PHP. Now I want to add support of python too. Thus, my config > > is slightly different. > > nginx doesn't know (or care) that you are using php or python or anything > else. All it knows is how you have configured different location{} blocks. > > Each request is handled by one location, so you must make sure that you > have the right configuration in the location that your request matches. > > > How should modify the nginx config to support python? > > If you are currently using php-fpm, you probably have something like > > location [something that matches urls that should be handled by php] { > fastcgi_pass [your php-fastcgi server]; > } > > So now that you are adding a separate fastcgi server that is associated > with python, you'll want to add a new location block like > > location [something that matches urls that should be handled by python] { > fastcgi_pass [your python-fastcgi server]; > } > > The details depend on what you're trying to do. The documentation on > "location", or the debug log, should show you which location is being > used for each request -- if it's not the right one, you'll need to > adjust the config. > > Good luck with it, BTW, I know that some people prefer to use uWSGI server for python. -- Igor Sysoev From martinloy.uy at gmail.com Wed Oct 12 09:24:48 2011 From: martinloy.uy at gmail.com (Martin Loy) Date: Wed, 12 Oct 2011 07:24:48 -0200 Subject: Best Practice question about log handling/storage In-Reply-To: References: Message-ID: Try scribe, https://github.com/facebook/scribe :) On Wed, Oct 12, 2011 at 6:44 AM, wrote: > Hi > > How should we share nginx web access logs for later analyzing for eg. > awstats. > Do you setup nfs server for nginx server or should we put out separate nfs > server where nginx should save logs. How do you do it? > > We dont want lockups/singlepoint of failures, like when you have nfs server > where nginx saves logs and that nfs server goes down so goes nginx because > nfs connection is broken and it cant write/read from nfs server. > ------------------------------ > 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 > > > > _______________________________________________ > 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.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Oct 12 09:52:01 2011 From: nginx-forum at nginx.us (MyName) Date: Wed, 12 Oct 2011 05:52:01 -0400 Subject: convert .htaccess for nginx In-Reply-To: References: Message-ID: <7c6b69cf14561e4dbed7b86f34f688cd.NginxMailingListEnglish@forum.nginx.org> i search on google and found this thread.. if still consufed i found 1 link usefull to convert htaccess to nginx cekidot bekicot http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,172639,216572#msg-216572 From nginx-forum at nginx.us Wed Oct 12 10:23:25 2011 From: nginx-forum at nginx.us (MyName) Date: Wed, 12 Oct 2011 06:23:25 -0400 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: try open this link..i hope is usefull to you www.anilcetin.com/convert-apache-htaccess-to-nginx/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216525,216581#msg-216581 From nginx at nginxuser.net Wed Oct 12 10:31:53 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 12 Oct 2011 13:31:53 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 12 October 2011 13:23, MyName wrote: > try open this link..i hope is usefull to you > www.anilcetin.com/convert-apache-htaccess-to-nginx/ I don't need to convert Apache htaccess to Nginx but thanks for the link anyway. Cheers. From mdounin at mdounin.ru Wed Oct 12 11:28:14 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 12 Oct 2011 15:28:14 +0400 Subject: Getting 502 bad gateway on uploading a file In-Reply-To: References: Message-ID: <20111012112814.GJ1137@mdounin.ru> Hello! On Tue, Oct 11, 2011 at 06:01:46PM -0700, Michael Shadle wrote: > Trying to upload a small .png to Drupal. PHP 5.3.8, CentOS 5.6 x64, nginx 1.1.3 > > Everything else seems to work fine, but can't seem to get any deeper > information as to why anything is getting messed up. Not sure if the > debug log has any hints or not. > > (note I also tried nginx 1.0.8) - does this debug log help with > anything? or is this "probably PHP"? > > http://pastebin.com/E1kDBegW The "recv() failed (104: Connection reset by peer) while reading response header from upstream" message suggests PHP closed connection for some reason (died?) right after nginx sent request to it. Looking more closes on php side is a way to go. Maxim Dounin From mauro.stettler at gmail.com Wed Oct 12 11:39:09 2011 From: mauro.stettler at gmail.com (Mauro Stettler) Date: Wed, 12 Oct 2011 19:39:09 +0800 Subject: Getting 502 bad gateway on uploading a file In-Reply-To: <20111012112814.GJ1137@mdounin.ru> References: <20111012112814.GJ1137@mdounin.ru> Message-ID: if you are using php-fpm over fastcgi i would guess its due to fpm's request_terminate_timeout because the upload took too long On Wed, Oct 12, 2011 at 19:28, Maxim Dounin wrote: > Hello! > > On Tue, Oct 11, 2011 at 06:01:46PM -0700, Michael Shadle wrote: > >> Trying to upload a small .png to Drupal. PHP 5.3.8, CentOS 5.6 x64, nginx 1.1.3 >> >> Everything else seems to work fine, but can't seem to get any deeper >> information as to why anything is getting messed up. Not sure if the >> debug log has any hints or not. >> >> (note I also tried nginx 1.0.8) - does this debug log help with >> anything? or is this "probably PHP"? >> >> http://pastebin.com/E1kDBegW > > The "recv() failed (104: Connection reset by peer) while reading > response header from upstream" message suggests PHP closed > connection for some reason (died?) right after nginx sent request > to it. ?Looking more closes on php side is a way to go. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From mdounin at mdounin.ru Wed Oct 12 12:20:00 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 12 Oct 2011 16:20:00 +0400 Subject: Nginx crash - possibly keepalives In-Reply-To: References: Message-ID: <20111012122000.GK1137@mdounin.ru> Hello! On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > Hi all, > > After turning on keepalives, we've been seeing one crash pretty > consistently. > We're running nginx 1.1.5 and here is the backtrace : > > (gdb) bt > #0 ngx_write_chain_to_file (file=0x173dbd0, cl=0x0, offset=26779, > pool=0x162b850) at src/os/unix/ngx_files.c:162 > #1 0x000000000040ea3e in ngx_write_chain_to_temp_file (tf=0x173dbd0, > chain=0x0) at src/core/ngx_file.c:35 > #2 0x000000000041c534 in ngx_event_pipe_write_chain_to_temp_file > (p=0x173d048) at src/event/ngx_event_pipe.c:771 Do you have any local patches here or it's just some debug logging added? $ grep -n ngx_write_chain_to_temp_file src/event/ngx_event_pipe.c 521: if (ngx_write_chain_to_temp_file(p->temp_file, &file) 765: if (ngx_write_chain_to_temp_file(p->temp_file, out) == NGX_ERROR) { > #3 0x000000000041cd3d in ngx_event_pipe_read_upstream (p=0x173d048, > do_write=0) at src/event/ngx_event_pipe.c:234 > #4 ngx_event_pipe (p=0x173d048, do_write=0) at > src/event/ngx_event_pipe.c:50 > #5 0x000000000043e1b6 in ngx_http_upstream_process_upstream (r=0x1ae4bb0, > u=0x1afb4f8) at src/http/ngx_http_upstream.c:2704 > #6 0x000000000043e612 in ngx_http_upstream_handler (ev=0x689b) at > src/http/ngx_http_upstream.c:936 > #7 0x000000000041b1f6 in ngx_event_process_posted (cycle= out>, posted=0x0) at src/event/ngx_event_posted.c:39 > #8 0x000000000041b0c6 in ngx_process_events_and_timers (cycle=0x151bbf0) at > src/event/ngx_event.c:272 > #9 0x0000000000420bc3 in ngx_worker_process_cycle (cycle=0x151bbf0, > data=) at src/os/unix/ngx_process_cycle.c:801 > #10 0x000000000041f4cc in ngx_spawn_process (cycle=0x151bbf0, proc=0x420aeb > , data=, name=0x470dc9 > "worker process", respawn=5) at src/os/unix/ngx_process.c:196 > #11 0x0000000000421359 in ngx_reap_children (cycle=0x151bbf0) at > src/os/unix/ngx_process_cycle.c:617 > #12 ngx_master_process_cycle (cycle=0x151bbf0) at > src/os/unix/ngx_process_cycle.c:180 > #13 0x000000000040700a in main (argc=, argv= optimized out>) at src/core/nginx.c:405 > > It seems that p->in is NULL in ngx_event_pipe_write_chain_to_temp_file() but > I can't figure out why. > It's using the proxy module as an upstream. > > Let me know I could provide more info to help! Could you please show: fr 2 p *p p p->bufs p *p->temp_file fr 5 p *r p *u p u->headers_in I think I see what's going on here, just to confirm. The underlying issue seems to be one identified in commit message here: http://trac.nginx.org/nginx/changeset/4136/nginx (all available buffers in the p->out chain) Setting proxy_busy_buffers to something lower compared to proxy_buffers may help as a workaround. Maxim Dounin From mdounin at mdounin.ru Wed Oct 12 12:28:57 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 12 Oct 2011 16:28:57 +0400 Subject: Getting 502 bad gateway on uploading a file In-Reply-To: References: <20111012112814.GJ1137@mdounin.ru> Message-ID: <20111012122857.GM1137@mdounin.ru> Hello! On Wed, Oct 12, 2011 at 07:39:09PM +0800, Mauro Stettler wrote: > if you are using php-fpm over fastcgi i would guess its due to fpm's > request_terminate_timeout because the upload took too long Very unlikely, as everything happens within 1 second. 2011/10/11 17:55:34 [debug] 2505#0: *1 http request line: "POST ... ... 2011/10/11 17:55:34 [error] 2505#0: *1 recv() failed (104: Connection reset by peer) ... Maxim Dounin > > On Wed, Oct 12, 2011 at 19:28, Maxim Dounin wrote: > > Hello! > > > > On Tue, Oct 11, 2011 at 06:01:46PM -0700, Michael Shadle wrote: > > > >> Trying to upload a small .png to Drupal. PHP 5.3.8, CentOS 5.6 x64, nginx 1.1.3 > >> > >> Everything else seems to work fine, but can't seem to get any deeper > >> information as to why anything is getting messed up. Not sure if the > >> debug log has any hints or not. > >> > >> (note I also tried nginx 1.0.8) - does this debug log help with > >> anything? or is this "probably PHP"? > >> > >> http://pastebin.com/E1kDBegW > > > > The "recv() failed (104: Connection reset by peer) while reading > > response header from upstream" message suggests PHP closed > > connection for some reason (died?) right after nginx sent request > > to it. ?Looking more closes on php side is a way to go. > > > > 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 matthieu.tourne at gmail.com Wed Oct 12 16:32:41 2011 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Wed, 12 Oct 2011 09:32:41 -0700 Subject: Nginx crash - possibly keepalives In-Reply-To: <20111012122000.GK1137@mdounin.ru> References: <20111012122000.GK1137@mdounin.ru> Message-ID: On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin wrote: > Hello! > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > Hi all, > > > > After turning on keepalives, we've been seeing one crash pretty > > consistently. > > We're running nginx 1.1.5 and here is the backtrace : > > > > (gdb) bt > > #0 ngx_write_chain_to_file (file=0x173dbd0, cl=0x0, offset=26779, > > pool=0x162b850) at src/os/unix/ngx_files.c:162 > > #1 0x000000000040ea3e in ngx_write_chain_to_temp_file (tf=0x173dbd0, > > chain=0x0) at src/core/ngx_file.c:35 > > #2 0x000000000041c534 in ngx_event_pipe_write_chain_to_temp_file > > (p=0x173d048) at src/event/ngx_event_pipe.c:771 > > Do you have any local patches here or it's just some debug logging > added? > There is one patch isn't in this code path and shouldn't have any effect here. > > $ grep -n ngx_write_chain_to_temp_file src/event/ngx_event_pipe.c > 521: if (ngx_write_chain_to_temp_file(p->temp_file, &file) > 765: if (ngx_write_chain_to_temp_file(p->temp_file, out) == NGX_ERROR) { > > > #3 0x000000000041cd3d in ngx_event_pipe_read_upstream (p=0x173d048, > > do_write=0) at src/event/ngx_event_pipe.c:234 > > #4 ngx_event_pipe (p=0x173d048, do_write=0) at > > src/event/ngx_event_pipe.c:50 > > #5 0x000000000043e1b6 in ngx_http_upstream_process_upstream > (r=0x1ae4bb0, > > u=0x1afb4f8) at src/http/ngx_http_upstream.c:2704 > > #6 0x000000000043e612 in ngx_http_upstream_handler (ev=0x689b) at > > src/http/ngx_http_upstream.c:936 > > #7 0x000000000041b1f6 in ngx_event_process_posted (cycle= optimized > > out>, posted=0x0) at src/event/ngx_event_posted.c:39 > > #8 0x000000000041b0c6 in ngx_process_events_and_timers (cycle=0x151bbf0) > at > > src/event/ngx_event.c:272 > > #9 0x0000000000420bc3 in ngx_worker_process_cycle (cycle=0x151bbf0, > > data=) at src/os/unix/ngx_process_cycle.c:801 > > #10 0x000000000041f4cc in ngx_spawn_process (cycle=0x151bbf0, > proc=0x420aeb > > , data=, name=0x470dc9 > > "worker process", respawn=5) at src/os/unix/ngx_process.c:196 > > #11 0x0000000000421359 in ngx_reap_children (cycle=0x151bbf0) at > > src/os/unix/ngx_process_cycle.c:617 > > #12 ngx_master_process_cycle (cycle=0x151bbf0) at > > src/os/unix/ngx_process_cycle.c:180 > > #13 0x000000000040700a in main (argc=, argv= > optimized out>) at src/core/nginx.c:405 > > > > It seems that p->in is NULL in ngx_event_pipe_write_chain_to_temp_file() > but > > I can't figure out why. > > It's using the proxy module as an upstream. > > > > Let me know I could provide more info to help! > > Could you please show: > > fr 2 > p *p > p p->bufs > p *p->temp_file > > fr 5 > p *r > p *u > p u->headers_in > (gdb) fr 2 #2 0x000000000041c534 in ngx_event_pipe_write_chain_to_temp_file (p=0x173d048) at src/event/ngx_event_pipe.c:771 771 src/event/ngx_event_pipe.c: No such file or directory. in src/event/ngx_event_pipe.c (gdb) p *p $1 = {upstream = 0x7f3e2cbe1010, downstream = 0x7f3e2cbdd950, free_raw_bufs = 0x0, in = 0x0, last_in = 0x173d060, out = 0x0, last_out = 0x17b9bf8, free = 0x17b9b30, busy = 0x17b9ec0, input_filter = 0x45c873 , input_ctx = 0x1ae4bb0, output_filter = 0x42897f , output_ctx = 0x1ae4bb0, read = 0, cacheable = 1, single_buf = 0, free_bufs = 1, upstream_done = 0, upstream_error = 0, upstream_eof = 0, upstream_blocked = 0, downstream_done = 0, downstream_error = 0, cyclic_temp_file = 0, cache_file_maxed = 0, allocated = 9, bufs = {num = 9, size = 8192}, tag = 0x693400, busy_size = 8192, read_length = 27269, length = 168, max_temp_file_size = 1048576, max_cache_file_size = 0, temp_file_write_size = 16384, read_timeout = 120000, send_timeout = 60000, send_lowat = 0, pool = 0x162b850, log = 0x16530b0, preread_bufs = 0x0, preread_size = 12, buf_to_file = 0x0, temp_file = 0x173dbd0, num = 61} (gdb) p p->bufs $2 = {num = 9, size = 8192} (gdb) p *p->temp_file $3 = {file = {fd = 308, name = {len = 46, data = 0x173dd88 "/usr/local/nginx-cache/storage/temp/0009520674"}, info = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}}, offset = 26779, sys_offset = 26779, log = 0x16530b0, valid_info = 0, directio = 0}, offset = 26779, path = 0x152efa0, pool = 0x162b850, warn = 0x0, access = 0, log_level = 0, persistent = 1, clean = 0} (gdb) fr 5 #5 0x000000000043e1b6 in ngx_http_upstream_process_upstream (r=0x1ae4bb0, u=0x1afb4f8) at src/http/ngx_http_upstream.c:2704 2704 src/http/ngx_http_upstream.c: No such file or directory. in src/http/ngx_http_upstream.c (gdb) p *r $4 = {signature = 1347703880, connection = 0x7f3e2cbdd950, ctx = 0x162bc60, main_conf = 0x151c9e0, srv_conf = 0x1537c68, loc_conf = 0x157d2c0, read_event_handler = 0x43e840 , write_event_handler = 0x43edf5 , cache = 0x173d188, upstream = 0x1afb4f8, upstream_states = 0x173d658, pool = 0x162b850, header_in = 0x15bff00, headers_in = {headers = {last = 0x162c668, part = {elts = 0x1afa9b0, nelts = 20, next = 0x162c668}, size = 48, nalloc = 20, pool = 0x162b850}, host = 0x1afaa10, connection = 0x0, if_modified_since = 0x1afae30, if_unmodified_since = 0x0, user_agent = 0x1afae00, 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, x_real_ip = 0x1afaa40, user = {len = 0, data = 0x0}, passwd = {len = 0, data = 0x0}, cookies = {elts = 0x162c558, nelts = 0, size = 8, nalloc = 2, pool = 0x162b850}, server = {len = 13, data = 0x162c57d "sir-emeth.comx-real-ipconnect-via-httpscf-host-origin-ipcf-ipcountrycf-iptypecf-use-byccf-use-obcf-pref-obcf-pref-geoloccf-identify-botcf-cache-levelcf-force-miss-tscf-minify-modehost-spoofset-expires"...}, content_length_n = -1, keep_alive_n = -1, connection_type = 0, msie = 0, msie6 = 0, opera = 0, gecko = 0, chrome = 0, safari = 0, konqueror = 0}, headers_out = {headers = {last = 0x1ae4d58, part = {elts = 0x162b8a0, nelts = 2, next = 0x0}, size = 48, nalloc = 20, pool = 0x162b850}, status = 200, status_line = {len = 6, data = 0x1afb981 "200 OK0 \321s\001"}, server = 0x0, date = 0x0, content_length = 0x0, content_encoding = 0x0, location = 0x0, refresh = 0x0, last_modified = 0x0, content_range = 0x0, accept_ranges = 0x0, www_authenticate = 0x0, expires = 0x0, etag = 0x0, override_charset = 0x0, content_type_len = 9, content_type = {len = 9, data = 0x173d9a8 "text/html"}, charset = {len = 0, data = 0x0}, content_type_lowcase = 0x0, content_type_hash = 0, cache_control = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, content_length_n = -1, date_time = 0, last_modified_time = -1}, request_body = 0x173d158, lingering_time = 0, start_sec = 1318377836, start_msec = 445, method = 2, http_version = 1001, request_line = {len = 116, data = 0x1822f70 "GET /bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag"}, uri = {len = 12, data = 0x1afb392 "/@@se/bible/"}, args = {len = 95, data = 0x1822f7c "bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag"}, exten = {len = 0, data = 0x0}, unparsed_uri = {len = 103, data = 0x1822f74 "/bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag"}, method_name = {len = 3, data = 0x1822f70 "GET /bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag"}, http_protocol = { len = 8, data = 0x1822fdc "HTTP/1.1\r\nCF-IDTag"}, out = 0x17ba158, main = 0x1ae4bb0, parent = 0x0, postponed = 0x0, post_subrequest = 0x0, posted_requests = 0x0, virtual_names = 0x0, phase_handler = 11, content_handler = 0x45960e , access_code = 0, variables = 0x162bdd8, ncaptures = 0, captures = 0x1afb130, captures_data = 0x1822f74 "/bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag", limit_rate = 0, header_size = 271, request_length = 736, err_status = 0, http_connection = 0x1653108, log_handler = 0x42f4b2 , cleanup = 0x173d6b8, subrequests = 51, count = 1, blocked = 0, aio = 0, http_state = 2, complex_uri = 0, quoted_uri = 0, plus_in_uri = 0, space_in_uri = 0, invalid_header = 0, add_uri_to_alias = 0, valid_location = 1, valid_unparsed_uri = 0, uri_changed = 0, uri_changes = 10, 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 = 0, gzip_ok = 0, gzip_vary = 0, gzip_force = 0, proxy = 0, bypass_cache = 0, no_cache = 0, limit_zone_set = 0, limit_req_set = 0, pipeline = 0, plain_http = 0, chunked = 1, header_only = 0, keepalive = 1, lingering_close = 0, discard_body = 0, internal = 1, error_page = 0, ignore_content_encoding = 0, filter_finalize = 0, post_action = 0, request_complete = 0, request_output = 1, header_sent = 1, expect_tested = 0, root_tested = 0, done = 0, logged = 0, buffered = 0, main_filter_need_in_memory = 0, filter_need_in_memory = 0, filter_need_temporary = 0, allow_ranges = 0, stat_reading = 0, stat_writing = 1, state = 0, header_hash = 116750, lowcase_index = 3, lowcase_header = "viansfer-encoding", '\000' , header_name_start = 0x1ae749c "33'>\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\r\n1a\r\n\n \r\n6\r\n \r\n9\r\n \n\r\n"..., header_name_end = 0x1ae745c "'20' width='5'>\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n "..., header_start = 0x1ae745e "0' width='5'>\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' , "\n "..., header_end = 0x1ae749c "33'>\n", ' ' , "\n", ' ' , "\n", ' ' , "\n", ' ' to continue, or q to quit--- s>, "\n", ' ' , "\n", ' ' , "\r\n1a\r\n\n \r\n6\r\n \r\n9\r\n \n\r\n"..., uri_start = 0x1822f74 "/bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag", uri_end = 0x1822fdb " HTTP/1.1\r\nCF-IDTag", uri_ext = 0x0, args_start = 0x1822f7c "bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag", request_start = 0x1822f70 "GET /bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag", request_end = 0x1822fe4 "\r\nCF-IDTag", method_end = 0x1822f72 "T /bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nCF-IDTag", schema_start = 0x0, schema_end = 0x0, host_start = 0x0, host_end = 0x0, port_start = 0x0, port_end = 0x0, http_minor = 1, http_major = 1} (gdb) p *u $5 = {read_event_handler = 0x43e15b , write_event_handler = 0x43b866 , peer = { connection = 0x7f3e2cbe1010, sockaddr = 0x1afb970, socklen = 16, name = 0x173d730, tries = 1, get = 0x465c0a , free = 0x465954 , data = 0x173d780, set_session = 0x465262 , save_session = 0x465275 , local = 0x157cf00, rcvbuf = 0, log = 0x16530b0, cached = 0, log_error = 1}, pipe = 0x173d048, request_bufs = 0x173d648, output = {buf = 0x0, in = 0x0, free = 0x0, busy = 0x0, sendfile = 1, directio = 0, unaligned = 0, need_in_memory = 0, need_in_temp = 0, alignment = 512, pool = 0x162b850, allocated = 0, bufs = {num = 1, size = 131072}, tag = 0x693400, output_filter = 0x4096f0 , filter_ctx = 0x1afb5f0}, writer = {out = 0x0, last = 0x1afb5f0, connection = 0x7f3e2cbe1010, pool = 0x162b850, limit = 0}, conf = 0x157d858, headers_in = {headers = {last = 0x1afb628, part = { elts = 0x173d7e0, nelts = 5, next = 0x0}, size = 48, nalloc = 8, pool = 0x162b850}, status_n = 200, status_line = {len = 6, data = 0x1afb981 "200 OK0 \321s\001"}, status = 0x0, date = 0x173d7e0, server = 0x173d810, connection = 0x0, expires = 0x0, etag = 0x0, x_accel_expires = 0x0, x_accel_redirect = 0x0, x_accel_limit_rate = 0x0, content_type = 0x173d840, content_length = 0x0, last_modified = 0x0, location = 0x0, accept_ranges = 0x0, www_authenticate = 0x0, transfer_encoding = 0x173d870, content_encoding = 0x0, content_length_n = -1, cache_control = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, connection_close = 0, chunked = 1}, resolved = 0x173d000, buffer = { pos = 0x1ae7330 "...", last = 0x1ae7330 "...", file_pos = 0, file_last = 0, start = 0x1ae7330 "...", end = 0x1ae9330 "", tag = 0x693400, file = 0x0, shadow = 0x0, temporary = 1, memory = 0, mmap = 0, recycled = 1, in_file = 0, flush = 0, sync = 0, last_buf = 0, last_in_chain = 0, last_shadow = 0, temp_file = 0, num = 9}, length = -1, out_bufs = 0x0, busy_bufs = 0x0, free_bufs = 0x0, input_filter_init = 0x4584f1 , input_filter = 0x459db3 , input_filter_ctx = 0x1ae4bb0, create_key = 0x45b21c , max_cache_file_size = 0, create_request = 0x45a9bf , reinit_request = 0x458470 , process_header = 0x45a572 , abort_request = 0x45861a , finalize_request = 0x45861c , rewrite_redirect = 0, timeout = 0, state = 0x173d680, method = {len = 0, data = 0x0}, schema = {len = 7, data = 0x1afb8f0 "http:///bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly"}, uri = {len = 103, data = 0x173d4b4 "/bible/?bookSelect=2+Chronicles&chapterSelect=13&verseSelect=7&addedRadio=Brackets&vsRefRadio=VerseOnly HTTP/1.1\r\nHost: sir-emeth.com\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip\r\nCF-Connecting-IP: "...}, cleanup = 0x173d6b8, bind_hash = 3776832724, store = 0, cacheable = 1, no_cache = 0, accel = 1, ssl = 0, cache_status = 1, buffering = 1, keepalive = 0, keepalive_status = 0, request_sent = 1, header_sent = 1} (gdb) p u->headers_in $6 = {headers = {last = 0x1afb628, part = {elts = 0x173d7e0, nelts = 5, next = 0x0}, size = 48, nalloc = 8, pool = 0x162b850}, status_n = 200, status_line = {len = 6, data = 0x1afb981 "200 OK0 \321s\001"}, status = 0x0, date = 0x173d7e0, server = 0x173d810, connection = 0x0, expires = 0x0, etag = 0x0, x_accel_expires = 0x0, x_accel_redirect = 0x0, x_accel_limit_rate = 0x0, content_type = 0x173d840, content_length = 0x0, last_modified = 0x0, location = 0x0, accept_ranges = 0x0, www_authenticate = 0x0, transfer_encoding = 0x173d870, content_encoding = 0x0, content_length_n = -1, cache_control = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, connection_close = 0, chunked = 1} Hope that this helps! > I think I see what's going on here, just to confirm. The > underlying issue seems to be one identified in commit message > here: > > http://trac.nginx.org/nginx/changeset/4136/nginx > > (all available buffers in the p->out chain) > > Setting proxy_busy_buffers to something lower compared to > proxy_buffers may help as a workaround. > We'll try that and see if that has a positive effect, thank you. Also, would having u->buffering == 0 (proxy_buffering off) help in this scenario ? > > 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 Wed Oct 12 17:22:41 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 12 Oct 2011 21:22:41 +0400 Subject: Nginx crash - possibly keepalives In-Reply-To: References: <20111012122000.GK1137@mdounin.ru> Message-ID: <20111012172241.GU1137@mdounin.ru> Hello! On Wed, Oct 12, 2011 at 09:32:41AM -0700, Matthieu Tourne wrote: > On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin wrote: > > > Hello! > > > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > > > Hi all, > > > > > > After turning on keepalives, we've been seeing one crash pretty > > > consistently. > > > We're running nginx 1.1.5 and here is the backtrace : [...] > (gdb) fr 2 > #2 0x000000000041c534 in ngx_event_pipe_write_chain_to_temp_file > (p=0x173d048) at src/event/ngx_event_pipe.c:771 > 771 src/event/ngx_event_pipe.c: No such file or directory. > in src/event/ngx_event_pipe.c > (gdb) p *p > $1 = { ..., free_raw_bufs = 0x0, in = 0x0, ..., out = 0x0, ..., > busy = 0x17b9ec0, ..., input_filter = 0x45c873 , > ..., cacheable = 1, ... allocated = 9, bufs = {num = 9, size = > 8192}, ..., busy_size = 8192, ..., > length = 168, ... } Ok, it looks like I'm right and all buffers are in busy chain. Likely this happens due to upstream sending response in many small chunks. I'll try to reproduce it here and provide proper fix. [...] > > I think I see what's going on here, just to confirm. The > > underlying issue seems to be one identified in commit message > > here: > > > > http://trac.nginx.org/nginx/changeset/4136/nginx > > > > (all available buffers in the p->out chain) > > > > Setting proxy_busy_buffers to something lower compared to > > proxy_buffers may help as a workaround. > > > > We'll try that and see if that has a positive effect, thank you. > Also, would having u->buffering == 0 (proxy_buffering off) help in this > scenario ? Yes, switching off proxy_buffering should help. Switching off disk buffering (proxy_cache off; proxy_max_temp_file_size 0;) should help as well. Maxim Dounin From calin at presslabs.com Wed Oct 12 17:50:27 2011 From: calin at presslabs.com (Calin Don) Date: Wed, 12 Oct 2011 20:50:27 +0300 Subject: nginx user agent type detection Message-ID: I have assembled a way to detect user agent types by using ideas from: http://notnotmobile.appspot.com/ This is the inital work I came up with: map $http_user_agent $agent_type_phase1 { default 'mobile'; '' 'unknown'; ~*iphone|ipod|blackberry|palm|windows\s+ce 'mobile'; ~*windows|linux|os\s+[x9]|solaris|bsd 'desktop'; ~*spider|crawl|slurp|bot|feedburner 'bot'; } map $http_x_skyfire_phone $agent_type_phase2 { default 'mobile'; '' $agent_type_phase1; } map $http_x_operamini_phone_ua $agent_type { default 'mobile'; '' $agent_type_phase2; } Please suggest any improvements. It is available also on https://gist.github.com/1281950 From mike503 at gmail.com Wed Oct 12 18:10:00 2011 From: mike503 at gmail.com (Michael Shadle) Date: Wed, 12 Oct 2011 11:10:00 -0700 Subject: Getting 502 bad gateway on uploading a file In-Reply-To: <20111012122857.GM1137@mdounin.ru> References: <20111012112814.GJ1137@mdounin.ru> <20111012122857.GM1137@mdounin.ru> Message-ID: 2011/10/12 Maxim Dounin : >> if you are using php-fpm over fastcgi i would guess its due to fpm's >> request_terminate_timeout because the upload took too long > > Very unlikely, as everything happens within 1 second. > > 2011/10/11 17:55:34 [debug] 2505#0: *1 http request line: "POST ... > ... > 2011/10/11 17:55:34 [error] 2505#0: *1 recv() failed (104: Connection reset by peer) ... Exactly - this happens *immediately* like it doesn't even try... Alright well if the logs don't give you any clue from the nginx side, I'll have to try to figure out the PHP side now :) From nginx-forum at nginx.us Wed Oct 12 18:19:48 2011 From: nginx-forum at nginx.us (suttles) Date: Wed, 12 Oct 2011 14:19:48 -0400 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: References: Message-ID: <4f816f7dec28b58856b3f346ed2146b3.NginxMailingListEnglish@forum.nginx.org> Ok, tried that, I have a suspicion that I may have a load balancer issue happening as well. Will report back. I was suppose to add fastcgi_index to the line of index index.php index.html; to look like index fastcgi_index index.php index.html; right? Thx Doug Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215921,216602#msg-216602 From nginx at nginxuser.net Wed Oct 12 18:35:59 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 12 Oct 2011 21:35:59 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: Hi. Updated Nginx to 1.0.8 and did my 3rd party modules as well and even went for rc versions nginx: nginx version: nginx/1.0.8 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51) nginx: configure arguments: --user=nginx --group=nginx --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_stub_status_module --with-http_perl_module --with-debug --without-http_memcached_module --without-http_scgi_module --without-http_split_clients_module --without-http_ssi_module --without-http_upstream_ip_hash_module --without-http_uwsgi_module --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/nginx-upstream-fair --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/ngx_cache_purge-1.4 --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/ngx-headers-more-0.16rc3-0 --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/ngx-devel-kit-0.2.17-4 --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/ngx-echo-module-0.37rc5-0 --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc9-0 --add-module=/usr/src/redhat/BUILD/nginx-1.0.8/ngx_auth_request-module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' Still seeing some evil type behaviour though. This renders php as expected.... if ($request_method !~* (GET|HEAD|POST) ) { return 400; } ... while this sends php files as text downloads ... rewrite_by_lua ' method = ngx.re.match(ngx.var.request_method, "GET", "i") if method == nil then method = ngx.re.match(ngx.var.request_method, "POST", "i") if method == nil then method = ngx.re.match(ngx.var.request_method, "HEAD", "i") if method == nil then ngx.exit(ngx.HTTP_BAD_REQUEST) end end end '; See debug output: http://pastebin.com/A7LNeCf0 Cheers From jim at ohlste.in Wed Oct 12 18:56:55 2011 From: jim at ohlste.in (Jim Ohlstein) Date: Wed, 12 Oct 2011 14:56:55 -0400 Subject: Getting 502 bad gateway on uploading a file In-Reply-To: References: Message-ID: <4E95E2F7.9060209@ohlste.in> On 10/11/11 9:01 PM, Michael Shadle wrote: > Trying to upload a small .png to Drupal. PHP 5.3.8, CentOS 5.6 x64, nginx 1.1.3 Is this only happening with png's? Are you able to upload other types of files? If so, I have seen this type of behavior before. It has happened after PHP version upgrades. Darn near drove me crazy as I could never trace it. It resolved with recompiling of php and all modules, including pecl modules. Just a thought. YMMV, of course. > > Everything else seems to work fine, but can't seem to get any deeper > information as to why anything is getting messed up. Not sure if the > debug log has any hints or not. > > (note I also tried nginx 1.0.8) - does this debug log help with > anything? or is this "probably PHP"? > > http://pastebin.com/E1kDBegW > > Thanks > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Jim Ohlstein From brian at akins.org Wed Oct 12 19:17:55 2011 From: brian at akins.org (Brian Akins) Date: Wed, 12 Oct 2011 15:17:55 -0400 Subject: nginx user agent type detection In-Reply-To: References: Message-ID: I did it in lua bcs I had slightly more complex rules. Looks like what you have will work, it's just O(n) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at nginxuser.net Wed Oct 12 19:24:16 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 12 Oct 2011 22:24:16 +0300 Subject: nginx user agent type detection In-Reply-To: References: Message-ID: On 12 October 2011 22:17, Brian Akins wrote: > I did it in lua ... Care to share? From nginx-forum at nginx.us Wed Oct 12 20:22:53 2011 From: nginx-forum at nginx.us (bimbonius) Date: Wed, 12 Oct 2011 16:22:53 -0400 Subject: using autoindex and the php index file Message-ID: <192f0ed83a15cd10773667cb7d168ac5.NginxMailingListEnglish@forum.nginx.org> Hi. My config looks like this: location / { ... index index.php; autoindex off; } ... location /autoindx_dir/ { autoindex on; } location /autoindx_dir/not/ { autoindex off; } also I have the php cgi options. The problem is that nginx opens the index.php for my root directory if i open only the domain. If I go to the "autoindx_dir" directory I see the directory files like i want. But if I open "autoindex_dir/not" I see also the hole directory although i have a index.php. Whats wrong ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216607,216607#msg-216607 From jabberuser at gmail.com Wed Oct 12 20:55:54 2011 From: jabberuser at gmail.com (Piotr Karbowski) Date: Wed, 12 Oct 2011 22:55:54 +0200 Subject: using autoindex and the php index file In-Reply-To: <192f0ed83a15cd10773667cb7d168ac5.NginxMailingListEnglish@forum.nginx.org> References: <192f0ed83a15cd10773667cb7d168ac5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4E95FEDA.4080605@gmail.com> On 12.10.2011 22:22, bimbonius wrote: > Hi. > > My config looks like this: > > > > > location / { > ... > index index.php; > autoindex off; > } > > ... > > location /autoindx_dir/ { > autoindex on; > } > > location /autoindx_dir/not/ { > autoindex off; > } > > > also I have the php cgi options. > The problem is that nginx opens the index.php for my root directory if i > open only the domain. If I go to the "autoindx_dir" directory I see the > directory files like i want. But if I open "autoindex_dir/not" I see > also the hole directory although i have a index.php. > > Whats wrong ? Propably because you set up 'index index.php;' in location / and not in /autoindex_dir/not/. Move it outside location /, like just into http {} Read http://wiki.nginx.org/HttpCoreModule#location -- Piotr. From nginx-forum at nginx.us Wed Oct 12 21:25:20 2011 From: nginx-forum at nginx.us (bimbonius) Date: Wed, 12 Oct 2011 17:25:20 -0400 Subject: using autoindex and the php index file In-Reply-To: <192f0ed83a15cd10773667cb7d168ac5.NginxMailingListEnglish@forum.nginx.org> References: <192f0ed83a15cd10773667cb7d168ac5.NginxMailingListEnglish@forum.nginx.org> Message-ID: Shame on me :( Thx very much Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216607,216611#msg-216611 From nginx at nginxuser.net Wed Oct 12 21:34:41 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 13 Oct 2011 00:34:41 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 12 October 2011 21:35, Nginx User wrote: > This renders php as expected.... > > if ($request_method !~* (GET|HEAD|POST) ) { > ? ? ? ?return 400; > } > > ... while this sends php files as text downloads ... > > rewrite_by_lua ' > ? ? ? ?method = ?ngx.re.match(ngx.var.request_method, "GET", "i") > ? ? ? ?if method == nil then > ? ? ? ? ? ? ? ?method = ?ngx.re.match(ngx.var.request_method, "POST", "i") > ? ? ? ? ? ? ? ?if method == nil then > ? ? ? ? ? ? ? ? ? ? ? ?method = ?ngx.re.match(ngx.var.request_method, "HEAD", "i") > ? ? ? ? ? ? ? ? ? ? ? ?if method == nil then > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ngx.exit(ngx.HTTP_BAD_REQUEST) > ? ? ? ? ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ?end > ? ? ? ?end > '; > > See debug output: http://pastebin.com/A7LNeCf0 Some additional info. I had thought the php files were being downloaded as text files but this is not strictly true. Files are downloaded whenever php is called but they are always empty with a "0" status code. The associated access log output for the request in the debug log in the paste bin is: xx.xxx.xx.xx - - [12/Oct/2011:18:20:50 +0000] "GET /help/ HTTP/1.1" 0 0 "http://testsite/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/534.50.2 (KHTML, like Gecko) Version/5.0.6 Safari/533.22.3" From brian at akins.org Thu Oct 13 00:03:49 2011 From: brian at akins.org (Brian Akins) Date: Wed, 12 Oct 2011 20:03:49 -0400 Subject: Python on Nginx In-Reply-To: <20111012090948.GF34233@nginx.com> References: <20111011180932.GA14165@craic.sysops.org> <20111012090948.GF34233@nginx.com> Message-ID: On Oct 12, 2011, at 5:09 AM, Igor Sysoev wrote: > > BTW, I know that some people prefer to use uWSGI server for python. > I prefer frameworks like gunicorn that use plain HTTP. --Brian From brian at akins.org Thu Oct 13 00:18:43 2011 From: brian at akins.org (Brian Akins) Date: Wed, 12 Oct 2011 20:18:43 -0400 Subject: nginx-1.0.x+mod_push vs node.js In-Reply-To: References: Message-ID: <0306AEF5-C65A-4B30-95BE-753DD408AE5E@akins.org> On Oct 8, 2011, at 4:47 PM, Davide D'Amico wrote: > Hi, I'd like to know if anyone is using nginx-1.0.x with mod_push in production to keep persistent connections on a website. > I'm little scary about the huge number of active connections my servers can mantain (10000 or 20000). That's not very many concurrent connections. I've seen nginx do much more with push. --Brian From cliff at develix.com Thu Oct 13 01:10:30 2011 From: cliff at develix.com (Cliff Wells) Date: Wed, 12 Oct 2011 18:10:30 -0700 Subject: Python on Nginx In-Reply-To: <20111012090948.GF34233@nginx.com> References: <20111011180932.GA14165@craic.sysops.org> <20111012090948.GF34233@nginx.com> Message-ID: <1318468230.2248.26.camel@portable-evil> On Wed, 2011-10-12 at 13:09 +0400, Igor Sysoev wrote: > On Tue, Oct 11, 2011 at 07:09:32PM +0100, Francis Daly wrote: > > On Tue, Oct 11, 2011 at 10:11:14AM -0400, etrader wrote: > > > > Hi there, > > > > > The instruction given on http://wiki.nginx.org/PythonFlup is to install > > > nginx supporting python. But I have a working Nginx with php-fpm > > > supporting PHP. Now I want to add support of python too. Thus, my config > > > is slightly different. > > > > nginx doesn't know (or care) that you are using php or python or anything > > else. All it knows is how you have configured different location{} blocks. > > > > Each request is handled by one location, so you must make sure that you > > have the right configuration in the location that your request matches. > > > > > How should modify the nginx config to support python? > > > > If you are currently using php-fpm, you probably have something like > > > > location [something that matches urls that should be handled by php] { > > fastcgi_pass [your php-fastcgi server]; > > } > > > > So now that you are adding a separate fastcgi server that is associated > > with python, you'll want to add a new location block like > > > > location [something that matches urls that should be handled by python] { > > fastcgi_pass [your python-fastcgi server]; > > } > > > > The details depend on what you're trying to do. The documentation on > > "location", or the debug log, should show you which location is being > > used for each request -- if it's not the right one, you'll need to > > adjust the config. > > > > Good luck with it, > > BTW, I know that some people prefer to use uWSGI server for python. > > http://blog.zacharyvoase.com/2010/03/05/django-uwsgi-nginx/ There's lots of articles on setting up Django + uwsgi + Nginx out there. Cliff From agentzh at gmail.com Thu Oct 13 01:34:28 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 13 Oct 2011 09:34:28 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Thu, Oct 13, 2011 at 2:35 AM, Nginx User wrote: > if ($request_method !~* (GET|HEAD|POST) ) { > ? ? ? ?return 400; > } > > ... while this sends php files as text downloads ... > > rewrite_by_lua ' > ? ? ? ?method = ?ngx.re.match(ngx.var.request_method, "GET", "i") > ? ? ? ?if method == nil then > ? ? ? ? ? ? ? ?method = ?ngx.re.match(ngx.var.request_method, "POST", "i") > ? ? ? ? ? ? ? ?if method == nil then > ? ? ? ? ? ? ? ? ? ? ? ?method = ?ngx.re.match(ngx.var.request_method, "HEAD", "i") > ? ? ? ? ? ? ? ? ? ? ? ?if method == nil then > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ngx.exit(ngx.HTTP_BAD_REQUEST) > ? ? ? ? ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ?end > ? ? ? ?end > '; BTW, you could have written the Lua code like this: local m = ngx.re.match(ngx.var.request_method, "GET|POST|HEAD", "io") if not m then ngx.exit(400) end The ngx.re.match uses the same PCRE engine as ngx_rewrite's "if" anyway. Also, because the regex argument is a constant here, the "o" flag can be specified to cache the compiled regex object on the global level. > > See debug output: http://pastebin.com/A7LNeCf0 > The debug log data you've provided contains a lot of references to the location @pretty_urls which is missing from your original nginx.conf snippet. Could you please provide a minimized but complete nginx.conf that can reproduce this problem as well as the corresponding debug.log snippet? Thanks! -agentzh From agentzh at gmail.com Thu Oct 13 02:06:08 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 13 Oct 2011 10:06:08 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Thu, Oct 13, 2011 at 5:34 AM, Nginx User wrote: >> >> See debug output: http://pastebin.com/A7LNeCf0 > > Some additional info. > > I had thought the php files were being downloaded as text files but > this is not strictly true. ?Files are downloaded whenever php is > called but they are always empty with a "0" status code. > This information is invaluable :) I've already reproduced this bug of ngx_lua on my side and fixed it in my local tree. Basically, calling ngx.exec to jump to a named location is buggy in that ngx_http_named_location() in the nginx core does not clear module ctx structures as ngx_http_internal_redirect() so ngx_lua should have cleared its ctx itself. I'll tag another rc release of ngx_lua for you to try when I finish running the whole test suite :) Thank you very much for the bug report! Hopefully it'll be no longer evil ;) Thanks! -agentzh From roberto at unbit.it Thu Oct 13 03:49:45 2011 From: roberto at unbit.it (Roberto De Ioris) Date: Thu, 13 Oct 2011 05:49:45 +0200 (CEST) Subject: Python on Nginx In-Reply-To: References: <20111011180932.GA14165@craic.sysops.org> <20111012090948.GF34233@nginx.com> Message-ID: > > On Oct 12, 2011, at 5:09 AM, Igor Sysoev wrote: >> >> BTW, I know that some people prefer to use uWSGI server for python. >> > > I prefer frameworks like gunicorn that use plain HTTP. uWSGI suggests using the uwsgi protocol to improve performance and to add some specific feature, but you can run it in http, fastcgi and zeromq mode. > -- Roberto De Ioris http://unbit.it From agentzh at gmail.com Thu Oct 13 03:57:14 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 13 Oct 2011 11:57:14 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Thu, Oct 13, 2011 at 10:06 AM, agentzh wrote: > This information is invaluable :) I've already reproduced this bug of > ngx_lua on my side and fixed it in my local tree. > > Basically, calling ngx.exec to jump to a named location is buggy in > that ngx_http_named_location() in the nginx core does not clear module > ctx structures as ngx_http_internal_redirect() so ngx_lua should have > cleared its ctx itself. > > I'll tag another rc release of ngx_lua for you to try when I finish > running the whole test suite :) > Please try out the latest ngx_lua v0.3.1rc10 release: https://github.com/chaoslawful/lua-nginx-module/tags Thanks! -agentzh From nginx at nginxuser.net Thu Oct 13 04:30:13 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 13 Oct 2011 07:30:13 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 13 October 2011 04:34, agentzh wrote: > The debug log data you've provided contains a lot of references to the > location @pretty_urls which is missing from your original nginx.conf > snippet. Could you please provide a minimized but complete nginx.conf > that can reproduce this problem as well as the corresponding debug.log > snippet? server { ... location @pretty_urls { # some rewrite rules to php } location @proxy { include /etc/nginx/firewall.default; proxy_pass http://127.0.0.1:8080; ... } location ~ ^.+\.php$ { content_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @pretty_urls; } } If request ends in ".php" it is sent to @proxy by php location. If not ".php", Nginx tries to find and serve resource. If not found, sent to @pretty_urls where it will either be rewritten to ".php" or a 404 error returned. From nginx at nginxuser.net Thu Oct 13 04:32:46 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 13 Oct 2011 07:32:46 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 13 October 2011 05:06, agentzh wrote: > Basically, calling ngx.exec to jump to a named location is buggy in > that ngx_http_named_location() in the nginx core does not clear module > ctx structures as ngx_http_internal_redirect() so ngx_lua should have > cleared its ctx itself. I see. Don't know much about this but does this mean the httpRewrite module does clear this ctx? I.E. why doesn't this affect the standard rewrite module? > > I'll tag another rc release of ngx_lua for you to try when I finish > running the whole test suite :) > > Thank you very much for the bug report! Hopefully it'll be no longer evil ;) Thanks are to you. From nginx at nginxuser.net Thu Oct 13 04:33:59 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 13 Oct 2011 07:33:59 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 13 October 2011 06:57, agentzh wrote: > Please try out the latest ngx_lua v0.3.1rc10 release: I'll have a bash later! Cheers! From nginx at nginxuser.net Thu Oct 13 04:52:25 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 13 Oct 2011 07:52:25 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 13 October 2011 07:30, Nginx User wrote: > On 13 October 2011 04:34, agentzh wrote: >> The debug log data you've provided contains a lot of references to the >> location @pretty_urls which is missing from your original nginx.conf >> snippet. Could you please provide a minimized but complete nginx.conf >> that can reproduce this problem as well as the corresponding debug.log >> snippet? > > server { > ? ? ? ... > ? ? ? location @pretty_urls { > ? ? ? ? ? ? ? # some rewrite rules to php > ? ? ? } > ? ? ? location @proxy { > ? ? ? ? ? ? ? include /etc/nginx/firewall.default; > ? ? ? ? ? ? ? proxy_pass http://127.0.0.1:8080; > ? ? ? ? ? ? ? ... > ? ? ? } > ? ? ? location ~ ^.+\.php$ { > ? ? ? ? ? ? ? content_by_lua 'ngx.exec("@proxy");'; > ? ? ? } > ? ? ? location / { > ? ? ? ? ? ? ? try_files $uri $uri/ @pretty_urls; > ? ? ? } > } > > If request ends in ".php" it is sent to @proxy by php location. If not > ".php", Nginx tries to find and serve resource. If not found, sent to > @pretty_urls where it will either be rewritten to ".php" or a 404 > error returned. > PS: I had earlier thought the issue might be with the content_by_lua 'ngx.exec("@proxy");'; line but when I tried to use the following ... location ~ ^.+\.php$ { rewrite_by_lua 'ngx.exec("@proxy");'; } ... which I thought should work and seems more appropriate, I got an error equivalent to issuing "return 444". From agentzh at gmail.com Thu Oct 13 04:55:20 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 13 Oct 2011 12:55:20 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Thu, Oct 13, 2011 at 12:32 PM, Nginx User wrote: > On 13 October 2011 05:06, agentzh wrote: >> Basically, calling ngx.exec to jump to a named location is buggy in >> that ngx_http_named_location() in the nginx core does not clear module >> ctx structures as ngx_http_internal_redirect() so ngx_lua should have >> cleared its ctx itself. > I see. Don't know much about this but does this mean the httpRewrite > module does clear this ctx? I.E. why doesn't this affect the standard > rewrite module? For ngx_lua, for example, it does have a flag field named "entered_content_phase" in its context object (ctx) which marks whether the current request has entered the content phase. So when doing an internal redirection to a named location, this field must be cleared out or some bad things will happen in rewrite_by_lua because ngx_lua now believes it's in a content_by_lua not rewrite_by_lua. Well, there're more flags like this in ngx_lua ctx. For ngx_rewrite, it's probably safe just because of its simplicity. Well, I still believe it is a bug in ngx_http_named_location function in the nginx core. The thumb of rule is to avoid using named locations like @proxy but use normal locations configured with the "internal" directive. And we've been keeping doing this in our production apps. Regards, -agentzh From agentzh at gmail.com Thu Oct 13 06:01:26 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 13 Oct 2011 14:01:26 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Thu, Oct 13, 2011 at 12:52 PM, Nginx User wrote: > > PS: I had earlier thought the issue might be with ?the content_by_lua > 'ngx.exec("@proxy");'; line but when I tried to use the following ... > > ? ? ?location ~ ^.+\.php$ { > ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? ?} > > ... which I thought should work and seems more appropriate, I got an > error equivalent to issuing "return 444". > This did not work due to exactly the same issue with ngx.exec + named locations. Please try the latest v0.3.1rc10 release mentioned earlier. It should also work now :) Regards, -agentzh From nginx-forum at nginx.us Thu Oct 13 06:49:48 2011 From: nginx-forum at nginx.us (gus) Date: Thu, 13 Oct 2011 02:49:48 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: <20091111122317.GI33359@rambler-co.ru> References: <20091111122317.GI33359@rambler-co.ru> Message-ID: <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> ?????, ? ???? CentOS 5.6 ???? 2.6.18-274.3.1.el5PAE ???????????? ? --with-file-aio ??????? checking for Linux AIO support ... found ? ?? ?????? ??? ????????? AIO ???? ?????? 2,6,22 ? ????!? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216629#msg-216629 From igor at sysoev.ru Thu Oct 13 06:51:45 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 13 Oct 2011 10:51:45 +0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111013065145.GL56380@nginx.com> On Thu, Oct 13, 2011 at 02:49:48AM -0400, gus wrote: > ?????, ? ???? CentOS 5.6 ???? 2.6.18-274.3.1.el5PAE > ???????????? ? --with-file-aio > ??????? > checking for Linux AIO support ... found > > ? ?? ?????? ??? ????????? AIO ???? ?????? > 2,6,22 ? ????!? ??? ???????? ???????? ????. RedHat, ????????? ? ????, ?????? backport. ???? ????? ?????????. -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Thu Oct 13 07:04:44 2011 From: nginx-forum at nginx.us (gus) Date: Thu, 13 Oct 2011 03:04:44 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> Message-ID: ? ??? 1 ??????. ? ???? 16?? ?????????? ?????? ?????: user nginx; worker_processes 8; worker_rlimit_nofile 819200; timer_resolution 100ms; worker_priority -5; http { #aio aio on; expires max; #directio 1m; sendfile off; tcp_nopush on; tcp_nodelay on; server_tokens off; gzip off; gzip_static on; gzip_comp_level 5; gzip_min_length 1024; keepalive_timeout 65; output_buffers 2 512k; ?????? ? ??????? ????? ?????? ? ?????? ????????. ?????? ???????? ?? 5 ?? 200 ????????. ????? ???????? directio ? output_buffers ??? ??????? ?????? ???????. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216631#msg-216631 From brian at akins.org Thu Oct 13 10:59:34 2011 From: brian at akins.org (Brian Akins) Date: Thu, 13 Oct 2011 06:59:34 -0400 Subject: Python on Nginx In-Reply-To: References: <20111011180932.GA14165@craic.sysops.org> <20111012090948.GF34233@nginx.com> Message-ID: <6D713740-2DA8-4D85-8B5A-69992ABC0DC4@akins.org> On Oct 12, 2011, at 11:49 PM, Roberto De Ioris wrote: > > uWSGI suggests using the uwsgi protocol to improve performance and to add > some specific feature, but you can run it in http, fastcgi and zeromq > mode. Of course uWSGI suggest using uwsgi ;) HTTP is easier to debug and do other "normal things" with it. I just use the normal nginx proxy. From igor at sysoev.ru Thu Oct 13 11:14:27 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 13 Oct 2011 15:14:27 +0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111013111427.GD65707@nginx.com> On Thu, Oct 13, 2011 at 03:04:44AM -0400, gus wrote: > ? ??? 1 ??????. > ? ???? 16?? ?????????? ?????? ?????: > user nginx; > worker_processes 8; > worker_rlimit_nofile 819200; > timer_resolution 100ms; > worker_priority -5; > > http { > #aio > aio on; > expires max; > #directio 1m; > sendfile off; > tcp_nopush on; > tcp_nodelay on; > server_tokens off; > gzip off; > gzip_static on; > gzip_comp_level 5; > gzip_min_length 1024; > keepalive_timeout 65; > output_buffers 2 512k; > > ?????? ? ??????? ????? ?????? ? ?????? > ????????. ?????? ???????? ?? 5 ?? 200 > ????????. > > ????? ???????? directio ? output_buffers ??? > ??????? ?????? ??? ???????? ??? aio ????? ??????????? directio. ??? ???? ???????????? aio ????????????. aio on; sendfile off; directio 1m; output_buffers 2 1m; ?? 16G ????? ??????????? ???-?? ?? 6000 ??????????. -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Thu Oct 13 12:07:50 2011 From: nginx-forum at nginx.us (gus) Date: Thu, 13 Oct 2011 08:07:50 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> Message-ID: ??????? ?? ?????. ? ???????? ??? ?? ????, ????? ?????? ?????? ?? ????????, ????? ??????????. ? ??????? ???? ???: 2011/10/13 16:55:12 [crit] 23226#0: *145115 aio read "/var/www/html/pub2/video/102011/8/85/634/885634152246.mp4" failed (22: Invalid argument) while sending mp4 to client, client: 217.25.22.82, server: server.com, request: "GET /pub2/video/102011/8/85/634/885634152246.mp4 HTTP/1.1", host: "server.com" ??? ?????????? ????????? directio, ? ????? ?????? ????????????, ?? ??? directio ? AIO ????? ???. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216642#msg-216642 From igor at sysoev.ru Thu Oct 13 12:10:20 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 13 Oct 2011 16:10:20 +0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111013121019.GI65707@nginx.com> On Thu, Oct 13, 2011 at 08:07:50AM -0400, gus wrote: > ??????? ?? ?????. > ? ???????? ??? ?? ????, ????? ?????? > ?????? ?? ????????, ????? ??????????. ? > ??????? ???? ???: > > 2011/10/13 16:55:12 [crit] 23226#0: *145115 aio read > "/var/www/html/pub2/video/102011/8/85/634/885634152246.mp4" failed (22: > Invalid argument) while sending mp4 to client, client: 217.25.22.82, > server: server.com, request: "GET > /pub2/video/102011/8/85/634/885634152246.mp4 HTTP/1.1", host: > "server.com" > > > ??? ?????????? ????????? directio, ? ????? > ?????? ????????????, ?? ??? directio ? AIO > ????? ???. ????? ?????? ? -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Thu Oct 13 12:17:04 2011 From: nginx-forum at nginx.us (gus) Date: Thu, 13 Oct 2011 08:17:04 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> Message-ID: <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> [root at server]# nginx -V nginx: nginx version: nginx/1.1.5 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51) nginx: TLS SNI support disabled nginx: configure arguments: --user=nginx --group=nginx --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_secure_link_module --with-http_random_index_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-file-aio --add-module=/gus/nginx_mod_h264_streaming-2.2.7 ??????? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216644#msg-216644 From igor at sysoev.ru Thu Oct 13 12:28:06 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 13 Oct 2011 16:28:06 +0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111013122806.GJ65707@nginx.com> On Thu, Oct 13, 2011 at 08:17:04AM -0400, gus wrote: > [root at server]# nginx -V > nginx: nginx version: nginx/1.1.5 > nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51) > nginx: TLS SNI support disabled > nginx: configure arguments: --user=nginx --group=nginx > --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_secure_link_module --with-http_random_index_module > --with-http_ssl_module --with-http_realip_module > --with-http_addition_module --with-http_sub_module > --with-http_dav_module --with-http_gzip_static_module > --with-http_stub_status_module --with-http_perl_module --with-file-aio > --add-module=/gus/nginx_mod_h264_streaming-2.2.7 - --add-module=/gus/nginx_mod_h264_streaming-2.2.7 + --with-http_mp4_module -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Thu Oct 13 12:37:53 2011 From: nginx-forum at nginx.us (gus) Date: Thu, 13 Oct 2011 08:37:53 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> Message-ID: ????? ?? ??? ??? ????????? ? ?????? ????. ? ???? ffmpeg ???????????? ? h264. ??? nginx_mod_h264_streaming-2.2.7 ? ? mp4_module ? ?? ???? ?????? ??????. :( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216647#msg-216647 From igor at sysoev.ru Thu Oct 13 12:47:20 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 13 Oct 2011 16:47:20 +0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111013124720.GK65707@nginx.com> On Thu, Oct 13, 2011 at 08:37:53AM -0400, gus wrote: > ????? ?? ??? ??? ????????? ? ?????? > ????. ? ???? ffmpeg ???????????? ? h264. > ??? nginx_mod_h264_streaming-2.2.7 ? ? mp4_module ? ?? ???? > ?????? ??????. :( ???? ?????? 32-??????, ?? ??????????? ???? ?????? ??????. -- ????? ?????? http://sysoev.ru -------------- next part -------------- Index: src/http/modules/ngx_http_mp4_module.c =================================================================== --- src/http/modules/ngx_http_mp4_module.c (revision 4189) +++ src/http/modules/ngx_http_mp4_module.c (revision 4190) @@ -1882,7 +1882,7 @@ } entries = trak->time_to_sample_entries; - start_time = mp4->start * trak->timescale / 1000; + start_time = (uint64_t) mp4->start * trak->timescale / 1000; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "time-to-sample start_time:%uL", start_time); From calin at presslabs.com Thu Oct 13 13:53:47 2011 From: calin at presslabs.com (Calin Don) Date: Thu, 13 Oct 2011 16:53:47 +0300 Subject: Limit requests per resource Message-ID: Hi, is there a way to limit the number of concurent requests per resource (eg. maximum 3 requests / backend, others waiting on frontend)? From nginx-forum at nginx.us Thu Oct 13 13:56:41 2011 From: nginx-forum at nginx.us (mikiso) Date: Thu, 13 Oct 2011 09:56:41 -0400 Subject: ipv4 & ipv6 Virtual Hosting - address in use In-Reply-To: <20101227170712.GU1084@mdounin.ru> References: <20101227170712.GU1084@mdounin.ru> Message-ID: <1c83cc3b1b26b00f0512264810189f17.NginxMailingListEnglish@forum.nginx.org> Hi All, I'm a newbie to nginx and facing similar problem in that I cannot bind IPv6 address (link local or global): My nginx.conf is like this: mail { # auth_http 127.0.0.1:8888/cgi-bin/auth.pl; # auth_http 127.0.0.1:8888/auth.pl; auth_http 127.0.0.1:8888/popproxy/auth; auth_http_header X-Auth-Domain "a-sya.com"; auth_http_header X-PopProxy-Secret "popproxy"; # auth_http_header X-Auth-Domain "ngm1.ocn-test.ne.jp"; auth_http_timeout 15000ms; # after_auth_http 127.0.0.1:8888/popproxy-auth/; pop3_auth plain; pop3_auth apop; pop3_auth cram-md5; proxy_pass_error_message on; server { listen 10110; listen 127.0.0.1:10110; listen [::]:10899; # link local address #listen [fe80::20c:29ff:fe86:7e4d]:10499; ***1 # global address #listen [fd41:28b7:be11:0:20c:29ff:fe86:7e4d]:10119; ***2 protocol pop3; server_name localhost; proxy on; } } If I uncomments the line marked "***1" , the following error occurs: nginx: [emerg] bind() to [fe80::20c:29ff:fe86:7e4d]:10499 failed (22: Invalid argument) If I uncomments the line marked "***2", the following error occurs: nginx: [emerg] bind() to [fd41:28b7:be11:0:20c:29ff:fe86:7e4d]:10119 failed (99: Cannot assign requested address) Could you tell me why these errors occur? I think simply I forget some important configuration though.. Thanks and regards, Soichiro MIKI Maxim Dounin Wrote: > > Could you please provide *full config* which > triggers the problem? > In particular, full list of server{} blocks with > their "listen" > directives. > > Maxim Dounin Posted at Nginx Forum: http://forum.nginx.org/read.php?2,154862,216653#msg-216653 From simohayha.bobo at gmail.com Thu Oct 13 15:06:04 2011 From: simohayha.bobo at gmail.com (Simon Liu) Date: Thu, 13 Oct 2011 23:06:04 +0800 Subject: Limit requests per resource In-Reply-To: References: Message-ID: You can use limit req module: http://wiki.nginx.org/HttpLimitReqModule . On Thu, Oct 13, 2011 at 9:53 PM, Calin Don wrote: > Hi, is there a way to limit the number of concurent requests per > resource (eg. maximum 3 requests / backend, others waiting on > frontend)? > > _______________________________________________ > 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 nginx at nginxuser.net Thu Oct 13 16:10:36 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 13 Oct 2011 19:10:36 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: Rebuilt with 0.31rc11. Also noticed note about, and implemented, module loading order. Everything seems straight as an arrow and no evil going ons detected so far. Cheers! From andrew.george.hammond at gmail.com Thu Oct 13 21:17:26 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Thu, 13 Oct 2011 14:17:26 -0700 Subject: upload_resume sha1, md5 and crc32 aggregates missing In-Reply-To: <19755009.461.1318324454956.JavaMail.root@zone.mtgsy.net> References: <19755009.461.1318324454956.JavaMail.root@zone.mtgsy.net> Message-ID: So, these are available if the entire file upload happens in a single HTTP transaction. But if there are multiple HTTP transactions (as in resumable uploads) then their value is not available. Right? A On Tue, Oct 11, 2011 at 2:14 AM, Valery Kholodkov < valery+nginxen at grid.net.ru> wrote: > > My fault, I'll change it to "not available for resumable uploads". > > Note: body part != file segment. > > ----- Andrew Hammond wrote: > > The documentation says they are supported (and for the entire uploaded > > file): > > > > http://www.grid.net.ru/nginx/upload.en.html#upload_aggregate_form_field > > * > > > > and following additional special variables: > > * > > * > > > > - $upload_file_md5 -- MD5 checksum of the file > > - $upload_file_md5_uc -- MD5 checksum of the file in uppercase letters > > - $upload_file_sha1 -- SHA1 checksum of the file > > - $upload_file_sha1_uc -- SHA1 checksum of the file in uppercase > letters > > - $upload_file_crc32 -- hexdecimal value of CRC32 of the file > > > > * > > *The value of a field specified by this directive is evaluated after > > successful upload of the file, thus these variables are valid only at the > > end of processing of one part of original request body.* > > > > Since I'm seeing the following in my error log, I believe the upload was > > successful... so the variables should be valid, right? > > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 http script var: > > "/var/lib/nginx/upload_resume/3/34313583" > > 2011/10/10 14:56:07 [info] 9844#0: *91 started uploading part > > 204800-209999/210000 of file "test_trans" to > > "/var/lib/nginx/upload_resume/3/34313583" (field "", content type > > "application/octet-stream"), client: 10.178.51.115, server: > > account.nutricateonline.com, request: "POST > /rspool/?id=test&sha1=00000000 > > HTTP/1.0", host: "209.114.46.109" > > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023D3DB7, 665, > > 204800 > > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CC420, > 4535, > > 205465 > > 2011/10/10 14:56:07 [debug] 9844#0: *91 read: 17, 00000000023CAC77, 16, 0 > > 2011/10/10 14:56:07 [debug] 9844#0: *91 a 0-209999/210000 > > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CA838, 16, > 0 > > 2011/10/10 14:56:07 [info] 9844#0: *91 removed state file > > "/var/lib/nginx/upload_resume/3/34313583.state", client: 10.178.51.115, > > server: account.nutricateonline.com, request: "POST > > /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" > > 2011/10/10 14:56:07 [info] 9844#0: *91 finished uploading file > "test_trans" > > to "/var/lib/nginx/upload_resume/3/34313583", client: 10.178.51.115, > server: > > account.nutricateonline.com, request: "POST > /rspool/?id=test&sha1=00000000 > > HTTP/1.0", host: "209.114.46.109" > > > > I'd love to get this sorted out. Anyone? > > > > Andrew > > > > > > On Sat, Oct 8, 2011 at 8:55 AM, Valery Kholodkov < > valery+nginxen at grid.net.ru > > > wrote: > > > > > > > > These aggregates are not available for resumable uploads, as hashes of > the > > > last part will not make sense anyway. > > > > > > ----- Andrew Hammond wrote: > > > > I'm seeing most, but not all of the upload form fields get set. > However, > > > the > > > > sha1, md5 and crc32 aggregates below are blanks: > > > > > > > > request.POST > > > u'upload_name': [u'py_lightweight_uploader.py'], > > > > u'upload_size': [u'11345'], > > > > u'upload_sha1': [u''], > > > > u'upload_content_type': [u'text/x-python'], > > > > u'upload_path': [u'/var/lib/nginx/resumable_download/7/64565707'], > > > > u'upload_md5': [u''], > > > > u'upload_crc32': [u'']}> > > > > > > > > I see that libssl is installed on the server. I don't see any entries > in > > > the > > > > error log that would make me think there is anything failing here. I > have > > > > the following in the nginx config: > > > > > > > > upload_set_form_field upload_name $upload_file_name; > > > > upload_set_form_field upload_content_type $upload_content_type; > > > > upload_set_form_field upload_path $upload_tmp_path; > > > > upload_aggregate_form_field upload_sha1 $upload_file_sha1; > > > > upload_aggregate_form_field upload_size $upload_file_size; > > > > upload_aggregate_form_field upload_crc32 $upload_file_crc32; > > > > upload_aggregate_form_field upload_md5 $upload_file_md5; > > > > > > > > I based the above on the documentation and example config. What am I > > > missing > > > > here? I'm using nginx 1.0.8 deb-src build from the PPA with the > latest > > > > version of the upload_resume module included. > > > > > > -- > > > Regards, > > > Valery Kholodkov > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > -- > -- > Regards, > Valery Kholodkov > > _______________________________________________ > 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 Oct 13 23:26:26 2011 From: nginx-forum at nginx.us (codetr) Date: Thu, 13 Oct 2011 19:26:26 -0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <0e5b21b6d31feb5d805a668edba0dce2.NginxMailingListEnglish@forum.nginx.org> the problem continues please help Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216667#msg-216667 From andrew.george.hammond at gmail.com Thu Oct 13 23:29:52 2011 From: andrew.george.hammond at gmail.com (Andrew Hammond) Date: Thu, 13 Oct 2011 16:29:52 -0700 Subject: upload_resume sha1, md5 and crc32 aggregates missing In-Reply-To: References: <19755009.461.1318324454956.JavaMail.root@zone.mtgsy.net> Message-ID: I tested this with smaller files and see that these are never populated for any resumable uploads. A On Thu, Oct 13, 2011 at 2:17 PM, Andrew Hammond < andrew.george.hammond at gmail.com> wrote: > So, these are available if the entire file upload happens in a single HTTP > transaction. But if there are multiple HTTP transactions (as in resumable > uploads) then their value is not available. Right? > > A > > > On Tue, Oct 11, 2011 at 2:14 AM, Valery Kholodkov < > valery+nginxen at grid.net.ru> wrote: > >> >> My fault, I'll change it to "not available for resumable uploads". >> >> Note: body part != file segment. >> >> ----- Andrew Hammond wrote: >> > The documentation says they are supported (and for the entire uploaded >> > file): >> > >> > http://www.grid.net.ru/nginx/upload.en.html#upload_aggregate_form_field >> > * >> > >> > and following additional special variables: >> > * >> > * >> > >> > - $upload_file_md5 -- MD5 checksum of the file >> > - $upload_file_md5_uc -- MD5 checksum of the file in uppercase >> letters >> > - $upload_file_sha1 -- SHA1 checksum of the file >> > - $upload_file_sha1_uc -- SHA1 checksum of the file in uppercase >> letters >> > - $upload_file_crc32 -- hexdecimal value of CRC32 of the file >> > >> > * >> > *The value of a field specified by this directive is evaluated after >> > successful upload of the file, thus these variables are valid only at >> the >> > end of processing of one part of original request body.* >> > >> > Since I'm seeing the following in my error log, I believe the upload was >> > successful... so the variables should be valid, right? >> > >> > 2011/10/10 14:56:07 [debug] 9844#0: *91 http script var: >> > "/var/lib/nginx/upload_resume/3/34313583" >> > 2011/10/10 14:56:07 [info] 9844#0: *91 started uploading part >> > 204800-209999/210000 of file "test_trans" to >> > "/var/lib/nginx/upload_resume/3/34313583" (field "", content type >> > "application/octet-stream"), client: 10.178.51.115, server: >> > account.nutricateonline.com, request: "POST >> /rspool/?id=test&sha1=00000000 >> > HTTP/1.0", host: "209.114.46.109" >> > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023D3DB7, >> 665, >> > 204800 >> > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CC420, >> 4535, >> > 205465 >> > 2011/10/10 14:56:07 [debug] 9844#0: *91 read: 17, 00000000023CAC77, 16, >> 0 >> > 2011/10/10 14:56:07 [debug] 9844#0: *91 a 0-209999/210000 >> > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CA838, 16, >> 0 >> > 2011/10/10 14:56:07 [info] 9844#0: *91 removed state file >> > "/var/lib/nginx/upload_resume/3/34313583.state", client: 10.178.51.115, >> > server: account.nutricateonline.com, request: "POST >> > /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" >> > 2011/10/10 14:56:07 [info] 9844#0: *91 finished uploading file >> "test_trans" >> > to "/var/lib/nginx/upload_resume/3/34313583", client: 10.178.51.115, >> server: >> > account.nutricateonline.com, request: "POST >> /rspool/?id=test&sha1=00000000 >> > HTTP/1.0", host: "209.114.46.109" >> > >> > I'd love to get this sorted out. Anyone? >> > >> > Andrew >> > >> > >> > On Sat, Oct 8, 2011 at 8:55 AM, Valery Kholodkov < >> valery+nginxen at grid.net.ru >> > > wrote: >> > >> > > >> > > These aggregates are not available for resumable uploads, as hashes of >> the >> > > last part will not make sense anyway. >> > > >> > > ----- Andrew Hammond wrote: >> > > > I'm seeing most, but not all of the upload form fields get set. >> However, >> > > the >> > > > sha1, md5 and crc32 aggregates below are blanks: >> > > > >> > > > request.POST > > > > u'upload_name': [u'py_lightweight_uploader.py'], >> > > > u'upload_size': [u'11345'], >> > > > u'upload_sha1': [u''], >> > > > u'upload_content_type': [u'text/x-python'], >> > > > u'upload_path': [u'/var/lib/nginx/resumable_download/7/64565707'], >> > > > u'upload_md5': [u''], >> > > > u'upload_crc32': [u'']}> >> > > > >> > > > I see that libssl is installed on the server. I don't see any >> entries in >> > > the >> > > > error log that would make me think there is anything failing here. I >> have >> > > > the following in the nginx config: >> > > > >> > > > upload_set_form_field upload_name $upload_file_name; >> > > > upload_set_form_field upload_content_type $upload_content_type; >> > > > upload_set_form_field upload_path $upload_tmp_path; >> > > > upload_aggregate_form_field upload_sha1 $upload_file_sha1; >> > > > upload_aggregate_form_field upload_size $upload_file_size; >> > > > upload_aggregate_form_field upload_crc32 $upload_file_crc32; >> > > > upload_aggregate_form_field upload_md5 $upload_file_md5; >> > > > >> > > > I based the above on the documentation and example config. What am I >> > > missing >> > > > here? I'm using nginx 1.0.8 deb-src build from the PPA with the >> latest >> > > > version of the upload_resume module included. >> > > >> > > -- >> > > Regards, >> > > Valery Kholodkov >> > > >> > > _______________________________________________ >> > > nginx mailing list >> > > nginx at nginx.org >> > > http://mailman.nginx.org/mailman/listinfo/nginx >> > > >> >> -- >> -- >> Regards, >> Valery Kholodkov >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at nginxuser.net Fri Oct 14 00:16:15 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 03:16:15 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: Hi, Unfortunately, I am still seeing the "0 0" outputs in my logs on (only some) requests. I had noticed that some pages just seemed to have the "loading" wheel spin for ever and on looking, I found the instances. It is not affecting standard php requests anymore from what I can see but it seems some Ajax type requests where php is being used for dynamic js (! need to look closer into how I set those up) and with phpMyAdmin which is aliased somewhere. Probably has to do with named locations as you mentioned earlier but I prefer to use these so I have rolled back to my back to my 1.0.6 install so as to get back my ngx_rewrite based setup which works fine with this. Will sort out upgrading and further tests later. From agentzh at gmail.com Fri Oct 14 00:36:09 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 14 Oct 2011 08:36:09 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Fri, Oct 14, 2011 at 12:10 AM, Nginx User wrote: > Rebuilt with 0.31rc11. Also noticed note about, and implemented, > module loading order. > Everything seems straight as an arrow and no evil going ons detected so far. > Great! But please note that this is really a bug in the nginx core, so what I'm doing in ngx_lua's ngx.exec() (as well as ngx_echo's echo_exec) is just a work-around. If you use other module to issue the jump to a named location, bad things could still happen (or in your words, evil stuffs). For example, ngx_upload's upload_pass directive or the core module's post_action directive. I've already posted a patch for the nginx core to the nginx-devel mailing list, which fixes the issue completely: http://mailman.nginx.org/pipermail/nginx-devel/2011-October/001327.html That patch can also be applied cleanly to nginx 1.0.8 (at least). BTW, this patch has already been incorporated into the ngx_openresty 1.0.8.5 devel release: http://openresty.org/#Download Regards, -agentzh From delta.yeh at gmail.com Fri Oct 14 01:09:04 2011 From: delta.yeh at gmail.com (Delta Yeh) Date: Fri, 14 Oct 2011 09:09:04 +0800 Subject: Limit requests per resource In-Reply-To: References: Message-ID: I think what Calin want is limit the concurrent request number to URI not from remote ip I don't know whether " limit_req_zone $uri zone=one:10m rate=1r/s; " can achieve this. 2011/10/13 Simon Liu : > You can use limit req module:? http://wiki.nginx.org/HttpLimitReqModule . > > On Thu, Oct 13, 2011 at 9:53 PM, Calin Don wrote: >> >> Hi, is there a way to limit the number of concurent requests per >> resource (eg. maximum 3 requests / backend, others waiting on >> frontend)? >> >> _______________________________________________ >> 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 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Fri Oct 14 01:23:25 2011 From: nginx-forum at nginx.us (reveldo) Date: Thu, 13 Oct 2011 21:23:25 -0400 Subject: Downloading file Message-ID: Hello, I have a problem setting up nginx i want to adapt to retrieve files through readfile php.The files will be charged an external server. Server --> My Server(Streaming) --> User I want the files pulled directly by nginx. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216675,216675#msg-216675 From lvella at gmail.com Fri Oct 14 01:45:56 2011 From: lvella at gmail.com (Lucas Clemente Vella) Date: Thu, 13 Oct 2011 22:45:56 -0300 Subject: "zero size buf in output" flooding the error.log Message-ID: I am using the external NGiNX_HTTP_Push_Module, and whenever a response is issued by one of its channels, I get this error logged: 2011/10/12 19:33:30 [alert] 10808#0: *64 zero size buf in output t:1 r:0 f:0 0000000001240C98 0000000001240C98-0000000001240C98 0000000000000000 0-0, client: 127.0.0.1, server: localhost, request: "GET /event?id=hJsrnGIdbngARLNBiNMoIO HTTP/1.1", host: "XXXXXXXXXXX", referrer: "XXXXXXXXXXXXXXXXXXX" Those 'client' and 'server' fields are strange, because they always point to localhost, even if connection is external. By "greping" through the source I found the message is logged by ngx_output_chain.c:100, where I saw that this is clearly a debug message, because of all the pointers it prints. So I thought it might be a bug on the NGiNX_HTTP_Push_Module that triggers the situation. What might be the issue on the module? What can trigger this message? -- Lucas Clemente Vella lvella at gmail.com From valery+nginxen at grid.net.ru Fri Oct 14 06:08:34 2011 From: valery+nginxen at grid.net.ru (Valery Kholodkov) Date: Fri, 14 Oct 2011 07:08:34 +0100 (BST) Subject: upload_resume sha1, md5 and crc32 aggregates missing In-Reply-To: Message-ID: <730917.772.1318572514174.JavaMail.root@zone.mtgsy.net> Right. ----- Andrew Hammond wrote: > So, these are available if the entire file upload happens in a single HTTP > transaction. But if there are multiple HTTP transactions (as in resumable > uploads) then their value is not available. Right? > > A > > > On Tue, Oct 11, 2011 at 2:14 AM, Valery Kholodkov < > valery+nginxen at grid.net.ru> wrote: > > > > > My fault, I'll change it to "not available for resumable uploads". > > > > Note: body part != file segment. > > > > ----- Andrew Hammond wrote: > > > The documentation says they are supported (and for the entire uploaded > > > file): > > > > > > http://www.grid.net.ru/nginx/upload.en.html#upload_aggregate_form_field > > > * > > > > > > and following additional special variables: > > > * > > > * > > > > > > - $upload_file_md5 -- MD5 checksum of the file > > > - $upload_file_md5_uc -- MD5 checksum of the file in uppercase letters > > > - $upload_file_sha1 -- SHA1 checksum of the file > > > - $upload_file_sha1_uc -- SHA1 checksum of the file in uppercase > > letters > > > - $upload_file_crc32 -- hexdecimal value of CRC32 of the file > > > > > > * > > > *The value of a field specified by this directive is evaluated after > > > successful upload of the file, thus these variables are valid only at the > > > end of processing of one part of original request body.* > > > > > > Since I'm seeing the following in my error log, I believe the upload was > > > successful... so the variables should be valid, right? > > > > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 http script var: > > > "/var/lib/nginx/upload_resume/3/34313583" > > > 2011/10/10 14:56:07 [info] 9844#0: *91 started uploading part > > > 204800-209999/210000 of file "test_trans" to > > > "/var/lib/nginx/upload_resume/3/34313583" (field "", content type > > > "application/octet-stream"), client: 10.178.51.115, server: > > > account.nutricateonline.com, request: "POST > > /rspool/?id=test&sha1=00000000 > > > HTTP/1.0", host: "209.114.46.109" > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023D3DB7, 665, > > > 204800 > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CC420, > > 4535, > > > 205465 > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 read: 17, 00000000023CAC77, 16, 0 > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 a 0-209999/210000 > > > 2011/10/10 14:56:07 [debug] 9844#0: *91 write: 17, 00000000023CA838, 16, > > 0 > > > 2011/10/10 14:56:07 [info] 9844#0: *91 removed state file > > > "/var/lib/nginx/upload_resume/3/34313583.state", client: 10.178.51.115, > > > server: account.nutricateonline.com, request: "POST > > > /rspool/?id=test&sha1=00000000 HTTP/1.0", host: "209.114.46.109" > > > 2011/10/10 14:56:07 [info] 9844#0: *91 finished uploading file > > "test_trans" > > > to "/var/lib/nginx/upload_resume/3/34313583", client: 10.178.51.115, > > server: > > > account.nutricateonline.com, request: "POST > > /rspool/?id=test&sha1=00000000 > > > HTTP/1.0", host: "209.114.46.109" > > > > > > I'd love to get this sorted out. Anyone? > > > > > > Andrew > > > > > > > > > On Sat, Oct 8, 2011 at 8:55 AM, Valery Kholodkov < > > valery+nginxen at grid.net.ru > > > > wrote: > > > > > > > > > > > These aggregates are not available for resumable uploads, as hashes of > > the > > > > last part will not make sense anyway. > > > > > > > > ----- Andrew Hammond wrote: > > > > > I'm seeing most, but not all of the upload form fields get set. > > However, > > > > the > > > > > sha1, md5 and crc32 aggregates below are blanks: > > > > > > > > > > request.POST > > > > u'upload_name': [u'py_lightweight_uploader.py'], > > > > > u'upload_size': [u'11345'], > > > > > u'upload_sha1': [u''], > > > > > u'upload_content_type': [u'text/x-python'], > > > > > u'upload_path': [u'/var/lib/nginx/resumable_download/7/64565707'], > > > > > u'upload_md5': [u''], > > > > > u'upload_crc32': [u'']}> > > > > > > > > > > I see that libssl is installed on the server. I don't see any entries > > in > > > > the > > > > > error log that would make me think there is anything failing here. I > > have > > > > > the following in the nginx config: > > > > > > > > > > upload_set_form_field upload_name $upload_file_name; > > > > > upload_set_form_field upload_content_type $upload_content_type; > > > > > upload_set_form_field upload_path $upload_tmp_path; > > > > > upload_aggregate_form_field upload_sha1 $upload_file_sha1; > > > > > upload_aggregate_form_field upload_size $upload_file_size; > > > > > upload_aggregate_form_field upload_crc32 $upload_file_crc32; > > > > > upload_aggregate_form_field upload_md5 $upload_file_md5; > > > > > > > > > > I based the above on the documentation and example config. What am I > > > > missing > > > > > here? I'm using nginx 1.0.8 deb-src build from the PPA with the > > latest > > > > > version of the upload_resume module included. > > > > > > > > -- > > > > Regards, > > > > Valery Kholodkov > > > > > > > > _______________________________________________ > > > > nginx mailing list > > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > -- > > -- > > Regards, > > Valery Kholodkov > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > -- -- Regards, Valery Kholodkov From nginx-forum at nginx.us Fri Oct 14 07:16:39 2011 From: nginx-forum at nginx.us (mrkissinger) Date: Fri, 14 Oct 2011 03:16:39 -0400 Subject: nginx doesn't accept new connection Message-ID: Hi there, I am using nginx as a reverse proxy on a Debian Linux. The nginx is running on server A, and apache is running on server B. Server A is a pure proxy, server B is the real web server. In most of time, nginx works well. But the HTTP port (80) will stop accepting new connection sometimes. When it happened, I tried to telnet port 80 from the server by "telnet localhost 80", the telnet was just keeping trying but cannot make socket connection. I checked the total HTTP connections by "netstat -an | grep 80 | wc -l", the number was always less than 2000. I am using nginx package from Debian Linux, the package was installed by apt-get. I added "ulimit -n 65535" into /etc/init.d/nginx to turned the "open files" limitation. The problem is not resolved yet. Can anyone help? Thanks. Hyacinth Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216681,216681#msg-216681 From igor at sysoev.ru Fri Oct 14 07:24:30 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 14 Oct 2011 11:24:30 +0400 Subject: nginx doesn't accept new connection In-Reply-To: References: Message-ID: <20111014072430.GA94633@nginx.com> On Fri, Oct 14, 2011 at 03:16:39AM -0400, mrkissinger wrote: > Hi there, > I am using nginx as a reverse proxy on a Debian Linux. > > The nginx is running on server A, and apache is running on server B. > Server A is a pure proxy, server B is the real web server. > > In most of time, nginx works well. > But the HTTP port (80) will stop accepting new connection sometimes. > When it happened, I tried to telnet port 80 from the server by "telnet > localhost 80", the telnet was just keeping trying but cannot make socket > connection. > > I checked the total HTTP connections by "netstat -an | grep 80 | wc > -l", the number was always less than 2000. > > I am using nginx package from Debian Linux, the package was installed > by apt-get. > I added "ulimit -n 65535" into /etc/init.d/nginx to turned the "open > files" limitation. > > The problem is not resolved yet. Can anyone help? What does "nginx -V" show ? Are any alerts in error_log ? -- Igor Sysoev From nginx-forum at nginx.us Fri Oct 14 07:45:59 2011 From: nginx-forum at nginx.us (mrkissinger) Date: Fri, 14 Oct 2011 03:45:59 -0400 Subject: nginx doesn't accept new connection In-Reply-To: <20111014072430.GA94633@nginx.com> References: <20111014072430.GA94633@nginx.com> Message-ID: Dell-DB:~# nginx -V nginx: nginx version: nginx/1.1.4 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 --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-http_gzip_static_module --with-http_ssl_module --with-ipv6 --without-http_browser_module --without-http_geo_module --without-http_limit_req_module --without-http_limit_zone_module --without-http_map_module --without-http_memcached_module --without-http_referer_module --without-http_scgi_module --without-http_split_clients_module --with-http_stub_status_module --without-http_ssi_module --without-http_userid_module --without-http_uwsgi_module --add-module=/tmp/buildd/nginx-1.1.4/debian/modules/nginx-echo Dell-DB:~# nginx error log is empty. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216681,216683#msg-216683 From nginx-forum at nginx.us Fri Oct 14 08:25:10 2011 From: nginx-forum at nginx.us (lsupper) Date: Fri, 14 Oct 2011 04:25:10 -0400 Subject: about the new feature:$uid_reset variable. Message-ID: <7bbcb55fd55f5cc889567e3ef9a32949.NginxMailingListEnglish@forum.nginx.org> hi, i tested a cast, a third modul which can echo 'helloworld', it could work well at 0.7.65 version. i tried to add this module into the 1.0.8 version nginx. it could configure well and build well, but when i run the nginx, it told me: nginx: [emerg] unknown "uid_reset" variable i found that the "uid_reset" is a new feature of 1.0.5. what do i need to do to make it work well at 1.0.8 verion? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216687,216687#msg-216687 From nginx at nginxuser.net Fri Oct 14 08:31:32 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 11:31:32 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 14 October 2011 03:36, agentzh wrote: > On Fri, Oct 14, 2011 at 12:10 AM, Nginx User wrote: >> Rebuilt with 0.31rc11. Also noticed note about, and implemented, >> module loading order. >> Everything seems straight as an arrow and no evil going ons detected so far. >> > > Great! > > But please note that this is really a bug in the nginx core, so what > I'm doing in ngx_lua's ngx.exec() (as well as ngx_echo's echo_exec) is > just a work-around. If you use other module to issue the jump to a > named location, bad things could still happen (or in your words, evil > stuffs). For example, ngx_upload's upload_pass directive or the core > module's post_action directive. > > I've already posted a patch for the nginx core to the nginx-devel > mailing list, which fixes the issue completely: > > ? ?http://mailman.nginx.org/pipermail/nginx-devel/2011-October/001327.html > > That patch can also be applied cleanly to nginx 1.0.8 (at least). Strange, looking at the message from Maxim to Igor, that this hadn't been changed before. If you refer to the message I sent just before yours, you will find I am still seeing this behaviour for some requests and that I rolled everything back to my last known working config. Perhaps the work around need to go into some other one of the modules I use. I'll look into applying the patch to the 1.0.8 core directly and retry later. > > BTW, this patch has already been incorporated into the ngx_openresty > 1.0.8.5 devel release: http://openresty.org/#Download Nice. I will be building openresty rpms for redhat presently. Wanted to try some of the elements first. From nginx-forum at nginx.us Fri Oct 14 09:11:29 2011 From: nginx-forum at nginx.us (mrkissinger) Date: Fri, 14 Oct 2011 05:11:29 -0400 Subject: nginx doesn't accept new connection In-Reply-To: References: Message-ID: Any one help, please? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216681,216690#msg-216690 From nginx-forum at nginx.us Fri Oct 14 09:30:01 2011 From: nginx-forum at nginx.us (mrkissinger) Date: Fri, 14 Oct 2011 05:30:01 -0400 Subject: nginx doesn't accept new connection In-Reply-To: References: Message-ID: <60deb01c006f61f2364a474b2c10b8b0.NginxMailingListEnglish@forum.nginx.org> Some thing strange happened. I added 2 ports (80 and 10080) to a vhost in nginx server. When port 80 is not responsing, port 10080 works well. It seems that the apache on server B works well, and the nginx on server A is still working. The problem is that port 80 is not responsing or responses very slowly. Any opinions? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216681,216691#msg-216691 From ngx.eugaia at gmail.com Fri Oct 14 11:01:39 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Fri, 14 Oct 2011 14:01:39 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: <4E981693.2030305@gmail.com> On 13/10/2011 07:55, agentzh wrote: > Well, I still believe it is a bug in ngx_http_named_location function > in the nginx core. The thumb of rule is to avoid using named locations > like @proxy but use normal locations configured with the "internal" > directive. And we've been keeping doing this in our production apps. In some situations it's probably the desired effect to reset the contexts, but not all. There are multiple situations in modules I've developed / am developing where resetting contexts would be highly undesirable and would break the code. I would say it should probably just be left up to the modules to reset their own contexts if they need to (as is the case now), or to just define multiple modules which would use different contexts anyway. Marcus. From nginx-forum at nginx.us Fri Oct 14 11:14:24 2011 From: nginx-forum at nginx.us (gus) Date: Fri, 14 Oct 2011 07:14:24 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> Message-ID: <7d4e54b3d037097123efb0c718d5d317.NginxMailingListEnglish@forum.nginx.org> ??????? ?? ????, ????? ????? AIO ??????????, ?? ????? ? h264 ?? ???????????? ?? swf ?????? ???? ?? ????????????? ?? ?????. ???????? ????????? ?? --add-module=/gus/nginx_mod_h264_streaming-2.2.7 ? ?? ?????????????? #directio=1m; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216698#msg-216698 From nginx-forum at nginx.us Fri Oct 14 11:19:03 2011 From: nginx-forum at nginx.us (zflairz) Date: Fri, 14 Oct 2011 07:19:03 -0400 Subject: preserving post data on redirect Message-ID: <34a069adf709c237dc905ba116bf42ef.NginxMailingListEnglish@forum.nginx.org> Any one know how to preserve post data while doing redirect? The scenario is that I have both http and https accepting connection, I want (internally?) redirect http post request to https counterpart. Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216699,216699#msg-216699 From nginx at nginxuser.net Fri Oct 14 11:41:24 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 14:41:24 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: <4E981693.2030305@gmail.com> References: <4E981693.2030305@gmail.com> Message-ID: On 14 October 2011 14:01, Eugaia wrote: > On 13/10/2011 07:55, agentzh wrote: >> >> Well, I still believe it is a bug in ngx_http_named_location function in >> the nginx core. The thumb of rule is to avoid using named locations like >> @proxy but use normal locations configured with the "internal" directive. >> And we've been keeping doing this in our production apps. > > In some situations it's probably the desired effect to reset the contexts, > but not all. ?There are multiple situations in modules I've developed / am > developing where resetting contexts would be highly undesirable and would > break the code. ?I would say it should probably just be left up to the > modules to reset their own contexts if they need to (as is the case now), or > to just define multiple modules which would use different contexts anyway. That throws a different spot light on things. I don't know about the guts of Nginx but I suppose the main point would be for things to work consistently. I.E. if this context is cleared in some places in the core (normal locations), then, it should be cleared in all similar places (all locations) except of course if there is specific good reason not to. Module developers should have a clear understanding of this "feature". Think I will go into holding mode with the standard rewrite module (which works without issue) for now. Just that lua allows for more complex logic for my tests. Thanks for your efforts chaps. From nginx at nginxuser.net Fri Oct 14 13:27:17 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 16:27:17 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 14 October 2011 03:16, Nginx User wrote: > Unfortunately, I am still seeing the "0 0" outputs in my logs on (only > some) requests. I had noticed that some pages just seemed to have the > "loading" wheel spin for ever and on looking, I found the instances. > > It is not affecting standard php requests anymore from what I can see > but it seems some Ajax type requests where php is being used for > dynamic js (! need to look closer into how I set those up) and with > phpMyAdmin which is aliased somewhere. Looking at things further, it may be a mime type issue clouding things. My js files use the non-standard but widely adopted "text/javascript" while Nginx comes with the standard but not always supported "application/X-javascript" mime type. Not sure I changed the mimes types file accordingly when I went to 1.0.8. The phpMyadmin one is funny though as all it does is use an alias. From igor at sysoev.ru Fri Oct 14 13:40:57 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 14 Oct 2011 17:40:57 +0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: <7d4e54b3d037097123efb0c718d5d317.NginxMailingListEnglish@forum.nginx.org> References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> <7d4e54b3d037097123efb0c718d5d317.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111014134056.GB1894@nginx.com> On Fri, Oct 14, 2011 at 07:14:24AM -0400, gus wrote: > ??????? ?? ????, ????? ????? AIO > ??????????, ?? ????? ? h264 ?? > ???????????? ?? swf ?????? ???? ?? > ????????????? ?? ?????. ???????? > ????????? ?? --add-module=/gus/nginx_mod_h264_streaming-2.2.7 > ? ?? ?????????????? #directio=1m; nginx_mod_h264_streaming ?????? ?????????, ??? ????????? ??????????. ngx_http_mp4_module ?????????, ?????? ???? ????? ???????? start=XXX, ???? ???? XXX ????? 0. ???? ????? ????????? ???, ?? ???? ???????? ??? ????. JW Player ?????? ??????????? ? ?????????? start=0. ? ????????, ????? ??????? ?????????, ????? ?????? ????????? ??????????. ?????????: http://nginx.org/ru/docs/http/ngx_http_mp4_module.html -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Fri Oct 14 18:36:29 2011 From: nginx-forum at nginx.us (vidan) Date: Fri, 14 Oct 2011 14:36:29 -0400 Subject: nginx for cs-cart Message-ID: this is for cs-cart RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php?sef_rewrite=1 [L,QSA] i know one rule only try_files $uri $uri/ /index.php?sef_rewrite=1; but i cant open those url with .html Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216707,216707#msg-216707 From nginx at nginxuser.net Fri Oct 14 19:24:52 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 22:24:52 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 14 October 2011 16:27, Nginx User wrote: > Looking at things further, it may be a mime type issue clouding things. > My js files use the non-standard but widely adopted "text/javascript" > while Nginx comes with the standard but not always supported > "application/X-javascript" mime type. > Not sure I changed the mimes types file accordingly when I went to 1.0.8. > > The phpMyadmin one is funny though as all it does is use an alias. OK. I went back to nginx1.0.8 and 0.31rc11, made sure everything was proper and made sure I only used rewrite by lua to trigger the jump server { ... location @pretty_urls { # some rewrite rules to php } location @proxy { include /etc/nginx/firewall.default; proxy_pass http://127.0.0.1:8080; ... } location ~ ^.+\.php$ { content_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @pretty_urls; } } Everything works perfectly and not a hint of evil behaviour. Not sure what I missed before but I am now as happy as Larry. Now I can implement the second stage of my WAF implementation plan where firewall.default would query PHPIDS (https://phpids.org/) instead of my homebrew regexes. From nginx at nginxuser.net Fri Oct 14 19:25:48 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 22:25:48 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 14 October 2011 22:24, Nginx User wrote: > ? ? ?location ~ ^.+\.php$ { > ? ? ? ? ? ? ?content_by_lua 'ngx.exec("@proxy");'; > ? ? ?} That should read location ~ ^.+\.php$ { rewrite_by_lua 'ngx.exec("@proxy");'; } From nginx at nginxuser.net Fri Oct 14 19:29:52 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 22:29:52 +0300 Subject: nginx for cs-cart In-Reply-To: References: Message-ID: On 14 October 2011 21:36, vidan wrote: > this is for cs-cart > > RewriteBase / > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule . index.php?sef_rewrite=1 [L,QSA] > > i know one rule only > > try_files $uri $uri/ /index.php?sef_rewrite=1; > but i cant open those url with .html That should open html files ordinarily. Do you get an error message with it? From mdounin at mdounin.ru Fri Oct 14 19:43:45 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 14 Oct 2011 23:43:45 +0400 Subject: Nginx crash - possibly keepalives In-Reply-To: <20111012172241.GU1137@mdounin.ru> References: <20111012122000.GK1137@mdounin.ru> <20111012172241.GU1137@mdounin.ru> Message-ID: <20111014194345.GE1137@mdounin.ru> Hello! On Wed, Oct 12, 2011 at 09:22:41PM +0400, Maxim Dounin wrote: > Hello! > > On Wed, Oct 12, 2011 at 09:32:41AM -0700, Matthieu Tourne wrote: > > > On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin wrote: > > > > > Hello! > > > > > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > > > > > Hi all, > > > > > > > > After turning on keepalives, we've been seeing one crash pretty > > > > consistently. > > > > We're running nginx 1.1.5 and here is the backtrace : [...] > Ok, it looks like I'm right and all buffers are in busy chain. > Likely this happens due to upstream sending response in many small > chunks. > > I'll try to reproduce it here and provide proper fix. Please try the attached patch. Maxim Dounin -------------- next part -------------- # HG changeset patch # User Maxim Dounin # Date 1318621020 -14400 # Node ID c91f35091533962be9bb3c6cb64f6acca60ff480 # Parent 1e17fe554aa2de75684f7a3898d8506281c4a323 Event pipe fixes for complex protocols. 1. In ngx_event_pipe_write_chain_to_temp_file() make sure to fully write all shadow buffers up to last_shadow. With this change recycled buffers cannot appear in p->out anymore. This also fixes segmentation faults observed due to ngx_event_pipe_write_chain_to_temp() not freeing any raw buffers while still returning NGX_OK. 2. In ngx_event_pipe_write_to_downstream() we now properly check for busy size as a size of buffers, not a size of data in these buffers. This fixes situations where all available buffers became busy (including segmentation faults due to this). 3. The ngx_event_pipe_free_shadow_raw_buf() function is dropped. It's incorrect and not needed. diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c --- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -15,8 +15,6 @@ static ngx_int_t ngx_event_pipe_write_to static ngx_int_t ngx_event_pipe_write_chain_to_temp_file(ngx_event_pipe_t *p); static ngx_inline void ngx_event_pipe_remove_shadow_links(ngx_buf_t *buf); -static ngx_inline void ngx_event_pipe_free_shadow_raw_buf(ngx_chain_t **free, - ngx_buf_t *buf); static ngx_int_t ngx_event_pipe_drain_chains(ngx_event_pipe_t *p); @@ -576,17 +574,13 @@ ngx_event_pipe_write_to_downstream(ngx_e if (p->out) { cl = p->out; - if (cl->buf->recycled - && bsize + cl->buf->last - cl->buf->pos > p->busy_size) - { - flush = 1; - break; + if (cl->buf->recycled) { + ngx_log_error(NGX_LOG_ALERT, p->log, 0, + "recycled buffer in pipe out chain"); } p->out = p->out->next; - ngx_event_pipe_free_shadow_raw_buf(&p->free_raw_bufs, cl->buf); - } else if (!p->cacheable && p->in) { cl = p->in; @@ -596,24 +590,13 @@ ngx_event_pipe_write_to_downstream(ngx_e cl->buf->pos, cl->buf->last - cl->buf->pos); - if (cl->buf->recycled - && cl->buf->last_shadow - && bsize + cl->buf->last - cl->buf->pos > p->busy_size) - { - if (!prev_last_shadow) { - p->in = p->in->next; - - cl->next = NULL; - - if (out) { - *ll = cl; - } else { - out = cl; - } + if (cl->buf->recycled && prev_last_shadow) { + if (bsize + cl->buf->end - cl->buf->start > p->busy_size) { + flush = 1; + break; } - flush = 1; - break; + bsize += cl->buf->end - cl->buf->start; } prev_last_shadow = cl->buf->last_shadow; @@ -624,10 +607,6 @@ ngx_event_pipe_write_to_downstream(ngx_e break; } - if (cl->buf->recycled) { - bsize += cl->buf->last - cl->buf->pos; - } - cl->next = NULL; if (out) { @@ -703,6 +682,7 @@ ngx_event_pipe_write_chain_to_temp_file( { ssize_t size, bsize; ngx_buf_t *b; + ngx_uint_t prev_last_shadow; ngx_chain_t *cl, *tl, *next, *out, **ll, **last_free, fl; if (p->buf_to_file) { @@ -719,6 +699,7 @@ ngx_event_pipe_write_chain_to_temp_file( size = 0; cl = out; ll = NULL; + prev_last_shadow = 1; ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "pipe offset: %O", p->temp_file->offset); @@ -726,16 +707,21 @@ ngx_event_pipe_write_chain_to_temp_file( do { bsize = cl->buf->last - cl->buf->pos; - ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0, - "pipe buf %p, pos %p, size: %z", - cl->buf->start, cl->buf->pos, bsize); + ngx_log_debug4(NGX_LOG_DEBUG_EVENT, p->log, 0, + "pipe buf ls:%d %p, pos %p, size: %z", + cl->buf->last_shadow, cl->buf->start, + cl->buf->pos, bsize); - if ((size + bsize > p->temp_file_write_size) - || (p->temp_file->offset + size + bsize > p->max_temp_file_size)) + if (prev_last_shadow + && ((size + bsize > p->temp_file_write_size) + || (p->temp_file->offset + size + bsize + > p->max_temp_file_size))) { break; } + prev_last_shadow = cl->buf->last_shadow; + size += bsize; ll = &cl->next; cl = cl->next; @@ -913,35 +899,6 @@ ngx_event_pipe_remove_shadow_links(ngx_b } -static ngx_inline void -ngx_event_pipe_free_shadow_raw_buf(ngx_chain_t **free, ngx_buf_t *buf) -{ - ngx_buf_t *s; - ngx_chain_t *cl, **ll; - - if (buf->shadow == NULL) { - return; - } - - for (s = buf->shadow; !s->last_shadow; s = s->shadow) { /* void */ } - - ll = free; - - for (cl = *free; cl; cl = cl->next) { - if (cl->buf == s) { - *ll = cl->next; - break; - } - - if (cl->buf->shadow) { - break; - } - - ll = &cl->next; - } -} - - ngx_int_t ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b) { From lists at ruby-forum.com Fri Oct 14 20:02:44 2011 From: lists at ruby-forum.com (Alpha D.) Date: Fri, 14 Oct 2011 22:02:44 +0200 Subject: Response time in header Message-ID: <0f14604b89890ccb85df7c8e255a43f1@ruby-forum.com> I would like to set/configure nginx such that I either a) set a single header equal to the time it takes nginx to receive and reply to a request, or b) set a hader for the time the request is received and another when the reponse is sent out from the webserver. Can this be done? -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Oct 14 20:14:17 2011 From: nginx-forum at nginx.us (Alexey Koscheev) Date: Fri, 14 Oct 2011 16:14:17 -0400 Subject: Limit requests per resource In-Reply-To: References: Message-ID: <4b9a6042fe2c7b486f46fff0fe2bf4a3.NginxMailingListEnglish@forum.nginx.org> http://forum.nginx.org/read.php?10,214474 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216652,216714#msg-216714 From nginx-forum at nginx.us Fri Oct 14 20:15:00 2011 From: nginx-forum at nginx.us (vidan) Date: Fri, 14 Oct 2011 16:15:00 -0400 Subject: nginx for cs-cart In-Reply-To: References: Message-ID: <9ee88a9386f4805b0457560f08edfea5.NginxMailingListEnglish@forum.nginx.org> yes, check in the logs, bla-bla.html not found Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216707,216715#msg-216715 From francis at daoine.org Fri Oct 14 20:39:30 2011 From: francis at daoine.org (Francis Daly) Date: Fri, 14 Oct 2011 21:39:30 +0100 Subject: nginx for cs-cart In-Reply-To: <9ee88a9386f4805b0457560f08edfea5.NginxMailingListEnglish@forum.nginx.org> References: <9ee88a9386f4805b0457560f08edfea5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111014203930.GA13085@craic.sysops.org> On Fri, Oct 14, 2011 at 04:15:00PM -0400, vidan wrote: Hi there, > yes, check in the logs, bla-bla.html not found Does bla-bla.html exist? The following nginx.conf seems to do for me what you describe you want (curl -v http://localhost:8000/there.html gives me the content of the file; curl -v http://localhost:8000/notthere.html gives me the output of /index.php with REQUEST_URI set to /notthere.html) If it doesn't do the same for you, what is different? === events { worker_connections 1024; debug_connection 127.0.0.1; } http { server { listen 8000; include fastcgi.conf; try_files $uri $uri/ /index.php?sef_rewrite=1; location = /index.php { fastcgi_pass unix:php.sock; } } } === f -- Francis Daly francis at daoine.org From nginx at nginxuser.net Fri Oct 14 20:41:19 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 14 Oct 2011 23:41:19 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: Additional feedback to agentzh: Everything seems to be working fine. However, a small configuration error showed a potential problem in that the rewrite_by_lua directive does not seem to take account of the rewrite module's "last" flag. Contrived example: # GET /sometext/xyz.html server { ... location @pretty_urls { rewrite ^/sometext/xyz\.html$ /abc.html last; # line below included by mistake and shouldn't have been there # On the other hand, the hit above should mean it is not called anyway rewrite_by_lua 'ngx.exec("@proxy");'; } location @proxy { include /etc/nginx/firewall.default; proxy_pass http://127.0.0.1:8080; ... } location ~ ^.+\.php$ { content_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @pretty_urls; } } ... generates an error along the lines of ... 2011/10/14 20:10:26 [error] 17325#0: *16 lua handler aborted: runtime error: attempt to call a nil value, blah, blah, blah". As said, it was a misconfig but I would have expected that with the earlier hit with the rewrite module, all further rewrites, including ngx_lua's should stop. Cheers From nginx-forum at nginx.us Fri Oct 14 21:02:50 2011 From: nginx-forum at nginx.us (vidan) Date: Fri, 14 Oct 2011 17:02:50 -0400 Subject: nginx for cs-cart In-Reply-To: References: Message-ID: <82260e685f4732ab96d69348cc76655e.NginxMailingListEnglish@forum.nginx.org> hi Francis, no bla-bla.html does not exist. its only a redirect from url like this http://indomakeup.com/index.php?dispatch=pages.view&page_id=11 i could open something like this /url/ but can't open url end with .html location / { try_files $uri $uri/ /index.php?sef_rewrite=1; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216707,216718#msg-216718 From francis at daoine.org Fri Oct 14 21:17:34 2011 From: francis at daoine.org (Francis Daly) Date: Fri, 14 Oct 2011 22:17:34 +0100 Subject: nginx for cs-cart In-Reply-To: <82260e685f4732ab96d69348cc76655e.NginxMailingListEnglish@forum.nginx.org> References: <82260e685f4732ab96d69348cc76655e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111014211734.GB13085@craic.sysops.org> On Fri, Oct 14, 2011 at 05:02:50PM -0400, vidan wrote: Hi there, > hi Francis, no bla-bla.html does not exist. > its only a redirect from url like this > http://indomakeup.com/index.php?dispatch=pages.view&page_id=11 > i could open something like this /url/ > but can't open url end with .html I'm afraid that I don't understand the problem you are reporting. a) what do you do? b) what do you see? c) what do you expect to see? and, if it isn't immediately clear: d) what is the difference between b) and c)? > location / { > try_files $uri $uri/ /index.php?sef_rewrite=1; > } My current guess is that you have another location{} block in your configuration that is being used instead of this one for the request you are making. But without more information, it remains guesswork. f -- Francis Daly francis at daoine.org From agentzh at gmail.com Sat Oct 15 01:27:02 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 09:27:02 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Fri, Oct 14, 2011 at 8:16 AM, Nginx User wrote: > Unfortunately, I am still seeing the "0 0" outputs in my logs on (only > some) requests. I had noticed that some pages just seemed to have the > "loading" wheel spin for ever and on looking, I found the instances. > Would you mind sharing the debug logs for such bad responses? I'd have a closer look at these :) Thanks! -agentzh From nginx-forum at nginx.us Sat Oct 15 02:18:58 2011 From: nginx-forum at nginx.us (krukmat) Date: Fri, 14 Oct 2011 22:18:58 -0400 Subject: 499 Code - The connection resets after 1 minute Message-ID: <8903a71f9a791a572fa1486ab96b0193.NginxMailingListEnglish@forum.nginx.org> I have a django view which lasts more than a minute. But after the first minute, the browser shows me the connection is reset. If I read the access log, I find this: "GET /2.1/jmsf/events?apikey=6ff9131a-2c37-4584-9988-7e0e4da91577&m=2010-06-18+00%3A33%3A34.None.None HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1" I tried adjusting client_header_timeout, client_body_timeout,keepalive_timeout,fastcgi_read_timeout ,fastcgi_connect_timeout,fastcgi_send_timeout and send_timeout. But It didn't work. Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216721,216721#msg-216721 From agentzh at gmail.com Sat Oct 15 06:36:27 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 14:36:27 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sat, Oct 15, 2011 at 4:41 AM, Nginx User wrote: > Everything seems to be working fine. However, a small configuration > error showed a potential problem in that the rewrite_by_lua directive > does not seem to take account of the rewrite module's "last" flag. > > Contrived example: > > # GET /sometext/xyz.html > server { > ? ? ... > ? ? location @pretty_urls { > ? ? ? ? ? ? ?rewrite ^/sometext/xyz\.html$ /abc.html last; > > ? ? ? ? ? ? ?# line below included by mistake and shouldn't have been there > ? ? ? ? ? ? ?# On the other hand, the hit above should mean it is not > called anyway > ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? } > ? ? location @proxy { > ? ? ? ? ? ? include /etc/nginx/firewall.default; > ? ? ? ? ? ? proxy_pass http://127.0.0.1:8080; > ? ? ? ? ? ? ... > ? ? } > ? ? location ~ ^.+\.php$ { > ? ? ? ? ? ? content_by_lua 'ngx.exec("@proxy");'; > ? ? } > ? ? location / { > ? ? ? ? ? ? try_files $uri $uri/ @pretty_urls; > ? ? } > } > ... generates an error along the lines of ... > 2011/10/14 20:10:26 [error] 17325#0: *16 lua handler aborted: runtime > error: attempt to call a nil value, blah, blah, blah". > Interesting. But I cannot reproduce this issue with the following small example on my side: location @pretty { rewrite ^/main/xyz\.html$ /abc.html last; rewrite_by_lua 'ngx.exec("@proxy")'; } location @proxy { echo hello; } location /abc.html { echo abc; } location /main { try_files $uri $uri/ @pretty; } Then GET /main/xyz.html yields the output "abc" as expected and I don't see that ngx_lua error message in my error.log. Could you show me the error.log with --with-debug + debug log level? Regards, -agentzh From nginx at nginxuser.net Sat Oct 15 08:33:35 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 11:33:35 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 15 October 2011 04:27, agentzh wrote: > On Fri, Oct 14, 2011 at 8:16 AM, Nginx User wrote: >> Unfortunately, I am still seeing the "0 0" outputs in my logs on (only >> some) requests. I had noticed that some pages just seemed to have the >> "loading" wheel spin for ever and on looking, I found the instances. >> > > Would you mind sharing the debug logs for such bad responses? I'd have > a closer look at these :) I stopped getting these responses. I rolled back to my 1.0.6 install and later redid the move the 1.0.8 with all the components more carefully and it stopped at that point. From nginx at nginxuser.net Sat Oct 15 08:46:14 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 11:46:14 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 15 October 2011 09:36, agentzh wrote: > Interesting. But I cannot reproduce this issue with the following > small example on my side: > > ? ?location @pretty { > ? ? ? ?rewrite ^/main/xyz\.html$ /abc.html last; > ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy")'; > ? ?} > ? ?location @proxy { > ? ? ? ?echo hello; > ? ?} > ? ?location /abc.html { > ? ? ? ?echo abc; > ? ?} > ? ?location /main { > ? ? ? ?try_files $uri $uri/ @pretty; > ? ?} > > Then GET /main/xyz.html yields the output "abc" as expected and I > don't see that ngx_lua error message in my error.log. > > Could you show me the error.log with --with-debug + debug log level? http://pastebin.com/estie4W8 # GET /forum/ server { root /home/user/testsite.com/public_html/test_app ... location @pretty_urls { # A number of rewrite rule. Hit line replicated ... rewrite ^/(abc|forum|xyz)/?$ "/index.php?pretty;action=$1" last; ... rewrite_by_lua 'ngx.exec("@proxy");'; } location @proxy { include /etc/nginx/firewall.default; proxy_pass http://127.0.0.1:8080; ... } location ~ ^.+\.php$ { rewrite_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @pretty_urls; } } From mdounin at mdounin.ru Sat Oct 15 08:53:05 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 15 Oct 2011 12:53:05 +0400 Subject: 499 Code - The connection resets after 1 minute In-Reply-To: <8903a71f9a791a572fa1486ab96b0193.NginxMailingListEnglish@forum.nginx.org> References: <8903a71f9a791a572fa1486ab96b0193.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111015085305.GF1137@mdounin.ru> Hello! On Fri, Oct 14, 2011 at 10:18:58PM -0400, krukmat wrote: > I have a django view which lasts more than a minute. > But after the first minute, the browser shows me the connection is > reset. > If I read the access log, I find this: > "GET > /2.1/jmsf/events?apikey=6ff9131a-2c37-4584-9988-7e0e4da91577&m=2010-06-18+00%3A33%3A34.None.None > HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) > AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1" > > I tried adjusting client_header_timeout, > client_body_timeout,keepalive_timeout,fastcgi_read_timeout > ,fastcgi_connect_timeout,fastcgi_send_timeout and send_timeout. But It > didn't work. Status code 499 indicate that from nginx point of view connection was closed by browser. (You may take a look at error log to find out more details, there should be something like "client closed connection" logged at info level.) As I don't expect Chrome to close connection after 1 minute (actually, I'v just tested - it doesn't) it's likely something between your browser and nginx. Maxim Dounin From agentzh at gmail.com Sat Oct 15 09:40:11 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 17:40:11 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sat, Oct 15, 2011 at 4:46 PM, Nginx User wrote: > > http://pastebin.com/estie4W8 > > # GET /forum/ > server { > ?root /home/user/testsite.com/public_html/test_app > ?... > ?location @pretty_urls { > ? ? ? # A number of rewrite rule. Hit line replicated > ? ? ? ... > ? ? ? rewrite ^/(abc|forum|xyz)/?$ "/index.php?pretty;action=$1" last; Okay, I must say that ngx_rewrite's "last" won't affect rewrite_by_lua because rewrite_by_lua is not part of that module (and there's no known way to achieve that). So it's recommended to do URL rewrite all in rewrite_by_lua. Some people has pointed out that ngx.exec() is a little heavy as compared to ngx_rewrite's rewrite directive. I may implement an ngx.rewrite() function for ngx_lua in the near future and it's an easy hack :) But set_by_lua will be affected because that directive is injected into ngx_rewrite's instruction list by means of ngx_devel_kit's set_var submodule. Regards, -agentzh From nginx at nginxuser.net Sat Oct 15 09:57:29 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 12:57:29 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 15 October 2011 12:40, agentzh wrote: > On Sat, Oct 15, 2011 at 4:46 PM, Nginx User wrote: >> >> http://pastebin.com/estie4W8 >> >> # GET /forum/ >> server { >> ?root /home/user/testsite.com/public_html/test_app >> ?... >> ?location @pretty_urls { >> ? ? ? # A number of rewrite rule. Hit line replicated >> ? ? ? ... >> ? ? ? rewrite ^/(abc|forum|xyz)/?$ "/index.php?pretty;action=$1" last; > > Okay, I must say that ngx_rewrite's "last" won't affect rewrite_by_lua > because rewrite_by_lua is not part of that module (and there's no > known way to achieve that). I guessed as much. I didn't need that line there in this case and if neeed, "try_files /dummy/ @proxy" would do the job. I like ngx_lua because it allows me to jump locations. Needs hacks to do this with the rewrite module. Either the try_files hack above or mapping an obscure error code to a location and using "return code". All in all, I have come to realise that ngx_lua is slightly evil in that unexpected things can happen. As with "if" however, evil understood is evil avoided :-) Any thoughts on Marcus' points earlier on clearing the ctx in the core? Seems to suggest that may cause problems elsewhere and that it is better to be handled at the module level. Seems logical as whether it was originally an oversight or not, changing it now would break other stuff. From agentzh at gmail.com Sat Oct 15 10:07:46 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 18:07:46 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sat, Oct 15, 2011 at 5:57 PM, Nginx User wrote: > All in all, I have come to realise that ngx_lua is slightly evil in > that unexpected things can happen. As with "if" however, evil > understood is evil avoided :-) > The ngx_lua module won't play seamlessly with ngx_rewrite because ngx_rewrite does use internal hacks and tricks to make things work. So I'd recommend use Lua to do as much as possible and avoid using ngx_rewrite's directives but simple "set". > Any thoughts on Marcus' points earlier on clearing the ctx in the core? Well, there're indeed cases that we do want to retain module contexts during a jump but I've already managed to "abuse" the post_subrequest mechanism to save the pointer to my module's context and later restore it in my output header filter, for example. (See how I do this in my ngx_lua module for ngx.location.capture.) But on the other hand, if I do want to clear my module's context before a internal redirection, then there's no easy way to do that myself. > Seems to suggest that may cause problems elsewhere and that it is > better to be handled at the module level. No, this is impossible to handle that fully on the module level. For example, if you do use ngx_upload module's upload_pass instead of ngx_lua or ngx_echo to do the jump, then it'll still break rewrite_by_lua and access_by_lua (at least). > Seems logical as whether it was originally an oversight or not, > changing it now would break other stuff. > I doubt it :) Unless one only jump to named locations and never to normal locations. The behaviors here are already inconsistent and very hard to work around. Regards, -agentzh From ngx.eugaia at gmail.com Sat Oct 15 10:16:31 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Sat, 15 Oct 2011 13:16:31 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: <4E995D7F.4010109@gmail.com> On 15/10/2011 12:40, agentzh wrote: > Okay, I must say that ngx_rewrite's "last" won't affect rewrite_by_lua > because rewrite_by_lua is not part of that module (and there's no > known way to achieve that). You could achieve that now by creating a dummy variable, and instead of using a new handler for the rewrite by code, you wrap the code around the setby lua code. It would waste a few cycles, since it would be setting a variable unnecessarily, but would have the benefit of not slowing down the execution of code that didn't use rewrite_by, since it wouldn't be adding an extra handler to process for all the other requests. A better way would be to extend the NDK and expose a generic rewrite-phase, script engine interface that other scripting functions (that are more than just set_xxx) can use, and to use that instead. You'd then not be wasting cycles on setting a variable unnecessarily. It'd be mostly similar to the set_var stuff, but would need to take the normal 'code'-type functions rather than the NDK setvar function types. Cheers, Marcus. From ngx.eugaia at gmail.com Sat Oct 15 10:25:43 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Sat, 15 Oct 2011 13:25:43 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: <4E995FA7.90203@gmail.com> On 15/10/2011 12:57, Nginx User wrote: > Any thoughts on Marcus' points earlier on clearing the ctx in the core? > Seems to suggest that may cause problems elsewhere and that it is > better to be handled at the module level. > Seems logical as whether it was originally an oversight or not, > changing it now would break other stuff. I had a closer look at the code, and in fact clearing the contexts automatically won't break my code in particular because I don't use ngx_http_named_location() to find named locations (I find the location at conf-read time, not run time, since it's more efficient). There may be other developers that use the function at runtime, but my guess is that it's probably not commonly used by module developers who would not prefer the contexts to be reset. I would therefore agree with agentzh and Maxim about it probably being the best way to go, and should any developers create modules that currently call ngx_http_named_location() but don't want to clear the contexts, then they can just re-write the function to not do so. Marcus. From agentzh at gmail.com Sat Oct 15 10:33:38 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 18:33:38 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: <4E995D7F.4010109@gmail.com> References: <4E995D7F.4010109@gmail.com> Message-ID: On Sat, Oct 15, 2011 at 6:16 PM, Eugaia wrote: > On 15/10/2011 12:40, agentzh wrote: >> >> Okay, I must say that ngx_rewrite's "last" won't affect rewrite_by_lua >> because rewrite_by_lua is not part of that module (and there's no >> known way to achieve that). > > You could achieve that now by creating a dummy variable, and instead of > using a new handler for the rewrite by code, you wrap the code around the > setby lua code. ?It would waste a few cycles, since it would be setting a > variable unnecessarily, but would have the benefit of not slowing down the > execution of code that didn't use rewrite_by, since it wouldn't be adding an > extra handler to process for all the other requests. > I do not fully grok your approach but I'd ask first: will this approach allow subrequests, internal redirection, non-blocking sleep, and all the other fancy stuffs? Regards, -agentzh From ngx.eugaia at gmail.com Sat Oct 15 10:43:59 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Sat, 15 Oct 2011 13:43:59 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: <4E995D7F.4010109@gmail.com> Message-ID: <4E9963EF.2080405@gmail.com> On 15/10/2011 13:33, agentzh wrote: > On Sat, Oct 15, 2011 at 6:16 PM, Eugaia wrote: >> On 15/10/2011 12:40, agentzh wrote: >>> Okay, I must say that ngx_rewrite's "last" won't affect rewrite_by_lua >>> because rewrite_by_lua is not part of that module (and there's no >>> known way to achieve that). >> You could achieve that now by creating a dummy variable, and instead of >> using a new handler for the rewrite by code, you wrap the code around the >> setby lua code. It would waste a few cycles, since it would be setting a >> variable unnecessarily, but would have the benefit of not slowing down the >> execution of code that didn't use rewrite_by, since it wouldn't be adding an >> extra handler to process for all the other requests. >> > I do not fully grok your approach but I'd ask first: will this > approach allow subrequests, internal redirection, non-blocking sleep, > and all the other fancy stuffs? If you were just wrapping around set_var, then no. It would only be able to handle non-reentrant code, just like setby. In order to have reentrant code, it would need to have a generic layer that would be able to jump in/out of the script engine (and handle re-calling the script engine post subrequest etc). The rewrite handler would also need to be re-written to handle re-entering the script engine. The advantage of having a generic rewrite re-entrant layer, though, would be that set_var would also be able to accept subrequests etc (assuming you used that to base setby on). Marcus. From nginx at nginxuser.net Sat Oct 15 11:06:07 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 14:06:07 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: <4E995FA7.90203@gmail.com> References: <4E995FA7.90203@gmail.com> Message-ID: On 15 October 2011 13:25, Eugaia wrote: > On 15/10/2011 12:57, Nginx User wrote: >> >> Any thoughts on Marcus' points earlier on clearing the ctx in the core? >> Seems to suggest that may cause problems elsewhere and that it is >> better to be handled at the module level. >> Seems logical as whether it was originally an oversight or not, >> changing it now would break other stuff. > > I had a closer look at the code, and in fact clearing the contexts > automatically won't break my code in particular because I don't use > ngx_http_named_location() to find named locations (I find the location at > conf-read time, not run time, since it's more efficient). ?There may be > other developers that use the function at runtime, but my guess is that it's > probably not commonly used by module developers who would not prefer the > contexts to be reset. > > I would therefore agree with agentzh and Maxim about it probably being the > best way to go, and should any developers create modules that currently call > ngx_http_named_location() but don't want to clear the contexts, then they > can just re-write the function to not do so. Great. I'll therefore look into applying agentzh's patch then. I had held off because your previous comment. From agentzh at gmail.com Sat Oct 15 11:09:36 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 19:09:36 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: <4E9963EF.2080405@gmail.com> References: <4E995D7F.4010109@gmail.com> <4E9963EF.2080405@gmail.com> Message-ID: On Sat, Oct 15, 2011 at 6:43 PM, Eugaia wrote: > > If you were just wrapping around set_var, then no. ?It would only be able to > handle non-reentrant code, just like setby. > Gathered so ;) I asked because I didn't want to miss any quick magic ;) > In order to have reentrant code, it would need to have a generic layer that > would be able to jump in/out of the script engine (and handle re-calling the > script engine post subrequest etc). ?The rewrite handler would also need to > be re-written to handle re-entering the script engine. > > The advantage of having a generic rewrite re-entrant layer, though, would be > that set_var would also be able to accept subrequests etc (assuming you used > that to base setby on). > I've been waiting for this feature for more than a year now ;) Thanks! -agentzh From nginx at nginxuser.net Sat Oct 15 11:37:01 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 14:37:01 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 15 October 2011 13:07, agentzh wrote: > On Sat, Oct 15, 2011 at 5:57 PM, Nginx User wrote: >> All in all, I have come to realise that ngx_lua is slightly evil in >> that unexpected things can happen. As with "if" however, evil >> understood is evil avoided :-) >> > > The ngx_lua module won't play seamlessly with ngx_rewrite because > ngx_rewrite does use internal hacks and tricks to make things work. So > I'd recommend use Lua to do as much as possible and avoid using > ngx_rewrite's directives but simple "set". > Would it mean "if" blocks? The last, redirect, permanent etc flags available to rewrite are very convenient. >> Any thoughts on Marcus' points earlier on clearing the ctx in the core? > > Well, there're indeed cases that we do want to retain module contexts > during a jump but I've already managed to "abuse" the post_subrequest > mechanism to save the pointer to my module's context and later restore > it in my output header filter, for example. (See how I do this in my > ngx_lua module for ngx.location.capture.) > > But on the other hand, if I do want to clear my module's context > before a internal redirection, then there's no easy way to do that > myself. > >> Seems to suggest that may cause problems elsewhere and that it is >> better to be handled at the module level. > > No, this is impossible to handle that fully on the module level. For > example, if you do use ngx_upload module's upload_pass instead of > ngx_lua or ngx_echo to do the jump, then it'll still break > rewrite_by_lua and access_by_lua (at least). > >> Seems logical as whether it was originally an oversight or not, >> changing it now would break other stuff. >> > > I doubt it :) Unless one only jump to named locations and never to > normal locations. The behaviors here are already inconsistent and very > hard to work around. Pardon my ignorance. I thought it was the same thing. Anyway, Marcus has lent his weight to your call so hopefully it will get picked up and implemeted. From ngx.eugaia at gmail.com Sat Oct 15 11:38:43 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Sat, 15 Oct 2011 14:38:43 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: <4E995D7F.4010109@gmail.com> <4E9963EF.2080405@gmail.com> Message-ID: <4E9970C3.40109@gmail.com> On 15/10/2011 14:09, agentzh wrote: > On Sat, Oct 15, 2011 at 6:43 PM, Eugaia wrote: >> If you were just wrapping around set_var, then no. It would only be able to >> handle non-reentrant code, just like setby. >> > Gathered so ;) I asked because I didn't want to miss any quick magic ;) Nope. WYSIWYG. :-) >> In order to have reentrant code, it would need to have a generic layer that >> would be able to jump in/out of the script engine (and handle re-calling the >> script engine post subrequest etc). The rewrite handler would also need to >> be re-written to handle re-entering the script engine. >> >> The advantage of having a generic rewrite re-entrant layer, though, would be >> that set_var would also be able to accept subrequests etc (assuming you used >> that to base setby on). >> > I've been waiting for this feature for more than a year now ;) Well, I've built a more generic scripting framework that implements ngx_http_script_xxx - type stuff at any phase for which you can define handlers, not just the rewrite phase, and have build a large number of functions that work of this framework (echo, memcache, json parsing, arrays, math functions, shell_exec and a bunch of other things). It is almost able to do everything that you can do in ngx_lua (not quite, but I'm getting there), as well as a few things I've not seen in Lua, and it also works with the ngx_tcp_module (so you can do scripting on arbitrary TCP traffic as well as at the various phases of HTTP requests). I've had it running in production for a while, and am actively developing it, I just haven't open-sourced it yet (I'm not sure yet whether I will or not, so I'm holding off on doing so for the time being). I could probably make what I've done work with the current Nginx and NDK code, but since I'm not using the NDK set_var stuff for this scripting stuff, I don't intend on spending quite a bit of time developing something for the NDK that I'm never going to use. Sorry. Marcus. From agentzh at gmail.com Sat Oct 15 13:22:32 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 15 Oct 2011 21:22:32 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sat, Oct 15, 2011 at 7:37 PM, Nginx User wrote: > Would it mean "if" blocks? The last, redirect, permanent etc flags > available to rewrite are very convenient. > Making different Nginx modules work together requires a bit more understanding of how things work behind the scene, like phase handler running order and etc. Nginx is full of dark magic already. That's the Nginx way of doing things (at least for now) and let's face it. Do not expect everything to work intuitively for multi-module scripting especially when interacting with ngx_rewrite. And that's why I suggest staying in pure Lua as much as possible. Regards, -agentzh From nginx at nginxuser.net Sat Oct 15 14:20:08 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 17:20:08 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 15 October 2011 16:22, agentzh wrote: > On Sat, Oct 15, 2011 at 7:37 PM, Nginx User wrote: >> Would it mean "if" blocks? The last, redirect, permanent etc flags >> available to rewrite are very convenient. >> > > Making different Nginx modules work together requires a bit more > understanding of how things work behind the scene, like phase handler > running order and etc. > > Nginx is full of dark magic already. That's the Nginx way of doing > things (at least for now) and let's face it. > > Do not expect everything to work intuitively for multi-module > scripting especially when interacting with ngx_rewrite. And that's why > I suggest staying in pure Lua as much as possible. Makes sense to stick to one given that each is independent of the other. Just so tempting/logical on the surface, when they all go into the same location block for instance, to try to pick and choose elements from each. In my example, the flags from rewrite with the single line syntax is nice, clear and familiar but it does not provide a native mechanism to jump to another specific location (perhaps Igor would consider allowing try_files to accept a single argument). Anyway, learnt a bit more and I will like to say thank you very much for the work put in to the various weird and wonderful modules you have pushed out. The modules open up a huge amount of options and really take Nginx to another level. From nginx at nginxuser.net Sat Oct 15 14:30:44 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 17:30:44 +0300 Subject: HTTP Status Codes in Nginx Message-ID: Are the available HTTP Status codes documented anywhere? Put another way, is it possible to issue all of the HTTP Status codes? I am thinking about 501 not implemented for instance. Thanks From nginx-forum at nginx.us Sat Oct 15 14:56:42 2011 From: nginx-forum at nginx.us (krukmat) Date: Sat, 15 Oct 2011 10:56:42 -0400 Subject: 499 Code - The connection resets after 1 minute In-Reply-To: <20111015085305.GF1137@mdounin.ru> References: <20111015085305.GF1137@mdounin.ru> Message-ID: <1024963f2121b46762536387221a2bcc.NginxMailingListEnglish@forum.nginx.org> But I've experienced the same problem with Firefox and Safari also.. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216721,216741#msg-216741 From admin at fefaya.com Sat Oct 15 15:13:14 2011 From: admin at fefaya.com (admin fefaya) Date: Sat, 15 Oct 2011 22:13:14 +0700 Subject: HTTP Status Codes in Nginx In-Reply-To: References: Message-ID: <4E99A30A.4020208@fefaya.com> On 10/15/2011 09:30 PM, Nginx User wrote: > Are the available HTTP Status codes documented anywhere? Is this what you are looking for? http://en.wikipedia.org/wiki/List_of_HTTP_status_codes http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html > > Put another way, is it possible to issue all of the HTTP Status codes? > > I am thinking about 501 not implemented for instance. > > Thanks > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx at nginxuser.net Sat Oct 15 15:46:43 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 18:46:43 +0300 Subject: HTTP Status Codes in Nginx In-Reply-To: <4E99A30A.4020208@fefaya.com> References: <4E99A30A.4020208@fefaya.com> Message-ID: On 15 October 2011 18:13, admin fefaya wrote: > On 10/15/2011 09:30 PM, Nginx User wrote: >> >> Are the available HTTP Status codes documented anywhere? > > Is this what you are looking for? > > http://en.wikipedia.org/wiki/List_of_HTTP_status_codes > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Sorry. I meant the list of codes implemented by Nginx. I think I have seen such a list before on the wiki perhaps but can't recollect where. Particularly, I am thinking of comparing them with those provided by ngx_lua. Thanks From nginx at nginxuser.net Sat Oct 15 15:56:05 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 18:56:05 +0300 Subject: HTTP Status Codes in Nginx In-Reply-To: References: <4E99A30A.4020208@fefaya.com> Message-ID: On 15 October 2011 18:46, Nginx User wrote: > Sorry. I meant the list of codes implemented by Nginx. I think I have > seen such a list before on the wiki perhaps but can't recollect where. Found what I wanted under the documentation for "return". http://wiki.nginx.org/HttpRewriteModule#return From nginx at nginxuser.net Sat Oct 15 16:15:40 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 15 Oct 2011 19:15:40 +0300 Subject: HTTP Status Headers Message-ID: On 13 October 2011 04:34, agentzh wrote: > BTW, you could have written the Lua code like this: > > local m = ngx.re.match(ngx.var.request_method, "GET|POST|HEAD", "io") > if not m then > ? ?ngx.exit(400) > end Does ngx_lua support the appropriate "501 Not Implemented" for this? A search took me to ngx_http_lua_consts.c but it doesn't seem to be there. Also didn't realise I could use the actual code instead of a constant. Is it possible to issue any status code or are we limited to those in ngx_http_lua_consts.c? Cheers. From nginx-forum at nginx.us Sat Oct 15 19:17:22 2011 From: nginx-forum at nginx.us (krukmat) Date: Sat, 15 Oct 2011 15:17:22 -0400 Subject: 499 Code - The connection resets after 1 minute In-Reply-To: <20111015085305.GF1137@mdounin.ru> References: <20111015085305.GF1137@mdounin.ru> Message-ID: <5e4bce9db5447b6a31d89b6c804315b1.NginxMailingListEnglish@forum.nginx.org> Oh sorry i misunderstood you. I'll figure it out. Maybe It's a iptables problem... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216721,216748#msg-216748 From ken at clipboard.com Sat Oct 15 20:18:44 2011 From: ken at clipboard.com (Ken Perkins) Date: Sat, 15 Oct 2011 13:18:44 -0700 Subject: Unlink Errors Message-ID: <05E858371DCB4006AB38FB745A7D0436@clipboard.com> Hello, We're having seemingly random errors in our nginx error log for unlink errors, here's a small exerpt: Oct 15 12:48:42 nginx-02 (https://papertrailapp.com/systems/nginx-02/events?centered_on_id=61953643766747137) error.log (https://papertrailapp.com/systems/nginx-02/events?centered_on_id=61953643766747137&q=error.log): 2011/10/15 19:48:42 [crit] 16166#0: unlink() "/tmp/nginx/proxy_cache/d/66/c935ad9f8d9651ea5ad3cbc1fed9a66d" failed (2: No such file or directory) Oct 15 12:48:50 nginx-01 (https://papertrailapp.com/systems/nginx-01/events?centered_on_id=61953676335521792) error.log (https://papertrailapp.com/systems/nginx-01/events?centered_on_id=61953676335521792&q=error.log): 2011/10/15 19:48:49 [crit] 27483#0: unlink() "/tmp/nginx/proxy_cache/c/50/9e00745b7ef68a151032293af8b2050c" failed (2: No such file or directory) Oct 15 12:49:44 nginx-01 (https://papertrailapp.com/systems/nginx-01/events?centered_on_id=61953902844715009) error.log (https://papertrailapp.com/systems/nginx-01/events?centered_on_id=61953902844715009&q=error.log): 2011/10/15 19:49:43 [crit] 27483#0: unlink() "/tmp/nginx/proxy_cache/b/50/0d58d2fff99fdbe14755273fbe7f750b" failed (2: No such file or directory) I have no idea what's going on here or how to track it down. Any assistance would be great here. Thanks! --Ken clipboard, inc. we're hiring!: www.clipboard.com/jobs -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Oct 15 21:41:39 2011 From: nginx-forum at nginx.us (eiji-gravion) Date: Sat, 15 Oct 2011 17:41:39 -0400 Subject: autoindex hiding dot folders Message-ID: <7dda340314b7b7071e9f8d3cf4980989.NginxMailingListEnglish@forum.nginx.org> Hello, I'm using nginx 1.1.5 and when getting a directory listing via autoindex directories that start with a dot "." are not shown. Is there an option to change this behavior or does anyone know where in the source code I can change this? Thank you Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216751,216751#msg-216751 From mdounin at mdounin.ru Sat Oct 15 21:45:51 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 16 Oct 2011 01:45:51 +0400 Subject: autoindex hiding dot folders In-Reply-To: <7dda340314b7b7071e9f8d3cf4980989.NginxMailingListEnglish@forum.nginx.org> References: <7dda340314b7b7071e9f8d3cf4980989.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111015214550.GH1137@mdounin.ru> Hello! On Sat, Oct 15, 2011 at 05:41:39PM -0400, eiji-gravion wrote: > Hello, > > I'm using nginx 1.1.5 and when getting a directory listing via autoindex > directories that start with a dot "." are not shown. Yes. > Is there an option to change this behavior or does anyone know where in > the source code I can change this? No, there is no option. In source code it's in src/http/modules/ngx_http_autoindex_module.c: if (ngx_de_name(&dir)[0] == '.') { continue; } Maxim Dounin From agentzh at gmail.com Sat Oct 15 23:02:47 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 16 Oct 2011 07:02:47 +0800 Subject: HTTP Status Headers In-Reply-To: References: Message-ID: On Sun, Oct 16, 2011 at 12:15 AM, Nginx User wrote: > On 13 October 2011 04:34, agentzh wrote: >> BTW, you could have written the Lua code like this: >> >> local m = ngx.re.match(ngx.var.request_method, "GET|POST|HEAD", "io") >> if not m then >> ? ?ngx.exit(400) >> end > Does ngx_lua support the appropriate "501 Not Implemented" for this? Sure. Just use ngx.exit(501) for it. > A search took me to ngx_http_lua_consts.c but it doesn't seem to be there. > The constants defined there are just for improving Lua code readability. > Also didn't realise I could use the actual code instead of a constant. > > Is it possible to issue any status code or are we limited to those in > ngx_http_lua_consts.c? > You can use any status code. See http://wiki.nginx.org/HttpLuaModule#ngx.exit BTW, I've already added constant ngx.HTTP_METHOD_NOT_IMPLEMENTED to ngx_lua v0.3.1rc12: https://github.com/chaoslawful/lua-nginx-module/tags Regards, -agentzh From jmbennett at gmail.com Sat Oct 15 23:40:17 2011 From: jmbennett at gmail.com (Jon Bennett) Date: Sun, 16 Oct 2011 00:40:17 +0100 Subject: Proxy cache for php site Message-ID: Hi, I'm trying to implement this style of proxy_cache config http://fennb.com/microcaching-speed-your-app-up-250x-with-no-n as a test locally, to stick in front of php sites. This is what I have: http://pastie.org/2703119 http://local-nocache.domain.co.uk works as expected, but http://local.domain.co.uk gives me a 502. Grateful for any advice. thanks, Jon From nginx-forum at nginx.us Sat Oct 15 23:51:43 2011 From: nginx-forum at nginx.us (sogi) Date: Sat, 15 Oct 2011 19:51:43 -0400 Subject: 502 Bad Gateway when downloading file Message-ID: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> Hello all. I have topology as follows: client->NGINX->haproxy-> 4xapache servers. Problem is, that on one page, we have option to download file - it is done through changing header. Resulting header is as follows: Content-type: application/txt Content-Length: "xxxxx" Content-Disposition: attachment; filename="aaa.txt" I'm getting 502 Bad Gateway, The server returned an invalid or incomplete response error everytime after clicking on link. In logs, there is nothing weird. When trying it directly through HAPROXY or directly through nginx (pointed to one of that apache servers) it is working correctly. Do you have any idea about how to resolve it? Have anybody experienced something like this? Many thanks for any reply concerning this. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216759,216759#msg-216759 From appa at perusio.net Sun Oct 16 00:50:15 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sun, 16 Oct 2011 01:50:15 +0100 Subject: Proxy cache for php site In-Reply-To: References: Message-ID: <87mxd17oag.wl%appa@perusio.net> On 16 Out 2011 00h40 WEST, jmbennett at gmail.com wrote: > Hi, > > I'm trying to implement this style of proxy_cache config > http://fennb.com/microcaching-speed-your-app-up-250x-with-no-n as a > test locally, to stick in front of php sites. > > This is what I have: http://pastie.org/2703119 Your config has a lot of cruft, meaning a lot of bad Yoda stuff. But the main issue is that you're proxying to fastcgi not to another HTTP server, hence the cache to be used is fastcgi cache, not proxy cache. http://wiki.nginx.org/HttpFcgiModule#fastcgi_cache Which apart from a few options has basically the same directives with proxy replaced by fastcgi. --- appa From jmbennett at gmail.com Sun Oct 16 01:16:27 2011 From: jmbennett at gmail.com (Jon Bennett) Date: Sun, 16 Oct 2011 02:16:27 +0100 Subject: Proxy cache for php site In-Reply-To: <87mxd17oag.wl%appa@perusio.net> References: <87mxd17oag.wl%appa@perusio.net> Message-ID: Hi Appa, > Your config has a lot of cruft, meaning a lot of bad Yoda stuff. No doubt, any tips on cleaning up appreciated :) > But the main issue is that you're proxying to fastcgi not to another > HTTP server, hence the cache to be used is fastcgi cache, not proxy > cache. > > http://wiki.nginx.org/HttpFcgiModule#fastcgi_cache > > Which apart from a few options has basically the same directives with > proxy replaced by fastcgi. Ok, from scanning the docs, this seems about right, but nothing is being written to the cache dir, this is where I've got to: http://pastie.org/2703119 Thanks, Jon -- jon bennett - www.jben.net - blog.jben.net From appa at perusio.net Sun Oct 16 02:53:53 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sun, 16 Oct 2011 03:53:53 +0100 Subject: Proxy cache for php site In-Reply-To: References: <87mxd17oag.wl%appa@perusio.net> Message-ID: <87lisl7ike.wl%appa@perusio.net> On 16 Out 2011 02h16 WEST, jmbennett at gmail.com wrote: > Hi Appa, > >> Your config has a lot of cruft, meaning a lot of bad Yoda stuff. > > No doubt, any tips on cleaning up appreciated :) > >> But the main issue is that you're proxying to fastcgi not to >> another HTTP server, hence the cache to be used is fastcgi cache, >> not proxy cache. >> >> http://wiki.nginx.org/HttpFcgiModule#fastcgi_cache >> >> Which apart from a few options has basically the same directives >> with proxy replaced by fastcgi. > > Ok, from scanning the docs, this seems about right, but nothing is > being written to the cache dir, this is where I've got to: > http://pastie.org/2703119 Try this: https://gist.github.com/1290446 --- appa From nginx at nginxuser.net Sun Oct 16 04:11:05 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 16 Oct 2011 07:11:05 +0300 Subject: HTTP Status Headers In-Reply-To: References: Message-ID: On 16 October 2011 02:02, agentzh wrote: > On Sun, Oct 16, 2011 at 12:15 AM, Nginx User wrote: >> On 13 October 2011 04:34, agentzh wrote: >>> BTW, you could have written the Lua code like this: >>> >>> local m = ngx.re.match(ngx.var.request_method, "GET|POST|HEAD", "io") >>> if not m then >>> ? ?ngx.exit(400) >>> end >> Does ngx_lua support the appropriate "501 Not Implemented" for this? > > Sure. Just use ngx.exit(501) for it. > >> A search took me to ngx_http_lua_consts.c but it doesn't seem to be there. >> > > The constants defined there are just for improving Lua code readability. > >> Also didn't realise I could use the actual code instead of a constant. >> >> Is it possible to issue any status code or are we limited to those in >> ngx_http_lua_consts.c? >> > > You can use any status code. See > > ? ?http://wiki.nginx.org/HttpLuaModule#ngx.exit > > BTW, I've already added constant ngx.HTTP_METHOD_NOT_IMPLEMENTED to > ngx_lua v0.3.1rc12: > > ? ?https://github.com/chaoslawful/lua-nginx-module/tags Cheers! From agentzh at gmail.com Sun Oct 16 04:17:34 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 16 Oct 2011 12:17:34 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sat, Oct 15, 2011 at 4:41 AM, Nginx User wrote: > Everything seems to be working fine. However, a small configuration > error showed a potential problem in that the rewrite_by_lua directive > does not seem to take account of the rewrite module's "last" flag. > I've just fixed this issue in ngx_lua v0.3.1rc13. Now running "rewrite a b;" and "rewrite a b last;" will cause rewrite_by_lua and rewrite_by_lua_file (as well as others) to skip completely. But please note that, only location rematch (or location re-lookup) triggered by ngx_rewrite's "rewrite" directive (or anything else) will skip rewrite phase Lua code. It has nothing to do with rewrite directive's "last" modifier. So "rewrite a b break" will not skip rewrite-phase Lua handlers just because no location re-lookup will follow it. The location rematch (or re-lookup) behavior of the "rewrite" directive is kinda like internal redirection, but not the same. BTW, ngx_openresty 1.0.8.9 devel release already includes this version of ngx_lua :) Regards, -agentzh From agentzh at gmail.com Sun Oct 16 04:29:34 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 16 Oct 2011 12:29:34 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sat, Oct 15, 2011 at 10:20 PM, Nginx User wrote: > Makes sense to stick to one given that each is independent of the other. > Just so tempting/logical on the surface, when they all go into the > same location block for instance, to try to pick and choose elements > from each. > That's all what we dream about, but the reality of the nginx internals are sad in various ways and have been preventing us from doing a lot of fancy things without hacking or even patching :) > In my example, the flags from rewrite with the single line syntax is > nice, clear and familiar but it does not provide a native mechanism to > jump to another specific location (perhaps Igor would consider > allowing try_files to accept a single argument). > You can now do what the "rewrite" directive does in pure Lua since the latest ngx_lua v0.3.1rc13 release. Your previous example location @pretty_urls { rewrite ^/sometext/xyz\.html$ /abc.html last; rewrite_by_lua 'ngx.exec("@proxy");'; } can be rewritten as location @pretty_urls { rewrite_by_lua ' if ngx.var.uri == "/sometext/xyz.html" then return ngx.req.set_uri("/abc.html") end ngx.exec("@proxy"); '; } I think it's also clean and readable as compared to the "rewrite" directive, but much more flexible. See the documentation here for details: http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri > Anyway, learnt a bit more and I will like to say thank you very much > for the work put in to the various weird and wonderful modules you > have pushed out. > The modules open up a huge amount of options and really take Nginx to > another level. Glad you like it! And thank YOU for reporting all these issues during your adventure ;) Thanks! -agentzh From nginx-forum at nginx.us Sun Oct 16 05:00:58 2011 From: nginx-forum at nginx.us (dannynoonan) Date: Sun, 16 Oct 2011 01:00:58 -0400 Subject: drizzle-nginx-module error body missing? Message-ID: <2896e4a4658f144f7a4f6162d8398389.NginxMailingListEnglish@forum.nginx.org> Hey nginx list, it's been awhile. This question is directed at agentzh and chaoslawful. I'm using nginx drizzle to insert to a table. I have a unique key constraint on the table. When I try to insert and violate the unique constraint, I get a 500 from the nginx location doing the mysql query, but no response body or headers to pass on to my client indicating what the mysql error was. I can easily check for the 500 in the location calling the mysql location, but I'd like to pass on the error code to the actual client with some useful error information and not mask any further 500's. The json-ified output of a successful insert has an errcode field: {"errcode":0,"insert_id":1,"affected_rows":1} , but an actual error returns an empty body. Is there no way to grab the error relating to my failed insert? Any suggestions? Here's the error log: 2011/10/16 04:08:53 [error] 2847#0: *60 failed to send query: 17 (1062): Duplicate entry '2-200-6094279b20' for key 'id_versions' while sending query to drizzle upstream, client: 10.102.17.232, server: , request: "POST http://foo/v1/publish HTTP/1.1", subrequest: "/mysql", upstream: "drizzle://10.102.17.232:3306", host: "foo" Here's the location: location /mysql { internal; drizzle_pass mysqldb; drizzle_module_header off; set_unescape_uri $mysql_query $query_string; drizzle_query $mysql_query; rds_json on; } Here's the query I'm sending lua and proven via ngx.say(query) INSERT INTO published SET packages_id=(SELECT id FROM packages WHERE name='infra-package'), sha='6094279b2033a9dfa8bd38cadffeb9d274657936', version='200', path='678459e1ce'; location /addpackage { internal; content_by_lua " local query = local res = ngx.location.capture('/mysql', { args = query} ) ngx.say(res.status..query) ngx.say(res.status) } ngx_openresty/1.0.6.22 configure arguments: --prefix=/usr/local/encap/nginx-resty-1.0.6.22/nginx --add-module=../ngx_devel_kit-0.2.17 --add-module=../echo-nginx-module-0.37rc4 --add-module=../xss-nginx-module-0.03rc3 --add-module=../set-misc-nginx-module-0.22rc2 --add-module=../form-input-nginx-module-0.07rc5 --add-module=../encrypted-session-nginx-module-0.01 --add-module=../drizzle-nginx-module-0.1.1 --add-module=../ngx_lua-0.3.1rc8 --add-module=../headers-more-nginx-module-0.16rc2 --add-module=../srcache-nginx-module-0.12 --add-module=../array-var-nginx-module-0.03rc1 --add-module=../memc-nginx-module-0.12 --add-module=../redis2-nginx-module-0.07 --add-module=../upstream-keepalive-nginx-module-0.3 --add-module=../auth-request-nginx-module-0.2 --add-module=../rds-json-nginx-module-0.12rc5 --add-module=../rds-csv-nginx-module-0.03 --add-module=/foursquare/david/src/third-party/nginx-gridfs --add-module=/foursquare/david/src/third-party/nginx_upload_module-2.2.0 --with-http_ssl_module Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216768,216768#msg-216768 From agentzh at gmail.com Sun Oct 16 05:12:58 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 16 Oct 2011 13:12:58 +0800 Subject: drizzle-nginx-module error body missing? In-Reply-To: <2896e4a4658f144f7a4f6162d8398389.NginxMailingListEnglish@forum.nginx.org> References: <2896e4a4658f144f7a4f6162d8398389.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Sun, Oct 16, 2011 at 1:00 PM, dannynoonan wrote: > I'm using nginx drizzle to insert to a table. I have a unique key > constraint on the table. When I try to insert and violate the unique > constraint, I get a 500 from the nginx location doing the mysql query, > but no response body or headers to pass on to my client indicating what > the mysql error was. I can easily check for the 500 in the location > calling the mysql location, but I'd like to pass on the error code to > the actual client with some useful error information and not mask any > further 500's. > I'll add a new directive named drizzle_outptu_errors to control whether to return the underlying error code and error string in the RDS output in the next few days or so. Thank you for reminding me of this missing feature :) Thanks! -agentzh From nginx-forum at nginx.us Sun Oct 16 05:24:08 2011 From: nginx-forum at nginx.us (dannynoonan) Date: Sun, 16 Oct 2011 01:24:08 -0400 Subject: drizzle-nginx-module error body missing? In-Reply-To: References: Message-ID: <383027f90fc16912715ce71b89829f87.NginxMailingListEnglish@forum.nginx.org> awesome, thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216768,216770#msg-216770 From stef at caunter.ca Sun Oct 16 07:34:58 2011 From: stef at caunter.ca (Stefan Caunter) Date: Sun, 16 Oct 2011 03:34:58 -0400 Subject: 502 Bad Gateway when downloading file In-Reply-To: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> References: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Sat, Oct 15, 2011 at 7:51 PM, sogi wrote: > Hello all. > I have topology as follows: > client->NGINX->haproxy-> 4xapache servers. > > Problem is, that on one page, we have option to download file - it is > done through changing header. Resulting header is as follows: > Content-type: application/txt how do you change header, and can you please post complete headers from successful request[s] and from unsuccessful request? > > Content-Length: "xxxxx" > > > Content-Disposition: attachment; filename="aaa.txt" > > I'm getting 502 Bad Gateway, The server returned an invalid or > incomplete response error everytime after clicking on link. In logs, > there is nothing weird. please post any relevant log entries When trying it directly through HAPROXY or > directly through nginx (pointed to one of that apache servers) it is > working correctly. we need to see the headers > Do you have any idea about how to resolve it? Have anybody experienced > something like this? > Many thanks for any reply concerning this. Stefan Caunter From agentzh at gmail.com Sun Oct 16 11:11:05 2011 From: agentzh at gmail.com (agentzh) Date: Sun, 16 Oct 2011 19:11:05 +0800 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On Sun, Oct 16, 2011 at 12:29 PM, agentzh wrote: > You can now do what the "rewrite" directive does in pure Lua since the > latest ngx_lua v0.3.1rc13 release. > > Your previous example > > ? ?location @pretty_urls { > ? ? ? ? ? ? rewrite ^/sometext/xyz\.html$ /abc.html last; > ? ? ? ? ? ? rewrite_by_lua 'ngx.exec("@proxy");'; > ? ?} > > can be rewritten as > > ? ?location @pretty_urls { > ? ? ? ?rewrite_by_lua ' > ? ? ? ? ? ?if ngx.var.uri == "/sometext/xyz.html" then > ? ? ? ? ? ? ? ?return ngx.req.set_uri("/abc.html") > ? ? ? ? ? ?end > ? ? ? ? ? ?ngx.exec("@proxy"); > ? ? ? ?'; > ? ?} > Sorry, I've changed my mind and changed the ngx.req.set_uri() API a bit in ngx_lua v0.3.1rc14. Now it's required to trigger location jump explicitly and the above example should be rewritten as location @pretty_urls { rewrite_by_lua ' if ngx.var.uri == "/sometext/xyz.html" then -- the following function never returns -- when the second ("jump") arg is true ngx.req.set_uri("/abc.html", true) end ngx.exec("@proxy"); '; } > See the documentation here for details: > http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri > I've also updated the document accordingly. Sorry for the inconvenience but I'd preserve the right to change APIs that haven't been in any formal releases of my modules :) Thanks! -agentzh P.S. ngx_lua v0.3.1rc14 has already been included in ngx_openresty devel release 1.0.8.11: http://openresty.org/#Download From nginx-forum at nginx.us Sun Oct 16 11:24:34 2011 From: nginx-forum at nginx.us (sogi) Date: Sun, 16 Oct 2011 07:24:34 -0400 Subject: 502 Bad Gateway when downloading file In-Reply-To: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> References: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <547792e5f5243070f7e6675a16b10e98.NginxMailingListEnglish@forum.nginx.org> Hello. Many thanks for your reply. We are changing headers through PHP header() function. Header is dispatching correctly from HAPROXY. It is as follows: HTTP/1.1 200 OK Date: Fri, 14 Oct 2011 01:18:08 GMT Server: Apache/2.2.16 (Debian) X-Powered-By: PHP/5.2.10 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 77032; Content-Disposition: attachment; filename="aaaa.txt" Connection: close Content-Type: application/txt Logs from nginx debug: http://pastebin.com/UrMXgYyf (I have more - all from logging into system to 502, but there are so large actually :) ) Actually, I don't have any successful header... Let me know if you want something, I can debug/prepare it if you need more informations. Many thanks for all the help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216759,216774#msg-216774 From jmbennett at gmail.com Sun Oct 16 12:25:02 2011 From: jmbennett at gmail.com (Jon Bennett) Date: Sun, 16 Oct 2011 13:25:02 +0100 Subject: Proxy cache for php site In-Reply-To: <87lisl7ike.wl%appa@perusio.net> References: <87mxd17oag.wl%appa@perusio.net> <87lisl7ike.wl%appa@perusio.net> Message-ID: Hi Appa, > Try this: https://gist.github.com/1290446 I've implemented what you suggested, and although got no errors, it doesn't look like it's caching, no files appearing in the cache dir (which I've 777 just to be sure!) and not getting a high rps either. I'm tailing my nginx error log with nginx compiled with debug, and there's nothing in there about fcgi cache. Bit of a weird one, will investigate further. Thanks, Jon From mdounin at mdounin.ru Sun Oct 16 12:31:29 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 16 Oct 2011 16:31:29 +0400 Subject: 502 Bad Gateway when downloading file In-Reply-To: <547792e5f5243070f7e6675a16b10e98.NginxMailingListEnglish@forum.nginx.org> References: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> <547792e5f5243070f7e6675a16b10e98.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111016123129.GJ1137@mdounin.ru> Hello! On Sun, Oct 16, 2011 at 07:24:34AM -0400, sogi wrote: > Hello. > Many thanks for your reply. > We are changing headers through PHP header() function. > > Header is dispatching correctly from HAPROXY. It is as follows: > HTTP/1.1 200 OK > > > Date: Fri, 14 Oct 2011 01:18:08 GMT > > > Server: Apache/2.2.16 (Debian) > > > X-Powered-By: PHP/5.2.10 > > > Expires: Thu, 19 Nov 1981 08:52:00 GMT > > > Cache-Control: no-store, no-cache, must-revalidate, post-check=0, > pre-check=0 > > Pragma: no-cache > > > Content-Length: 77032; The ";" is incorrect and shouldn't be here. If it's indeed present in headers returned by your backend - there is no surprise haproxy rejects such responses (see below). > > > Content-Disposition: attachment; filename="aaaa.txt" > > > Connection: close > > > Content-Type: application/txt > > Logs from nginx debug: > http://pastebin.com/UrMXgYyf > (I have more - all from logging into system to 502, but there are so > large actually :) ) Debug log shows response from backend was already 502: 2011/10/13 21:47:05 [debug] 15881#0: *33 http proxy status 502 "502 Bad Gateway" That is, most likely it's haproxy who returned 502. See above for possible reason. Maxim Dounin From nginx-forum at nginx.us Sun Oct 16 14:15:18 2011 From: nginx-forum at nginx.us (sogi) Date: Sun, 16 Oct 2011 10:15:18 -0400 Subject: 502 Bad Gateway when downloading file In-Reply-To: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> References: <23f62b9612c89ee8676a50b3dc9422e2.NginxMailingListEnglish@forum.nginx.org> Message-ID: mmm you are the man :) Well, its confirmed now - it is working when I removed ; from header. I missed it before... Great - many thanks again - you made my day :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216759,216779#msg-216779 From nginx at nginxuser.net Sun Oct 16 15:43:22 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 16 Oct 2011 18:43:22 +0300 Subject: So is "rewrite_by_lua" also evil? In-Reply-To: References: Message-ID: On 16 October 2011 14:11, agentzh wrote: > Sorry, I've changed my mind and changed the ngx.req.set_uri() API a > bit in ngx_lua v0.3.1rc14. Now it's required to trigger location jump > explicitly and the above example should be rewritten as > > ? ?location @pretty_urls { > ? ? ? ?rewrite_by_lua ' > ? ? ? ? ? ?if ngx.var.uri == "/sometext/xyz.html" then > ? ? ? ? ? ? ? ?-- the following function never returns > ? ? ? ? ? ? ? ?-- when the second ("jump") arg is true > ? ? ? ? ? ? ? ?ngx.req.set_uri("/abc.html", true) > ? ? ? ? ? ?end > ? ? ? ? ? ?ngx.exec("@proxy"); > ? ? ? ?'; > ? ?} > >> See the documentation here for details: >> http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri >> > > I've also updated the document accordingly. Sorry for the > inconvenience but I'd preserve the right to change APIs that haven't > been in any formal releases of my modules :) No problem and to be expected ... which is why I normally don't install the rc versions and why I am still at 0.3.1rc11 which works just fine for me. I'll stay with 0.3.1rc11 and swing back to the formal release cycle down the line. I'll also keep the rewrite module as my default tool (A series of one line "rewrite a b last" calls is easier to deal with) and use rewrite_by_lua when I need more flexibility ... taking care as required. It is nice to have the option. Cheers. From yaniv at aknin.name Sun Oct 16 15:51:25 2011 From: yaniv at aknin.name (Yaniv Aknin) Date: Sun, 16 Oct 2011 17:51:25 +0200 Subject: add_header and error_page Message-ID: Hi, It seems to me add_header and error_page don't work together (error pages don't have headers added in the http scope). This (http://www.ruby-forum.com/topic/196700) old posting from 2009 also says so, and claims the only workaround is the non-standard headers-more module. Am I missing something? Any chance this oversight will be fixed in mainline nginx? Thanks, - Yaniv -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at nginxuser.net Sun Oct 16 20:11:44 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 16 Oct 2011 23:11:44 +0300 Subject: Strange rewrite_by_lua outcome Message-ID: This works produces a 403 Forbidden error as expected: #GET /submit_links/ if ($request_uri ~* \:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\)) ) { return 403; } This produces a 500 Internal server error instead: #GET /submit_links/ rewrite_by_lua ' local request_uri = ngx.re.match(ngx.var.request_uri, "\:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\))", "io") if request_uri then ngx.exit(ngx.HTTP_FORBIDDEN) end '; Line 62: "23388#0: *258 Failed to load Lua inlined code: [string "rewrite_by_lua"]:24: ')' expected near '|', client: xx.xxx.xx.xx, server: testsite.com, request: "GET /submit_links HTTP/1.1", host: "testsite.com"" http://pastebin.com/XYNwEciX From nginx-forum at nginx.us Sun Oct 16 20:33:41 2011 From: nginx-forum at nginx.us (codetr) Date: Sun, 16 Oct 2011 16:33:41 -0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: hey pls change topic subject nginx crash every night pls help me Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216416,216792#msg-216792 From mdounin at mdounin.ru Sun Oct 16 20:49:54 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 17 Oct 2011 00:49:54 +0400 Subject: upstream sent too many data while reading In-Reply-To: References: Message-ID: <20111016204954.GO1137@mdounin.ru> Hello! On Sun, Oct 16, 2011 at 04:33:41PM -0400, codetr wrote: > hey pls change topic subject nginx crash every night pls help me As you were already told, from the information you've provided it's clear that there is no nginx crash. Instead, something on your system kills it. It's mostly pointless to ask here for further help - it's up to you to investigate your system to find out problematic script. Maxim Dounin From jmbennett at gmail.com Sun Oct 16 23:01:57 2011 From: jmbennett at gmail.com (Jon Bennett) Date: Mon, 17 Oct 2011 00:01:57 +0100 Subject: Proxy cache for php site In-Reply-To: References: <87mxd17oag.wl%appa@perusio.net> <87lisl7ike.wl%appa@perusio.net> Message-ID: Hi Appa, got it sorted thanks, had cookies being written all the time and that was stopping it. Now in production, many thanks! Jon On 16 October 2011 13:25, Jon Bennett wrote: > Hi Appa, > >> Try this: https://gist.github.com/1290446 > > I've implemented what you suggested, and although got no errors, it > doesn't look like it's caching, no files appearing in the cache dir > (which I've 777 just to be sure!) and not getting a high rps either. > > I'm tailing my nginx error log with nginx compiled with debug, and > there's nothing in there about fcgi cache. > > Bit of a weird one, will investigate further. > > Thanks, > > Jon > -- jon bennett - www.jben.net - blog.jben.net From agentzh at gmail.com Mon Oct 17 00:55:54 2011 From: agentzh at gmail.com (agentzh) Date: Mon, 17 Oct 2011 08:55:54 +0800 Subject: Strange rewrite_by_lua outcome In-Reply-To: References: Message-ID: On Mon, Oct 17, 2011 at 4:11 AM, Nginx User wrote: > > This produces a 500 Internal server error instead: > #GET /submit_links/ > rewrite_by_lua ' > ? ? ? ?local request_uri = ngx.re.match(ngx.var.request_uri, > "\:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\))", > "io") I think you should escape "\" here according to nginx's string literal syntax (you do not need to escape "\" in your previous "if" example because Nginx uses special regex syntax in that regex context. You'll also have to escape the "\" according to Lua string escaping rules too. That is, escaping "\" *twice*. > > Line 62: "23388#0: *258 Failed to load Lua inlined code: [string > "rewrite_by_lua"]:24: ')' expected near '|', client: xx.xxx.xx.xx, > server: testsite.com, request: "GET /submit_links HTTP/1.1", host: > "testsite.com"" > http://pastebin.com/XYNwEciX > The error message indicates a Lua syntax error in your Lua source code. A quick solution to this is to put your code into a separate .lua file and use rewrite_by_lua_file instead such that you do not have to escape "\" twice (once for Nginx string escaping rules and another for Lua string escaping rules). Here's an example: # nginx.conf location /foo { rewrite_by_lua 'ngx.re.match("\\\\d+", ngx.var.uri)'; # we're using \d+ here but requires twice escaping } And to use external .lua file: # nginx.conf location /foo { rewrite_by_lua_file conf/my.lua; } # conf/my.lua ngx.re.match("\\d+", ngx.var.uri) We can see that in the first example, we need to escape "\" for Nginx string literals (so it becomes "\\") and then escape each of these two back-slashes again according for Lua string literals and thus got "\\\\" at last. But in the second example, we only need to esacpe "\" once according to Lua string literal syntax, which is a bit better looking :) This gotcha is documented in ngx_lua's wiki page here: http://wiki.nginx.org/HttpLuaModule#ngx.re.match Best, -agentzh From nginx-forum at nginx.us Mon Oct 17 02:01:55 2011 From: nginx-forum at nginx.us (suttles) Date: Sun, 16 Oct 2011 22:01:55 -0400 Subject: A Control Panel for Nginx? In-Reply-To: References: Message-ID: <1228a510a73402efe608243d94caded8.NginxMailingListEnglish@forum.nginx.org> Is there an update on this project? Thx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,124883,216800#msg-216800 From nginx-forum at nginx.us Mon Oct 17 04:18:25 2011 From: nginx-forum at nginx.us (mrkissinger) Date: Mon, 17 Oct 2011 00:18:25 -0400 Subject: nginx doesn't accept new connection In-Reply-To: References: Message-ID: Resolved. SYN flood. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216681,216803#msg-216803 From nginx-forum at nginx.us Mon Oct 17 04:27:19 2011 From: nginx-forum at nginx.us (artemg) Date: Mon, 17 Oct 2011 00:27:19 -0400 Subject: nginx with custom modules crashes in gzip crc32() Message-ID: I have nginx with my custom module, that rewrite content on some conditions. Without it everything works fine, but after enabling it, nginx start to crash approx. every 2 hours ( > 100 req./sec) coredump shows that it crahses in gzip module: Core was generated by `nginx: worker process '. Program terminated with signal 11, Segmentation fault. #0 0x000000343ea0286d in crc32 () from /usr/lib64/libz.so.1 (gdb) bt #0 0x000000343ea0286d in crc32 () from /usr/lib64/libz.so.1 #1 0x0000000000450f3f in ngx_http_gzip_filter_add_data (r=0x601f380, in=0x29ac280) at src/http/modules/ngx_http_gzip_filter_module.c:708 #2 ngx_http_gzip_body_filter (r=0x601f380, in=0x29ac280) at src/http/modules/ngx_http_gzip_filter_module.c:394 #3 0x0000000000451ac5 in ngx_http_postpone_filter (r=0x601f380, in=0x29ac280) at src/http/ngx_http_postpone_filter_module.c:82 #4 0x00000000004521b1 in ngx_http_ssi_body_filter (r=0x343ea0c9c0, in=0x7906442d) at src/http/modules/ngx_http_ssi_filter_module.c:392 #5 0x00000000004564b5 in ngx_http_charset_body_filter (r=0x343ea0c9c0, in=0x61c0ff8) at src/http/modules/ngx_http_charset_filter_module.c:552 #6 0x0000000000457a5c in ngx_http_sub_body_filter (r=0x343ea0c9c0, in=0x29ac280) at src/http/modules/ngx_http_sub_filter_module.c:188 #7 0x0000000000470e8f in ngx_http_af_filter (r=0x601f380, in=0x29ac280) at /usr/src/redhat/SOURCES/af-headers/ngx_af_headers_module.c:768 #8 0x00000000004793e6 in clweb_c_body_filter (r=0x601f380, in=0x29ac280) at /usr/src/redhat/SOURCES/content-parser-module/ngx_mod_content_parser.c:510 #9 0x0000000000479d28 in ngx_http_gunzip_body_filter (r=0x601f380, in=0x29ac280) at /usr/src/redhat/SOURCES/gunzip/ngx_http_gunzip_filter_module.c:323 #10 0x000000000047ca5d in ngx_subr_body_filter (r=0x601f380, in=0x1f5f830) at /usr/src/redhat/SOURCES/ngx_subr_module/ngx_subr_module.c:219 #11 0x000000000047d46d in ngx_subr_body_filter (r=0x601f380, in=0x1f5f830) at /usr/src/redhat/SOURCES/ngx_subr_all_module/ngx_subr_all_module.c:219 #12 0x000000000040ba99 in ngx_output_chain (ctx=0x5e958c0, in=0x61c0ff8) at src/core/ngx_output_chain.c:65 #13 0x000000000043bbf7 in ngx_http_copy_filter (r=0x601f380, in=0x1f5f830) at src/http/ngx_http_copy_filter_module.c:141 #14 0x000000000044bdd1 in ngx_http_range_body_filter (r=0x343ea0c9c0, in=0x61c0ff8) at src/http/modules/ngx_http_range_filter_module.c:551 #15 0x000000000042ed92 in ngx_http_output_filter (r=0x601f380, in=0x1f5f830) at src/http/ngx_http_core_module.c:1868 #16 0x00000000004463fa in ngx_http_upstream_process_non_buffered_request (r=0x601f380, do_write=) at src/http/ngx_http_upstream.c:2381 #17 0x00000000004468fc in ngx_http_upstream_process_non_buffered_upstream (r=0x601f380, u=0x6096858) at src/http/ngx_http_upstream.c:2352 #18 0x00000000004457f6 in ngx_http_upstream_handler (ev=0x148e568) at src/http/ngx_http_upstream.c:917 #19 0x00000000004269be in ngx_epoll_process_events (cycle=0x796480, timer=, flags=) at src/event/modules/ngx_epoll_module.c:635 #20 0x000000000041e3c8 in ngx_process_events_and_timers (cycle=0x796480) at src/event/ngx_event.c:245 #21 0x0000000000425203 in ngx_worker_process_cycle (cycle=0x796480, data=) at src/os/unix/ngx_process_cycle.c:800 #22 0x0000000000423967 in ngx_spawn_process (cycle=0x796480, proc=0x425118 , data=0x0, name=0x4d01ce "worker process", respawn=-3) at src/os/unix/ngx_process.c:196 #23 0x000000000042478c in ngx_start_worker_processes (cycle=0x796480, n=12, type=-3) at src/os/unix/ngx_process_cycle.c:360 #24 0x0000000000425964 in ngx_master_process_cycle (cycle=0x796480) at src/os/unix/ngx_process_cycle.c:136 #25 0x0000000000408dba in main (argc=22, argv=0x795060) at src/core/nginx.c:405 dmesg says: nginx[20500]: segfault at 61c1000 ip 000000343ea0286d sp 00007fff348eec78 error 4 in libz.so.1.2.3[343ea00000+14000] so libz is going to read smth at bad address. This is definetly not nginx bug, but it is not simple to debug nginx, so I will be happy for any advice, what can cause nginx to crash? May be its stack problems? Server info: Centos linux 5.6, amd64, nginx 1.0.6, zlib-devel-1.2.3-3 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216804,216804#msg-216804 From nginx at nginxuser.net Mon Oct 17 04:47:26 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 07:47:26 +0300 Subject: Strange rewrite_by_lua outcome In-Reply-To: References: Message-ID: On 17 October 2011 03:55, agentzh wrote: > On Mon, Oct 17, 2011 at 4:11 AM, Nginx User wrote: >> >> This produces a 500 Internal server error instead: >> #GET /submit_links/ >> rewrite_by_lua ' >> ? ? ? ?local request_uri = ngx.re.match(ngx.var.request_uri, >> "\:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\))", >> "io") > > I think you should escape "\" here according to nginx's string literal > syntax (you do not need to escape "\" in your previous "if" example > because Nginx uses special regex syntax in that regex context. You'll > also have to escape the "\" according to Lua string escaping rules > too. That is, escaping "\" *twice*. > >> >> Line 62: "23388#0: *258 Failed to load Lua inlined code: [string >> "rewrite_by_lua"]:24: ')' expected near '|', client: xx.xxx.xx.xx, >> server: testsite.com, request: "GET /submit_links HTTP/1.1", host: >> "testsite.com"" >> http://pastebin.com/XYNwEciX >> > > The error message indicates a Lua syntax error in your Lua source > code. A quick solution to this is to put your code into a separate > .lua file and use rewrite_by_lua_file instead such that you do not > have to escape "\" twice (once for Nginx string escaping rules and > another for Lua string escaping rules). > > Here's an example: > ? ?# nginx.conf > ? ?location /foo { > ? ? ? ?rewrite_by_lua 'ngx.re.match("\\\\d+", ngx.var.uri)'; ?# we're > using \d+ here but requires twice escaping > ? ?} > > And to use external .lua file: > > ? ?# nginx.conf > ? ?location /foo { > ? ? ? ?rewrite_by_lua_file conf/my.lua; > ? ?} > > ? ?# conf/my.lua > ? ?ngx.re.match("\\d+", ngx.var.uri) > > We can see that in the first example, we need to escape "\" for Nginx > string literals (so it becomes "\\") and then escape each of these two > back-slashes again according for Lua string literals and thus got > "\\\\" at last. > > But in the second example, we only need to esacpe "\" once according > to Lua string literal syntax, which is a bit better looking :) > > This gotcha is documented in ngx_lua's wiki page here: > > ? ?http://wiki.nginx.org/HttpLuaModule#ngx.re.match I'll use the rewrite module for this regex since it works as is and try to understand the issue later. Thanks. From nginx at nginxuser.net Mon Oct 17 04:50:34 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 07:50:34 +0300 Subject: Strange rewrite_by_lua outcome In-Reply-To: References: Message-ID: On 17 October 2011 07:47, Nginx User wrote: > On 17 October 2011 03:55, agentzh wrote: >> On Mon, Oct 17, 2011 at 4:11 AM, Nginx User wrote: >>> >>> This produces a 500 Internal server error instead: >>> #GET /submit_links/ >>> rewrite_by_lua ' >>> ? ? ? ?local request_uri = ngx.re.match(ngx.var.request_uri, >>> "\:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\))", >>> "io") >> >> I think you should escape "\" here according to nginx's string literal >> syntax (you do not need to escape "\" in your previous "if" example >> because Nginx uses special regex syntax in that regex context. You'll >> also have to escape the "\" according to Lua string escaping rules >> too. That is, escaping "\" *twice*. >> >>> >>> Line 62: "23388#0: *258 Failed to load Lua inlined code: [string >>> "rewrite_by_lua"]:24: ')' expected near '|', client: xx.xxx.xx.xx, >>> server: testsite.com, request: "GET /submit_links HTTP/1.1", host: >>> "testsite.com"" >>> http://pastebin.com/XYNwEciX >>> >> >> The error message indicates a Lua syntax error in your Lua source >> code. A quick solution to this is to put your code into a separate >> .lua file and use rewrite_by_lua_file instead such that you do not >> have to escape "\" twice (once for Nginx string escaping rules and >> another for Lua string escaping rules). >> >> Here's an example: >> ? ?# nginx.conf >> ? ?location /foo { >> ? ? ? ?rewrite_by_lua 'ngx.re.match("\\\\d+", ngx.var.uri)'; ?# we're >> using \d+ here but requires twice escaping >> ? ?} >> >> And to use external .lua file: >> >> ? ?# nginx.conf >> ? ?location /foo { >> ? ? ? ?rewrite_by_lua_file conf/my.lua; >> ? ?} >> >> ? ?# conf/my.lua >> ? ?ngx.re.match("\\d+", ngx.var.uri) >> >> We can see that in the first example, we need to escape "\" for Nginx >> string literals (so it becomes "\\") and then escape each of these two >> back-slashes again according for Lua string literals and thus got >> "\\\\" at last. >> >> But in the second example, we only need to esacpe "\" once according >> to Lua string literal syntax, which is a bit better looking :) >> >> This gotcha is documented in ngx_lua's wiki page here: >> >> ? ?http://wiki.nginx.org/HttpLuaModule#ngx.re.match > > I'll use the rewrite module for this regex since it works as is and > try to understand the issue later. > > Thanks. > BTW this works fine even though it has "\": local query_string = ngx.re.match(ngx.var.request_uri, "((php|sql)-?my-?admin/|my-?(php|sql)-?admin|(php|sql)-?manager)|(_vpi|xAou6|db_name|clientrequest|option_value|sys_cpanel|db_connect|doeditconfig|check_proxy|system_user|spaw2|prx2|thisdoesnotexist|proxyjudge1|ImpEvData|proxydeny|base64|crossdomain|localhost|wwwroot|mosconfig|scanner|proc/self/environ)|\.(outcontrol|rdf|XMLHTTP|cgi|asp|aspx|cfg|dll|exe|jsp|mdb|sql|ini|rar|inc|dll)|(/admin/sqlpatch\.php/password_forgotten\.php\?action=execute)|etc/passwd|/manager/html", "io") if query_string then ngx.exit(ngx.HTTP_FORBIDDEN) end Haven't read the gotcha link yet to understand the intricacies yet though. Cheers. From tim-nginx at bitgems.com Mon Oct 17 05:03:45 2011 From: tim-nginx at bitgems.com (Tim Mensch) Date: Sun, 16 Oct 2011 23:03:45 -0600 Subject: Strange rewrite_by_lua outcome In-Reply-To: References: Message-ID: <4E9BB731.8080106@bitgems.com> On 10/16/2011 10:50 PM, Nginx User wrote: > > BTW this works fine even though it has "\": > > local query_string = ngx.re.match(ngx.var.request_uri, > "((php|sql)-?my-?admin/|my-?(php|sql)-?admin|(php|sql)-?manager)|(_vpi|xAou6|db_name|clientrequest|option_value|sys_cpanel|db_connect|doeditconfig|check_proxy|system_user|spaw2|prx2|thisdoesnotexist|proxyjudge1|ImpEvData|proxydeny|base64|crossdomain|localhost|wwwroot|mosconfig|scanner|proc/self/environ)|\.(outcontrol|rdf|XMLHTTP|cgi|asp|aspx|cfg|dll|exe|jsp|mdb|sql|ini|rar|inc|dll)|(/admin/sqlpatch\.php/password_forgotten\.php\?action=execute)|etc/passwd|/manager/html","io") You're just doing "\." in that line. If Nginx strips that "\", then it ends up in Lua as ".", which changes the meaning but will happen to work in most cases (though it would match sqlpatch_php and other similar strings, and not just sqlpatch.php, since the "." will be the wildcard). Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewmbenton at gmail.com Mon Oct 17 05:51:48 2011 From: andrewmbenton at gmail.com (Andrew Benton) Date: Sun, 16 Oct 2011 22:51:48 -0700 Subject: multiple add_header directives in different contexts Message-ID: so i have a configuration like this: ... http { ... add_header X-Bleep bloop; server { ... add_header X-Foo bar; } server { ... } } and only "X-Bleep: bloop" is showing up in responses. is this expected behavior? is there any way to have multiple add_header directives in separate contexts work as i would expect? that is, every response includes "X-Bleep: bloop" but only requests matching the first server block should have "X-Foo: bar" as well? i know i could add the first add_header directive to every server block, but i have a lot of server blocks and this header may have to change so it would be a maintenance nightmare. thanks for your help! amb From agentzh at gmail.com Mon Oct 17 07:00:32 2011 From: agentzh at gmail.com (agentzh) Date: Mon, 17 Oct 2011 15:00:32 +0800 Subject: multiple add_header directives in different contexts In-Reply-To: References: Message-ID: On Mon, Oct 17, 2011 at 1:51 PM, Andrew Benton wrote: > so i have a configuration like this: > > ... > http { > ? ?... > ? ?add_header X-Bleep bloop; > ? ?server { > ? ? ? ?... > ? ? ? ?add_header X-Foo bar; > ? ?} > ? ?server { > ? ? ? ?... > ? ?} > } > > and only "X-Bleep: bloop" is showing up in responses. is this expected > behavior? Yes, this is the expected behavior of the standard ngx_headers module. Try the 3rd-party module ngx_headers_more instead: http://wiki.nginx.org/HttpHeadersMoreModule It supports incremental inheritance, here's a working example from its test suite: more_set_headers -s 404 -t 'text/html' 'X-status: yeah'; location /bad { default_type 'text/html'; more_set_headers -s 404 -t 'text/html' 'X-status2: nope'; return 404; } Then, request "GET /bad" will give the following response headers: X-status: yeah X-status2: nope which is what you want :) Regards, -agentzh From andrewmbenton at gmail.com Mon Oct 17 07:37:39 2011 From: andrewmbenton at gmail.com (Andrew Benton) Date: Mon, 17 Oct 2011 00:37:39 -0700 Subject: multiple add_header directives in different contexts Message-ID: I had found the headers more module but was trying to avoid a recompile. Looks like I will have to though. Thanks for the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Mon Oct 17 08:27:30 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 17 Oct 2011 12:27:30 +0400 Subject: nginx with custom modules crashes in gzip crc32() In-Reply-To: References: Message-ID: <20111017082730.GB75019@nginx.com> On Mon, Oct 17, 2011 at 12:27:19AM -0400, artemg wrote: > I have nginx with my custom module, that rewrite content on some > conditions. Without it everything works fine, but after enabling it, > nginx start to crash approx. every 2 hours ( > 100 req./sec) coredump > shows that it crahses in gzip module: > > Core was generated by `nginx: worker process '. > Program terminated with signal 11, Segmentation fault. > #0 0x000000343ea0286d in crc32 () from /usr/lib64/libz.so.1 > (gdb) bt > #0 0x000000343ea0286d in crc32 () from /usr/lib64/libz.so.1 > #1 0x0000000000450f3f in ngx_http_gzip_filter_add_data (r=0x601f380, > in=0x29ac280) at src/http/modules/ngx_http_gzip_filter_module.c:708 > #2 ngx_http_gzip_body_filter (r=0x601f380, in=0x29ac280) at > src/http/modules/ngx_http_gzip_filter_module.c:394 > #3 0x0000000000451ac5 in ngx_http_postpone_filter (r=0x601f380, > in=0x29ac280) at src/http/ngx_http_postpone_filter_module.c:82 > #4 0x00000000004521b1 in ngx_http_ssi_body_filter (r=0x343ea0c9c0, > in=0x7906442d) at src/http/modules/ngx_http_ssi_filter_module.c:392 > #5 0x00000000004564b5 in ngx_http_charset_body_filter (r=0x343ea0c9c0, > in=0x61c0ff8) at src/http/modules/ngx_http_charset_filter_module.c:552 > #6 0x0000000000457a5c in ngx_http_sub_body_filter (r=0x343ea0c9c0, > in=0x29ac280) at src/http/modules/ngx_http_sub_filter_module.c:188 > #7 0x0000000000470e8f in ngx_http_af_filter (r=0x601f380, in=0x29ac280) > at /usr/src/redhat/SOURCES/af-headers/ngx_af_headers_module.c:768 > #8 0x00000000004793e6 in clweb_c_body_filter (r=0x601f380, > in=0x29ac280) at > /usr/src/redhat/SOURCES/content-parser-module/ngx_mod_content_parser.c:510 > #9 0x0000000000479d28 in ngx_http_gunzip_body_filter (r=0x601f380, > in=0x29ac280) at > /usr/src/redhat/SOURCES/gunzip/ngx_http_gunzip_filter_module.c:323 > #10 0x000000000047ca5d in ngx_subr_body_filter (r=0x601f380, > in=0x1f5f830) at > /usr/src/redhat/SOURCES/ngx_subr_module/ngx_subr_module.c:219 > #11 0x000000000047d46d in ngx_subr_body_filter (r=0x601f380, > in=0x1f5f830) at > /usr/src/redhat/SOURCES/ngx_subr_all_module/ngx_subr_all_module.c:219 > #12 0x000000000040ba99 in ngx_output_chain (ctx=0x5e958c0, in=0x61c0ff8) > at src/core/ngx_output_chain.c:65 > #13 0x000000000043bbf7 in ngx_http_copy_filter (r=0x601f380, > in=0x1f5f830) at src/http/ngx_http_copy_filter_module.c:141 > #14 0x000000000044bdd1 in ngx_http_range_body_filter (r=0x343ea0c9c0, > in=0x61c0ff8) at src/http/modules/ngx_http_range_filter_module.c:551 > #15 0x000000000042ed92 in ngx_http_output_filter (r=0x601f380, > in=0x1f5f830) at src/http/ngx_http_core_module.c:1868 > #16 0x00000000004463fa in ngx_http_upstream_process_non_buffered_request > (r=0x601f380, do_write=) at > src/http/ngx_http_upstream.c:2381 > #17 0x00000000004468fc in > ngx_http_upstream_process_non_buffered_upstream (r=0x601f380, > u=0x6096858) at src/http/ngx_http_upstream.c:2352 > #18 0x00000000004457f6 in ngx_http_upstream_handler (ev=0x148e568) at > src/http/ngx_http_upstream.c:917 > #19 0x00000000004269be in ngx_epoll_process_events (cycle=0x796480, > timer=, flags=) at > src/event/modules/ngx_epoll_module.c:635 > #20 0x000000000041e3c8 in ngx_process_events_and_timers (cycle=0x796480) > at src/event/ngx_event.c:245 > #21 0x0000000000425203 in ngx_worker_process_cycle (cycle=0x796480, > data=) at src/os/unix/ngx_process_cycle.c:800 > #22 0x0000000000423967 in ngx_spawn_process (cycle=0x796480, > proc=0x425118 , data=0x0, name=0x4d01ce > "worker process", respawn=-3) at src/os/unix/ngx_process.c:196 > #23 0x000000000042478c in ngx_start_worker_processes (cycle=0x796480, > n=12, type=-3) at src/os/unix/ngx_process_cycle.c:360 > #24 0x0000000000425964 in ngx_master_process_cycle (cycle=0x796480) at > src/os/unix/ngx_process_cycle.c:136 > #25 0x0000000000408dba in main (argc=22, argv=0x795060) at > src/core/nginx.c:405 > > dmesg says: > nginx[20500]: segfault at 61c1000 ip 000000343ea0286d sp > 00007fff348eec78 error 4 in libz.so.1.2.3[343ea00000+14000] > > so libz is going to read smth at bad address. > This is definetly not nginx bug, but it is not simple to debug nginx, so > I will be happy for any advice, what can cause nginx to crash? May be > its stack problems? > > Server info: Centos linux 5.6, amd64, nginx 1.0.6, zlib-devel-1.2.3-3 It seems your module errorneously overrides memory area that corresponds to ctx->zstream.next_in or ctx->zstream.avail_in values: ctx->crc32 = crc32(ctx->crc32, ctx->zstream.next_in, ctx->zstream.avail_in); -- Igor Sysoev From nginx-forum at nginx.us Mon Oct 17 11:48:08 2011 From: nginx-forum at nginx.us (pricne5) Date: Mon, 17 Oct 2011 07:48:08 -0400 Subject: proxy to a .Net webservice In-Reply-To: References: Message-ID: <17c6052b43a6e2e8462d29be51875355.NginxMailingListEnglish@forum.nginx.org> Dear ??, I face the same problem as yours, please could you show me configurations which worked for you? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,84720,216823#msg-216823 From nginx-forum at nginx.us Mon Oct 17 12:25:00 2011 From: nginx-forum at nginx.us (vidan) Date: Mon, 17 Oct 2011 08:25:00 -0400 Subject: nginx for cs-cart In-Reply-To: References: Message-ID: <452702e5fdf6d240d45e8ea2964e3366.NginxMailingListEnglish@forum.nginx.org> Hello, please do open http://kb2.cs-cart.com/seo-not-work#1 [quote] DirectoryIndex index.html index.php RewriteEngine on # Some hostings require RewriteBase to be uncommented # Example: # Your store url is http://www.yourcompany.com/store/cscart # So "RewriteBase" should be: # RewriteBase /store/cscart RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php?sef_rewrite=1 [L,QSA] [/quote] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216707,216795#msg-216795 From agentzh at gmail.com Mon Oct 17 13:21:21 2011 From: agentzh at gmail.com (agentzh) Date: Mon, 17 Oct 2011 21:21:21 +0800 Subject: multiple add_header directives in different contexts In-Reply-To: References: Message-ID: On Mon, Oct 17, 2011 at 3:37 PM, Andrew Benton wrote: > I had found the headers more module but was trying to avoid a recompile. > Looks like I will have to though. Thanks for the help. > Heh, given that so many people hate recompiling nginx, dynamic module loading support is indeed a selling point for nginx 2.x :) Regards, -agentzh From igor at sysoev.ru Mon Oct 17 15:24:15 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 17 Oct 2011 19:24:15 +0400 Subject: nginx-1.1.6 Message-ID: <20111017152415.GC83067@nginx.com> Changes with nginx 1.1.6 17 Oct 2011 *) Change in internal API: now module context data are cleared while internal redirect to named location. Requested by Yichun Zhang. *) Change: if a server in an upstream failed, only one request will be sent to it after fail_timeout; the server will be considered alive if it will successfully respond to the request. *) Change: now the 0x7F-0x1F characters are escaped as \xXX in an access_log. *) Feature: "proxy/fastcgi/scgi/uwsgi_ignore_headers" directives support the following additional values: X-Accel-Limit-Rate, X-Accel-Buffering, X-Accel-Charset. *) Feature: decrease of memory consumption if SSL is used. *) Bugfix: some UTF-8 characters were processed incorrectly. Thanks to Alexey Kuts. *) Bugfix: the ngx_http_rewrite_module directives specified at "server" level were executed twice if no matching locations were defined. *) Bugfix: a socket leak might occurred if "aio sendfile" was used. *) Bugfix: connections with fast clients might be closed after send_timeout if file AIO was used. *) Bugfix: in the ngx_http_autoindex_module. *) Bugfix: the module ngx_http_mp4_module did not support seeking on 32-bit platforms. -- Igor Sysoev From nginx-forum at nginx.us Mon Oct 17 16:19:50 2011 From: nginx-forum at nginx.us (suttles) Date: Mon, 17 Oct 2011 12:19:50 -0400 Subject: =?UTF-8?Q?Re=3A_why_my_php_file_in_subdirectory_doesn=27t_work=EF=BC=9F?= In-Reply-To: References: Message-ID: <61b7f4ff35ccac81d4708939acb29750.NginxMailingListEnglish@forum.nginx.org> Update on my problem.... if the URL is typed this way http://www.domain.com/subdirectory it will not pull up the site, but when the URL is typed http://www.domain.com/subdirectory/ the site comes up immediately. How to do force nginx to put the trailing slash onto the subdomains? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215921,216831#msg-216831 From nginx at nginxuser.net Mon Oct 17 16:33:20 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 19:33:20 +0300 Subject: Strange rewrite_by_lua outcome In-Reply-To: <4E9BB731.8080106@bitgems.com> References: <4E9BB731.8080106@bitgems.com> Message-ID: On 17 October 2011 08:03, Tim Mensch wrote: > On 10/16/2011 10:50 PM, Nginx User wrote: >> >> BTW this works fine even though it has "\": >> >> local query_string = ngx.re.match(ngx.var.request_uri, >> >> "((php|sql)-?my-?admin/|my-?(php|sql)-?admin|(php|sql)-?manager)|(_vpi|xAou6|db_name|clientrequest|option_value|sys_cpanel|db_connect|doeditconfig|check_proxy|system_user|spaw2|prx2|thisdoesnotexist|proxyjudge1|ImpEvData|proxydeny|base64|crossdomain|localhost|wwwroot|mosconfig|scanner|proc/self/environ)|\.(outcontrol|rdf|XMLHTTP|cgi|asp|aspx|cfg|dll|exe|jsp|mdb|sql|ini|rar|inc|dll)|(/admin/sqlpatch\.php/password_forgotten\.php\?action=execute)|etc/passwd|/manager/html","io") > > You're just doing "\." in that line. If Nginx strips that "\", then it ends > up in Lua as ".", which changes the meaning but will happen to work in most > cases (though it would match sqlpatch_php and other similar strings, and not > just sqlpatch.php, since the "." will be the wildcard). > > Tim Let me get this right. Do I need to always escape the "\" inserted to escape "." in "\." in lua and then add another couple of "\"s? I.E., do I need to do "sqlpatch\\\\.php" to get "sqlpatch\.php" passed to the regex finally? IOW, do I basically replace each "\" with "\\\\"? If I understand agentzh, the rewrite module handles this behind the scenes and allows us to use familiar syntax. Is that right? Thanks From nginx at nginxuser.net Mon Oct 17 16:35:20 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 19:35:20 +0300 Subject: nginx-1.1.6 In-Reply-To: <20111017152415.GC83067@nginx.com> References: <20111017152415.GC83067@nginx.com> Message-ID: On 17 October 2011 18:24, Igor Sysoev wrote: > Changes with nginx 1.1.6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 17 Oct 2011 > > ? ?*) Change in internal API: now module context data are cleared while > ? ? ? internal redirect to named location. > ? ? ? Requested by Yichun Zhang. Thanks. Will this be implemented in the stable branch? From tim-nginx at bitgems.com Mon Oct 17 17:45:26 2011 From: tim-nginx at bitgems.com (Tim Mensch) Date: Mon, 17 Oct 2011 11:45:26 -0600 Subject: Strange rewrite_by_lua outcome In-Reply-To: References: <4E9BB731.8080106@bitgems.com> Message-ID: <4E9C69B6.2000707@bitgems.com> On 10/17/2011 10:33 AM, Nginx User wrote: > Let me get this right. Do I need to always escape the "\" inserted > to escape "." in "\." in lua and then add another couple of "\"s? > I.E., do I need to do "sqlpatch\\\\.php" to get "sqlpatch\.php" > passed to the regex finally? IOW, do I basically replace each "\" > with "\\\\"? Yes. > If I understand agentzh, the rewrite module handles this behind the > scenes and allows us to use familiar syntax. Is that right? The rewrite module apparently changes how the string is parsed in the Nginx file, yes. Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at nginxuser.net Mon Oct 17 17:54:44 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 20:54:44 +0300 Subject: Strange rewrite_by_lua outcome In-Reply-To: <4E9C69B6.2000707@bitgems.com> References: <4E9BB731.8080106@bitgems.com> <4E9C69B6.2000707@bitgems.com> Message-ID: On 17 October 2011 20:45, Tim Mensch wrote: > On 10/17/2011 10:33 AM, Nginx User wrote: >> Let me get this right. Do I need to always escape the "\" inserted >> to escape "." in "\." in lua and then add another couple of "\"s? >> I.E., do I need to do "sqlpatch\\\\.php" to get "sqlpatch\.php" >> passed to the regex finally? IOW, do I basically replace each "\" >> with "\\\\"? > > Yes. Thanks. I had done that anyway and got expected results. Not strictly changing "\" to "\\\\". It was "\\" to "\\\\\" & "\" to "\\\\" > >> If I understand agentzh, the rewrite module handles this behind the >> scenes and allows us to use familiar syntax. Is that right? > > The rewrite module apparently changes how the string is parsed in the Nginx > file, yes. Very thoughtful. Cheers. From nginx-forum at nginx.us Mon Oct 17 20:24:50 2011 From: nginx-forum at nginx.us (microchip) Date: Mon, 17 Oct 2011 16:24:50 -0400 Subject: Help on rewrite rule Message-ID: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> Hi, I'm fairly new when it comes to nginx and would like to basically rewrite the following: /main.php --> index.php Can someone please give me an example how to do this? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216843,216843#msg-216843 From nginx at nginxuser.net Mon Oct 17 20:35:27 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 23:35:27 +0300 Subject: Help on rewrite rule In-Reply-To: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> References: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 17 October 2011 23:24, microchip wrote: > Hi, > > I'm fairly new when it comes to nginx and would like to basically > rewrite the following: > > /main.php --> index.php > > Can someone please give me an example how to do this? Thanks rewrite ^/main\.php(.*) index.php$1; Hopefully we are not having a case of the XY Problem here as it looks like you may be using Gallery2 ... in which case you should be looking for Gallery2 rewrite rules. From nginx at nginxuser.net Mon Oct 17 20:36:18 2011 From: nginx at nginxuser.net (Nginx User) Date: Mon, 17 Oct 2011 23:36:18 +0300 Subject: Help on rewrite rule In-Reply-To: References: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 17 October 2011 23:35, Nginx User wrote: > rewrite ^/main\.php(.*) index.php$1; Sorry rewrite ^/main\.php(.*) /index.php$1; From latypoff at yandex.ru Mon Oct 17 20:48:26 2011 From: latypoff at yandex.ru (Denis F. Latypoff) Date: Tue, 18 Oct 2011 03:48:26 +0700 Subject: Help on rewrite rule In-Reply-To: References: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> Message-ID: <277751318884506@web79.yandex.ru> 18.10.2011, 03:36, "Nginx User" : > On 17 October 2011 23:35, Nginx User wrote: > >> ?rewrite ^/main\.php(.*) index.php$1; > > Sorry > rewrite ^/main\.php(.*) /index.php$1; > forget about rewrite with nginx: location = /main.php { fastcgi_pass ... fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME /path/to/index.php; } -- br, Denis F. Latypoff. From nginx-forum at nginx.us Mon Oct 17 20:49:18 2011 From: nginx-forum at nginx.us (microchip) Date: Mon, 17 Oct 2011 16:49:18 -0400 Subject: Help on rewrite rule In-Reply-To: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> References: <91911f60754227d17d2a5185eca2a785.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6d11b1571b921a83741168d7c0ef0ac1.NginxMailingListEnglish@forum.nginx.org> Thanks :) and no, I'm not using Gallary2 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216843,216849#msg-216849 From roberts at bluenile.com Tue Oct 18 01:40:35 2011 From: roberts at bluenile.com (Robert Suh) Date: Mon, 17 Oct 2011 18:40:35 -0700 Subject: Passing $geoip variables ( $geoip_city_country_code ) via proxy_set_header not working Message-ID: Hello, We've come across a problem with trying to pass $geoip_city_country_code (and all of the other $geoip_ variables) to an upstream via proxy_set_header. The geoip module is configured correctly and working. We use the exact same variable name for logging. The applicable configuration is: http { geoip_city /usr/local/share/GeoIP/GeoLiteCity.dat; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-GeoIP-Country-Code $geoip_city_country_code; include /etc/nginx/vhosts/*.vhost; } /etc/nginx/vhosts/test.vhost: server { listen 80; location / { proxy_pass http://127.0.0.1:9232; } } >From the localhost (127.0.0.1), I use 'nc' to listen to 9232 and from there I connect via a browser to nginx. Here's the output after I connect to nginx via a browser. $ nc -l 9232 GET / HTTP/1.0 Host: test X-Forwarded-For: 172.16.n.n Connection: close Cache-Control: max-age=0 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 If I set "proxy_set_header X-GeoIP-Country-Code True;", then the HTTP header shows up as expected. $ nc -l 9232 GET / HTTP/1.0 Host: test X-Forwarded-For: 172.16.n.n X-GeoIP-Country-Code: True Connection: close Cache-Control: max-age=0 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 This has been tested with 1.1.1 and 1.1.6 and it isn't working on either version. Here's the output to 'nginx -V' nginx: nginx version: nginx/1.1.1 nginx: built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42) nginx: TLS SNI support disabled nginx: configure arguments: --prefix=/var/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 --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-pcre --with-http_ssl_module --with-http_stub_status_module --with-http_geoip_module What is interesting is that this webpage details doing essentially the same thing and have it work. http://www.howtoforge.com/using-geoip-with-nginx-on-debian-squeeze-ubuntu-11.04 For us, the upstream is another webserver. Any ideas? Thanks, Rob From igor at sysoev.ru Tue Oct 18 05:48:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 18 Oct 2011 09:48:48 +0400 Subject: Passing $geoip variables ( $geoip_city_country_code ) via proxy_set_header not working In-Reply-To: References: Message-ID: <20111018054848.GA98847@nginx.com> On Mon, Oct 17, 2011 at 06:40:35PM -0700, Robert Suh wrote: > Hello, > > We've come across a problem with trying to pass $geoip_city_country_code (and all of the other $geoip_ variables) to an upstream via proxy_set_header. > > The geoip module is configured correctly and working. We use the exact same variable name for logging. > > The applicable configuration is: > > http { > geoip_city /usr/local/share/GeoIP/GeoLiteCity.dat; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header X-GeoIP-Country-Code $geoip_city_country_code; > > include /etc/nginx/vhosts/*.vhost; > } > > /etc/nginx/vhosts/test.vhost: > > server { > listen 80; > > location / { > proxy_pass http://127.0.0.1:9232; > } > } > > From the localhost (127.0.0.1), I use 'nc' to listen to 9232 and from there I connect via a browser to nginx. > > Here's the output after I connect to nginx via a browser. > > $ nc -l 9232 > GET / HTTP/1.0 > Host: test > X-Forwarded-For: 172.16.n.n > Connection: close > Cache-Control: max-age=0 > User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Encoding: gzip,deflate,sdch > Accept-Language: en-US,en;q=0.8 > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 > > If I set "proxy_set_header X-GeoIP-Country-Code True;", then the HTTP header shows up as expected. > > $ nc -l 9232 > GET / HTTP/1.0 > Host: test > X-Forwarded-For: 172.16.n.n > X-GeoIP-Country-Code: True > Connection: close > Cache-Control: max-age=0 > User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Encoding: gzip,deflate,sdch > Accept-Language: en-US,en;q=0.8 > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 > > This has been tested with 1.1.1 and 1.1.6 and it isn't working on either version. > > Here's the output to 'nginx -V' > > nginx: nginx version: nginx/1.1.1 > nginx: built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42) > nginx: TLS SNI support disabled > nginx: configure arguments: --prefix=/var/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 --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-pcre --with-http_ssl_module --with-http_stub_status_module --with-http_geoip_module > > What is interesting is that this webpage details doing essentially the same thing and have it work. > > http://www.howtoforge.com/using-geoip-with-nginx-on-debian-squeeze-ubuntu-11.04 > > For us, the upstream is another webserver. > > Any ideas? I believe, GeoIP returns empty string for 172.16.x networks, and nginx does tno pass header field with no value. -- Igor Sysoev From lists at ruby-forum.com Tue Oct 18 10:31:49 2011 From: lists at ruby-forum.com (Sandesh K.) Date: Tue, 18 Oct 2011 12:31:49 +0200 Subject: Nginx stuck processes Message-ID: Hi, We are using nginx version: 1.0.0 for pop-proxy. We have seen off-late certain processes remaining in state whereby nginx becomes non-responsive. Below is the dump of ps showing the stuck process of nginx ==> R --> 4150:24. i have shared the gdb dump and the backtrace of the stuck process. 38487 ? S 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /etc/nginx/conf/nginx.conf 7044 ? R 4150:24 \_ nginx: worker process 22408 ? S 0:03 /usr/local/apache3/sbin/httpd 22461 ? S 4:25 \_ /usr/local/apache3/sbin/httpd 27699 ? D 0:00 | \_ /home/httpd/dal/cgi-bin/dal/rmailajax.cgi 15853 ? S 0:06 \_ /usr/local/apache3/sbin/httpd 17290 ? S 0:05 \_ /usr/local/apache3/sbin/httpd 22796 ? S 0:04 /usr/sbin/httpd -DSSL 22801 ? S 0:29 \_ /usr/sbin/httpd -DSSL 20605 ? S 4:05 \_ /usr/sbin/httpd -DSSL 19391 ? S 2:33 \_ /usr/sbin/httpd -DSSL 60469 ? S 0:59 \_ /usr/sbin/httpd -DSSL 3437 ? S 0:35 \_ /usr/sbin/httpd -DSSL 11200 ? S 0:30 \_ /usr/sbin/httpd -DSSL 16597 ? S 0:19 \_ /usr/sbin/httpd -DSSL 19556 ? S 0:09 \_ /usr/sbin/httpd -DSSL 27218 ? S 0:00 \_ /usr/sbin/httpd -DSSL [root at xxx logs]# strace [root at xxx logs]# gdb GNU gdb Red Hat Linux (6.3.0.0-0.30.1rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu". (gdb) attach 7044 Attaching to process 7044 Reading symbols from /usr/local/nginx/sbin/nginx...done. Using host libthread_db library "/lib/tls/libthread_db.so.1". Reading symbols from /lib/libcrypto.so.4...done. Loaded symbols for /lib/libcrypto.so.4 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /usr/kerberos/lib/libgssapi_krb5.so.2...done. Loaded symbols for /usr/kerberos/lib/libgssapi_krb5.so.2 Reading symbols from /usr/kerberos/lib/libkrb5.so.3...done. Loaded symbols for /usr/kerberos/lib/libkrb5.so.3 Reading symbols from /usr/kerberos/lib/libcom_err.so.3...done. Loaded symbols for /usr/kerberos/lib/libcom_err.so.3 Reading symbols from /usr/kerberos/lib/libk5crypto.so.3...done. Loaded symbols for /usr/kerberos/lib/libk5crypto.so.3 Reading symbols from /lib/libresolv.so.2...done. Loaded symbols for /lib/libresolv.so.2 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /usr/lib/libz.so.1...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 0x001dbb74 in _int_malloc () from /lib/tls/libc.so.6 (gdb) backtrace #0 0x001dbb74 in _int_malloc () from /lib/tls/libc.so.6 #1 0x001dc89c in _int_memalign () from /lib/tls/libc.so.6 #2 0x001db2c7 in memalign () from /lib/tls/libc.so.6 #3 0x001dd367 in posix_memalign () from /lib/tls/libc.so.6 #4 0x0805d614 in ngx_memalign (alignment=16, size=2746520, log=0x108) at src/os/unix/ngx_alloc.c:56 #5 0x0804b603 in ngx_create_pool (size=256, log=0x93bd1a0) at src/core/ngx_palloc.c:20 #6 0x0805be26 in ngx_event_accept (ev=0x93df338) at src/event/ngx_event_accept.c:124 #7 0x0805b7f9 in ngx_event_process_posted (cycle=0x93bce28, posted=0x8070e3c) at src/event/ngx_event_posted.c:39 #8 0x0805a8e1 in ngx_process_events_and_timers (cycle=0x93bce28) at src/event/ngx_event.c:253 #9 0x0806051a in ngx_worker_process_cycle (cycle=0x93bce28, data=0x0) at src/os/unix/ngx_process_cycle.c:800 #10 0x0805eb3c in ngx_spawn_process (cycle=0x93bce28, proc=0x8060465 , data=0x0, name=0x806b971 "worker process", respawn=17) at src/os/unix/ngx_process.c:196 #11 0x0806023e in ngx_reap_children (cycle=0x93bce28) at src/os/unix/ngx_process_cycle.c:617 #12 0x0805f8e1 in ngx_master_process_cycle (cycle=0x93bce28) at src/os/unix/ngx_process_cycle.c:180 #13 0x08049fea in main (argc=3, argv=0x93bd5a4) at src/core/nginx.c:405 -- Posted via http://www.ruby-forum.com/. From igor at sysoev.ru Tue Oct 18 10:49:09 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 18 Oct 2011 14:49:09 +0400 Subject: Nginx stuck processes In-Reply-To: References: Message-ID: <20111018104909.GE2145@nginx.com> On Tue, Oct 18, 2011 at 12:31:49PM +0200, Sandesh K. wrote: > Hi, > > We are using nginx version: 1.0.0 for pop-proxy. We have seen off-late > certain processes remaining in state whereby nginx becomes > non-responsive. > > Below is the dump of ps showing the stuck process of nginx ==> R --> > 4150:24. > > i have shared the gdb dump and the backtrace of the stuck process. > > 38487 ? S 0:00 nginx: master process > /usr/local/nginx/sbin/nginx -c /etc/nginx/conf/nginx.conf > 7044 ? R 4150:24 \_ nginx: worker process > 22408 ? S 0:03 /usr/local/apache3/sbin/httpd > 22461 ? S 4:25 \_ /usr/local/apache3/sbin/httpd > 27699 ? D 0:00 | \_ > /home/httpd/dal/cgi-bin/dal/rmailajax.cgi > 15853 ? S 0:06 \_ /usr/local/apache3/sbin/httpd > 17290 ? S 0:05 \_ /usr/local/apache3/sbin/httpd > 22796 ? S 0:04 /usr/sbin/httpd -DSSL > 22801 ? S 0:29 \_ /usr/sbin/httpd -DSSL > 20605 ? S 4:05 \_ /usr/sbin/httpd -DSSL > 19391 ? S 2:33 \_ /usr/sbin/httpd -DSSL > 60469 ? S 0:59 \_ /usr/sbin/httpd -DSSL > 3437 ? S 0:35 \_ /usr/sbin/httpd -DSSL > 11200 ? S 0:30 \_ /usr/sbin/httpd -DSSL > 16597 ? S 0:19 \_ /usr/sbin/httpd -DSSL > 19556 ? S 0:09 \_ /usr/sbin/httpd -DSSL > 27218 ? S 0:00 \_ /usr/sbin/httpd -DSSL > > [root at xxx logs]# strace > [root at xxx logs]# gdb > GNU gdb Red Hat Linux (6.3.0.0-0.30.1rh) > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you > are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for > details. > This GDB was configured as "i386-redhat-linux-gnu". > (gdb) attach 7044 > Attaching to process 7044 > Reading symbols from /usr/local/nginx/sbin/nginx...done. > Using host libthread_db library "/lib/tls/libthread_db.so.1". > Reading symbols from /lib/libcrypto.so.4...done. > Loaded symbols for /lib/libcrypto.so.4 > Reading symbols from /lib/tls/libc.so.6...done. > Loaded symbols for /lib/tls/libc.so.6 > Reading symbols from /usr/kerberos/lib/libgssapi_krb5.so.2...done. > Loaded symbols for /usr/kerberos/lib/libgssapi_krb5.so.2 > Reading symbols from /usr/kerberos/lib/libkrb5.so.3...done. > Loaded symbols for /usr/kerberos/lib/libkrb5.so.3 > Reading symbols from /usr/kerberos/lib/libcom_err.so.3...done. > Loaded symbols for /usr/kerberos/lib/libcom_err.so.3 > Reading symbols from /usr/kerberos/lib/libk5crypto.so.3...done. > Loaded symbols for /usr/kerberos/lib/libk5crypto.so.3 > Reading symbols from /lib/libresolv.so.2...done. > Loaded symbols for /lib/libresolv.so.2 > Reading symbols from /lib/libdl.so.2...done. > Loaded symbols for /lib/libdl.so.2 > Reading symbols from /usr/lib/libz.so.1...done. > Loaded symbols for /usr/lib/libz.so.1 > Reading symbols from /lib/ld-linux.so.2...done. > Loaded symbols for /lib/ld-linux.so.2 > Reading symbols from /lib/libnss_files.so.2...done. > Loaded symbols for /lib/libnss_files.so.2 > 0x001dbb74 in _int_malloc () from /lib/tls/libc.so.6 > (gdb) backtrace > #0 0x001dbb74 in _int_malloc () from /lib/tls/libc.so.6 > #1 0x001dc89c in _int_memalign () from /lib/tls/libc.so.6 > #2 0x001db2c7 in memalign () from /lib/tls/libc.so.6 > #3 0x001dd367 in posix_memalign () from /lib/tls/libc.so.6 > #4 0x0805d614 in ngx_memalign (alignment=16, size=2746520, log=0x108) > at src/os/unix/ngx_alloc.c:56 > #5 0x0804b603 in ngx_create_pool (size=256, log=0x93bd1a0) at > src/core/ngx_palloc.c:20 > #6 0x0805be26 in ngx_event_accept (ev=0x93df338) at > src/event/ngx_event_accept.c:124 > #7 0x0805b7f9 in ngx_event_process_posted (cycle=0x93bce28, > posted=0x8070e3c) at src/event/ngx_event_posted.c:39 > #8 0x0805a8e1 in ngx_process_events_and_timers (cycle=0x93bce28) at > src/event/ngx_event.c:253 > #9 0x0806051a in ngx_worker_process_cycle (cycle=0x93bce28, data=0x0) > at src/os/unix/ngx_process_cycle.c:800 > #10 0x0805eb3c in ngx_spawn_process (cycle=0x93bce28, proc=0x8060465 > , data=0x0, name=0x806b971 "worker process", > respawn=17) > at src/os/unix/ngx_process.c:196 > #11 0x0806023e in ngx_reap_children (cycle=0x93bce28) at > src/os/unix/ngx_process_cycle.c:617 > #12 0x0805f8e1 in ngx_master_process_cycle (cycle=0x93bce28) at > src/os/unix/ngx_process_cycle.c:180 > #13 0x08049fea in main (argc=3, argv=0x93bd5a4) at src/core/nginx.c:405 It seems that malloc() loops inside. This may be bug in nginx or glibc. Could you show: nginx -V uname -osrvmpi -- Igor Sysoev From lists at ruby-forum.com Tue Oct 18 11:23:19 2011 From: lists at ruby-forum.com (Sandesh K.) Date: Tue, 18 Oct 2011 13:23:19 +0200 Subject: Nginx stuck processes In-Reply-To: References: Message-ID: [root at xxx root]# uname -osrvmpi Linux 2.4.21-32.ELsmp #1 SMP Wed May 18 17:49:28 EDT 2005 i686 i686 i386 GNU/Linux [root at xxx root]# /usr/local/nginx/sbin/nginx -V nginx: nginx version: nginx/1.0.0 nginx: built by gcc 3.2.3 20030502 (Red Hat Linux 3.2.3-52) nginx: configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/etc/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/logs/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/log/nginx/logs/nginx.lock --with-mail --without-http --without-mail_imap_module --without-mail_smtp_module - sandesh -- Posted via http://www.ruby-forum.com/. From roberts at bluenile.com Tue Oct 18 16:53:01 2011 From: roberts at bluenile.com (Robert Suh) Date: Tue, 18 Oct 2011 09:53:01 -0700 Subject: Passing $geoip variables ( $geoip_city_country_code ) via proxy_set_header not working In-Reply-To: <20111018054848.GA98847@nginx.com> References: <20111018054848.GA98847@nginx.com> Message-ID: Thank you Igor, a colleague was able to find a forum posting about the realip module. Using the realip module we were able to test the geoip variables passing via proxy_set_header. It works as expected now. Thanks again, Rob -----Original Message----- From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of Igor Sysoev Sent: Monday, October 17, 2011 10:49 PM To: nginx at nginx.org Subject: Re: Passing $geoip variables ( $geoip_city_country_code ) via proxy_set_header not working On Mon, Oct 17, 2011 at 06:40:35PM -0700, Robert Suh wrote: > Hello, > ... > > Any ideas? I believe, GeoIP returns empty string for 172.16.x networks, and nginx does tno pass header field with no value. -- Igor Sysoev _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From nginx at nginxuser.net Tue Oct 18 16:55:00 2011 From: nginx at nginxuser.net (Nginx User) Date: Tue, 18 Oct 2011 19:55:00 +0300 Subject: ngx_lua location capture issue Message-ID: I tried to create the following scenario: 1. Request test_page.php 2. lua exec to @checkpoint 3. @checkpoint does capture location to test_loc (future phpids) 4. test_loc/index.php returns either 200 or 403 status 5. @checkpoint continues or halts request accordingly # GET /test_page.php server { listen 80; server_name testsite.com; root /home/user/testsite.com/public_html; location @checkpoint { access_by_lua ' local res = ngx.location.capture("/test_loc") if res.status == ngx.HTTP_OK then return end if res.status == ngx.HTTP_FORBIDDEN then ngx.exit(res.status) end ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) '; } location @proxy { include /etc/nginx/firewall.default; # Block IPs in Spamhaus drop list if ($block = 1) { return 444; } proxy_pass http://127.0.0.1:8080; ... } location /error_docs { internal; alias /home/user/$host/error_docs; } location /test_loc { internal; alias /usr/share/test_loc/; rewrite_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @proxy; } location ~ .+\.php$ { location ~ ^/test_page\.php$ { rewrite_by_lua 'ngx.exec("@checkpoint");'; } rewrite_by_lua 'ngx.exec("@proxy");'; } } Result is "the http output chain is empty while connecting to upstream" blah blah blah and output is equivalent to issuing "return 444". http://pastebin.com/7WisVBDU Logs seem to show "GET /test_page.php" being run a second time. Any tips on fixing? Cheers From nginx at nginxuser.net Tue Oct 18 17:28:27 2011 From: nginx at nginxuser.net (Nginx User) Date: Tue, 18 Oct 2011 20:28:27 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 18 October 2011 19:55, Nginx User wrote: > I tried to create the following scenario: > > 1. Request test_page.php > 2. lua exec to @checkpoint > 3. @checkpoint does capture location to test_loc (future phpids) > 4. test_loc/index.php returns either 200 or 403 status > 5. @checkpoint continues or halts request accordingly > > # GET /test_page.php > server { > ? ? ? ?listen 80; > ? ? ? ?server_name testsite.com; > ? ? ? ?root /home/user/testsite.com/public_html; > ? ? ? ?location @checkpoint { > ? ? ? ?access_by_lua ' > ? ? ? ? ? ?local res = ngx.location.capture("/test_loc") > > ? ? ? ? ? ?if res.status == ngx.HTTP_OK then > ? ? ? ? ? ? ? ?return > ? ? ? ? ? ?end > > ? ? ? ? ? ?if res.status == ngx.HTTP_FORBIDDEN then > ? ? ? ? ? ? ? ?ngx.exit(res.status) > ? ? ? ? ? ?end > > ? ? ? ? ? ?ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) > ? ? ? ?'; > ? ?} > ? ? ? ?location @proxy { > ? ? ? ? ? ? ? ?include /etc/nginx/firewall.default; > > ? ? ? ? ? ? ? ?# Block IPs in Spamhaus drop list > ? ? ? ? ? ? ? ?if ($block = 1) { > ? ? ? ? ? ? ? ? ? ? ? ?return 444; > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?proxy_pass http://127.0.0.1:8080; > ? ? ? ? ? ? ? ?... > ? ? ? ?} > ? ? ? ?location /error_docs { > ? ? ? ? ? ? ? ?internal; > ? ? ? ? ? ? ? ?alias /home/user/$host/error_docs; > ? ? ? ?} > ? ? ? ?location /test_loc { > ? ? ? ? ? ? ? ?internal; > ? ? ? ? ? ? ? ?alias /usr/share/test_loc/; > ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? ? ?} > ? ? ? ?location / { > ? ? ? ? ? ? ? ?try_files $uri $uri/ @proxy; > ? ? ? ?} > ? ? ? ?location ~ .+\.php$ { > ? ? ? ? ? ? ? ?location ~ ^/test_page\.php$ { > ? ? ? ? ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@checkpoint");'; > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? ? ?} > } > > Result is "the http output chain is empty while connecting to > upstream" blah blah blah and output is equivalent to issuing "return > 444". http://pastebin.com/7WisVBDU > > Logs seem to show "GET /test_page.php" being run a second time. > > Any tips on fixing? > > Cheers > A more considered read of the docs shows I had been mixingsubrequests and internal redirections all over the place and that this works as expected # GET /test_page.php server { listen 80; server_name testsite.com; root /home/user/testsite.com/public_html; location @proxy { include /etc/nginx/firewall.default; # Block IPs in Spamhaus drop list if ($block = 1) { return 444; } proxy_pass http://127.0.0.1:8080; ... } location /error_docs { internal; alias /home/user/$host/error_docs; } location /test_loc { internal; alias /usr/share/test_loc/; rewrite_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @proxy; } location ~ .+\.php$ { location ~ ^/test_page\.php$ { access_by_lua ' local res = ngx.location.capture("/phpids") if res.status == ngx.HTTP_OK then ngx.exec("@proxy_no_cache") end if res.status == ngx.HTTP_FORBIDDEN then ngx.exit(res.status) end ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) '; } rewrite_by_lua 'ngx.exec("@proxy");'; } } No need for @checkpoint. Just put the access check directly in place. Cool beans! From nginx at nginxuser.net Tue Oct 18 17:29:17 2011 From: nginx at nginxuser.net (Nginx User) Date: Tue, 18 Oct 2011 20:29:17 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 18 October 2011 20:28, Nginx User wrote: > On 18 October 2011 19:55, Nginx User wrote: >> I tried to create the following scenario: >> >> 1. Request test_page.php >> 2. lua exec to @checkpoint >> 3. @checkpoint does capture location to test_loc (future phpids) >> 4. test_loc/index.php returns either 200 or 403 status >> 5. @checkpoint continues or halts request accordingly >> >> # GET /test_page.php >> server { >> ? ? ? ?listen 80; >> ? ? ? ?server_name testsite.com; >> ? ? ? ?root /home/user/testsite.com/public_html; >> ? ? ? ?location @checkpoint { >> ? ? ? ?access_by_lua ' >> ? ? ? ? ? ?local res = ngx.location.capture("/test_loc") >> >> ? ? ? ? ? ?if res.status == ngx.HTTP_OK then >> ? ? ? ? ? ? ? ?return >> ? ? ? ? ? ?end >> >> ? ? ? ? ? ?if res.status == ngx.HTTP_FORBIDDEN then >> ? ? ? ? ? ? ? ?ngx.exit(res.status) >> ? ? ? ? ? ?end >> >> ? ? ? ? ? ?ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) >> ? ? ? ?'; >> ? ?} >> ? ? ? ?location @proxy { >> ? ? ? ? ? ? ? ?include /etc/nginx/firewall.default; >> >> ? ? ? ? ? ? ? ?# Block IPs in Spamhaus drop list >> ? ? ? ? ? ? ? ?if ($block = 1) { >> ? ? ? ? ? ? ? ? ? ? ? ?return 444; >> ? ? ? ? ? ? ? ?} >> >> ? ? ? ? ? ? ? ?proxy_pass http://127.0.0.1:8080; >> ? ? ? ? ? ? ? ?... >> ? ? ? ?} >> ? ? ? ?location /error_docs { >> ? ? ? ? ? ? ? ?internal; >> ? ? ? ? ? ? ? ?alias /home/user/$host/error_docs; >> ? ? ? ?} >> ? ? ? ?location /test_loc { >> ? ? ? ? ? ? ? ?internal; >> ? ? ? ? ? ? ? ?alias /usr/share/test_loc/; >> ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; >> ? ? ? ?} >> ? ? ? ?location / { >> ? ? ? ? ? ? ? ?try_files $uri $uri/ @proxy; >> ? ? ? ?} >> ? ? ? ?location ~ .+\.php$ { >> ? ? ? ? ? ? ? ?location ~ ^/test_page\.php$ { >> ? ? ? ? ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@checkpoint");'; >> ? ? ? ? ? ? ? ?} >> >> ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; >> ? ? ? ?} >> } >> >> Result is "the http output chain is empty while connecting to >> upstream" blah blah blah and output is equivalent to issuing "return >> 444". http://pastebin.com/7WisVBDU >> >> Logs seem to show "GET /test_page.php" being run a second time. >> >> Any tips on fixing? >> >> Cheers >> > > > A more considered read of the docs shows I had been mixingsubrequests > and internal redirections all over the place and that this works as > expected > > > # GET /test_page.php > server { > ? ? ? ?listen 80; > ? ? ? ?server_name testsite.com; > ? ? ? ?root /home/user/testsite.com/public_html; > ? ? ? ?location @proxy { > ? ? ? ? ? ? ? ?include /etc/nginx/firewall.default; > > ? ? ? ? ? ? ? ?# Block IPs in Spamhaus drop list > ? ? ? ? ? ? ? ?if ($block = 1) { > ? ? ? ? ? ? ? ? ? ? ? ?return 444; > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?proxy_pass http://127.0.0.1:8080; > ? ? ? ? ? ? ? ?... > ? ? ? ?} > ? ? ? ?location /error_docs { > ? ? ? ? ? ? ? ?internal; > ? ? ? ? ? ? ? ?alias /home/user/$host/error_docs; > ? ? ? ?} > ? ? ? ?location /test_loc { > ? ? ? ? ? ? ? ?internal; > ? ? ? ? ? ? ? ?alias /usr/share/test_loc/; > ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? ? ?} > ? ? ? ?location / { > ? ? ? ? ? ? ? ?try_files $uri $uri/ @proxy; > ? ? ? ?} > ? ? ? ?location ~ .+\.php$ { > ? ? ? ? ? ? ? ?location ~ ^/test_page\.php$ { > ? ? ? ? ? ? ? ? ? ? ? ?access_by_lua ' > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?local res = ngx.location.capture("/phpids") > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if res.status == ngx.HTTP_OK then > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ngx.exec("@proxy_no_cache") > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if res.status == ngx.HTTP_FORBIDDEN then > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ngx.exit(res.status) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) > ? ? ? ? ? ? ? ? ? ? ? ?'; > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? ? ?} > } > > > No need for @checkpoint. Just put the access check directly in place. > > Cool beans! > "@proxy_no_cache" = "@proxy" From nginx at nginxuser.net Tue Oct 18 17:59:01 2011 From: nginx at nginxuser.net (Nginx User) Date: Tue, 18 Oct 2011 20:59:01 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: Jumped the gun there. There's a sting in the tail. # GET /test_page.php location ~ .+\.php$ { location ~ ^/test_page\.php$ { access_by_lua ' local res = ngx.location.capture("/phpids") if res.status == ngx.HTTP_OK then ngx.exec("@proxy") end if res.status == ngx.HTTP_FORBIDDEN then ngx.exit(res.status) end ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) '; } rewrite_by_lua 'ngx.exec("@proxy");'; } Will result in the rewrite by lua line being executed instead of the access by lua within the sub location. Changing the access by lua in the sub location to rewrite by lua executes the script. In any case, my original config is the preferred to get workingas I need the request params to be passed along the redirection chain. Better wait until agentzh wakes up in his timezone. From nginx-forum at nginx.us Wed Oct 19 00:20:23 2011 From: nginx-forum at nginx.us (artemg) Date: Tue, 18 Oct 2011 20:20:23 -0400 Subject: nginx with custom modules crashes in gzip crc32() In-Reply-To: <20111017082730.GB75019@nginx.com> References: <20111017082730.GB75019@nginx.com> Message-ID: Thanks for the answer, but its difficult to understand how can that happen. I even compare output of modified (by my module) response and unmodified - they are the same, with the only difference that data in chains is filled in another way. I.e. input data lengths are 100-200-100 bytes (.last - .pos) and after my content rewriting module they can be 0-0-400, or even 0-0-0 chain, and data can be added in next chain. I am doing buffering to match some patterns. In fact of this I see in error log: [alert] 31974#0: *98657 zero size buf in writer t:1 r:1 f:0 0000000001714FE0 0000000001F8D290-0000000001F8D290 0000000000000000 0-0 while sending to client Is that ok, to have zero size bufs, or I need to modify the chain, not to pass them forward to other modules? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216804,216883#msg-216883 From matthieu.tourne at gmail.com Wed Oct 19 01:32:53 2011 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Tue, 18 Oct 2011 18:32:53 -0700 Subject: Nginx crash - possibly keepalives In-Reply-To: <20111014194345.GE1137@mdounin.ru> References: <20111012122000.GK1137@mdounin.ru> <20111012172241.GU1137@mdounin.ru> <20111014194345.GE1137@mdounin.ru> Message-ID: So in order to try to reproduce the problem locally, I made this debug module : https://github.com/mtourne/ngx_massive_chunker This is meant to have 2 nginx chained one to the other. nginx#1 has proxy_pass to nginx#2 while using keepalives nginx#2 has mass_chunk on, which for this extreme test will chunk a 15M file into 10 bytes chunk (in different tcp packets or not). I wasn't able to reproduce the segfault, but when I'm using proxy_buffering off it works fine. But, when I'm using proxy_buffering and proxy_caching (with sendfile on, and directio 2M). It seems like readv() returns 0, but finalize_request returns NGX_AGAIN. I'm not sure that test is relevant, and what I'm really benching here. And if it might not be the tcp layer directly? But maybe the failure should be explicit. The behavior was the same with or without the patch. I've also tried various combination of proxy buffers, sendfile, directio. Any thoughts ? Thank you! Matthieu. On Fri, Oct 14, 2011 at 12:43 PM, Maxim Dounin wrote: > Hello! > > On Wed, Oct 12, 2011 at 09:22:41PM +0400, Maxim Dounin wrote: > > > Hello! > > > > On Wed, Oct 12, 2011 at 09:32:41AM -0700, Matthieu Tourne wrote: > > > > > On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin > wrote: > > > > > > > Hello! > > > > > > > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > > > > > > > Hi all, > > > > > > > > > > After turning on keepalives, we've been seeing one crash pretty > > > > > consistently. > > > > > We're running nginx 1.1.5 and here is the backtrace : > > [...] > > > Ok, it looks like I'm right and all buffers are in busy chain. > > Likely this happens due to upstream sending response in many small > > chunks. > > > > I'll try to reproduce it here and provide proper fix. > > Please try the attached patch. > > 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 agentzh at gmail.com Wed Oct 19 02:33:22 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 19 Oct 2011 10:33:22 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Wed, Oct 19, 2011 at 12:55 AM, Nginx User wrote: > ? ? ? ?location /test_loc { > ? ? ? ? ? ? ? ?internal; > ? ? ? ? ? ? ? ?alias /usr/share/test_loc/; > ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; Could you please try using content_by_lua here instead of rewrite_by_lua? I want to confirm that it is indeed a bug in rewrite_by_lua rather than content_by_lua :) > ? ? ? ?} > ? ? ? ?location / { > ? ? ? ? ? ? ? ?try_files $uri $uri/ @proxy; > ? ? ? ?} > ? ? ? ?location ~ .+\.php$ { > ? ? ? ? ? ? ? ?location ~ ^/test_page\.php$ { > ? ? ? ? ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@checkpoint");'; Same here :) > > Result is "the http output chain is empty while connecting to > upstream" blah blah blah and output is equivalent to issuing "return > 444". http://pastebin.com/7WisVBDU > Thanks for the debug log. It helped a lot :) > > Any tips on fixing? > Please try content_by_lua instead of rewrite_by_lua to call ngx.exec(). It can help me fix the issue here :) Thanks for the report! -agenzh From agentzh at gmail.com Wed Oct 19 02:40:01 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 19 Oct 2011 10:40:01 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Wed, Oct 19, 2011 at 1:59 AM, Nginx User wrote: > Jumped the gun there. There's a sting in the tail. > > # GET /test_page.php > ? ? ? location ~ .+\.php$ { > ? ? ? ? ? ? ? location ~ ^/test_page\.php$ { > ? ? ? ? ? ? ? ? ? ? ? access_by_lua ' > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? local res = ngx.location.capture("/phpids") > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if res.status == ngx.HTTP_OK then > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ngx.exec("@proxy") > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? end > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if res.status == ngx.HTTP_FORBIDDEN then > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ngx.exit(res.status) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? end > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) > ? ? ? ? ? ? ? ? ? ? ? '; > ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? rewrite_by_lua 'ngx.exec("@proxy");'; > ? ? ? } > > Will result in the rewrite by lua line being executed instead of the > access by lua within the sub location. ?Changing the access by lua in > the sub location to rewrite by lua executes the script. > The inner location (i.e., location "^/test_page\.php$") automatically inherits the rewrite_by_lua directive defined in the outer location (i.e., location ".+\.php$"). So your rewrite_by_lua code runs before your access_by_lua code in the inner location. And further, your rewrite_by_lua code does an internal redirection and thus your access_by_lua never has a chance to run. Apparently you do not want the inner location to inherit the outer rewrite_by_lua setting, so just add the following line to your inner location: rewrite_by_lua return; This will override the rewrite_by_lua directive in the outer scope. > In any case, my original config is the preferred to get workingas I > need the request params to be passed along the redirection chain. > See my last reply :) > Better wait until agentzh wakes up in his timezone. > 10:41 AM here already ;) Best, -agentzh From agentzh at gmail.com Wed Oct 19 02:49:21 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 19 Oct 2011 10:49:21 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Wed, Oct 19, 2011 at 1:28 AM, Nginx User wrote: > > A more considered read of the docs shows I had been mixingsubrequests > and internal redirections all over the place and that this works as > expected > Mixing subrequests and internal redirections should be fine for recent releases of ngx_lua. (I've found a way to survive my ngx_lua's context though an internal redirection! :D) Which part of the documentation is giving you this invalid implication? I'd fix the doc :) Thanks! -agentzh From agentzh at gmail.com Wed Oct 19 03:24:44 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 19 Oct 2011 11:24:44 +0800 Subject: nginx with custom modules crashes in gzip crc32() In-Reply-To: References: <20111017082730.GB75019@nginx.com> Message-ID: On Wed, Oct 19, 2011 at 8:20 AM, artemg wrote: > 0-0-400, or even 0-0-0 chain, and data can be added in next chain. I am > doing buffering to match some patterns. In fact of this I see in error > log: > > [alert] 31974#0: *98657 zero size buf in writer t:1 r:1 f:0 > 0000000001714FE0 0000000001F8D290-0000000001F8D290 0000000000000000 0-0 > while sending to client > > Is that ok, to have zero size bufs, or I need to modify the chain, not > to pass them forward to other modules? > Passing zero-size non-special bufs to the downstream output filters is surely BAD. You have to fix it :) Also, using tools like valgrind's memcheck to find memory issues in your modules is highly recommended and can often save you huge number of hours of debugging :) Regards, -agentzh From lists at ruby-forum.com Wed Oct 19 05:54:18 2011 From: lists at ruby-forum.com (Sandesh K.) Date: Wed, 19 Oct 2011 07:54:18 +0200 Subject: Nginx stuck processes In-Reply-To: References: Message-ID: <7efb85fdbf5ec94ab17531ab41499073@ruby-forum.com> Hello Igor, Do you have any update on this? -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Wed Oct 19 06:06:18 2011 From: nginx-forum at nginx.us (mikiso) Date: Wed, 19 Oct 2011 02:06:18 -0400 Subject: How to control access for specific IP-addresses of clients when using as mail proxy Message-ID: Hi, I am running nginx 1.0.8 for mail proxy , and I would like to add access control feature(by IP address) to this proxy. For HTTP, there is http access module for this purpose, however mail module doesn't seem to have this feature. Do someone know how to implement this feature? I found ngx_tcpwrapper on https://launchpad.net/ngx-tcpwrappers , but unfortunately this is also only for HTTP. Thanks and Regards, Soichiro Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216892,216892#msg-216892 From nginx-forum at nginx.us Wed Oct 19 08:19:41 2011 From: nginx-forum at nginx.us (artemg) Date: Wed, 19 Oct 2011 04:19:41 -0400 Subject: nginx with custom modules crashes in gzip crc32() In-Reply-To: References: Message-ID: <0d762ee856759c3127980b2be853da32.NginxMailingListEnglish@forum.nginx.org> agentzh, thanks for the answer, seems the problem is really with zero size bufs. I changed code to insert spaces, if buffer is empty and everything start to work with gzip disabled (before that nothing worked with gzip off), and I think there will be no crashes in gzip now if enabled. Now I will create my own chains to pass to downstream filters. I didn't try valgrind because usually it consumes a lot more cpu, and this is unacceptable on staging machine(there will be high cpu load, or I will need to decrease number of requests so I will wait for crash more time). But thanks for reminding about it. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216804,216893#msg-216893 From mdounin at mdounin.ru Wed Oct 19 09:24:01 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 19 Oct 2011 13:24:01 +0400 Subject: Nginx crash - possibly keepalives In-Reply-To: References: <20111012122000.GK1137@mdounin.ru> <20111012172241.GU1137@mdounin.ru> <20111014194345.GE1137@mdounin.ru> Message-ID: <20111019092400.GQ1911@mdounin.ru> Hello! On Tue, Oct 18, 2011 at 06:32:53PM -0700, Matthieu Tourne wrote: > So in order to try to reproduce the problem locally, I made this debug > module : > https://github.com/mtourne/ngx_massive_chunker > > This is meant to have 2 nginx chained one to the other. > nginx#1 has proxy_pass to nginx#2 while using keepalives > nginx#2 has mass_chunk on, which for this extreme test will chunk a 15M file > into 10 bytes chunk (in different tcp packets or not). > > I wasn't able to reproduce the segfault, but when I'm using > proxy_buffering off it works fine. To reproduce the segfault you have to: 1. Fill client socket buffers to make sure no buffers will be freed at (2), i.e. all buffers will become busy. This should be done carefully to avoid making some proxy buffers busy here, as this is likely to make (2) impossible. 2. Trigger "all buffers in the out chain" problem by sending multiple small chunks at once. Amount of data must be less than proxy_busy_buffers, but total input size (including chunked encoding overhead) must be big enough to consume all proxy_buffers (including first one, proxy_buffer_size). 3. Send some more data to actually trigger segfault due to all buffers being busy. I'm able to reproduce it here (using specially crafted backend server and specially crafted client), and I'm not really intrested in another artificial reproduction. > But, when I'm using proxy_buffering and proxy_caching (with sendfile on, and > directio 2M). > It seems like readv() returns 0, but finalize_request returns NGX_AGAIN. ENOPARSE The ngx_http_finalize_request() is void, it doesn't return anything. You may want to provide debug log to make it clear what are you talking about. Maxim Dounin > I'm not sure that test is relevant, and what I'm really benching here. And > if it might not be the tcp layer directly? > But maybe the failure should be explicit. > > The behavior was the same with or without the patch. I've also tried various > combination of proxy buffers, sendfile, directio. > > Any thoughts ? > > Thank you! > Matthieu. > > On Fri, Oct 14, 2011 at 12:43 PM, Maxim Dounin wrote: > > > Hello! > > > > On Wed, Oct 12, 2011 at 09:22:41PM +0400, Maxim Dounin wrote: > > > > > Hello! > > > > > > On Wed, Oct 12, 2011 at 09:32:41AM -0700, Matthieu Tourne wrote: > > > > > > > On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin > > wrote: > > > > > > > > > Hello! > > > > > > > > > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > > > > > > > > > Hi all, > > > > > > > > > > > > After turning on keepalives, we've been seeing one crash pretty > > > > > > consistently. > > > > > > We're running nginx 1.1.5 and here is the backtrace : > > > > [...] > > > > > Ok, it looks like I'm right and all buffers are in busy chain. > > > Likely this happens due to upstream sending response in many small > > > chunks. > > > > > > I'll try to reproduce it here and provide proper fix. > > > > Please try the attached patch. > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > From agentzh at gmail.com Wed Oct 19 09:24:35 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 19 Oct 2011 17:24:35 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Wed, Oct 19, 2011 at 10:33 AM, agentzh wrote: > On Wed, Oct 19, 2011 at 12:55 AM, Nginx User wrote: >> ? ? ? ?location /test_loc { >> ? ? ? ? ? ? ? ?internal; >> ? ? ? ? ? ? ? ?alias /usr/share/test_loc/; >> ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; > > Could you please try using content_by_lua here instead of > rewrite_by_lua? I want to confirm that it is indeed a bug in > rewrite_by_lua rather than content_by_lua :) > I think I've already fixed this issue in the ngx_lua v0.3.1rc17 release: https://github.com/chaoslawful/lua-nginx-module/tags There was a bug in ngx.exec()'s handling when being used within rewrite_by_lua* and access_by_lua* directives, which could cause hanging in certain extreme conditions. Could you please try it out on your side? Thanks for the report! -agentzh P.S. This new version of ngx_lua has also been included in the latest ngx_openresty 1.0.8.15 devel release here: http://openresty.org/#Download From nbubingo at gmail.com Wed Oct 19 09:41:58 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Wed, 19 Oct 2011 17:41:58 +0800 Subject: How to control access for specific IP-addresses of clients when using as mail proxy In-Reply-To: References: Message-ID: I have added this feature in my nginx_tcp_proxy_module. You can do it as a reference: https://github.com/yaoweibin/nginx_tcp_proxy_module/commit/fcacae8236444261d5e9301c144e085b706d5f32#diff-5 2011/10/19 mikiso > Hi, > > I am running nginx 1.0.8 for mail proxy , and I would like to add access > control feature(by IP address) to this proxy. > For HTTP, there is http access module for this purpose, however mail > module doesn't seem to have this feature. > Do someone know how to implement this feature? > > I found ngx_tcpwrapper on https://launchpad.net/ngx-tcpwrappers , > but unfortunately this is also only for HTTP. > > > > Thanks and Regards, > Soichiro > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,216892,216892#msg-216892 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kworthington at gmail.com Wed Oct 19 09:56:41 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Wed, 19 Oct 2011 05:56:41 -0400 Subject: nginx-1.1.6 In-Reply-To: <20111017152415.GC83067@nginx.com> References: <20111017152415.GC83067@nginx.com> Message-ID: Hello Nginx Users, I just released Nginx 1.1.6 For Windows http://goo.gl/GysFd (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. http://www.kevinworthington.com/ On Mon, Oct 17, 2011 at 11:24 AM, Igor Sysoev wrote: > Changes with nginx 1.1.6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 17 Oct 2011 > > ? ?*) Change in internal API: now module context data are cleared while > ? ? ? internal redirect to named location. > ? ? ? Requested by Yichun Zhang. > > ? ?*) Change: if a server in an upstream failed, only one request will be > ? ? ? sent to it after fail_timeout; the server will be considered alive if > ? ? ? it will successfully respond to the request. > > ? ?*) Change: now the 0x7F-0x1F characters are escaped as \xXX in an > ? ? ? access_log. > > ? ?*) Feature: "proxy/fastcgi/scgi/uwsgi_ignore_headers" directives support > ? ? ? the following additional values: X-Accel-Limit-Rate, > ? ? ? X-Accel-Buffering, X-Accel-Charset. > > ? ?*) Feature: decrease of memory consumption if SSL is used. > > ? ?*) Bugfix: some UTF-8 characters were processed incorrectly. > ? ? ? Thanks to Alexey Kuts. > > ? ?*) Bugfix: the ngx_http_rewrite_module directives specified at "server" > ? ? ? level were executed twice if no matching locations were defined. > > ? ?*) Bugfix: a socket leak might occurred if "aio sendfile" was used. > > ? ?*) Bugfix: connections with fast clients might be closed after > ? ? ? send_timeout if file AIO was used. > > ? ?*) Bugfix: in the ngx_http_autoindex_module. > > ? ?*) Bugfix: the module ngx_http_mp4_module did not support seeking on > ? ? ? 32-bit platforms. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From lists at ruby-forum.com Wed Oct 19 15:36:22 2011 From: lists at ruby-forum.com (Igor Clark) Date: Wed, 19 Oct 2011 17:36:22 +0200 Subject: gzip "stream" content? Message-ID: <810d238c97340d080bbe637975b3b7b1@ruby-forum.com> Hi there, Is it possible to apply gzip encoding to output from an upstream? How about one which is sending a stream of data? Or does it only work on static or fixed-size objects? Thanks, Igor -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Wed Oct 19 15:49:35 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 19 Oct 2011 19:49:35 +0400 Subject: gzip "stream" content? In-Reply-To: <810d238c97340d080bbe637975b3b7b1@ruby-forum.com> References: <810d238c97340d080bbe637975b3b7b1@ruby-forum.com> Message-ID: <20111019154935.GB1911@mdounin.ru> Hello! On Wed, Oct 19, 2011 at 05:36:22PM +0200, Igor Clark wrote: > Hi there, > > Is it possible to apply gzip encoding to output from an upstream? How > about one which is sending a stream of data? Or does it only work on Yes. Yes. > static or fixed-size objects? No. Maxim Dounin From noagbodjivictor at gmail.com Wed Oct 19 15:53:06 2011 From: noagbodjivictor at gmail.com (victor) Date: Wed, 19 Oct 2011 11:53:06 -0400 Subject: Having trouble understand how rewrite works Message-ID: Here's a small sample that is not working: server { # /index.cfm?PageID=1 --> / location ^~ /index\.cfm\?PageID=1$ { rewrite ^ / permanent; } location / { try_files $uri @django; } location @django { 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; include uwsgi_params; if (!-f $request_filename) { uwsgi_pass staging; break; } } } It seems like the first directive is ignored when I request /index.cfm?PageID=1. The idea is to redirect some old links. Thanks -- Victor Noagbodji http://www.victorsreviews.com From simone.fumagalli at contactlab.com Wed Oct 19 16:07:37 2011 From: simone.fumagalli at contactlab.com (Simone Fumagalli) Date: Wed, 19 Oct 2011 18:07:37 +0200 Subject: Regex do not match Message-ID: <4E9EF5C9.20206@contactlab.com> Hello, can someone please help me and tell me why this regex location ~ /(.*)/wp\-content(/.*) { [..] } does not match this URL http://www.mysite.com/mydir/wp-content/my_image/foo.jpg ? I just have this other directive in the server section location / { [..] } Thanks -- Simone From latypoff at yandex.ru Wed Oct 19 16:27:33 2011 From: latypoff at yandex.ru (Denis F. Latypoff) Date: Wed, 19 Oct 2011 23:27:33 +0700 Subject: Having trouble understand how rewrite works In-Reply-To: References: Message-ID: <358531319041653@web115.yandex.ru> 19.10.2011, 22:53, "victor" : > Here's a small sample that is not working: > > server { > ????????# /index.cfm?PageID=1 ?--> / - ????????location ^~ /index\.cfm\?PageID=1$ { - ????????????????rewrite ^ / permanent; + ????????location = /index.cfm { + if ($arg_PageID = 1) { + return 301 /; + } + ????????????????try_files $uri @django; > ????????} > > ????????location / { > ????????????????try_files $uri @django; > ????????} > > ????????location @django { > ????????????????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; > > ????????????????include uwsgi_params; + # 'if' is useless here - ????????????????if (!-f $request_filename) { > ????????????????????uwsgi_pass staging; - ????????????????????break; - ????????????????} > ????????} > } > > It seems like the first directive is ignored when I request > /index.cfm?PageID=1. The idea is to redirect some old links. > > Thanks > > -- > Victor Noagbodji > http://www.victorsreviews.com > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- br, Denis F. Latypoff. From noagbodjivictor at gmail.com Wed Oct 19 16:32:57 2011 From: noagbodjivictor at gmail.com (victor) Date: Wed, 19 Oct 2011 12:32:57 -0400 Subject: Having trouble understand how rewrite works In-Reply-To: <358531319041653@web115.yandex.ru> References: <358531319041653@web115.yandex.ru> Message-ID: Hi Dennis, Thanks for your help, If I understand correctly, I need to use $arg_PARAMS. But in the full source, I have expressions like this one: /index\.cfm\?PageID=(2|46)&(.*)$ how do I deal with them in that case, if I can't use regex on the query parameters? Thanks 2011/10/19 Denis F. Latypoff : > 19.10.2011, 22:53, "victor" : >> Here's a small sample that is not working: >> >> server { >> ????????# /index.cfm?PageID=1 ?--> / > - ????????location ^~ /index\.cfm\?PageID=1$ { > - ????????????????rewrite ^ / permanent; > + ????????location = /index.cfm { > + ? ? ? ? ? ? ? ? if ($arg_PageID = 1) { > + ? ? ? ? ? ? ? ? ? ? ? ? return 301 /; > + ? ? ? ? ? ? ? ? } > + ????????????????try_files $uri @django; >> ????????} >> >> ????????location / { >> ????????????????try_files $uri @django; >> ????????} >> >> ????????location @django { >> ????????????????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; >> >> ????????????????include uwsgi_params; > + ? ? ? ? ? ? ? ? # 'if' is useless here > - ????????????????if (!-f $request_filename) { >> ????????????????????uwsgi_pass staging; > - ????????????????????break; > - ????????????????} >> ????????} >> } >> >> It seems like the first directive is ignored when I request >> /index.cfm?PageID=1. The idea is to redirect some old links. >> >> Thanks >> >> -- >> Victor Noagbodji >> http://www.victorsreviews.com >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > -- > br, Denis F. Latypoff. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Victor Noagbodji http://www.victorsreviews.com From latypoff at yandex.ru Wed Oct 19 16:37:25 2011 From: latypoff at yandex.ru (Denis F. Latypoff) Date: Wed, 19 Oct 2011 23:37:25 +0700 Subject: Having trouble understand how rewrite works In-Reply-To: References: <358531319041653@web115.yandex.ru> Message-ID: <364741319042245@web112.yandex.ru> 19.10.2011, 23:32, "victor" : > Hi Dennis, > > Thanks for your help, > > If I understand correctly, I need to use $arg_PARAMS. But in the full > source, I have expressions like this one: > > /index\.cfm\?PageID=(2|46)&(.*)$ map $arg_PageID $is_old { default 0; 2 1; 46 1; } server { location = /index.cfm { if ($is_old) { return 301 /; } # regular rules } } > > how do I deal with them in that case, if I can't use regex on the > query parameters? > > Thanks > > 2011/10/19 Denis F. Latypoff : > >> ?19.10.2011, 22:53, "victor" : >>> ?Here's a small sample that is not working: >>> >>> ?server { >>> ?????????# /index.cfm?PageID=1 ?--> / >> ?- ????????location ^~ /index\.cfm\?PageID=1$ { >> ?- ????????????????rewrite ^ / permanent; >> ?+ ????????location = /index.cfm { >> ?+ ? ? ? ? ? ? ? ? if ($arg_PageID = 1) { >> ?+ ? ? ? ? ? ? ? ? ? ? ? ? return 301 /; >> ?+ ? ? ? ? ? ? ? ? } >> ?+ ????????????????try_files $uri @django; >>> ?????????} >>> >>> ?????????location / { >>> ?????????????????try_files $uri @django; >>> ?????????} >>> >>> ?????????location @django { >>> ?????????????????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; >>> >>> ?????????????????include uwsgi_params; >> ?+ ? ? ? ? ? ? ? ? # 'if' is useless here >> ?- ????????????????if (!-f $request_filename) { >>> ?????????????????????uwsgi_pass staging; >> ?- ????????????????????break; >> ?- ????????????????} >>> ?????????} >>> ?} >>> >>> ?It seems like the first directive is ignored when I request >>> ?/index.cfm?PageID=1. The idea is to redirect some old links. >>> >>> ?Thanks >>> >>> ?-- >>> ?Victor Noagbodji >>> ?http://www.victorsreviews.com >>> >>> ?_______________________________________________ >>> ?nginx mailing list >>> ?nginx at nginx.org >>> ?http://mailman.nginx.org/mailman/listinfo/nginx >> ?-- >> ?br, Denis F. Latypoff. >> >> ?_______________________________________________ >> ?nginx mailing list >> ?nginx at nginx.org >> ?http://mailman.nginx.org/mailman/listinfo/nginx > -- > Victor Noagbodji > http://www.victorsreviews.com > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- br, Denis F. Latypoff. From nginx-forum at nginx.us Wed Oct 19 16:39:23 2011 From: nginx-forum at nginx.us (locojohn) Date: Wed, 19 Oct 2011 12:39:23 -0400 Subject: Having trouble understand how rewrite works In-Reply-To: References: Message-ID: <419433073ed38af866b06c28479991ec.NginxMailingListEnglish@forum.nginx.org> Hi! Arguments cannot be checked with location directive. Put the below code into your main server {} block, for example, before declaring any of the locations: if ($request_uri ~ ^/index\.php\?PageID=1$) { rewrite ^ /? permanent; } Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216917,216922#msg-216922 From nginx-forum at nginx.us Wed Oct 19 16:40:04 2011 From: nginx-forum at nginx.us (locojohn) Date: Wed, 19 Oct 2011 12:40:04 -0400 Subject: Having trouble understand how rewrite works In-Reply-To: <419433073ed38af866b06c28479991ec.NginxMailingListEnglish@forum.nginx.org> References: <419433073ed38af866b06c28479991ec.NginxMailingListEnglish@forum.nginx.org> Message-ID: <80a72057fd73c6d2d98a3597e429a171.NginxMailingListEnglish@forum.nginx.org> Sorry, index\.cfm, of course, not index\.php. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216917,216923#msg-216923 From nginx at nginxuser.net Wed Oct 19 16:45:35 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 19 Oct 2011 19:45:35 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 19 October 2011 05:49, agentzh wrote: > On Wed, Oct 19, 2011 at 1:28 AM, Nginx User wrote: >> >> A more considered read of the docs shows I had been mixingsubrequests >> and internal redirections all over the place and that this works as >> expected >> > > Mixing subrequests and internal redirections should be fine for recent > releases of ngx_lua. (I've found a way to survive my ngx_lua's context > though an internal redirection! :D) > > Which part of the documentation is giving you this invalid > implication? I'd fix the doc :) Hi. I didn't mean to imply that the docs said there was anything wrong with this just that it identified that some items were internal redirection and others were subrequests. I started wondering, all by myself, whether there was an implication ... with post requests for instance. From noagbodjivictor at gmail.com Wed Oct 19 16:51:07 2011 From: noagbodjivictor at gmail.com (victor) Date: Wed, 19 Oct 2011 12:51:07 -0400 Subject: Having trouble understand how rewrite works In-Reply-To: <80a72057fd73c6d2d98a3597e429a171.NginxMailingListEnglish@forum.nginx.org> References: <419433073ed38af866b06c28479991ec.NginxMailingListEnglish@forum.nginx.org> <80a72057fd73c6d2d98a3597e429a171.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks again. I understand the map solution. Here's another issue, you see, the links below all map to the index page (there are other pages too, that have those PageID, ParentPageID, etc.. parameters). /index.cfm?PageID=1 /index.cfm?resetCache=yes /index.cfm?PageID=1&ParentPageID=1&NavID=1 /index.cfm?PageID=22&ParentPageID=1&NavID=22 /index.cfm?PageID=14&ParentPageID=38&NavID=38&ReferringPage=1 all map to / (index) /index.cfm?PageID=35&ParentPageID=26&NavID=26 /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=8&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=9&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=10&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=15&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=16&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=11&PageText=off and these for example would map to another unique page. The parameters specify the actual page that must be mapped to. And since I now know I can't use regex on query parameters, is there a way to handle this situation? Thanks On Wed, Oct 19, 2011 at 12:40 PM, locojohn wrote: > Sorry, index\.cfm, of course, not index\.php. > > Andrejs > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216917,216923#msg-216923 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Victor Noagbodji http://www.victorsreviews.com From noagbodjivictor at gmail.com Wed Oct 19 16:51:29 2011 From: noagbodjivictor at gmail.com (victor) Date: Wed, 19 Oct 2011 12:51:29 -0400 Subject: Having trouble understand how rewrite works In-Reply-To: <80a72057fd73c6d2d98a3597e429a171.NginxMailingListEnglish@forum.nginx.org> References: <419433073ed38af866b06c28479991ec.NginxMailingListEnglish@forum.nginx.org> <80a72057fd73c6d2d98a3597e429a171.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks, Please see reply to Denis. On Wed, Oct 19, 2011 at 12:40 PM, locojohn wrote: > Sorry, index\.cfm, of course, not index\.php. > > Andrejs > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216917,216923#msg-216923 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Victor Noagbodji http://www.victorsreviews.com From noagbodjivictor at gmail.com Wed Oct 19 17:08:03 2011 From: noagbodjivictor at gmail.com (victor) Date: Wed, 19 Oct 2011 13:08:03 -0400 Subject: Having trouble understand how rewrite works In-Reply-To: <364741319042245@web112.yandex.ru> References: <358531319041653@web115.yandex.ru> <364741319042245@web112.yandex.ru> Message-ID: Ah sorry, this one was meant for you Denis, not sure how gmail handled it. --- Thanks again. I understand the map solution. Here's another issue, you see, the links below all map to the index page (there are other pages too, that have those PageID, ParentPageID, etc.. parameters). /index.cfm?PageID=1 /index.cfm?resetCache=yes /index.cfm?PageID=1&ParentPageID=1&NavID=1 /index.cfm?PageID=22&ParentPageID=1&NavID=22 /index.cfm?PageID=14&ParentPageID=38&NavID=38&ReferringPage=1 all map to / (index) /index.cfm?PageID=35&ParentPageID=26&NavID=26 /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=8&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=9&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=10&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=15&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=16&PageText=off /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=11&PageText=off and these for example would map to another unique page. The parameters specify the actual page that must be mapped to. And since I now know I can't use regex on query parameters, is there a way to handle this situation? 2011/10/19 Denis F. Latypoff : > 19.10.2011, 23:32, "victor" : >> Hi Dennis, >> >> Thanks for your help, >> >> If I understand correctly, I need to use $arg_PARAMS. But in the full >> source, I have expressions like this one: >> >> /index\.cfm\?PageID=(2|46)&(.*)$ > > map $arg_PageID $is_old { > ? ?default ? ?0; > ? ?2 ? ? ? ? ? ?1; > ? ?46 ? ? ? ? ?1; > } > > server { > ? ?location = /index.cfm { > ? ? ? ?if ($is_old) { > ? ? ? ? ? ?return 301 /; > ? ? ? ?} > ? ? ? ?# regular rules > ? ?} > } > >> >> how do I deal with them in that case, if I can't use regex on the >> query parameters? >> >> Thanks >> >> 2011/10/19 Denis F. Latypoff : >> >>> ?19.10.2011, 22:53, "victor" : >>>> ?Here's a small sample that is not working: >>>> >>>> ?server { >>>> ?????????# /index.cfm?PageID=1 ?--> / >>> ?- ????????location ^~ /index\.cfm\?PageID=1$ { >>> ?- ????????????????rewrite ^ / permanent; >>> ?+ ????????location = /index.cfm { >>> ?+ ? ? ? ? ? ? ? ? if ($arg_PageID = 1) { >>> ?+ ? ? ? ? ? ? ? ? ? ? ? ? return 301 /; >>> ?+ ? ? ? ? ? ? ? ? } >>> ?+ ????????????????try_files $uri @django; >>>> ?????????} >>>> >>>> ?????????location / { >>>> ?????????????????try_files $uri @django; >>>> ?????????} >>>> >>>> ?????????location @django { >>>> ?????????????????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; >>>> >>>> ?????????????????include uwsgi_params; >>> ?+ ? ? ? ? ? ? ? ? # 'if' is useless here >>> ?- ????????????????if (!-f $request_filename) { >>>> ?????????????????????uwsgi_pass staging; >>> ?- ????????????????????break; >>> ?- ????????????????} >>>> ?????????} >>>> ?} >>>> >>>> ?It seems like the first directive is ignored when I request >>>> ?/index.cfm?PageID=1. The idea is to redirect some old links. >>>> >>>> ?Thanks >>>> >>>> ?-- >>>> ?Victor Noagbodji >>>> ?http://www.victorsreviews.com >>>> >>>> ?_______________________________________________ >>>> ?nginx mailing list >>>> ?nginx at nginx.org >>>> ?http://mailman.nginx.org/mailman/listinfo/nginx >>> ?-- >>> ?br, Denis F. Latypoff. >>> >>> ?_______________________________________________ >>> ?nginx mailing list >>> ?nginx at nginx.org >>> ?http://mailman.nginx.org/mailman/listinfo/nginx >> -- >> Victor Noagbodji >> http://www.victorsreviews.com >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > -- > br, Denis F. Latypoff. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Victor Noagbodji http://www.victorsreviews.com From matthieu.tourne at gmail.com Wed Oct 19 17:49:26 2011 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Wed, 19 Oct 2011 10:49:26 -0700 Subject: Nginx crash - possibly keepalives In-Reply-To: <20111019092400.GQ1911@mdounin.ru> References: <20111012122000.GK1137@mdounin.ru> <20111012172241.GU1137@mdounin.ru> <20111014194345.GE1137@mdounin.ru> <20111019092400.GQ1911@mdounin.ru> Message-ID: On Wed, Oct 19, 2011 at 2:24 AM, Maxim Dounin wrote: > Hello! > > On Tue, Oct 18, 2011 at 06:32:53PM -0700, Matthieu Tourne wrote: > > > So in order to try to reproduce the problem locally, I made this debug > > module : > > https://github.com/mtourne/ngx_massive_chunker > > > > This is meant to have 2 nginx chained one to the other. > > nginx#1 has proxy_pass to nginx#2 while using keepalives > > nginx#2 has mass_chunk on, which for this extreme test will chunk a 15M > file > > into 10 bytes chunk (in different tcp packets or not). > > > > I wasn't able to reproduce the segfault, but when I'm using > > proxy_buffering off it works fine. > > To reproduce the segfault you have to: > > 1. Fill client socket buffers to make sure no buffers will be > freed at (2), i.e. all buffers will become busy. This should be > done carefully to avoid making some proxy buffers busy here, as > this is likely to make (2) impossible. > > 2. Trigger "all buffers in the out chain" problem by sending multiple > small chunks at once. Amount of data must be less than > proxy_busy_buffers, but total input size (including chunked encoding > overhead) must be big enough to consume all proxy_buffers > (including first one, proxy_buffer_size). > > 3. Send some more data to actually trigger segfault due to all > buffers being busy. > > I'm able to reproduce it here (using specially crafted backend > server and specially crafted client), and I'm not really intrested > in another artificial reproduction. > > > But, when I'm using proxy_buffering and proxy_caching (with sendfile on, > and > > directio 2M). > > It seems like readv() returns 0, but finalize_request returns NGX_AGAIN. > > ENOPARSE > > The ngx_http_finalize_request() is void, it doesn't return anything. > > You may want to provide debug log to make it clear what are you > talking about. > I'm not exactly sure what part of it is relevant, so instead of posting pages of log I provided steps to reproduce a configuration where nginx shows an erratic behavior, by not outputing the entire response while doing a proxy_pass. I'll be experimenting more, and I'll let you know if I find the origin of this issue. M. > > Maxim Dounin > > > I'm not sure that test is relevant, and what I'm really benching here. > And > > if it might not be the tcp layer directly? > > But maybe the failure should be explicit. > > > > The behavior was the same with or without the patch. I've also tried > various > > combination of proxy buffers, sendfile, directio. > > > > Any thoughts ? > > > > Thank you! > > Matthieu. > > > > On Fri, Oct 14, 2011 at 12:43 PM, Maxim Dounin > wrote: > > > > > Hello! > > > > > > On Wed, Oct 12, 2011 at 09:22:41PM +0400, Maxim Dounin wrote: > > > > > > > Hello! > > > > > > > > On Wed, Oct 12, 2011 at 09:32:41AM -0700, Matthieu Tourne wrote: > > > > > > > > > On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin > > > wrote: > > > > > > > > > > > Hello! > > > > > > > > > > > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > After turning on keepalives, we've been seeing one crash pretty > > > > > > > consistently. > > > > > > > We're running nginx 1.1.5 and here is the backtrace : > > > > > > [...] > > > > > > > Ok, it looks like I'm right and all buffers are in busy chain. > > > > Likely this happens due to upstream sending response in many small > > > > chunks. > > > > > > > > I'll try to reproduce it here and provide proper fix. > > > > > > Please try the attached patch. > > > > > > 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 at nginxuser.net Wed Oct 19 18:10:49 2011 From: nginx at nginxuser.net (Nginx User) Date: Wed, 19 Oct 2011 21:10:49 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 19 October 2011 12:24, agentzh wrote: > On Wed, Oct 19, 2011 at 10:33 AM, agentzh wrote: >> On Wed, Oct 19, 2011 at 12:55 AM, Nginx User wrote: >>> ? ? ? ?location /test_loc { >>> ? ? ? ? ? ? ? ?internal; >>> ? ? ? ? ? ? ? ?alias /usr/share/test_loc/; >>> ? ? ? ? ? ? ? ?rewrite_by_lua 'ngx.exec("@proxy");'; >> >> Could you please try using content_by_lua here instead of >> rewrite_by_lua? I want to confirm that it is indeed a bug in >> rewrite_by_lua rather than content_by_lua :) >> > > I think I've already fixed this issue in the ngx_lua v0.3.1rc17 release: > > ? ?https://github.com/chaoslawful/lua-nginx-module/tags > > There was a bug in ngx.exec()'s handling when being used within > rewrite_by_lua* and access_by_lua* directives, which could cause > hanging in certain extreme conditions. > > Could you please try it out on your side? I'll have a go in due course. I have dumped the config originally posted. Will look into reconfiguring along those lines later. In the meantime, can you help out with my fallback? I have a set of about 70 regexes that are run using access_by_lua_file after finding out that access_by_lua has a string length limit (undefined). I have applied the escaping sequences and they generally work but these ones generate errors: -- 42 -- original "(?:"\s*or\s*"?\d)|(?:\\x(?:23|27|3d))|(?:^.?"$)|(?:(?:^["\\]*(?:[\d"]+|[^"]+"))+\s*(?:n?and|x?or|not|\|\||\&\&)\s*[\w"[+&!@(),.-])|(?:[^\w\s]\w+\s*[|-]\s*"\s*\w)|(?:@\w+\s+(and|or)\s*["\d]+)|(?:@[\w-]+\s(and|or)\s*[^\w\s])|(?:[^\w\s:]\s*\d\W+[^\w\s]\s*".)|(?:\Winformation_schema|table_name\W)" local query_string = ngx.re.match(ngx.var.request_uri,"(?:"\\\s*or\\\s*"?\\\d)|(?:\\\\\\x(?:23|27|3d))|(?:^.?"$)|(?:(?:^["\\\\\\]*(?:[\\\d"]+|[^"]+"))+\\\s*(?:n?and|x?or|not|\\\|\\\||\\\&\\\&)\\\s*[\\\w"[+&!@(),.-])|(?:[^\\\w\\\s]\\\w+\\\s*[|-]\\\s*"\\\s*\\\w)|(?:@\\\w+\\\s+(and|or)\\\s*["\\\d]+)|(?:@[\\\w-]+\\\s(and|or)\\\s*[^\\\w\\\s])|(?:[^\\\w\\\s:]\\\s*\\\d\\\W+[^\\\w\\\s]\\\s*".)|(?:\\\Winformation_schema|table_name\\\W)", "io") -- 45 -- original "(?:union\s*(?:all|distinct|[(!@]*)?\s*[([]*\s*select)|(?:\w+\s+like\s+\")|(?:like\s*"\%)|(?:"\s*like\W*["\d])|(?:"\s*(?:n?and|x?or|not |\|\||\&\&)\s+[\s\w]+=\s*\w+\s*having)|(?:"\s*\*\s*\w+\W+")|(?:"\s*[^?\w\s=.,;)(]+\s*[(@"]*\s*\w+\W+\w)|(?:select\s*[\[\]()\s\w\.,"-]+from)|(?:find_in_set\s*\()" local query_string = ngx.re.match(ngx.var.request_uri, "(?:union\\\s*(?:all|distinct|[(!@]*)?\\\s*[([]*\\\s*select)|(?:\\\w+\\\s+like\\\s+\\\")|(?:like\\\s*"\\\%)|(?:"\\\s*like\\\W*["\\\d])|(?:"\\\s*(?:n?and|x?or|not |\\\|\\\||\\\&\\\&)\\\s+[\\\s\\\w]+=\\\s*\\\w+\\\s*having)|(?:"\\\s*\\\*\\\s*\\\w+\\\W+")|(?:"\\\s*[^?\\\w\\\s=.,;)(]+\\\s*[(@"]*\\\s*\\\w+\\\W+\\\w)|(?:select\\\s*[\\\[\\\]()\\\s\\\w\\\.,"-]+from)|(?:find_in_set\\\s*\\\()", "io") Thanks From nginx-forum at nginx.us Wed Oct 19 18:39:40 2011 From: nginx-forum at nginx.us (gus) Date: Wed, 19 Oct 2011 14:39:40 -0400 Subject: CentOS 5 - NGiNX - AIO In-Reply-To: References: <20091111122317.GI33359@rambler-co.ru> <04e2fb35db4a1d432197c88983166144.NginxMailingListEnglish@forum.nginx.org> <746e6ad77df78d3e9502a8b0392c2450.NginxMailingListEnglish@forum.nginx.org> Message-ID: <15fc80a32dd51a8e9c835e6caaba6ec6.NginxMailingListEnglish@forum.nginx.org> ? ???? ??????? ??? ? ?????????: location / { root /var/www/html; index index.html index.htm index.php; location ~ \.mp4$ { mp4; ??? ?????????? ? --with-http_mp4_module ????? ?? ????????????? ???? ?? ??????????? ?? ?????, ? ???? ?????????? ???????? ??????, ???????? ?? 30 ??? ????? ??????, ?????????? ?????, ?? ??? ?????. ?????????? ????? ??????? ? --add-module=/gus/nginx_mod_h264_streaming-2.2.7. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,22085,216931#msg-216931 From nginx-forum at nginx.us Wed Oct 19 20:10:06 2011 From: nginx-forum at nginx.us (seanhess) Date: Wed, 19 Oct 2011 16:10:06 -0400 Subject: Poor load balancer performance on rackspace and centos Message-ID: <63d3f54f22d9532c18dc9479dbae65fc.NginxMailingListEnglish@forum.nginx.org> I am load testing different options for load balancing, and am getting poor results from Nginx, haproxy, and varnish. I have one 4GB instance at Rackspace, hitting 4x1GB app servers. I'm hitting a url called "/slow" which deliberately waits 500ms before responding. If I hit an application server directly it can handle a connection rate of 1600-1800 per second. If I hit the Nginx load balancer, it can only handle about 2000 connections. I was hoping for something closer to 4x1600 = 6000. Below is the command I'm using to test it. This is run in parallel on 40 256 MB instances. I'm deliberately setting num_call to 1, because I want to see connection performance. Any higher than this and I start to get a lot of errors. httperf --server 50.56.80.227 --port 1555 --uri /slow --rate 50 --num-call 1 --num-conn 100 --timeout 5 Here is my nginx config: https://gist.github.com/1299501 So, here's the weird thing, no matter whether I use nginx, haproxy, or varnish, I get roughly the same results. However, I tested Rackspace's new cloud balancers, and they get much better performance (doing fine at 7000/s). Since nginx and the others are all running on an instance I set up, and the rackspace balancer isn't, I'm guessing there's something about the system that is wrong. I'd rather use a balancer I control, so I can add caching, gzip, ssl, and other stuff to it. How can I find out what the bottleneck is? Is there anything I should tweak on the system to get performance to be better? Do I need more than 4GB of ram? (Ram usage is not high during the test). Any other random ideas? Thank you for your help! ~sean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216935,216935#msg-216935 From nginx-forum at nginx.us Wed Oct 19 21:20:09 2011 From: nginx-forum at nginx.us (mwilbanks) Date: Wed, 19 Oct 2011 17:20:09 -0400 Subject: Poor load balancer performance on rackspace and centos In-Reply-To: <63d3f54f22d9532c18dc9479dbae65fc.NginxMailingListEnglish@forum.nginx.org> References: <63d3f54f22d9532c18dc9479dbae65fc.NginxMailingListEnglish@forum.nginx.org> Message-ID: <768565c58534aa75e441c58f888f0044.NginxMailingListEnglish@forum.nginx.org> Hi Sean, I work at Rackspace and would be happy to connect you with one of our techs about this. Email me at mw at rackspace dot com and I'll set up a call for you. Best, Matt Wilbanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216935,216936#msg-216936 From mdounin at mdounin.ru Wed Oct 19 22:12:27 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 20 Oct 2011 02:12:27 +0400 Subject: Nginx crash - possibly keepalives In-Reply-To: References: <20111012122000.GK1137@mdounin.ru> <20111012172241.GU1137@mdounin.ru> <20111014194345.GE1137@mdounin.ru> <20111019092400.GQ1911@mdounin.ru> Message-ID: <20111019221227.GE1911@mdounin.ru> Hello! On Wed, Oct 19, 2011 at 10:49:26AM -0700, Matthieu Tourne wrote: > On Wed, Oct 19, 2011 at 2:24 AM, Maxim Dounin wrote: > > > Hello! > > > > On Tue, Oct 18, 2011 at 06:32:53PM -0700, Matthieu Tourne wrote: [...] > > > But, when I'm using proxy_buffering and proxy_caching (with sendfile on, > > and > > > directio 2M). > > > It seems like readv() returns 0, but finalize_request returns NGX_AGAIN. > > > > ENOPARSE > > > > The ngx_http_finalize_request() is void, it doesn't return anything. > > > > You may want to provide debug log to make it clear what are you > > talking about. > > > > I'm not exactly sure what part of it is relevant, so instead of posting > pages of log I provided steps to reproduce a configuration where nginx shows > an erratic behavior, by not outputing the entire response while doing a > proxy_pass. So the issue you are seeing is truncated response, right? I'm not able to reproduce it here (though I've tested under FreeBSD, not Linux). Do you see sendfile and/or directio have any influence? And the point still remains: please provide debug log. Obviously posting it here is a bad idea as it's likely to be huge, though making gzipped version available for download would be really helpfull. > I'll be experimenting more, and I'll let you know if I find the origin of > this issue. Please note that testing with your module may be problematic, as there are at least the following issues with it: 1. "mass_chunk_multi_packets on" expected to cause truncated responses as it aborts response on != NGX_OK from next body filter (e.g. on NGX_AGAIN if network isn't as fast as reading from disk for some reason). 2. checksums will not match as buffers from previous filters are marked as free before actual data are sent, thus causing mostly arbitrary data to be sent (again, if network isn't as fast as reading from disk for some reason). Maxim Dounin > > > M. > > > > > > Maxim Dounin > > > > > I'm not sure that test is relevant, and what I'm really benching here. > > And > > > if it might not be the tcp layer directly? > > > But maybe the failure should be explicit. > > > > > > The behavior was the same with or without the patch. I've also tried > > various > > > combination of proxy buffers, sendfile, directio. > > > > > > Any thoughts ? > > > > > > Thank you! > > > Matthieu. > > > > > > On Fri, Oct 14, 2011 at 12:43 PM, Maxim Dounin > > wrote: > > > > > > > Hello! > > > > > > > > On Wed, Oct 12, 2011 at 09:22:41PM +0400, Maxim Dounin wrote: > > > > > > > > > Hello! > > > > > > > > > > On Wed, Oct 12, 2011 at 09:32:41AM -0700, Matthieu Tourne wrote: > > > > > > > > > > > On Wed, Oct 12, 2011 at 5:20 AM, Maxim Dounin > > > > wrote: > > > > > > > > > > > > > Hello! > > > > > > > > > > > > > > On Tue, Oct 11, 2011 at 07:53:36PM -0700, Matthieu Tourne wrote: > > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > After turning on keepalives, we've been seeing one crash pretty > > > > > > > > consistently. > > > > > > > > We're running nginx 1.1.5 and here is the backtrace : > > > > > > > > [...] > > > > > > > > > Ok, it looks like I'm right and all buffers are in busy chain. > > > > > Likely this happens due to upstream sending response in many small > > > > > chunks. > > > > > > > > > > I'll try to reproduce it here and provide proper fix. > > > > > > > > Please try the attached patch. > > > > > > > > Maxim Dounin > > > > > > > > _______________________________________________ > > > > nginx mailing list > > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > From appa at perusio.net Thu Oct 20 00:20:07 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 20 Oct 2011 01:20:07 +0100 Subject: Having trouble understand how rewrite works In-Reply-To: References: <419433073ed38af866b06c28479991ec.NginxMailingListEnglish@forum.nginx.org> <80a72057fd73c6d2d98a3597e429a171.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87y5wgikeg.wl%appa@perusio.net> On 19 Out 2011 17h51 WEST, noagbodjivictor at gmail.com wrote: > Thanks again. I understand the map solution. Here's another issue, > you see, the links below all map to the index page (there are other > pages too, that have those PageID, ParentPageID, etc.. parameters). > > /index.cfm?PageID=1 > /index.cfm?resetCache=yes > /index.cfm?PageID=1&ParentPageID=1&NavID=1 > /index.cfm?PageID=22&ParentPageID=1&NavID=22 > /index.cfm?PageID=14&ParentPageID=38&NavID=38&ReferringPage=1 > > all map to / (index) Taking the lead from Denis, try: map $request_uri $is_old { default 0; ~/index\.cfm\?PageId=\d+ 1; ~/index\.cfm\?PageID=\d+&ParentPageID=\d+&NavID=\d+ 1; ~/index\.cfm\?PageID=\d+&ParentPageID=\d+&NavID=\d+&ReferringPage=\d+ 1; } > /index.cfm?PageID=35&ParentPageID=26&NavID=26 > /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=8&PageText=off > /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=9&PageText=off > /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=10&PageText=off > /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=15&PageText=off > /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=16&PageText=off > /index.cfm?PageID=35&ParentPageID=26&NavID=35&ProductID=11&PageText=off map $request_uri $is_old_also { default 0; ~/index\.cfm\?PageID=\d+&ParentPageID=\d+&NavID=\d+&ProductID=\d+&PageText=off 1; } Then you use the same type of if in location like exemplified by Denis before. Just also a test for $is_old_also. ... if ($is_old_also) { return 301 ; } > and these for example would map to another unique page. > > The parameters specify the actual page that must be mapped to. And > since I now know I can't use regex on query parameters, is there a > way to handle this situation? See above. Try it. --- appa From agentzh at gmail.com Thu Oct 20 00:43:46 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 20 Oct 2011 08:43:46 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Thu, Oct 20, 2011 at 2:10 AM, Nginx User wrote: >> I think I've already fixed this issue in the ngx_lua v0.3.1rc17 release: >> >> ? ?https://github.com/chaoslawful/lua-nginx-module/tags >> >> There was a bug in ngx.exec()'s handling when being used within >> rewrite_by_lua* and access_by_lua* directives, which could cause >> hanging in certain extreme conditions. >> >> Could you please try it out on your side? > > I'll have a go in due course. I have dumped the config originally > posted. Will look into reconfiguring along those lines later. > Cool :) > In the meantime, can you help out with my fallback? > > I have a set of about 70 regexes that are run using access_by_lua_file > after finding out that access_by_lua has a string length limit > (undefined). > It is the nginx config file parser has a length limit on individual config directives. Use access_by_lua_file instead to put your Lua code into an external .lua file and thus eliminating the length constraint altogether. > I have applied the escaping sequences and they generally work ?but > these ones generate errors: > > -- 42 > ? ? ? -- original > "(?:"\s*or\s*"?\d)|(?:\\x(?:23|27|3d))|(?:^.?"$)|(?:(?:^["\\]*(?:[\d"]+|[^"]+"))+\s*(?:n?and|x?or|not|\|\||\&\&)\s*[\w"[+&!@(),.-])|(?:[^\w\s]\w+\s*[|-]\s*"\s*\w)|(?:@\w+\s+(and|or)\s*["\d]+)|(?:@[\w-]+\s(and|or)\s*[^\w\s])|(?:[^\w\s:]\s*\d\W+[^\w\s]\s*".)|(?:\Winformation_schema|table_name\W)" > ? ? ? local query_string = > ngx.re.match(ngx.var.request_uri,"(?:"\\\s*or\\\s*"?\\\d)|(?:\\\\\\x(?:23|27|3d))| A rule of thumb is that "\" should become "\\\\" (four back-slashes!) while using access_by_lua and "\\" (two back-slashes!) while using access_by_lua_file. You're writing things like "\\\s" (three back-slashes!), which is weird. Why not put your Lua code into an external .lua file and use access_by_lua_file or rewrite_by_lua_file instead? That way you only need to escape each "\" only once. Regards, -agentzh From nginx-forum at nginx.us Thu Oct 20 00:44:40 2011 From: nginx-forum at nginx.us (mikiso) Date: Wed, 19 Oct 2011 20:44:40 -0400 Subject: How to control access for specific IP-addresses of clients when using as mail proxy In-Reply-To: References: Message-ID: Thank you very much. I'll refer to these codes and add something like mail access module to the mail core module. ??? Wrote: ------------------------------------------------------- > I have added this feature in my > nginx_tcp_proxy_module. You can do it as a > reference: > https://github.com/yaoweibin/nginx_tcp_proxy_modul > e/commit/fcacae8236444261d5e9301c144e085b706d5f32# > diff-5 > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216892,216944#msg-216944 From nginx at nginxuser.net Thu Oct 20 08:17:21 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 20 Oct 2011 11:17:21 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 20 October 2011 03:43, agentzh wrote: > On Thu, Oct 20, 2011 at 2:10 AM, Nginx User wrote: >> I have a set of about 70 regexes that are run using access_by_lua_file > A rule of thumb is that "\" should become "\\\\" (four back-slashes!) > while using access_by_lua and "\\" (two back-slashes!) while using > access_by_lua_file. You're writing things like "\\\s" (three > back-slashes!), which is weird. > > Why not put your Lua code into an external .lua file and use > access_by_lua_file or rewrite_by_lua_file instead? That way you only > need to escape each "\" only once. I am using an external .lua file and I only get consistent results when I use "\\\s" etc. "\\s" etc resulted is several ")" expected near "|" type messages. Basically, it's what seems to work for me. From agentzh at gmail.com Thu Oct 20 08:46:14 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 20 Oct 2011 16:46:14 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Thu, Oct 20, 2011 at 4:17 PM, Nginx User wrote: >> Why not put your Lua code into an external .lua file and use >> access_by_lua_file or rewrite_by_lua_file instead? That way you only >> need to escape each "\" only once. > I am using an external .lua file and I only get consistent results > when I use "\\\s" etc. "\\s" etc resulted is several ")" expected near > "|" type messages. > "\\\s" is essentially equivalent to "\\s" in Lua string literals because "\s" evaluates to "s". You can try small examples on your shell (ensure you have the "lua" interpreter visible in your PATH environment): $ lua -e 'print("\s" == "s")' true $ lua -e 'print("\\\s" == "\\s")' true $ lua -e 'print("\\s")' \s $ lua -e 'print("\\\s")' \s > Basically, it's what seems to work for me. > I suggest you design trivial samples like above to get clear what is going on here :) Regards, -agentzh From nginx-forum at nginx.us Thu Oct 20 09:48:06 2011 From: nginx-forum at nginx.us (kamalakarv) Date: Thu, 20 Oct 2011 05:48:06 -0400 Subject: Nginx Connections dipped on reload Message-ID: <3fb7c723332c146591f2937235585327.NginxMailingListEnglish@forum.nginx.org> Our Setup: * We are using Nginx as load balancer and using ip_hash * Two backend nodes with each can accept 'x' connections and Nginx connections are '2x' Yesterday we had huge traffic so decided to increase backed node connections so increased it by 'y' and restarted backend nodes and reloaded the Nginx . We have Observed that Nginx connections dipped on reload? Why Nginx connections dipped on reload ? any idea? Thanks Kamalakar Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216947,216947#msg-216947 From nginx-forum at nginx.us Thu Oct 20 10:00:18 2011 From: nginx-forum at nginx.us (kamalakarv) Date: Thu, 20 Oct 2011 06:00:18 -0400 Subject: difference between request _time vs upstream_response_time Message-ID: As per my understanding upstream_response_time is subset of request_time. # request_time : This shows how long Nginx dealt with the request # upstream_response_time: Gives us the time it took our upstream server (in this case Apache/mod_wsgi) to respond request_time = time nginx got the request to the time it sends the reponse to client(browser). request_time = variable component + upstream_response_time Can anybody explain me what exactly the "variable component" is ? Regards Kamalakar Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216948,216948#msg-216948 From nginx at nginxuser.net Thu Oct 20 10:48:18 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 20 Oct 2011 13:48:18 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 20 October 2011 11:46, agentzh wrote: > On Thu, Oct 20, 2011 at 4:17 PM, Nginx User wrote: >>> Why not put your Lua code into an external .lua file and use >>> access_by_lua_file or rewrite_by_lua_file instead? That way you only >>> need to escape each "\" only once. >> I am using an external .lua file and I only get consistent results >> when I use "\\\s" etc. "\\s" etc resulted is several ")" expected near >> "|" type messages. >> > > "\\\s" is essentially equivalent to "\\s" in Lua string literals > because "\s" evaluates to "s". Would the Nginx string literal you mentioned before not then turn "\\s" into "\s" ... which is were I want to be in the end? I suspect I am missing something in the process. Wish I could just use the familiar "\" and have it figured out in the background without me having to worry about it as rewrite apparently does though. From nginx-forum at nginx.us Thu Oct 20 11:17:19 2011 From: nginx-forum at nginx.us (artemg) Date: Thu, 20 Oct 2011 07:17:19 -0400 Subject: nginx with custom modules crashes in gzip crc32() In-Reply-To: References: Message-ID: <3c9e13aeded41cf777b8bd112d09ad82.NginxMailingListEnglish@forum.nginx.org> By the way passing zero size last_buf is ok, as I understand? What do you mean by "non-special bufs" ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216804,216951#msg-216951 From agentzh at gmail.com Thu Oct 20 11:48:29 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 20 Oct 2011 19:48:29 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Thu, Oct 20, 2011 at 6:48 PM, Nginx User wrote: > Would the Nginx string literal you mentioned before not then turn > "\\s" into "\s" ... which is were I want to be in the end? I suspect I > am missing something in the process. > The Nginx config file parser first parses Nginx string literal 'ngx.re.match("\\\\s")' into Lua code ngx.re.match("\\s") and then Lua code parser parse the Lua string literal "\\s" into the character string \s which is the regex pattern that you want. > Wish I could just use the familiar "\" and have it figured out in the > background without me having to worry about it as rewrite apparently > does though. > Nginx does have builtin support for regex syntax, so does Perl and JavaScript, and that's why you do not have to esacpe "\" in that context. Unfortunately Lua does not have such built-in regex syntax support and the ngx.re API was implemented by ngx_lua and by no means to be a real a language extension to Lua. As I said, try using external .lua file and content/rewrite/access/set_by_lua_file to avoid nginx string escaping issues. Regards, -agentzh From agentzh at gmail.com Thu Oct 20 11:52:59 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 20 Oct 2011 19:52:59 +0800 Subject: nginx with custom modules crashes in gzip crc32() In-Reply-To: <3c9e13aeded41cf777b8bd112d09ad82.NginxMailingListEnglish@forum.nginx.org> References: <3c9e13aeded41cf777b8bd112d09ad82.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Oct 20, 2011 at 7:17 PM, artemg wrote: > By the way passing zero size last_buf is ok, as I understand? What do > you mean by "non-special bufs" ? > A buf with last_buf set is "special". Check out the ngx_buf_special macro definition in nginx core's src/core/ngx_buf.h: #define ngx_buf_special(b) \ ((b->flush || b->last_buf || b->sync) \ && !ngx_buf_in_memory(b) && !b->in_file) Regards, -agentzh From nginx-forum at nginx.us Thu Oct 20 13:06:15 2011 From: nginx-forum at nginx.us (groknaut) Date: Thu, 20 Oct 2011 09:06:15 -0400 Subject: nginx reload not working, restart creates orphan yet active worker Message-ID: <9f6fa0e7e3270d51b21df894b888dd5a.NginxMailingListEnglish@forum.nginx.org> hello, after trying to reload nginx after making a config change, the reload didn't show that the new config had taken affect. i then issued a restart and what happened was, the nginx parent died, yet the nginx worker kept running serving requests. any help? this appears to happen after the nginx parent has been running for "a while". we're running nginx 1.0.5 with the following patches from https://github.com/yaoweibin: * nginx_ajp_module * nginx_upstream_module * nginx_syslog_patch i have a pile of debug error log, lsof, process list, and straces. shall i provide those? if so, where? off-list? the config change i was making was node membership in the pool in upstream.conf - taking one node in and out. processes prior to restart: root 30403 0.0 0.2 13972 4912 ? Ss Aug17 0:01 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf nginx 9685 0.0 0.2 14364 4220 ? S Oct13 3:53 \_ nginx: worker process nginx.conf: user nginx; worker_processes 1; syslog local2 nginx; error_log /var/log/nginx/error.log debug; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; proxy_buffers 8 16k; proxy_buffer_size 32k; 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 syslog:warn|/var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; gzip on; server { listen 80; server_name _; location /nginx-status { stub_status on; access_log off; allow 10.0.0.0/8; allow 127.0.0.1; deny all; } location /upstream-status { check_status; access_log off; allow 10.0.0.0/8; allow 127.0.0.1; deny all; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/error; } error_page 403 /403.html; location = /403.html { root /usr/share/nginx/error; } error_page 500 502 504 /500.html; location = /500.html { root /usr/share/nginx/error; } error_page 503 /503.html; location = /503.html { root /usr/share/nginx/error; } if ($request_filename ~* "api/(.*)") { return 403; break; } set $global_ssl_redirect 'yes'; if ($request_filename ~ "nginx-status") { set $global_ssl_redirect 'no'; } if ($request_filename ~ "upstream-status") { set $global_ssl_redirect 'no'; } if ($global_ssl_redirect ~* '^yes$') { rewrite ^ https://$host$request_uri? permanent; break; } } include upstream.conf; server { listen 443; server_name _; ssl on; ssl_certificate certs/wildcard.sushimysavior.com.crt; ssl_certificate_key certs/wildcard.sushimysavior.com.key; ssl_protocols SSLv3 TLSv1; ssl_ciphers HIGH:!ADH:!MD5; set_real_ip_from 10.0.0.0/8; real_ip_header X-Forwarded-For; add_header Cache-Control public; location /WEB-INF { deny all; } location /jmxb { deny all; } location /static { root /var/www; expires 0; add_header Pragma "no-cache"; add_header Cache-Control "no-cache"; if ($request_filename ~ "Plugin.exe") { add_header Content-Disposition "attachment; filename=Plugin.exe"; } } location / { proxy_pass http://tomcats_http; proxy_connect_timeout 10s; proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504; proxy_set_header Host $host; proxy_set_header X-Server-Port $server_port; proxy_set_header X-Server-Protocol https; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Strict-Transport-Security max-age=315360000; proxy_set_header X-Secure true; proxy_set_header Transfer-Encoding ""; if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)") { expires 365d; break; } } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/error; } error_page 403 /403.html; location = /403.html { root /usr/share/nginx/error; } error_page 500 502 504 /500.html; location = /500.html { root /usr/share/nginx/error; } error_page 503 /503.html; location = /503.html { root /usr/share/nginx/error; } } } upstream.conf: upstream tomcats_http { server app2:1802; server app4:1802; check interval=3000 rise=3 fall=2 timeout=1000 type=http default_down=false; check_http_send "GET /monitor/ystatus HTTP/1.0\r\n\r\n"; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216933,216933#msg-216933 From nginx at nginxuser.net Thu Oct 20 16:02:39 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 20 Oct 2011 19:02:39 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 20 October 2011 14:48, agentzh wrote: > As I said, try using external .lua file and > content/rewrite/access/set_by_lua_file to avoid nginx string escaping > issues. Understood. However, when I follow your instructions on this, things fail. They seem to work my way. Take this regex for example: (?:^>[\w\s]*<\/?\w{2,}>) When I use my "incorrect" escaping in access_by_lua file ... local query_string = ngx.re.match(ngx.var.request_uri, "(?:^>[\\\w\\\s]*<\\\/?\\\w{2,}>)", "io") -- finds unquoted attribute breaking injections -- xss -- csrf -- 2 if query_string then ngx.exit(ngx.HTTP_BAD_REQUEST) end ... the debug log entry is .... [debug] 24803#0: *154 lua regex cache miss for match regex "(?:^>[\w\s]*<\/?\w{2,}>)" with options "io" [debug] 24803#0: *154 lua compiling match regex "(?:^>[\w\s]*<\/?\w{2,}>)" with options "io" (compile once: 1) [debug] 24803#0: *154 lua saving compiled regex (0 captures) into the cache (entries 6) [debug] 24803#0: *154 regex "(?:^>[\w\s]*<\/?\w{2,}>)" not matched on string "/trackip/?searchip=213.162.113.89" starting from 0 I.E. the match regex, "(?:^>[\w\s]*<\/?\w{2,}>)" is the same as the original. I don't know why, but it works and the "correct" escaping does not. So I'm sticking with this until I start to see problems. Cheers. From ryanchan404 at gmail.com Thu Oct 20 16:12:01 2011 From: ryanchan404 at gmail.com (Ryan Chan) Date: Fri, 21 Oct 2011 00:12:01 +0800 Subject: Nginx rewrite: last & break Message-ID: Hello, According to document: http://wiki.nginx.org/HttpRewriteModule#rewrite It said "break - completes processing of rewrite directives and breakes location lookup cycle by not doing any location lookup and internal jump at all" However, seems my config below is an exception? server { listen 80; server_name .example.com root /data/example/; if ($request_uri ~ "foo") { rewrite ^/foo /bar break; } location /bar { echo "error"; } } When I curl using: curl http://example.com/foo the string "error" was returned. However, isn't the break will skip any following location block? So it shouldn't matche the location below, right? Thanks. From mdounin at mdounin.ru Thu Oct 20 16:38:31 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 20 Oct 2011 20:38:31 +0400 Subject: Nginx rewrite: last & break In-Reply-To: References: Message-ID: <20111020163831.GM1911@mdounin.ru> Hello! On Fri, Oct 21, 2011 at 12:12:01AM +0800, Ryan Chan wrote: > Hello, > > According to document: http://wiki.nginx.org/HttpRewriteModule#rewrite > > It said "break - completes processing of rewrite directives and > breakes location lookup cycle by not doing any location lookup and > internal jump at all" > > However, seems my config below is an exception? > > server { > listen 80; > > server_name .example.com > root /data/example/; > > if ($request_uri ~ "foo") { > rewrite ^/foo /bar break; > } > > location /bar { > echo "error"; > } > } > > When I curl using: curl http://example.com/foo > > the string "error" was returned. > > However, isn't the break will skip any following location block? So it > shouldn't matche the location below, right? Processing of rewrite directives at server level may be stopped via break, but the location lookup will follow anyway (as there is no location at this stage where request may be processed). Note original documentation doesn't say anything about "breakes location lookup cycle ...". It's looks like it was added by Agentzh here: http://wiki.nginx.org/index.php?title=HttpRewriteModule&action=historysubmit&diff=7141&oldid=6736 I've reverted it as it's incorrect and obviously causes confusion. Maxim Dounin From nginx at nginxuser.net Thu Oct 20 16:54:41 2011 From: nginx at nginxuser.net (Nginx User) Date: Thu, 20 Oct 2011 19:54:41 +0300 Subject: Nginx rewrite: last & break In-Reply-To: <20111020163831.GM1911@mdounin.ru> References: <20111020163831.GM1911@mdounin.ru> Message-ID: On 20 October 2011 19:38, Maxim Dounin wrote: > Hello! > > On Fri, Oct 21, 2011 at 12:12:01AM +0800, Ryan Chan wrote: > >> Hello, >> >> According to document: http://wiki.nginx.org/HttpRewriteModule#rewrite >> >> It said "break - completes processing of rewrite directives and >> breakes location lookup cycle by not doing any location lookup and >> internal jump at all" >> >> However, seems my config below is an exception? >> >> server { >> ? ? ? ? listen 80; >> >> ? ? ? ? server_name .example.com >> ? ? ? ? root /data/example/; >> >> ? ? ? ? if ($request_uri ~ "foo") { >> ? ? ? ? ? ? rewrite ^/foo /bar break; >> ? ? ? ? } >> >> ? ? ? ? location /bar { >> ? ? ? ? ? ? echo "error"; >> ? ? ? ? } >> } >> >> When I curl using: ?curl http://example.com/foo >> >> the string "error" was returned. >> >> However, isn't the break will skip any following location block? So it >> shouldn't matche the location below, right? > > Processing of rewrite directives at server level may be stopped > via break, but the location lookup will follow anyway (as there is > no location at this stage where request may be processed). > > Note original documentation doesn't say anything about "breakes > location lookup cycle ...". ?It's looks like it was added by > Agentzh here: > > http://wiki.nginx.org/index.php?title=HttpRewriteModule&action=historysubmit&diff=7141&oldid=6736 > > I've reverted it as it's incorrect and obviously causes confusion. Still quite confusing because the "last" portion goes on to say "after which searches for corresponding URI and location". As the "break" part does not say anything, it implies that "after which DOES NOT search for corresponding URI OR location". I.E. It implies what agentzh wrote. Perhaps needs some clarification about it being appropriate at server level (If I understand you --- totally confused lol). From nginx-forum at nginx.us Thu Oct 20 17:22:53 2011 From: nginx-forum at nginx.us (groknaut) Date: Thu, 20 Oct 2011 13:22:53 -0400 Subject: nginx reload not working, restart creates orphan yet active worker In-Reply-To: <9f6fa0e7e3270d51b21df894b888dd5a.NginxMailingListEnglish@forum.nginx.org> References: <9f6fa0e7e3270d51b21df894b888dd5a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9e311fc82ea2e2340a2d40b2454a30b2.NginxMailingListEnglish@forum.nginx.org> and i forgot to include nginx -V .. 10/19 19:12[root at proxy2 ~]# nginx -V nginx: nginx version: nginx/1.0.5 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) nginx: TLS SNI support disabled nginx: configure arguments: --user=nginx --group=nginx --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 --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --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_xslt_module --with-http_image_filter_module --with-http_sub_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --with-debug --add-module=src/http/modules/nginx_syslog_patch --add-module=src/http/modules/nginx_upstream_module --add-module=src/http/modules/nginx_ajp_module Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216933,216969#msg-216969 From mdounin at mdounin.ru Thu Oct 20 17:34:50 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 20 Oct 2011 21:34:50 +0400 Subject: nginx reload not working, restart creates orphan yet active worker In-Reply-To: <9e311fc82ea2e2340a2d40b2454a30b2.NginxMailingListEnglish@forum.nginx.org> References: <9f6fa0e7e3270d51b21df894b888dd5a.NginxMailingListEnglish@forum.nginx.org> <9e311fc82ea2e2340a2d40b2454a30b2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111020173449.GN1911@mdounin.ru> Hello! On Thu, Oct 20, 2011 at 01:22:53PM -0400, groknaut wrote: > and i forgot to include nginx -V .. > > > 10/19 19:12[root at proxy2 ~]# nginx -V > nginx: nginx version: nginx/1.0.5 > nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) > nginx: TLS SNI support disabled > nginx: configure arguments: --user=nginx --group=nginx > --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 > --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi > --http-scgi-temp-path=/var/lib/nginx/tmp/scgi > --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_xslt_module > --with-http_image_filter_module --with-http_sub_module > --with-http_gzip_static_module --with-http_random_index_module > --with-http_secure_link_module --with-http_degradation_module > --with-http_stub_status_module --with-http_perl_module --with-ipv6 > --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions > -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 > -mtune=generic -fasynchronous-unwind-tables' --with-cc-opt='-O2 -g -pipe > -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector > --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic > -fasynchronous-unwind-tables' --with-debug > --add-module=src/http/modules/nginx_syslog_patch > --add-module=src/http/modules/nginx_upstream_module > --add-module=src/http/modules/nginx_ajp_module Are you able to reproduce the problem without 3rd party modules/patches? Maxim Dounin From nginx-forum at nginx.us Thu Oct 20 17:43:53 2011 From: nginx-forum at nginx.us (groknaut) Date: Thu, 20 Oct 2011 13:43:53 -0400 Subject: nginx reload not working, restart creates orphan yet active worker In-Reply-To: <9f6fa0e7e3270d51b21df894b888dd5a.NginxMailingListEnglish@forum.nginx.org> References: <9f6fa0e7e3270d51b21df894b888dd5a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0376102e621d7c0190ab027e6caf5568.NginxMailingListEnglish@forum.nginx.org> unfortunately at this time our site relies on nginx_upstream_module. not sure if/when i'll have time to rebuild sans those modules and try to repro. in the meantime, i'm going to add configuration to allow nginx to dump core, and see if the module author, yaoweibin, has any insight. of course if you can offer help i'd love to have it. thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216933,216973#msg-216973 From nginx-forum at nginx.us Fri Oct 21 00:20:13 2011 From: nginx-forum at nginx.us (mikiso) Date: Thu, 20 Oct 2011 20:20:13 -0400 Subject: How to control access for specific IP-addresses of clients when using as mail proxy In-Reply-To: References: Message-ID: <51036f710aed5b4a7dd5a0a3fba6a057.NginxMailingListEnglish@forum.nginx.org> Finally I wrote mail access module with reference to the source code of http access module and Evan Miller's guide to Nginx module development because we need this feature for only pop3 proxy. And I noticed I don't understand how my module to be called before the pop3 handler. >From the guide it is important the order of the modules, however it doesn't mention granular control for request/connection handling. So I'd like to know how to call this handler before the pop3 handler and how the ngx_mail_pop3_init_session is called after "epoll_process_event". Do I need to register connection handler or do I need to implement tcp based source code as he does? Regards, Soichiro Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216892,216979#msg-216979 From ryanchan404 at gmail.com Fri Oct 21 03:14:07 2011 From: ryanchan404 at gmail.com (Ryan Chan) Date: Fri, 21 Oct 2011 11:14:07 +0800 Subject: Nginx rewrite: last & break In-Reply-To: References: <20111020163831.GM1911@mdounin.ru> Message-ID: On Fri, Oct 21, 2011 at 12:54 AM, Nginx User wrote: > Still quite confusing because the "last" portion goes on to say "after > which searches for corresponding URI and location". As the "break" > part does not say anything, it implies that "after which DOES NOT > search for corresponding URI OR location". I.E. It implies what > agentzh wrote. > > Perhaps needs some clarification about it being appropriate at server > level (If I understand you --- totally confused lol). > Agreed. Perhaps need some examples as well. It is quit dangerous because sometimes we think it just worked and it is ok, but in fact we are wrong e.g.: http://serverfault.com/questions/131474/nginx-url-rewriting-difference-between-break-and-last I spent a whole day to debug this issue.. From agentzh at gmail.com Fri Oct 21 04:08:13 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 21 Oct 2011 12:08:13 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Fri, Oct 21, 2011 at 12:02 AM, Nginx User wrote: > On 20 October 2011 14:48, agentzh wrote: > Take this regex for example: (?:^>[\w\s]*<\/?\w{2,}>) > Good lord! Why are you using "^" here? Are you meant to match from the very start of your $request_uri string? And why are you escaping "/" ? It is *not* a special thing in the regex syntax that requires escaping. As years of Perl programmer, I must say your regex here is by no means correct. > When I use my "incorrect" escaping in access_by_lua file ... > > ? ? ? local query_string = ngx.re.match(ngx.var.request_uri, > "(?:^>[\\\w\\\s]*<\\\/?\\\w{2,}>)", "io") > ? ? ? ? ? ? ? ?-- finds unquoted attribute breaking injections -- xss -- csrf > ? ? ? ? ? ? ? ?-- 2 > ? ? ? ? ? ? ? ?if query_string then > ? ? ? ? ? ? ? ? ? ? ? ?ngx.exit(ngx.HTTP_BAD_REQUEST) > ? ? ? ? ? ? ? ?end > I'm not meant to help with Perl compatible regex usage, but here's my working version: -- html/foo.lua local uri = "2" local regex = '(?:>[\\w\\s]*)'; ngx.say("regex: ", regex) m = ngx.re.match(uri, regex, "oi") if m then ngx.say("[", m[0], "]") else ngx.say("not matched!") end # nginx.conf location /re { access_by_lua_file html/foo.lua; content_by_lua return; } GET /re yields regex: (?:>[\w\s]*) [>2] Regards, -agentzh From agentzh at gmail.com Fri Oct 21 04:13:30 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 21 Oct 2011 12:13:30 +0800 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On Fri, Oct 21, 2011 at 12:08 PM, agentzh wrote: >> ? ? ? local query_string = ngx.re.match(ngx.var.request_uri, >> "(?:^>[\\\w\\\s]*<\\\/?\\\w{2,}>)", "io") >> ? ? ? ? ? ? ? ?-- finds unquoted attribute breaking injections -- xss -- csrf >> ? ? ? ? ? ? ? ?-- 2 BTW, it's bad practice to match against $request_uri directly because query strings may be escaped according to URI escaping rules. (Yes! there's escaping everywhere!) For example, Forefox will escape "3" into "a=%3Ca%3E3%3C/a%3E", which will surely never be matched by the regexes used here. You can try ngx.unescape_uri to preprocess the $request_uri thing first, see: http://wiki.nginx.org/HttpLuaModule#ngx.unescape_uri Good luck! -agentzh From agentzh at gmail.com Fri Oct 21 04:19:40 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 21 Oct 2011 12:19:40 +0800 Subject: Nginx rewrite: last & break In-Reply-To: <20111020163831.GM1911@mdounin.ru> References: <20111020163831.GM1911@mdounin.ru> Message-ID: On Fri, Oct 21, 2011 at 12:38 AM, Maxim Dounin wrote: > > Processing of rewrite directives at server level may be stopped > via break, but the location lookup will follow anyway (as there is > no location at this stage where request may be processed). > > Note original documentation doesn't say anything about "breakes > location lookup cycle ...". ?It's looks like it was added by > Agentzh here: > > http://wiki.nginx.org/index.php?title=HttpRewriteModule&action=historysubmit&diff=7141&oldid=6736 > Yes, I forgot to take into account server-level rewrites. And sorry about that. But what I said is correct for location-level rewrites, no? We definitely need more clarification here. And in fact, location jump actually happens in post-rewrite phase handler for location-wise rewrites! LOL Regards, -agentzh From nginx at nginxuser.net Fri Oct 21 07:35:21 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 10:35:21 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 21 October 2011 07:13, agentzh wrote: > On Fri, Oct 21, 2011 at 12:08 PM, agentzh wrote: >>> ? ? ? local query_string = ngx.re.match(ngx.var.request_uri, >>> "(?:^>[\\\w\\\s]*<\\\/?\\\w{2,}>)", "io") >>> ? ? ? ? ? ? ? ?-- finds unquoted attribute breaking injections -- xss -- csrf >>> ? ? ? ? ? ? ? ?-- 2 > > BTW, it's bad practice to match against $request_uri directly because > query strings may be escaped according to URI escaping rules. (Yes! > there's escaping everywhere!) > > For example, Forefox will escape "3" into "a=%3Ca%3E3%3C/a%3E", > which will surely never be matched by the regexes used here. > > You can try ngx.unescape_uri to preprocess the $request_uri thing first, see: > > ? ?http://wiki.nginx.org/HttpLuaModule#ngx.unescape_uri > > Good luck! Thanks for the emails above. I'll look into tackling the issues raised in due course. "/" is escaped because the original regex is from a php application which uses "/" as a delimiter. I left it in place because the snippet posted in just a part of the result of a series of "find and replace" sequences on an xml file (https://dev.itratos.de/svn/php-ids/trunk/lib/IDS/default_filter.xml) that changes it to the lua format. "-- 2" is not the target but just a hang over from the original xml I couldn't find an easy find and replace for to cater for all possible "" tags and is there as a lua comment. As said, things are working as expected for me at present in that the resultant regexes are consistent with the target regexes from the xml file so I am keeping them as they are. I will change them if/when I see issues. In any case, this is just a fallback I put in place when trying to call the actual application and having just recompiled with rc17, I'll look into having a go at that again. Thanks! From nginx-forum at nginx.us Fri Oct 21 07:39:41 2011 From: nginx-forum at nginx.us (mikiso) Date: Fri, 21 Oct 2011 03:39:41 -0400 Subject: How to control access for specific IP-addresses of clients when using as mail proxy In-Reply-To: <51036f710aed5b4a7dd5a0a3fba6a057.NginxMailingListEnglish@forum.nginx.org> References: <51036f710aed5b4a7dd5a0a3fba6a057.NginxMailingListEnglish@forum.nginx.org> Message-ID: I noticed that HTTP request will be processed according to the ngx_http_phases and mail core module doesn't have the same mechanism. So it seems I have to refer to his code if I don't want to modify the core code... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216892,216989#msg-216989 From nginx at nginxuser.net Fri Oct 21 07:55:12 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 10:55:12 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 21 October 2011 10:35, Nginx User wrote: > In any case, this is just a fallback I put in place when trying to > call the actual application and having just recompiled with rc17, I'll > look into having a go at that again. "... when trying to call the actual application failed ..." . From nginx-forum at nginx.us Fri Oct 21 08:55:56 2011 From: nginx-forum at nginx.us (sureshvv) Date: Fri, 21 Oct 2011 04:55:56 -0400 Subject: Is cache being used? In-Reply-To: References: Message-ID: Same thing happening with me but I don't have proxy_cache_min_uses set at all so default 1 should work Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212954,216992#msg-216992 From nginx-forum at nginx.us Fri Oct 21 12:12:41 2011 From: nginx-forum at nginx.us (edisoti) Date: Fri, 21 Oct 2011 08:12:41 -0400 Subject: php_info - fastcgi_split_path_info - Not does not work Message-ID: I am having trouble setting the PATH_INFO I want accessing thus: http://www.examples.com/test.php/images/test/000001 LOGS 2011/10/20 15:54:51 [error] 76110#0: *1 open() "/var/www1/examples.com/test.php/dddd/eeee" failed (20: Not a directory), client: 200.12.10.92, server: examples.com, request: "GET /test.php/dddd/eeee HTTP/1.1", host: "www.examples.com" nginx.conf -------------------------------------------------- user www; worker_processes 4; worker_rlimit_nofile 8192; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 4096; } http { default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] $status ' '"$request" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; keepalive_timeout 35; tcp_nodelay on; server_names_hash_bucket_size 128; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; server { listen 80; server_name examples.com www.examples.com; access_log /var/log/nginx/examples.com-access.log main; error_log /var/log/nginx/examples.com-error.log; root /var/www1/examples.com; index index.php index.html index.htm; location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } location ~ ^.+\.php$ { include fastcgi_params; fastcgi_intercept_errors on; fastcgi_pass unix:/tmp/php.socket; } } } fastcgi_params -------------------------------------------------------------------------- fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 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_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/1.0.8; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_index index.php; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; -------------------------------------------------------------------------- Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216975,216975#msg-216975 From francis at daoine.org Fri Oct 21 13:14:52 2011 From: francis at daoine.org (Francis Daly) Date: Fri, 21 Oct 2011 14:14:52 +0100 Subject: php_info - fastcgi_split_path_info - Not does not work In-Reply-To: References: Message-ID: <20111021131452.GA27078@craic.sysops.org> On Fri, Oct 21, 2011 at 08:12:41AM -0400, edisoti wrote: Hi there, > I am having trouble setting the PATH_INFO > > I want accessing thus: > http://www.examples.com/test.php/images/test/000001 The "location" here is /test.php/images/test/000001 > location /nginx_status { It doesn't match that one. > location ~ ^.+\.php$ { It doesn't match that one. So fastcgi_split_path_info is not used. As a short-term test, to confirm that the directives act as you expect, change this location definition to location ~ php Then when you are happy that you understand what everything is doing, change it to something that is right for your environment. (Perhaps some variation on "\.php($|/)" will be right for you; or perhaps nesting it inside a non-regex location.) Good luck, f -- Francis Daly francis at daoine.org From nginx at nginxuser.net Fri Oct 21 14:00:53 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 17:00:53 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 21 October 2011 07:13, agentzh wrote: > BTW, it's bad practice to match against $request_uri directly because > query strings may be escaped according to URI escaping rules. (Yes! > there's escaping everywhere!) That's a great point. ngx.unescape.uri helps get over this. Better still yet, it is the actual arguments I need to be matching against and that was just an initial setup thing. I have since moved on to .... local args = ngx.req.get_uri_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, ", ") else my_arg = val end if my_arg then local query_string = ngx.re.match(my_arg, "regex_1", "io") ... local query_string = ngx.re.match(my_arg, "regex_n", "io") ... end end The val entities are url unescaped by ngx_lua so no issues with that. Now that this is all working fine (after using "\\\" in place of the documented "\\" to get it to actually work - and it does work while the "correct" version does not), I can get back trying out the location capture again. Will let you know how that goes in a new thread since I have derailed this one with the regex issue. Cheers! From nginx at nginxuser.net Fri Oct 21 14:05:55 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 17:05:55 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 21 October 2011 07:08, agentzh wrote: > On Fri, Oct 21, 2011 at 12:02 AM, Nginx User wrote: >> On 20 October 2011 14:48, agentzh wrote: >> Take this regex for example: (?:^>[\w\s]*<\/?\w{2,}>) >> > > Good lord! > > Why are you using "^" here? Are you meant to match from the very start > of your $request_uri string? Very start of GET Arg, Yes ... It searches for an injection attempt. http://mailman.nginx.org/pipermail/nginx/2011-October/029901.html Thanks for your help. Enjoying my journey through ngx_lua! From nginx at nginxuser.net Fri Oct 21 14:27:01 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 17:27:01 +0300 Subject: ngx_lua location capture issue In-Reply-To: References: Message-ID: On 21 October 2011 17:00, Nginx User wrote: > I have since moved on to .... > > ? ? ? ?local args = ngx.req.get_uri_args() > ? ? ? ?for key, val in pairs(args) do > ? ? ? ? ? ? ? ?if type(val) == "table" then > ? ? ? ? ? ? ? ? ? ? ? ?my_arg = table.concat(val, ", ") > ? ? ? ? ? ? ? ?else > ? ? ? ? ? ? ? ? ? ? ? ?my_arg = ?val > ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ?if my_arg then - if my_arg then + if my_arg and type( my_arg ) ~= "boolean" then From nginx at nginxuser.net Fri Oct 21 15:04:09 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 18:04:09 +0300 Subject: lua_need_request_body ... limitations? Message-ID: So I managed to get my config going smoothly with "GET" requests as outlined here: http://mailman.nginx.org/pipermail/nginx/2011-October/029901.html with this correction http://mailman.nginx.org/pipermail/nginx/2011-October/029903.html I then decided to extend to cover "POST" requests. Here is the calling location: location @proxy_no_cache { lua_need_request_body on; access_by_lua_file '/etc/nginx/firewall.lua'; ... proxy_pass http://127.0.0.1:8080; ... } firewall.lua contains: ... -- Check "GET" Args local args = ngx.req.get_uri_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, ", ") else my_arg = val end if my_arg and type( my_arg ) ~= "boolean" then dofile("/etc/nginx/regex_rules.lua") end end -- Check "POST" Args local args = ngx.req.get_post_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, ", ") else my_arg = val end if my_arg and type( my_arg ) ~= "boolean" then dofile("/etc/nginx/regex_rules.lua") end end ngx.exit(ngx.OK) The 'Check "GET" Args' bit works fine but the 'Check "POST" Args' bit falls over with ... 'lua handler aborted: runtime error: /etc/nginx/firewall.lua:54: no request body found; maybe you should turn on lua_need_request_body?, blah, blah, blah' Question is that, are there limitations on calling lua_need_request_body on that my set up does not meet? Thanks. From nginx at nginxuser.net Fri Oct 21 15:32:32 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 18:32:32 +0300 Subject: lua_need_request_body ... limitations? In-Reply-To: References: Message-ID: On 21 October 2011 18:04, Nginx User wrote: > So I managed to get my config going smoothly with "GET" requests as > outlined here: http://mailman.nginx.org/pipermail/nginx/2011-October/029901.html > with this correction > http://mailman.nginx.org/pipermail/nginx/2011-October/029903.html > > I then decided to extend to cover "POST" requests. > > Here is the calling location: > > ? ? ? ?location @proxy_no_cache { > ? ? ? ? ? ? ? ?lua_need_request_body on; > ? ? ? ? ? ? ? ?access_by_lua_file '/etc/nginx/firewall.lua'; > ? ? ? ? ? ? ? ?... > ? ? ? ? ? ? ? ?proxy_pass http://127.0.0.1:8080; > ? ? ? ? ? ? ? ?... > ? ? ? ?} > > firewall.lua contains: > > ... > -- Check "GET" Args > ? ? ? ?local args = ngx.req.get_uri_args() > ? ? ? ?for key, val in pairs(args) do > ? ? ? ? ? ? ? ?if type(val) == "table" then > ? ? ? ? ? ? ? ? ? ? ? ?my_arg = table.concat(val, ", ") > ? ? ? ? ? ? ? ?else > ? ? ? ? ? ? ? ? ? ? ? ?my_arg = ?val > ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ?if my_arg and type( my_arg ) ~= "boolean" then > ? ? ? ? ? ? ? ? ? ? ? ?dofile("/etc/nginx/regex_rules.lua") > ? ? ? ? ? ? ? ?end > ? ? ? ?end > > -- Check "POST" Args > ? ? ? ?local args = ngx.req.get_post_args() > ? ? ? ?for key, val in pairs(args) do > ? ? ? ? ? ? ? ?if type(val) == "table" then > ? ? ? ? ? ? ? ? ? ? ? ?my_arg = table.concat(val, ", ") > ? ? ? ? ? ? ? ?else > ? ? ? ? ? ? ? ? ? ? ? ?my_arg = ?val > ? ? ? ? ? ? ? ?end > ? ? ? ? ? ? ? ?if my_arg and type( my_arg ) ~= "boolean" then > ? ? ? ? ? ? ? ? ? ? ? ?dofile("/etc/nginx/regex_rules.lua") > ? ? ? ? ? ? ? ?end > ? ? ? ?end > ? ? ? ?ngx.exit(ngx.OK) My mistake. Needed to make the blocks conditional -- Check "GET" Args if ngx.var.request_method == "GET" then local args = ngx.req.get_uri_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, ", ") else my_arg = val end if my_arg and type( my_arg ) ~= "boolean" then dofile("/etc/nginx/regex_rules.lua") end end end -- Check "POST" Args if ngx.var.request_method == "POST" then local args = ngx.req.get_post_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, ", ") else my_arg = val end if my_arg and type( my_arg ) ~= "boolean" then dofile("/etc/nginx/regex_rules.lua") end end end ngx.exit(ngx.OK) From nginx-forum at nginx.us Fri Oct 21 16:14:36 2011 From: nginx-forum at nginx.us (iberkner) Date: Fri, 21 Oct 2011 12:14:36 -0400 Subject: Suggestions regarding number of connections Message-ID: <45d4e47cdad5c56ce9677623baff48bf.NginxMailingListEnglish@forum.nginx.org> Currently we have a single Nginx web sever connecting to a pool of PHP app servers. The response from the application layer (PHP / DB) is excellent, but our site load times are not great. We've run some analytical tools and the network / web server response time is where a significant bottleneck exists. In working with our managed hosting company on this issue, we ran the following shell commands. I was wondering if someone could give me an idea if these numbers are indicative of a configuration issue with OS and / or Nginx OR will more CPU power help with this problem OR maybe we need to load balance the traffic to another web server. Should Nginx be able to handle this kind of traffic in general? Is there something that can be done in terms of Nginx configuration or OS configuration that can improve this issue (i.e. > 7,000 connections waiting)? root at server1 [~]# netstat -anp | grep ':80' | grep ESTABLISHED -c 4785 Over 4000 current connections. root at server1 [~]# netstat -anp | grep ':80' | grep -i WAIT -c 7982 7000 Connections in waiting for data state. root at server1 [~]# netstat -anp | grep ':80' | grep -i SYN -c 280 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217026,217026#msg-217026 From nginx at nginxuser.net Fri Oct 21 18:06:54 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 21:06:54 +0300 Subject: ngx_lua post data error/bug? Message-ID: This is a follow on from: http://mailman.nginx.org/pipermail/nginx/2011-October/029905.html The conditional statements take care of the basic error but what happens is that when "post" requests match any of the test regexes, an error is thrown ... "lua handler aborted: runtime error: attempt to yield across metamethod/C-call boundary blah, blah, blah". It appears this is due to a limitation in Lua 5.1 and this yeilding is a major item for Lua 5.2. However, trying to build Nginx with the lua module against Lua 5.2 fails... /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_conf.c /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c: In function 'ngx_http_lua_new_thread': /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:189: error: 'LUA_GLOBALSINDEX' undeclared (first use in this function) /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:189: error: (Each undeclared identifier is reported only once /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:189: error: for each function it appears in.) /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c: In function 'ngx_http_lua_del_thread': /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:228: warning: implicit declaration of function 'lua_getfenv' /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:234: warning: implicit declaration of function 'lua_setfenv' /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c: In function 'init_ngx_lua_globals': /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:507: error: 'LUA_GLOBALSINDEX' undeclared (first use in this function) /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c: In function 'ngx_http_lua_discard_bufs': /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:544: warning: unused parameter 'pool' /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c: In function 'ngx_http_lua_set_multi_value_table': /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:1167: warning: implicit declaration of function 'lua_objlen' make[1]: *** [objs/addon/src/ngx_http_lua_util.o] Error 1 make[1]: *** Waiting for unfinished jobs.... /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_conf.c: In function 'ngx_http_lua_merge_loc_conf': /usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_conf.c:95: warning: unused parameter 'cf' make[1]: Leaving directory `/usr/src/redhat/BUILD/nginx-1.0.8' make: *** [build] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.63523 (%build) The upshot is that perhaps only LuaJIT 2.0 can be used for all features in recent versions of ngx_lua. Luckily, I took a backup of my server state so I'll be rolling back and commenting out the "post" block. From nginx-forum at nginx.us Fri Oct 21 19:36:23 2011 From: nginx-forum at nginx.us (iberkner) Date: Fri, 21 Oct 2011 15:36:23 -0400 Subject: An upstream response is buffered to a temporary file Message-ID: What settings / parameters can be tweaked to increase the amount of buffers available as to not go to a temporary file? We are seeing many of these: 2011/10/21 14:01:24 [warn] 24547#0: *2408454 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695 while reading upstream, client: 1.1.1.1, server: www.someserver.com, request: "GET /edit.html?id=6816841 HTTP/1.1", upstream: "fastcgi://192.168.1.5:9000", host: "www.someserver.com", referrer: "http://www.someserver.com/c.html" I tried messing around with proxy_buffer settings, but not sure if I'm on the right track. Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217034,217034#msg-217034 From nginx at nginxuser.net Fri Oct 21 19:43:03 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 21 Oct 2011 22:43:03 +0300 Subject: ngx_lua post data error/bug? In-Reply-To: References: Message-ID: On 21 October 2011 21:06, Nginx User wrote: > This is a follow on from: > http://mailman.nginx.org/pipermail/nginx/2011-October/029905.html > > The conditional statements take care of the basic error but what > happens is that when "post" requests match any of the test regexes, an > error is thrown ... > "lua handler aborted: runtime error: attempt to yield across > metamethod/C-call boundary blah, blah, blah". > > It appears this is due to a limitation in Lua 5.1 ... Testing shows that the error is generated because of the 'dofile("/etc/nginx/regex_rules.lua")' line. I.E., when the regex rules are placed directly in the access_by_lua_file, a hit on a regex is processed as expected. When the rules are included using the dofile function, a hit on a regex results in the "attempt to yield across > metamethod/C-call boundary" error. From mdounin at mdounin.ru Fri Oct 21 19:44:07 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 21 Oct 2011 23:44:07 +0400 Subject: An upstream response is buffered to a temporary file In-Reply-To: References: Message-ID: <20111021194407.GD62535@mdounin.ru> Hello! On Fri, Oct 21, 2011 at 03:36:23PM -0400, iberkner wrote: > What settings / parameters can be tweaked to increase the amount of > buffers available as to not go to a temporary file? > > We are seeing many of these: > > 2011/10/21 14:01:24 [warn] 24547#0: *2408454 an upstream response is > buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695 > while reading upstream, client: 1.1.1.1, server: www.someserver.com, > request: "GET /edit.html?id=6816841 HTTP/1.1", upstream: > "fastcgi://192.168.1.5:9000", host: "www.someserver.com", referrer: > "http://www.someserver.com/c.html" > > I tried messing around with proxy_buffer settings, but not sure if I'm > on the right track. This is a warning message which is here to let you know that response was buffered to disk. Depending on your use case you may want either to tune fastcgi_buffers/fastcgi_buffer_size, or disable disk buffering with "fastcgi_max_temp_file 0", or just ignore this warning. Maxim Dounin From ilan at time4learning.com Fri Oct 21 20:02:22 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Fri, 21 Oct 2011 16:02:22 -0400 Subject: An upstream response is buffered to a temporary file In-Reply-To: <20111021194407.GD62535@mdounin.ru> References: <20111021194407.GD62535@mdounin.ru> Message-ID: Thanks, I increased the fastcgi_buffers as follows: fastcgi_buffers 256 4k; and that took care of this problem. Another problem I'm trying to deal with is: netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c 12 CLOSING 1176 ESTABLISHED 58 FIN_WAIT1 218 FIN_WAIT2 23 LAST_ACK 43 LISTEN 91 SYN_RECV 3606 TIME_WAIT I'm trying to understand why there are so many connections in TIME_WAIT status. Any ideas on how to research this issue? On Fri, Oct 21, 2011 at 3:44 PM, Maxim Dounin wrote: > Hello! > > On Fri, Oct 21, 2011 at 03:36:23PM -0400, iberkner wrote: > > > What settings / parameters can be tweaked to increase the amount of > > buffers available as to not go to a temporary file? > > > > We are seeing many of these: > > > > 2011/10/21 14:01:24 [warn] 24547#0: *2408454 an upstream response is > > buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695 > > while reading upstream, client: 1.1.1.1, server: www.someserver.com, > > request: "GET /edit.html?id=6816841 HTTP/1.1", upstream: > > "fastcgi://192.168.1.5:9000", host: "www.someserver.com", referrer: > > "http://www.someserver.com/c.html" > > > > I tried messing around with proxy_buffer settings, but not sure if I'm > > on the right track. > > This is a warning message which is here to let you know that > response was buffered to disk. Depending on your use case you may > want either to tune fastcgi_buffers/fastcgi_buffer_size, or disable > disk buffering with "fastcgi_max_temp_file 0", or just ignore this > warning. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilan at time4learning.com Fri Oct 21 20:10:27 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Fri, 21 Oct 2011 16:10:27 -0400 Subject: An upstream response is buffered to a temporary file In-Reply-To: References: <20111021194407.GD62535@mdounin.ru> Message-ID: I read online that making these changes: echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse can potentially have a good impact on performance but can also increase connection drops. Any thoughts? On Fri, Oct 21, 2011 at 4:02 PM, Ilan Berkner wrote: > Thanks, > > I increased the fastcgi_buffers as follows: > > fastcgi_buffers 256 4k; > > and that took care of this problem. > > Another problem I'm trying to deal with is: > > netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c > 12 CLOSING > 1176 ESTABLISHED > 58 FIN_WAIT1 > 218 FIN_WAIT2 > 23 LAST_ACK > 43 LISTEN > 91 SYN_RECV > 3606 TIME_WAIT > > I'm trying to understand why there are so many connections in TIME_WAIT > status. Any ideas on how to research this issue? > > On Fri, Oct 21, 2011 at 3:44 PM, Maxim Dounin wrote: > >> Hello! >> >> On Fri, Oct 21, 2011 at 03:36:23PM -0400, iberkner wrote: >> >> > What settings / parameters can be tweaked to increase the amount of >> > buffers available as to not go to a temporary file? >> > >> > We are seeing many of these: >> > >> > 2011/10/21 14:01:24 [warn] 24547#0: *2408454 an upstream response is >> > buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695 >> > while reading upstream, client: 1.1.1.1, server: www.someserver.com, >> > request: "GET /edit.html?id=6816841 HTTP/1.1", upstream: >> > "fastcgi://192.168.1.5:9000", host: "www.someserver.com", referrer: >> > "http://www.someserver.com/c.html" >> > >> > I tried messing around with proxy_buffer settings, but not sure if I'm >> > on the right track. >> >> This is a warning message which is here to let you know that >> response was buffered to disk. Depending on your use case you may >> want either to tune fastcgi_buffers/fastcgi_buffer_size, or disable >> disk buffering with "fastcgi_max_temp_file 0", or just ignore this >> warning. >> >> Maxim Dounin >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > > -- > > Ilan Berkner > Chief Technology Officer > Time4Learning.com > > 6300 NE 1st Ave., Suite 203 > Ft. Lauderdale, FL 33334 > (954) 771-0914 > > > > > Time4Learning.com - Online interactive curriculum for home use, PreK-8th > Grade. > Time4Writing.com - Online writing tutorials for high, middle, and > elementary school students. > Time4Learning.net - A forum to chat with parents online about kids, > education, parenting and more. > spellingcity.com - Online vocabulary and spelling activities for teachers, > parents and students. > > > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at akins.org Sat Oct 22 00:32:49 2011 From: brian at akins.org (Brian Akins) Date: Fri, 21 Oct 2011 20:32:49 -0400 Subject: Suggestions regarding number of connections In-Reply-To: <45d4e47cdad5c56ce9677623baff48bf.NginxMailingListEnglish@forum.nginx.org> References: <45d4e47cdad5c56ce9677623baff48bf.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1F952CF1-8793-494D-8861-69EA3CF2319C@akins.org> I've seen an nginx server handle around 1 million concurrent connections. Set ulimit and do basic tcp tuning is generally good enough. From agentzh at gmail.com Sat Oct 22 01:25:39 2011 From: agentzh at gmail.com (agentzh) Date: Sat, 22 Oct 2011 09:25:39 +0800 Subject: ngx_lua post data error/bug? In-Reply-To: References: Message-ID: On Sat, Oct 22, 2011 at 3:43 AM, Nginx User wrote: > > Testing shows that the error is generated because of the > 'dofile("/etc/nginx/regex_rules.lua")' line. > Lua's "dofile" builtin is implemented as a C function in both Lua 5.1 and LuaJIT 2.0. And when you call ngx.location.capture or ngx.exec or ngx.exit or ngx.req.read_body or something like those in the regex_rules.lua, it'll effectively initiate a coroutine yield and that yield will run across C function boundary, which is disallowed. I think it's more efficient to use Lua modules and the "require" builtin because dofile will load the .lua file from disk at *every* request and it's quite costy while "require" will only load the .lua module file only once unless lua_code_cache is turned off. Here is an example, -- regex_rules.lua module("regex_rules", package.seeall) function check() ngx.req.read_body() -- other processing goes here... end # nginx.conf lua_package_path "/path/to/regex_rules.lua's-parent-directory/?.lua;;" server { location /foo { access_by_lua ' local regex_rules = require "regex_rules" regex_rules.check() '; # content handler config goes here... } } BTW, compatibility with Lua 5.2 is not maintained by ngx_lua (yet). Regards, -agentzh From ilan at time4learning.com Sat Oct 22 02:12:04 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Fri, 21 Oct 2011 22:12:04 -0400 Subject: Suggestions regarding number of connections In-Reply-To: <1F952CF1-8793-494D-8861-69EA3CF2319C@akins.org> References: <45d4e47cdad5c56ce9677623baff48bf.NginxMailingListEnglish@forum.nginx.org> <1F952CF1-8793-494D-8861-69EA3CF2319C@akins.org> Message-ID: That's what I'm trying to understand. Could you give me some more specific examples of what to look for? On Fri, Oct 21, 2011 at 8:32 PM, Brian Akins wrote: > > I've seen an nginx server handle around 1 million concurrent connections. > Set ulimit and do basic tcp tuning is generally good enough. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanchan404 at gmail.com Sat Oct 22 03:30:28 2011 From: ryanchan404 at gmail.com (Ryan Chan) Date: Sat, 22 Oct 2011 11:30:28 +0800 Subject: Nginx rewrite: last & break In-Reply-To: References: <20111020163831.GM1911@mdounin.ru> Message-ID: Hello, On Fri, Oct 21, 2011 at 12:19 PM, agentzh wrote: > We definitely need more clarification here. And in fact, location jump > actually happens in post-rewrite phase handler for location-wise > rewrites! LOL > > Regards, > -agentzh > > _______________________________________________ Thanks. Anyone would like to do a quick summary for the issue? From nginx at nginxuser.net Sat Oct 22 06:31:20 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 22 Oct 2011 09:31:20 +0300 Subject: ngx_lua post data error/bug? In-Reply-To: References: Message-ID: On 22 October 2011 04:25, agentzh wrote: > On Sat, Oct 22, 2011 at 3:43 AM, Nginx User wrote: >> >> Testing shows that the error is generated because of the >> 'dofile("/etc/nginx/regex_rules.lua")' line. >> > > Lua's "dofile" builtin is implemented as a C function in both Lua 5.1 > and LuaJIT 2.0. And when you call ngx.location.capture or ngx.exec or > ngx.exit or ngx.req.read_body or something like those in the > regex_rules.lua, it'll effectively initiate a coroutine yield and that > yield will run across C function boundary, which is disallowed. > > I think it's more efficient to use Lua modules and the "require" > builtin because dofile will load the .lua file from disk at *every* > request and it's quite costy while "require" will only load the .lua > module file only once unless lua_code_cache is turned off. Here is an > example, > > ? ?-- regex_rules.lua > ? ?module("regex_rules", package.seeall) > ? ?function check() > ? ? ? ?ngx.req.read_body() > ? ? ? ?-- other processing goes here... > ? ?end > > ? ?# nginx.conf > ? ?lua_package_path "/path/to/regex_rules.lua's-parent-directory/?.lua;;" > ? ?server { > ? ? ? ?location /foo { > ? ? ? ? ? ? access_by_lua ' > ? ? ? ? ? ? ? ? local regex_rules = require "regex_rules" > ? ? ? ? ? ? ? ? regex_rules.check() > ? ? ? ? ? ? '; > ? ? ? ? ? ? # content handler config goes here... > ? ? ? ?} > ? ?} > > BTW, compatibility with Lua 5.2 is not maintained by ngx_lua (yet). Magic ... Works perfectly. You are a legend! From nginx at nginxuser.net Sat Oct 22 11:04:21 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 22 Oct 2011 14:04:21 +0300 Subject: Nginx rewrite: last & break In-Reply-To: References: <20111020163831.GM1911@mdounin.ru> Message-ID: On 22 October 2011 06:30, Ryan Chan wrote: > Anyone would like to do a quick summary for the issue? Minaev's answer in the serverfault link you provided is the clearest explanation I have seen to date of this. To paraphrase, he says, within a location block, when you use "last" the rewrites are stopped and a new subrequest is generated which will take all all locations into account. When you use "break" the rewrites are stopped and processing continued within the location you are in. Adding Maxim's statement above into account, outside a location block, "break" behaves just like "last" does since there are no location directives to run here. Someone just needs to update the docs if this is correct. From nginx-forum at nginx.us Sat Oct 22 14:25:29 2011 From: nginx-forum at nginx.us (locojohn) Date: Sat, 22 Oct 2011 10:25:29 -0400 Subject: Nginx rewrite: last & break In-Reply-To: References: Message-ID: <5145a61ef49164bceb0d30eac603370a.NginxMailingListEnglish@forum.nginx.org> Nginx User Wrote: ------------------------------------------------------- > Adding Maxim's statement above into account, > outside a location block, > "break" behaves just like "last" does since there > are no location > directives to run here. > > Someone just needs to update the docs if this is > correct. > I have experienced situations when "rewrite something target last;" in the server {} section generates the 503 page, while "rewrite something target break;" instead works OK. It means that "break" does not behave like "last" in the server section of the virtual host either. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216965,217052#msg-217052 From lists at ruby-forum.com Sat Oct 22 18:29:05 2011 From: lists at ruby-forum.com (Graham D.) Date: Sat, 22 Oct 2011 20:29:05 +0200 Subject: Nginx NAS serving large files Message-ID: Hello Ladies and Gentlemen, We have a very frustrating problem with a NAS configuration that we recently set-up. After running a filesharing website on 8 servers for 1+ years we decided to switch to a NAS configuration. We set-up our NAS (24x1TB Raid 5) to serve files to 9 front end servers over a private switch - doing 9 servers on 1 disk(logical)... not sure if nginx can handle this. Since we've moved to the NAS BW usage has dropped significantly even though our traffic has stayed the same. Download speeds are pretty bad aswell but this is due to IO issues that are being created by NGINX. so here's the problem we are facing... In theory nginx is creating an io bottleneck because it's opening to many times without closing. We're using nginx on our front end servers to grab files off our nas - each file will stay alive though for 45+ minutes. Instead of opening it for 10 seconds, reading into memory, and closing - it's opening it for 10 seconds, reading into memory, streaming it for 45 minutes, THEN closing. We ran a test with nginx and we were only able to download at 30kbps on port 182, how-ever over apache we were able to reach speeds of 20mb/s. We've re-compiled nignx and installed the most recent stable version but that didn't fix anything. Can someone please suggest a fix here? I've ran out of ideas... Thank you! -- Posted via http://www.ruby-forum.com/. From brian at akins.org Sun Oct 23 00:59:24 2011 From: brian at akins.org (Brian Akins) Date: Sat, 22 Oct 2011 20:59:24 -0400 Subject: Nginx NAS serving large files In-Reply-To: References: Message-ID: Do you have sendfile on or off? We generally run it off for NAS. Also, are you using the open file cache? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Oct 23 01:40:09 2011 From: nginx-forum at nginx.us (jische) Date: Sat, 22 Oct 2011 21:40:09 -0400 Subject: HELP: ngx_http_token_module compile failed. Message-ID: gcc -c -O -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include -I objs -I src/http -I src/http/modules -o objs/src/http/modules/ngx_http_upstream_ip_hash_module.o src/http/modules/ngx_http_upstream_ip_hash_module.c gcc -c -O -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include -I objs -I src/http -I src/http/modules -I src/mail -o objs/addon/nginx-token/ngx_http_token_module.o /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c: In function 'ngx_http_token_handler': /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c:148: error: 'ngx_http_upstream_conf_t' has no member named 'schema' /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c: In function 'ngx_http_token_merge_loc_conf': /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c:358: error: 'ngx_http_upstream_conf_t' has no member named 'schema' /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c:358: error: 'ngx_http_upstream_conf_t' has no member named 'schema' /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c: In function 'ngx_http_token_server': /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c:374: error: 'ngx_http_upstream_conf_t' has no member named 'schema' /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c:390: error: 'ngx_http_upstream_conf_t' has no member named 'schema' /usr/local/pureftp_user/nginx-token/ngx_http_token_module.c:391: error: 'ngx_http_upstream_conf_t' has no member named 'schema' *** Error code 1 Stop in /usr/local/pureftp_user/nginx-0.7.65. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217060,217060#msg-217060 From nginx-forum at nginx.us Sun Oct 23 01:44:11 2011 From: nginx-forum at nginx.us (jische) Date: Sat, 22 Oct 2011 21:44:11 -0400 Subject: HELP: ngx_http_token_module compile failed. In-Reply-To: References: Message-ID: The software ,including nginx and the module, are downloaded from https://github.com/roast/nginx-token I write a config file and come to the above error while do making... is there any suggestion on the next step? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217060,217061#msg-217061 From nginx-forum at nginx.us Sun Oct 23 02:40:53 2011 From: nginx-forum at nginx.us (iberkner) Date: Sat, 22 Oct 2011 22:40:53 -0400 Subject: Highest requests per second - what is considered top performance? Message-ID: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> We've been running Nginx for sometime powering a fairly high traffic website. The single box, dual CPU (dual core) has been serving us well but its time to upgrade. I've got a new system configured, quad CPU (quad core) = 16 cores (plenty of RAM) and CentOS. My understanding is that even though there are 16 cores, more than 5 Nginx instances will not greatly improve performance. I decided to benchmark the system using a single Nginx instance and default configuration with a static html file. Using "ab" (locally) with 50,000 connections and 1,000 concurrent ones I get around 10K requests / second. What particular parameters should I look into adjusting to try to double that number? (Nginx and OS). What is considered top performance for a single box / instance? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217062,217062#msg-217062 From ryanchan404 at gmail.com Sun Oct 23 04:39:48 2011 From: ryanchan404 at gmail.com (Ryan Chan) Date: Sun, 23 Oct 2011 12:39:48 +0800 Subject: Nginx rewrite: last & break In-Reply-To: References: <20111020163831.GM1911@mdounin.ru> Message-ID: Hello, On Sat, Oct 22, 2011 at 7:04 PM, Nginx User wrote: > To paraphrase, he says, within a location block, when you use "last" > the rewrites are stopped and a new subrequest is generated which will > take all all locations into account. When you use "break" the rewrites > are stopped and processing continued within the location you are in. > > Adding Maxim's statement above into account, outside a location block, > "break" behaves just like "last" does since there are no location > directives to run here. > > Someone just needs to update the docs if this is correct. > This is also my understanding, so if it is right, please update the wiki as this feature is quite important. From nginx-forum at nginx.us Sun Oct 23 07:07:05 2011 From: nginx-forum at nginx.us (jische) Date: Sun, 23 Oct 2011 03:07:05 -0400 Subject: HELP: ngx_http_token_module compile failed. In-Reply-To: References: Message-ID: <0aea7cf040fe244968eb06e14e571354.NginxMailingListEnglish@forum.nginx.org> # cat config ngx_addon_name=ngx_http_token_module HTTP_MODULES="$HTTP_MODULES ngx_http_token_module" NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_token_module.c" #CORE_LIBS="$CORE_LIBS -lm" ============= the config file is not in place in the downloaded zip file, I wrote one as above. Any one can help on this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217060,217074#msg-217074 From eisa.mohammadzadeh at gmail.com Sun Oct 23 03:47:02 2011 From: eisa.mohammadzadeh at gmail.com (Pcparsi Admin) Date: Sun, 23 Oct 2011 07:17:02 +0330 Subject: Please heeeeeeeeeelp meeeee Message-ID: hey guys i installed nginx in my VPS (plesk) via this topic: http://www.grafxsoftware.com/faq.php/HOW-TO-configure-PLESK-with-NGinx-proxy-reverse/1/1/ every thing is ok but i see only apache 404 error page: http://www.axparsi.com/ pleseeeeeeeee help me what should i do now i wanna change home page to my main home page> /var/www/vhosts/ axparsi.com/httpdocs please help meeeeeeeeee -------------- next part -------------- An HTML attachment was scrubbed... URL: From frumentius at gmail.com Sun Oct 23 09:30:54 2011 From: frumentius at gmail.com (Joe) Date: Sun, 23 Oct 2011 16:30:54 +0700 Subject: Please heeeeeeeeeelp meeeee In-Reply-To: References: Message-ID: Hi, Change the location. location / { index index.htm index.html index.php; root /var/www/vhosts/axparsi.com/httpdocs; Regards, Joe On Sun, Oct 23, 2011 at 10:47 AM, Pcparsi Admin < eisa.mohammadzadeh at gmail.com> wrote: > hey guys > > i installed nginx in my VPS (plesk) via this topic: > > > http://www.grafxsoftware.com/faq.php/HOW-TO-configure-PLESK-with-NGinx-proxy-reverse/1/1/ > > every thing is ok but i see only apache 404 error page: > > http://www.axparsi.com/ > > pleseeeeeeeee help me what should i do now > > i wanna change home page to my main home page> /var/www/vhosts/ > axparsi.com/httpdocs > > please help meeeeeeeeee > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at nginxuser.net Sun Oct 23 14:20:07 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 23 Oct 2011 17:20:07 +0300 Subject: Funny ngy_lua outcome Message-ID: SETUP ***CONF FILE*** server { location @proxy { access_by_lua_file '/etc/nginx/firewall.lua'; proxy_cache proxy.capture360.net; proxy_pass http://127.0.0.1:8080; include /etc/nginx/proxy.default; } location /error_docs { internal; alias /usr/share/nginx/html; sub_filter '' '$host'; sub_filter_once off; } location @pretty_urls { # -- Several rewrite X Y break lines rewrite_by_lua 'ngx.exec("@proxy");'; } location / { try_files $uri $uri/ @pretty_urls; } location ~ .+\.php$ { location ~ \..*/.*\.php$ { return 400; } rewrite_by_lua 'ngx.exec("@proxy");'; } } ***FIREWALL.LUA*** -- F. Check "GET" Args if ngx.var.request_method == "GET" then local args = ngx.req.get_uri_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, " ") else my_arg = val end if my_arg and my_arg ~= "" and type(my_arg) ~= "boolean" then rule_id = regex_rules.check() if rule_id then ngx.log(ngx.INFO, "Firewall Match: Rule " .. rule_id .. " on POST: " .. my_arg) ngx.exit(ngx.HTTP_BAD_REQUEST) end end end end -- G. Check "POST" Args if ngx.var.request_method == "POST" then ngx.req.read_body() local args = ngx.req.get_post_args() for key, val in pairs(args) do if type(val) == "table" then my_arg = table.concat(val, " ") else my_arg = val end if my_arg and my_arg ~= "" and type(my_arg) ~= "boolean" then rule_id = regex_rules.check() if rule_id then ngx.log(ngx.INFO, "Firewall Match: Rule " .. rule_id .. " on POST: " .. my_arg) ngx.exit(ngx.HTTP_BAD_REQUEST) end end end ngx.req.discard_body() end ***REGEX_RULES.LUA*** module("regex_rules", package.seeall) function check() -- 00 local query_string = "//" local query_match = ngx.re.match(my_arg, query_string, "io") -- generic attacks -- 9 if query_match then return "00" end -- 01 local query_string = "(?:\"[^\"]*[^-]?>)|(?:[^\\\w\\\s]\\\s*\\\/>)|(?:>\")" local query_match = ngx.re.match(my_arg, query_string, "io") -- finds html breaking injections including whitespace attacks -- xss -- csrf -- 4 if query_match then return "01" end ..... ISSUES 1. A googlebot visit while testing a post string designed to be blocked "language=vbscript" is also blocked as the googlebot request is also tested against the same string. 2. Despite the "return id" line, the regex rules are run to the end. I.E., if there is a match on Rule 02, the rest are still run anyway and only after the last is evaluated is the 400 error returned. 3. The log from "ngx.log" does not seem to be produced. COMMENTARY Abridged debug log with commentary here: http://pastebin.com/A0cXpHwg (Lost the one with thegooglebot issue) Issue 1 seems to be a variable scope issue with "my_arg" but when I use"local" regex_rules.check() gets fed a blank. Could the log thing be a level issue? I.E. "ngx.INFO" is too low?? Thanks From mdounin at mdounin.ru Sun Oct 23 15:26:04 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 23 Oct 2011 19:26:04 +0400 Subject: Nginx rewrite: last & break In-Reply-To: References: <20111020163831.GM1911@mdounin.ru> Message-ID: <20111023152603.GI62535@mdounin.ru> Hello! On Sat, Oct 22, 2011 at 02:04:21PM +0300, Nginx User wrote: > On 22 October 2011 06:30, Ryan Chan wrote: > > Anyone would like to do a quick summary for the issue? > > Minaev's answer in the serverfault link you provided is the clearest > explanation I have seen to date of this. > > To paraphrase, he says, within a location block, when you use "last" > the rewrites are stopped and a new subrequest is generated which will Just a side note: "subrequest" is incorrect term here. > take all all locations into account. When you use "break" the rewrites > are stopped and processing continued within the location you are in. > > Adding Maxim's statement above into account, outside a location block, > "break" behaves just like "last" does since there are no location > directives to run here. > > Someone just needs to update the docs if this is correct. Reading rewrite module docs carefully enough will tell basically the same: ... If the URI changed as a result of the execution of directives inside location, then location is again determined for the new URI. This cycle can be repeated up to 10 times, after which Nginx returns a 500 error. ... ... Example: rewrite ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 last; rewrite ^(/download/.*)/audio/(.*)\..*$ $1/mp3/$2.ra last; return 403; But if we place these directives in location /download/, then it is necessary to replace flag "last" by "break", otherwise Nginx will hit the 10 cycle limit and return error 500: location /download/ { rewrite ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 break; rewrite ^(/download/.*)/audio/(.*)\..*$ $1/mp3/$2.ra break; return 403; } ... The translation though looks awful and needs re-translation; additionally, it was already polluted with user comments, and this doesn't improve readability either. Maxim Dounin From mdounin at mdounin.ru Sun Oct 23 15:32:03 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 23 Oct 2011 19:32:03 +0400 Subject: Nginx rewrite: last & break In-Reply-To: <5145a61ef49164bceb0d30eac603370a.NginxMailingListEnglish@forum.nginx.org> References: <5145a61ef49164bceb0d30eac603370a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111023153203.GJ62535@mdounin.ru> Hello! On Sat, Oct 22, 2011 at 10:25:29AM -0400, locojohn wrote: > Nginx User Wrote: > ------------------------------------------------------- > > > Adding Maxim's statement above into account, > > outside a location block, > > "break" behaves just like "last" does since there > > are no location > > directives to run here. > > > > Someone just needs to update the docs if this is > > correct. > > > > I have experienced situations when "rewrite something target last;" in > the server {} section generates the 503 page, while "rewrite something > target break;" instead works OK. It means that "break" does not behave > like "last" in the server section of the virtual host either. The 500, likely. This might happen with nginx before 1.1.6 due to completely different reason: if there were no matching location found, the rewrite directives specified at server level were executed inside an implicit location again. It is fixed in 1.1.6: *) Bugfix: the ngx_http_rewrite_module directives specified at "server" level were executed twice if no matching locations were defined. Simple and effective way to prevent such sort of problems is to always define "location /". Maxim Dounin From mdounin at mdounin.ru Sun Oct 23 16:24:01 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 23 Oct 2011 20:24:01 +0400 Subject: Highest requests per second - what is considered top performance? In-Reply-To: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111023162401.GM62535@mdounin.ru> Hello! On Sat, Oct 22, 2011 at 10:40:53PM -0400, iberkner wrote: > We've been running Nginx for sometime powering a fairly high traffic > website. The single box, dual CPU (dual core) has been serving us well > but its time to upgrade. I've got a new system configured, quad CPU > (quad core) = 16 cores (plenty of RAM) and CentOS. My understanding is > that even though there are 16 cores, more than 5 Nginx instances will > not greatly improve performance. > > I decided to benchmark the system using a single Nginx instance and > default configuration with a static html file. Using "ab" (locally) > with 50,000 connections and 1,000 concurrent ones I get around 10K > requests / second. > > What particular parameters should I look into adjusting to try to double > that number? (Nginx and OS). Likely just doubling number of "ab" processes will do the trick (i.e. just run two "ab" in parallel), it looks like most obvious bottleneck in your test. Maxim Dounin From brian at akins.org Sun Oct 23 17:15:09 2011 From: brian at akins.org (Brian Akins) Date: Sun, 23 Oct 2011 13:15:09 -0400 Subject: Highest requests per second - what is considered top performance? In-Reply-To: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> Message-ID: <25F594B3-A0C6-40B4-B646-69642E82B2D3@akins.org> On Oct 22, 2011, at 10:40 PM, iberkner wrote: > > What is considered top performance for a single box / instance? I've seen 200k+ requests/second on a smaller box than you have. Usually, your testing tool is the bottle neck. I usually run one nginx worker per CPU core. Not sure why more than 5 wouldn't improve performance, the processes are generally independent. Make sure you are using buffered access logs (if using them) and you have worker_rlimit_nofile set high (like 256k). From nginx at nginxuser.net Sun Oct 23 18:06:46 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 23 Oct 2011 21:06:46 +0300 Subject: Highest requests per second - what is considered top performance? In-Reply-To: <25F594B3-A0C6-40B4-B646-69642E82B2D3@akins.org> References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <25F594B3-A0C6-40B4-B646-69642E82B2D3@akins.org> Message-ID: On 23 October 2011 20:15, Brian Akins wrote: > Make sure you are using buffered access logs (if using them) Hi, Can you clarify what this means? Thanks. From ilan at time4learning.com Sun Oct 23 18:39:08 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Sun, 23 Oct 2011 14:39:08 -0400 Subject: Highest requests per second - what is considered top performance? In-Reply-To: <20111023162401.GM62535@mdounin.ru> References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <20111023162401.GM62535@mdounin.ru> Message-ID: Hi Maxim, How do you suggest running "ab" in parallel? Ultimately, my objective is to baseline the system so that as I start adding our customizations to it I can measure the performance impact. On Sun, Oct 23, 2011 at 12:24 PM, Maxim Dounin wrote: > Hello! > > On Sat, Oct 22, 2011 at 10:40:53PM -0400, iberkner wrote: > > > We've been running Nginx for sometime powering a fairly high traffic > > website. The single box, dual CPU (dual core) has been serving us well > > but its time to upgrade. I've got a new system configured, quad CPU > > (quad core) = 16 cores (plenty of RAM) and CentOS. My understanding is > > that even though there are 16 cores, more than 5 Nginx instances will > > not greatly improve performance. > > > > I decided to benchmark the system using a single Nginx instance and > > default configuration with a static html file. Using "ab" (locally) > > with 50,000 connections and 1,000 concurrent ones I get around 10K > > requests / second. > > > > What particular parameters should I look into adjusting to try to double > > that number? (Nginx and OS). > > Likely just doubling number of "ab" processes will do the trick > (i.e. just run two "ab" in parallel), it looks like most obvious > bottleneck in your test. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stef at caunter.ca Sun Oct 23 19:00:40 2011 From: stef at caunter.ca (Stefan Caunter) Date: Sun, 23 Oct 2011 19:00:40 +0000 Subject: Highest requests per second - what is considered top performance? In-Reply-To: References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <20111023162401.GM62535@mdounin.ru> Message-ID: <389966569-1319396438-cardhu_decombobulator_blackberry.rim.net-341021611-@b2.c30.bise6.blackberry> Run them in two shells or from two different systems. Also look at wcat. BlackBerry PIN 280C6BCD +1 647 459 9475 -----Original Message----- From: Ilan Berkner Sender: nginx-bounces at nginx.orgDate: Sun, 23 Oct 2011 14:39:08 To: Reply-To: nginx at nginx.org Subject: Re: Highest requests per second - what is considered top performance? _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From ilan at time4learning.com Sun Oct 23 19:47:55 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Sun, 23 Oct 2011 15:47:55 -0400 Subject: Highest requests per second - what is considered top performance? In-Reply-To: <389966569-1319396438-cardhu_decombobulator_blackberry.rim.net-341021611-@b2.c30.bise6.blackberry> References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <20111023162401.GM62535@mdounin.ru> <389966569-1319396438-cardhu_decombobulator_blackberry.rim.net-341021611-@b2.c30.bise6.blackberry> Message-ID: Thanks. I ran them in 2 separate shells concurrently (as best I could) and got about the same result, i.e. 10K req. / sec. per each "ab" test, so it does look as if the bottleneck is the testing tool. I would like to see > 50,000 req. / sec. ultimately in a controlled testing environment, what is the best way to try and achieve that? Running "ab" in "n" different shells at the same time is an option, but difficult. Is there a better way? On Sun, Oct 23, 2011 at 3:00 PM, Stefan Caunter wrote: > Run them in two shells or from two different systems. Also look at wcat. > BlackBerry PIN 280C6BCD +1 647 459 9475 > > -----Original Message----- > From: Ilan Berkner > Sender: nginx-bounces at nginx.orgDate: Sun, 23 Oct 2011 14:39:08 > To: > Reply-To: nginx at nginx.org > Subject: Re: Highest requests per second - what is considered top > performance? > > _______________________________________________ > 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 stef at caunter.ca Sun Oct 23 20:02:42 2011 From: stef at caunter.ca (Stefan Caunter) Date: Sun, 23 Oct 2011 20:02:42 +0000 Subject: Highest requests per second - what is considered top performance? In-Reply-To: References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <20111023162401.GM62535@mdounin.ru> <389966569-1319396438-cardhu_decombobulator_blackberry.rim.net-341021611-@b2.c30.bise6.blackberry> Message-ID: <568222895-1319400159-cardhu_decombobulator_blackberry.rim.net-500871707-@b2.c30.bise6.blackberry> The varnish folks, Krystjan in particular, have blogged about how they do this. Easy to find them on the google ;) BlackBerry PIN 280C6BCD +1 647 459 9475 -----Original Message----- From: Ilan Berkner Sender: nginx-bounces at nginx.orgDate: Sun, 23 Oct 2011 15:47:55 To: Reply-To: nginx at nginx.org Subject: Re: Highest requests per second - what is considered top performance? _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From appa at perusio.net Sun Oct 23 20:06:00 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sun, 23 Oct 2011 21:06:00 +0100 Subject: Highest requests per second - what is considered top performance? In-Reply-To: References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <20111023162401.GM62535@mdounin.ru> <389966569-1319396438-cardhu_decombobulator_blackberry.rim.net-341021611-@b2.c30.bise6.blackberry> Message-ID: <87wrbvpj6f.wl%appa@perusio.net> On 23 Out 2011 20h47 WEST, ilan at time4learning.com wrote: > I ran them in 2 separate shells concurrently (as best I could) and > got about the same result, i.e. 10K req. / sec. per each "ab" test, > so it does look as if the bottleneck is the testing tool. > > I would like to see > 50,000 req. / sec. ultimately in a controlled > testing environment, what is the best way to try and achieve that? > Running "ab" in "n" different shells at the same time is an option, > but difficult. Forget ab. Use httpload/http_load. It uses a single process, hence it mimics to a certain extent the way Nginx works. It uses select() though instead of epoll() or kqueue(). Requesting the empty_gif you should get always something north of 20k req/s on a semi-decent machine. --- appa From ilan at time4learning.com Sun Oct 23 20:06:49 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Sun, 23 Oct 2011 16:06:49 -0400 Subject: Highest requests per second - what is considered top performance? In-Reply-To: <568222895-1319400159-cardhu_decombobulator_blackberry.rim.net-500871707-@b2.c30.bise6.blackberry> References: <5e51b1d371557d400bc8eb6591c92ac1.NginxMailingListEnglish@forum.nginx.org> <20111023162401.GM62535@mdounin.ru> <389966569-1319396438-cardhu_decombobulator_blackberry.rim.net-341021611-@b2.c30.bise6.blackberry> <568222895-1319400159-cardhu_decombobulator_blackberry.rim.net-500871707-@b2.c30.bise6.blackberry> Message-ID: Thanks, I've been doing a lot of reading regarding this subject matter, haven't found anything specific by Varnish folks and Krystjan, if you can point me to a blog entry would be great. Thanks On Sun, Oct 23, 2011 at 4:02 PM, Stefan Caunter wrote: > The varnish folks, Krystjan in particular, have blogged about how they do > this. Easy to find them on the google ;) > BlackBerry PIN 280C6BCD +1 647 459 9475 > > -----Original Message----- > From: Ilan Berkner > Sender: nginx-bounces at nginx.orgDate: Sun, 23 Oct 2011 15:47:55 > To: > Reply-To: nginx at nginx.org > Subject: Re: Highest requests per second - what is considered top > performance? > > _______________________________________________ > 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 > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Oct 23 20:13:37 2011 From: nginx-forum at nginx.us (TECK) Date: Sun, 23 Oct 2011 16:13:37 -0400 Subject: Location not called properly Message-ID: Hi all, I'm trying to call a location of this format: location = /somedir/file1.php { try_files @cache =404; } location = /anotherdir/file2.php { try_files @cache =404; } location @cache { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass fastcgi; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; include fastcgi.conf; } For some reason is not working, can you please let me know what is the proper syntax? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217122,217122#msg-217122 From ilan at time4learning.com Sun Oct 23 21:48:53 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Sun, 23 Oct 2011 17:48:53 -0400 Subject: Confirmation of AIO Message-ID: Hi All, I'm trying to understand the advantages of AIO and how using it with Nginx can improve performance. I've compiled Nginx from source with the AIO option. I've enabled AIO in my Nginx configuration. How can I confirm that its working? If the server is serving pages, does it mean that its using AIO? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Sun Oct 23 23:32:42 2011 From: francis at daoine.org (Francis Daly) Date: Mon, 24 Oct 2011 00:32:42 +0100 Subject: Location not called properly In-Reply-To: References: Message-ID: <20111023233242.GB27078@craic.sysops.org> On Sun, Oct 23, 2011 at 04:13:37PM -0400, TECK wrote: Hi there, > I'm trying to call a location of this format: > > location = /somedir/file1.php { > try_files @cache =404; > } Only the last parameter of try_files is "magic". Any others that start with @ or = will probably not do what you want. > For some reason is not working, can you please let me know what is the > proper syntax? It's not immediately clear what it is that you want, that is different from "include fastcgi.conf" at server level and "fastcgi_pass fastcgi" in your exact-match locations. If that isn't adequate, can you describe more? Good luck, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Mon Oct 24 00:03:42 2011 From: nginx-forum at nginx.us (Skolde) Date: Sun, 23 Oct 2011 20:03:42 -0400 Subject: Blank Adsense ads on certain pages Message-ID: I have inserted my adsense code into my site in certain areas, and the issue is very strange: ads only randomly work on some pages, and others the ad block still 'loads', but nothing appears. Just a black box. When you load the homepage page, you see the ad...but clicking on the forums tab takes you to another page with the **exact same ad code**, but nothing loads. You can even rightclick where the ad should be and you can see the iframe it inserted. If you go to the forums and navigate the member list, random profiles show ads, others do not. Certain forums show ads, other ads do not. Certain forum topics show ads, other don't. Refreshing the page does not help. This stays consistent across multiple browsers. The forum has a "SEO" function available, which I have enabled so the URLs look better. The .htaccess file if I had gone with apache is structured as follows: Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Turning the SEO URL function to 'off' removes the issue of ads not appearing, but this isn't acceptable for us. It just makes me think I have done something wrong in the NGINX config file. Here is the site-available file I have done for this website: ------------------------------------------------- ##redirect to www server { server_name twinkinfo.com; rewrite ^/(.*) http://www.twinkinfo.com/$1 permanent; } ################## server { server_name www.twinkinfo.com; root /home/username/www; location / { index index.php; try_files $uri $uri/ /index.php; } location ^~ /page { #?q=$uri&$args; required for in-line JS editor try_files $uri $uri/ /index.php?q=$uri&$args; } ##This is the catch-all for .php files location ~ \.php$ { include fastcgi_params; include fastcgi_config; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri =404; } ## Disable viewing .htaccess & .htpassword location ~ /\.ht { deny all; } } upstream backend { server 127.0.0.1:9000; } ------------------------------------- I've been messing with this for days and can't seem to figure out a reason behind it. If anyone can offer suggestions I would be most grateful. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217145,217145#msg-217145 From appa at perusio.net Mon Oct 24 00:39:43 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Mon, 24 Oct 2011 01:39:43 +0100 Subject: Blank Adsense ads on certain pages In-Reply-To: References: Message-ID: <87vcrfp6i8.wl%appa@perusio.net> On 24 Out 2011 01h03 WEST, nginx-forum at nginx.us wrote: > I have inserted my adsense code into my site in certain areas, and > the issue is very strange: ads only randomly work on some pages, and > others the ad block still 'loads', but nothing appears. Just a black > box. > > When you load the homepage page, you see the ad...but clicking on > the forums tab takes you to another page with the **exact same ad > code**, but nothing loads. You can even rightclick where the ad > should be and you can see the iframe it inserted. If you go to the > forums and navigate the member list, random profiles show ads, > others do not. Certain forums show ads, other ads do not. Certain > forum topics show ads, other don't. Refreshing the page does not > help. This stays consistent across multiple browsers. > > The forum has a "SEO" function available, which I have enabled so > the URLs look better. The .htaccess file if I had gone with apache > is structured as follows: > > > Options -MultiViews > RewriteEngine On > RewriteBase / > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule . /index.php [L] > > > Turning the SEO URL function to 'off' removes the issue of ads not > appearing, but this isn't acceptable for us. It just makes me think > I have done something wrong in the NGINX config file. > > Here is the site-available file I have done for this website: > > ------------------------------------------------- > > ##redirect to www > server { > server_name twinkinfo.com; > rewrite ^/(.*) http://www.twinkinfo.com/$1 permanent; > } Like this: server { server_name twinkinfo.com; return 301 http://www.twinkinfo.com; } > ################## > > server { > > server_name www.twinkinfo.com; > root /home/username/www; > > location / { > index index.php; > try_files $uri $uri/ /index.php; > } The catch all location is falling back to index.php without any arguments. Is that the way it's supposed to be? > location ^~ /page { > > #?q=$uri&$args; required for in-line JS editor > try_files $uri $uri/ /index.php?q=$uri&$args; > } The URIs starting with page have a fallback to index.php with args. > ##This is the catch-all for .php files > > location ~ \.php$ { > include fastcgi_params; > include fastcgi_config; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > try_files $uri =404; > } Is index.php your PHP "handler"? If it is then use this: location = /index.php { include fastcgi_params; include fastcgi_config; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } > ## Disable viewing .htaccess & .htpassword > > location ~ /\.ht { > deny all; > } > > } > > upstream backend { > server 127.0.0.1:9000; > } Enable the debug log and trace the way the request is handled. http://nginx.org/en/docs/debugging_log.html --- appa From egriffith92 at gmail.com Mon Oct 24 04:10:32 2011 From: egriffith92 at gmail.com (Eric Griffith) Date: Mon, 24 Oct 2011 00:10:32 -0400 Subject: Nginx displaying blank page, doesn't error Message-ID: So I'm attempting to move my OwnCloud instance from Apache to Nginx because I heard it was better on low-spec machines (the box is basically a recycled desktop from like 2004; P4 + 1GB of RAM ) I've always run OwnCloud out of a home directory for ease of use with samba and non-root privs. The tutorial I followed had me place it back in /srv/http and it worked fine there; now I'm trying to figure out why when I try to configure it back to /home, it DOESNT work. The working config: user http; worker_processes 1; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; location / { root /srv/http/owncloud; index index.html index.php; } location ~ \.php$ { root /srv/http/owncloud; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/http/owncloud/$fastcgi_script_name; include fastcgi_params; } } } In that setup; its set to run via /srv/http/owncloud, under the user http. And it works fine, displays the webpage no problem. (Complains about not having permission to the database, but thats cuz its running as http, and the database is set for public) Below all I attempted to change was make it run via /home/public/www/owncloud instead of /srv/http/owncloud, and under the user public, group users. user public users; worker_processes 1; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; location / { root /home/public/www/owncloud; index index.html index.php; } location ~ \.php$ { root /home/public/www/owncloud; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/public/www/owncloud/$fastcgi_script_name; include fastcgi_params; } } } Using this config file, when i give the server's IP (192.168.0.101) all I get is a blank page. No error messages, no warnings, nothing in the log files. Just a blank page. if I give i192.168.0.101/index.php, nothing changes. Anyone got any ideas as to what may be happening? I've been staring at config files, and wiki's for the last 3hrs so it may just need a fresh set of eyes. From ewgraf at gmail.com Mon Oct 24 05:56:20 2011 From: ewgraf at gmail.com (Sokolov Evgeniy) Date: Mon, 24 Oct 2011 11:56:20 +0600 Subject: Nginx displaying blank page, doesn't error In-Reply-To: References: Message-ID: Hi! You can see blank page because you have display_errors=off in php.ini, or may be you haven't enough error_reporting level. Also I think this can be because php configured with suhosin path. 2011/10/24 Eric Griffith > So I'm attempting to move my OwnCloud instance from Apache to Nginx > because I heard it was better on low-spec machines (the box is > basically a recycled desktop from like 2004; P4 + 1GB of RAM ) > > I've always run OwnCloud out of a home directory for ease of use with > samba and non-root privs. The tutorial I followed had me place it back > in /srv/http and it worked fine there; now I'm trying to figure out > why when I try to configure it back to /home, it DOESNT work. > > The working config: > > user http; > > worker_processes 1; > > #pid logs/nginx.pid; > > > events { > worker_connections 1024; > } > > > http { > include mime.types; > default_type application/octet-stream; > > sendfile on; > #tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 65; > > #gzip on; > > server { > listen 80; > server_name localhost; > > location / { > root /srv/http/owncloud; > index index.html index.php; > } > > location ~ \.php$ { > root /srv/http/owncloud; > fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME /srv/http/owncloud/$fastcgi_script_name; > include fastcgi_params; > } > } > > } > > > > In that setup; its set to run via /srv/http/owncloud, under the user > http. And it works fine, displays the webpage no problem. (Complains > about not having permission to the database, but thats cuz its running > as http, and the database is set for public) > > Below all I attempted to change was make it run via > /home/public/www/owncloud instead of /srv/http/owncloud, and under the > user public, group users. > > > user public users; > > worker_processes 1; > > #pid logs/nginx.pid; > > > events { > worker_connections 1024; > } > > > http { > include mime.types; > default_type application/octet-stream; > > sendfile on; > #tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 65; > > #gzip on; > > server { > listen 80; > server_name localhost; > > location / { > root /home/public/www/owncloud; > index index.html index.php; > } > > location ~ \.php$ { > root /home/public/www/owncloud; > fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > /home/public/www/owncloud/$fastcgi_script_name; > include fastcgi_params; > } > } > > } > > > Using this config file, when i give the server's IP (192.168.0.101) > all I get is a blank page. No error messages, no warnings, nothing in > the log files. Just a blank page. if I give i192.168.0.101/index.php, > nothing changes. Anyone got any ideas as to what may be happening? > I've been staring at config files, and wiki's for the last 3hrs so it > may just need a fresh set of eyes. > > _______________________________________________ > 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 Mon Oct 24 10:45:14 2011 From: nginx-forum at nginx.us (jjjaime) Date: Mon, 24 Oct 2011 06:45:14 -0400 Subject: Client certificates from multiple CAs Message-ID: <8598aaa8646c79aaa660563d3e8b0fd4.NginxMailingListEnglish@forum.nginx.org> Is it possible to configure nginx to perform client certificate validation when the client certificates are generated by different CAs? I've seen that it's rather easy when the client certificates are generated by only one (using the directive: ssl_client_certificate), but I cannot assure that all the certificates will be generated by only one CA. Any suggestion? Thanks, Jaime Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217172,217172#msg-217172 From nginx-forum at nginx.us Mon Oct 24 11:02:35 2011 From: nginx-forum at nginx.us (TECK) Date: Mon, 24 Oct 2011 07:02:35 -0400 Subject: Location not called properly In-Reply-To: References: Message-ID: <760792e12f19a323f98cf63822e0adae.NginxMailingListEnglish@forum.nginx.org> The fastcgi value is the name of my upstream. The idea is: once the location /somedir/file1.php is reached, everything in @cache should execute. In this way, I don't repeat several times the same code. This works: location /somedir/file1.php { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass fastcgi; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; include fastcgi.conf; } This does not: location = /somedir/file1.php { try_files @cache =404; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217122,217174#msg-217174 From jg at internetx.de Mon Oct 24 12:02:15 2011 From: jg at internetx.de (Juergen Gotteswinter) Date: Mon, 24 Oct 2011 14:02:15 +0200 Subject: NGINX SMTP Proxy Message-ID: <4EA553C7.6010306@internetx.com> Hi, i already googled, but unfortanly i wasnt able to find a example for nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy in front of a sendmail daemon. thanks! Juergen From sb at waeme.net Mon Oct 24 12:30:56 2011 From: sb at waeme.net (Sergey Budnevitch) Date: Mon, 24 Oct 2011 16:30:56 +0400 Subject: Confirmation of AIO In-Reply-To: References: Message-ID: <99C4E19D-2615-4A08-9E60-D35D19948FFA@waeme.net> On 24.10.2011, at 1:48, Ilan Berkner wrote: > Hi All, > > I'm trying to understand the advantages of AIO and how using it with Nginx can improve performance. > > I've compiled Nginx from source with the AIO option. > > I've enabled AIO in my Nginx configuration. > > How can I confirm that its working? If the server is serving pages, does it mean that its using AIO? What OS are you using? From andrew at nginx.com Mon Oct 24 13:02:17 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Mon, 24 Oct 2011 17:02:17 +0400 Subject: NGINX SMTP Proxy In-Reply-To: <4EA553C7.6010306@internetx.com> References: <4EA553C7.6010306@internetx.com> Message-ID: Hi, You can check this one http://wiki.nginx.org/MailCoreModule and probably (albeit, only through a translation :) http://citrin.ru/nginx:ngx_mail_core_module We'll shortly be adding an updated version on http://nginx.org/en/docs/ too. Also, do you need smtp proxy with or w/o authorization? What's the scenario of use? On Oct 24, 2011, at 4:02 PM, Juergen Gotteswinter wrote: > Hi, > > i already googled, but unfortanly i wasnt able to find a example for nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy in front of a sendmail daemon. > > thanks! > > Juergen > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From iberkner at gmail.com Mon Oct 24 13:07:57 2011 From: iberkner at gmail.com (iberkner at gmail.com) Date: Mon, 24 Oct 2011 13:07:57 +0000 Subject: Confirmation of AIO Message-ID: <1873471172-1319461679-cardhu_decombobulator_blackberry.rim.net-1701464188-@b2.c5.bise6.blackberry> CentOS ------Original Message------ From: Sergey Budnevitch Sender: nginx-bounces at nginx.org To: nginx at nginx.org ReplyTo: nginx at nginx.org Subject: Re: Confirmation of AIO Sent: Oct 24, 2011 8:30 AM On 24.10.2011, at 1:48, Ilan Berkner wrote: > Hi All, > > I'm trying to understand the advantages of AIO and how using it with Nginx can improve performance. > > I've compiled Nginx from source with the AIO option. > > I've enabled AIO in my Nginx configuration. > > How can I confirm that its working? If the server is serving pages, does it mean that its using AIO? What OS are you using? _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From jg at internetx.de Mon Oct 24 13:15:08 2011 From: jg at internetx.de (Juergen Gotteswinter) Date: Mon, 24 Oct 2011 15:15:08 +0200 Subject: NGINX SMTP Proxy In-Reply-To: References: <4EA553C7.6010306@internetx.com> Message-ID: <4EA564DC.8080208@internetx.com> Am 24.10.11 15:02, schrieb Andrew Alexeev: > Hi, > > You can check this one > http://wiki.nginx.org/MailCoreModule > > and probably (albeit, only through a translation :) > http://citrin.ru/nginx:ngx_mail_core_module > > We'll shortly be adding an updated version on http://nginx.org/en/docs/ too. > > Also, do you need smtp proxy with or w/o authorization? What's the scenario of use? > > On Oct 24, 2011, at 4:02 PM, Juergen Gotteswinter wrote: > >> Hi, >> >> i already googled, but unfortanly i wasnt able to find a example for nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy in front of a sendmail daemon. >> >> thanks! >> >> Juergen >> >> _______________________________________________ >> 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 > Hi Andrew, thanks! the 2nd link looks good. we just need to protect the real smtp server from the bad bad internet :) no smtp auth at all. cheers, juergen From sb at waeme.net Mon Oct 24 13:54:33 2011 From: sb at waeme.net (Sergey Budnevitch) Date: Mon, 24 Oct 2011 17:54:33 +0400 Subject: Confirmation of AIO In-Reply-To: <1873471172-1319461679-cardhu_decombobulator_blackberry.rim.net-1701464188-@b2.c5.bise6.blackberry> References: <1873471172-1319461679-cardhu_decombobulator_blackberry.rim.net-1701464188-@b2.c5.bise6.blackberry> Message-ID: <562BAFA2-BA7B-4154-A4C6-594916E17106@waeme.net> On 24.10.2011, at 17:07, iberkner at gmail.com wrote: > CentOS Run nginx under strace: strace -f -e trace=io_submit /usr/sbin/nginx You will see something like [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 ... if aio is working. > > ------Original Message------ > From: Sergey Budnevitch > Sender: nginx-bounces at nginx.org > To: nginx at nginx.org > ReplyTo: nginx at nginx.org > Subject: Re: Confirmation of AIO > Sent: Oct 24, 2011 8:30 AM > > > On 24.10.2011, at 1:48, Ilan Berkner wrote: > >> Hi All, >> >> I'm trying to understand the advantages of AIO and how using it with Nginx can improve performance. >> >> I've compiled Nginx from source with the AIO option. >> >> I've enabled AIO in my Nginx configuration. >> >> How can I confirm that its working? If the server is serving pages, does it mean that its using AIO? > > What OS are you using? > _______________________________________________ > 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 brane.gracnar at tsmedia.si Mon Oct 24 13:58:33 2011 From: brane.gracnar at tsmedia.si (Brane F. =?utf-8?q?Gra=C4=8Dnar?=) Date: Mon, 24 Oct 2011 15:58:33 +0200 Subject: NGINX SMTP Proxy In-Reply-To: <4EA553C7.6010306@internetx.com> References: <4EA553C7.6010306@internetx.com> Message-ID: <201110241558.33256.brane.gracnar@tsmedia.si> On Monday 24 of October 2011 14:02:15 Juergen Gotteswinter wrote: > Hi, > > i already googled, but unfortanly i wasnt able to find a example for > nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy > in front of a sendmail daemon. This one works for me: mail { auth_http localhost:9090/cgi-bin/auth; server { listen [a:b:c::d]:25; # this is SMTP proxy! protocol smtp; smtp_capabilities "PIPELINING" "SIZE 10240000" "VRFY" "ETRN" "ENHANCEDSTATUSCODES" "8BITMIME" "DSN"; server_name maili2.prod.interseek.com; proxy on; proxy_timeout 30; proxy_pass_error_message on; # only if upstream supports XCLIENT xclient on; smtp_auth none; so_keepalive on; } } Brane From mdounin at mdounin.ru Mon Oct 24 14:16:19 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 24 Oct 2011 18:16:19 +0400 Subject: NGINX SMTP Proxy In-Reply-To: <201110241558.33256.brane.gracnar@tsmedia.si> References: <4EA553C7.6010306@internetx.com> <201110241558.33256.brane.gracnar@tsmedia.si> Message-ID: <20111024141619.GU62535@mdounin.ru> Hello! On Mon, Oct 24, 2011 at 03:58:33PM +0200, Brane F. Gra?nar wrote: > On Monday 24 of October 2011 14:02:15 Juergen Gotteswinter wrote: > > Hi, > > > > i already googled, but unfortanly i wasnt able to find a example for > > nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy > > in front of a sendmail daemon. > > > This one works for me: > > mail { > > auth_http localhost:9090/cgi-bin/auth; > server { > listen [a:b:c::d]:25; > > # this is SMTP proxy! > protocol smtp; > smtp_capabilities "PIPELINING" "SIZE 10240000" "VRFY" "ETRN" "ENHANCEDSTATUSCODES" "8BITMIME" "DSN"; The "PIPELINING" here may be problematic, as out of the box nginx *doesn't* support SMTP pipelining. Maxim Dounin > > server_name maili2.prod.interseek.com; > > proxy on; > proxy_timeout 30; > proxy_pass_error_message on; > > # only if upstream supports XCLIENT > xclient on; > > smtp_auth none; > so_keepalive on; > > > } > } > > Brane > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Mon Oct 24 15:08:35 2011 From: nginx-forum at nginx.us (caiotarifa) Date: Mon, 24 Oct 2011 11:08:35 -0400 Subject: Nginx: different content to specific request method Message-ID: <5a11c69bbf4887c1ee4aa7c35a8c2104.NginxMailingListEnglish@forum.nginx.org> Hey Guys, I have the image in the url (my server): http://www.example.com/example.jpg If my user put this image url on his site: return the image (normal). If my user put this image url on his browser: return redirect to my site, i.e. http://www.example.com/?fimage=example.jpg How to do it? Regards, Caio Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217215,217215#msg-217215 From lvella at gmail.com Mon Oct 24 15:32:55 2011 From: lvella at gmail.com (Lucas Clemente Vella) Date: Mon, 24 Oct 2011 13:32:55 -0200 Subject: Client certificates from multiple CAs In-Reply-To: <8598aaa8646c79aaa660563d3e8b0fd4.NginxMailingListEnglish@forum.nginx.org> References: <8598aaa8646c79aaa660563d3e8b0fd4.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2011/10/24 jjjaime : > Is it possible to configure nginx to perform client certificate > validation when the client certificates are generated by different CAs? > I've seen that it's rather easy when the client certificates are > generated by only one (using the directive: ssl_client_certificate), but > I cannot assure that all the certificates will be generated by only one > CA. > Any suggestion? I would try to concatenate all the CA roots in a single file... -- Lucas Clemente Vella lvella at gmail.com From lists at ruby-forum.com Mon Oct 24 16:43:42 2011 From: lists at ruby-forum.com (Graham D.) Date: Mon, 24 Oct 2011 18:43:42 +0200 Subject: Nginx NAS serving large files In-Reply-To: References: Message-ID: <3ffa2259fc1b605fdc7f68c8c5ea937f@ruby-forum.com> Brian Akins wrote in post #1027955: > Do you have sendfile on or off? We generally run it off for NAS. Also, > are > you using the open file cache? Hello, yes at the moment we have sendfile set to off. And yes we are using open file cache. And our readahead is 2mb incase you're wondering. Any other ideas? -- Posted via http://www.ruby-forum.com/. From egriffith92 at gmail.com Mon Oct 24 17:44:34 2011 From: egriffith92 at gmail.com (Eric Griffith) Date: Mon, 24 Oct 2011 13:44:34 -0400 Subject: Nginx displaying blank page, doesn't error In-Reply-To: References: Message-ID: Was able to figure it out after a fresh night of sleep and some more googling; the reason it worked under /srv/http but not under /home/public; was because in /etc/php/php-fpm.conf there was a semi-hidden line for user group and they were both set to http; which is fine for /srv/http/ cuz http owns them; but since its a home directory, it needed to be user public group users Thanks anyway guys; if nothing else you made me start looking at it being php's fault instead of nginx's haha On Mon, Oct 24, 2011 at 1:56 AM, Sokolov Evgeniy wrote: > Hi! > > You can see blank page because you have display_errors=off in php.ini, or > may be you haven't enough error_reporting level. > > Also I think this can be because php configured with suhosin path. > > > 2011/10/24 Eric Griffith >> >> So I'm attempting to move my OwnCloud instance from Apache to Nginx >> because I heard it was better on low-spec machines (the box is >> basically a recycled desktop from like 2004; P4 + 1GB of RAM ) >> >> I've always run OwnCloud out of a home directory for ease of use with >> samba and non-root privs. The tutorial I followed had me place it back >> in /srv/http and it worked fine there; now I'm trying to figure out >> why when I try to configure it back to /home, it DOESNT work. >> >> The working config: >> >> user http; >> >> worker_processes ?1; >> >> #pid ? ? ? ?logs/nginx.pid; >> >> >> events { >> ? ?worker_connections ?1024; >> } >> >> >> http { >> ? ?include ? ? ? mime.types; >> ? ?default_type ?application/octet-stream; >> >> ? ?sendfile ? ? ? ?on; >> ? ?#tcp_nopush ? ? on; >> >> ? ?#keepalive_timeout ?0; >> ? ?keepalive_timeout ?65; >> >> ? ?#gzip ?on; >> >> server { >> ?listen 80; >> ?server_name localhost; >> >> ?location / { >> ? ?root /srv/http/owncloud; >> ? ?index index.html index.php; >> ?} >> >> ?location ~ \.php$ { >> ? ?root /srv/http/owncloud; >> ? ?fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; >> ? ?fastcgi_index index.php; >> ? ?fastcgi_param SCRIPT_FILENAME /srv/http/owncloud/$fastcgi_script_name; >> ? ?include fastcgi_params; >> ?} >> } >> >> } >> >> >> >> In that setup; its set to run via /srv/http/owncloud, under the user >> http. And it works fine, displays the webpage no problem. (Complains >> about not having permission to the database, but thats cuz its running >> as http, and the database is set for public) >> >> Below all I attempted to change was make it run via >> /home/public/www/owncloud instead of /srv/http/owncloud, and under the >> user public, group users. >> >> >> user public users; >> >> worker_processes ?1; >> >> #pid ? ? ? ?logs/nginx.pid; >> >> >> events { >> ? ?worker_connections ?1024; >> } >> >> >> http { >> ? ?include ? ? ? mime.types; >> ? ?default_type ?application/octet-stream; >> >> ? ?sendfile ? ? ? ?on; >> ? ?#tcp_nopush ? ? on; >> >> ? ?#keepalive_timeout ?0; >> ? ?keepalive_timeout ?65; >> >> ? ?#gzip ?on; >> >> server { >> ?listen 80; >> ?server_name localhost; >> >> ?location / { >> ? ?root /home/public/www/owncloud; >> ? ?index index.html index.php; >> ?} >> >> ?location ~ \.php$ { >> ? ?root /home/public/www/owncloud; >> ? ?fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; >> ? ?fastcgi_index index.php; >> ? ?fastcgi_param SCRIPT_FILENAME >> /home/public/www/owncloud/$fastcgi_script_name; >> ? ?include fastcgi_params; >> ?} >> } >> >> } >> >> >> Using this config file, when i give the server's IP (192.168.0.101) >> all I get is a blank page. No error messages, no warnings, nothing in >> the log files. Just a blank page. if I give i192.168.0.101/index.php, >> nothing changes. Anyone got any ideas as to what may be happening? >> I've been staring at config files, and wiki's for the last 3hrs so it >> may just need a fresh set of eyes. >> >> _______________________________________________ >> 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 ilan at time4learning.com Mon Oct 24 19:27:32 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Mon, 24 Oct 2011 15:27:32 -0400 Subject: Confirm event model Message-ID: Is there a way to confirm / see which event model Nginx is using? i.e. "select", "epoll", "kqueue", etc.? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Mon Oct 24 20:12:48 2011 From: francis at daoine.org (Francis Daly) Date: Mon, 24 Oct 2011 21:12:48 +0100 Subject: Location not called properly In-Reply-To: <760792e12f19a323f98cf63822e0adae.NginxMailingListEnglish@forum.nginx.org> References: <760792e12f19a323f98cf63822e0adae.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111024201248.GC27078@craic.sysops.org> On Mon, Oct 24, 2011 at 07:02:35AM -0400, TECK wrote: Hi there, > The fastcgi value is the name of my upstream. Yes, that part works. > The idea is: once the location /somedir/file1.php is reached, > everything in @cache should execute. If you *really* want to do it that way, it would be something like try_files /no-such-file @cache; But you probably don't want to do it that way. > In this way, I don't repeat several times the same code. If you don't want to *see* lots of repetition in nginx.conf, use "include". If you don't want to *write* lots of repetition in nginx.conf, use a separate generator to create it. > This works: > > location /somedir/file1.php { This will match "/somedir/file1.php", and "/somedir/file1.phpX", and "/somedir/file1.php/X", for any X. Although later config will likely block anything except "/somedir/file1.php" from being processed. > This does not: > location = /somedir/file1.php { This will match only "/somedir/file1.php". > try_files @cache =404; This will serve the file "/usr/local/nginx/html at cache", or else return 404. (try_files tries files. Only the last parameter is handled specially.) Either make it "try_files /no-such-file @cache;", or replace it with "include my-repeated-php-config-file;" Good luck, f -- Francis Daly francis at daoine.org From ilan at time4learning.com Mon Oct 24 21:06:03 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Mon, 24 Oct 2011 17:06:03 -0400 Subject: client closed prematurely connection while reading client request line Message-ID: Very basic configuration, strictly for serving static files. I've got the error_log setting configured to "info" to get more information as to what's happening with connections, etc. While monitoring the error log and loading a single static html file through my web browser, I noticed this line in the error log show up: 2011/10/24 16:02:04 [info] 26517#0: *3132 client closed prematurely connection while reading client request line, client: ###.###.###.###, server: localhost What's the reason for this error, does it matter and is there a way to address it? is it indicative of a deeper network configuration issue with TCP settings? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Oct 24 21:16:46 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Mon, 24 Oct 2011 17:16:46 -0400 Subject: Confirm event model In-Reply-To: References: Message-ID: <441f893461ea530b3cdb82340f797ed4.NginxMailingListEnglish@forum.nginx.org> It'll automatically use the best one available. Unless you're on some embedded system which might have an old kernel then you really don't need to worry about this at all. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217238,217247#msg-217247 From ilan at time4learning.com Mon Oct 24 21:19:35 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Mon, 24 Oct 2011 17:19:35 -0400 Subject: Confirm event model In-Reply-To: <441f893461ea530b3cdb82340f797ed4.NginxMailingListEnglish@forum.nginx.org> References: <441f893461ea530b3cdb82340f797ed4.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks, I read that as well, none the less, it would be nice to be able to confirm which one its chosen. On Mon, Oct 24, 2011 at 5:16 PM, Ensiferous wrote: > It'll automatically use the best one available. Unless you're on some > embedded system which might have an old kernel then you really don't > need to worry about this at all. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,217238,217247#msg-217247 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zzz at zzz.org.ua Mon Oct 24 21:27:38 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 25 Oct 2011 00:27:38 +0300 Subject: Confirm event model In-Reply-To: References: <441f893461ea530b3cdb82340f797ed4.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Tue, Oct 25, 2011 at 12:19 AM, Ilan Berkner wrote: > Thanks, I read that as well, none the less, it would be nice to be able to confirm which one its chosen. Just enable notice-level messages for error_log and you'll see: error_log logs/error.log notice; From brane.gracnar at tsmedia.si Mon Oct 24 22:14:16 2011 From: brane.gracnar at tsmedia.si (Brane F. =?utf-8?q?Gra=C4=8Dnar?=) Date: Tue, 25 Oct 2011 00:14:16 +0200 Subject: Confirm event model In-Reply-To: References: Message-ID: <201110250014.16943.brane.gracnar@tsmedia.si> On Monday 24 of October 2011 21:27:32 Ilan Berkner wrote: > Is there a way to confirm / see which event model Nginx is using? > > i.e. "select", "epoll", "kqueue", etc.? strace -p :) Best regards, Brane From brane.gracnar at tsmedia.si Mon Oct 24 22:16:01 2011 From: brane.gracnar at tsmedia.si (Brane F. =?utf-8?q?Gra=C4=8Dnar?=) Date: Tue, 25 Oct 2011 00:16:01 +0200 Subject: NGINX SMTP Proxy In-Reply-To: <20111024141619.GU62535@mdounin.ru> References: <4EA553C7.6010306@internetx.com> <201110241558.33256.brane.gracnar@tsmedia.si> <20111024141619.GU62535@mdounin.ru> Message-ID: <201110250016.01685.brane.gracnar@tsmedia.si> On Monday 24 of October 2011 16:16:19 Maxim Dounin wrote: > > smtp_capabilities "PIPELINING" "SIZE 10240000" "VRFY" "ETRN" > > "ENHANCEDSTATUSCODES" "8BITMIME" "DSN"; > > The "PIPELINING" here may be problematic, as out of the box nginx > *doesn't* support SMTP pipelining. Thanks *alot* for this clarification! Brane From contact at jpluscplusm.com Mon Oct 24 22:17:05 2011 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 24 Oct 2011 23:17:05 +0100 Subject: Time To First Byte and proxy_buffering Message-ID: Hi all - Does "proxy_buffering on" (especially when it'll definitely buffer to disk) imply that the client will *not* be sent the first part of the response until nginx has received and buffered the entire response from the upstream server? Or does/can the upstream response buffering happen in parallel with the client-side response being sent? Many thanks, Jonathan -- Jonathan Matthews London, UK http://www.jpluscplusm.com/contact.html From mdounin at mdounin.ru Mon Oct 24 22:33:35 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 25 Oct 2011 02:33:35 +0400 Subject: client closed prematurely connection while reading client request line In-Reply-To: References: Message-ID: <20111024223334.GY62535@mdounin.ru> Hello! On Mon, Oct 24, 2011 at 05:06:03PM -0400, Ilan Berkner wrote: > Very basic configuration, strictly for serving static files. > > I've got the error_log setting configured to "info" to get more information > as to what's happening with connections, etc. > > While monitoring the error log and loading a single static html file through > my web browser, I noticed this line in the error log show up: > > 2011/10/24 16:02:04 [info] 26517#0: *3132 client closed prematurely > connection while reading client request line, client: ###.###.###.###, > server: localhost > > What's the reason for this error, does it matter and is there a way to > address it? is it indicative of a deeper network configuration issue with > TCP settings? Some modern browsers tend to open 2 tcp connections to server from start, and if you are loading a single static file - one of them remains unused. The browser eventually closes it without sending any request, and this causes the above message in logs. Maxim Dounin From mdounin at mdounin.ru Mon Oct 24 22:53:50 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 25 Oct 2011 02:53:50 +0400 Subject: Time To First Byte and proxy_buffering In-Reply-To: References: Message-ID: <20111024225350.GZ62535@mdounin.ru> Hello! On Mon, Oct 24, 2011 at 11:17:05PM +0100, Jonathan Matthews wrote: > Does "proxy_buffering on" (especially when it'll definitely buffer to > disk) imply that the client will *not* be sent the first part of the > response until nginx has received and buffered the entire response > from the upstream server? No. > Or does/can the upstream response buffering > happen in parallel with the client-side response being sent? Yes. There is a caveat though: individual buffers (see proxy_buffers directive) will be sent to client only once they are fully filled. And that's why "proxy_buffering off" exists: it allows pass all data without any delay even if buffer isn't yet filled, as this may be critical in some use cases (streaming, some server push cases). Maxim Dounin From appa at perusio.net Mon Oct 24 23:58:12 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 25 Oct 2011 00:58:12 +0100 Subject: Nginx rewrite: last & break In-Reply-To: <20111023152603.GI62535@mdounin.ru> References: <20111020163831.GM1911@mdounin.ru> <20111023152603.GI62535@mdounin.ru> Message-ID: <871uu2ueln.wl%appa@perusio.net> On 23 Out 2011 16h26 WEST, mdounin at mdounin.ru wrote: Hello Maxim, Can this be reasoned like this? 1. last means the *last* rewrite, after which the location matching phase reoccurs, in search of a content handler. 2. break means that the rewrite phase is done and we proceed to the next phase. There must be a content handler (be a location) for this to be true. 3. Outside a location block there's no content handler, hence using last or break is basically the same. Thx, --- appa > Hello! > > On Sat, Oct 22, 2011 at 02:04:21PM +0300, Nginx User wrote: > >> On 22 October 2011 06:30, Ryan Chan wrote: >>> Anyone would like to do a quick summary for the issue? >> >> Minaev's answer in the serverfault link you provided is the >> clearest explanation I have seen to date of this. >> >> To paraphrase, he says, within a location block, when you use >> "last" the rewrites are stopped and a new subrequest is generated >> which will > > Just a side note: "subrequest" is incorrect term here. > >> take all all locations into account. When you use "break" the >> rewrites are stopped and processing continued within the location >> you are in. >> >> Adding Maxim's statement above into account, outside a location >> block, "break" behaves just like "last" does since there are no >> location directives to run here. >> >> Someone just needs to update the docs if this is correct. > > Reading rewrite module docs carefully enough will tell basically > the same: > > ... > If the URI changed as a result of the execution of directives > inside location, then location is again determined for the new > URI. This cycle can be repeated up to 10 times, after which Nginx > returns a 500 error. > ... > > ... > Example: > > rewrite ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 last; > rewrite ^(/download/.*)/audio/(.*)\..*$ $1/mp3/$2.ra last; > return 403; > > But if we place these directives in location /download/, then it > is necessary to replace flag "last" by "break", otherwise Nginx > will hit the 10 cycle limit and return error 500: > > location /download/ { > rewrite ^(/download/.*)/media/(.*)\..*$ $1/mp3/$2.mp3 break; > rewrite ^(/download/.*)/audio/(.*)\..*$ $1/mp3/$2.ra break; > return 403; > } > ... > > The translation though looks awful and needs re-translation; > additionally, it was already polluted with user comments, and this > doesn't improve readability either. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From appa at perusio.net Tue Oct 25 00:07:40 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 25 Oct 2011 01:07:40 +0100 Subject: Blank Adsense ads on certain pages In-Reply-To: <87vcrfp6i8.wl%appa@perusio.net> References: <87vcrfp6i8.wl%appa@perusio.net> Message-ID: <87zkgqszlf.wl%appa@perusio.net> On 24 Out 2011 01h39 WEST, appa at perusio.net wrote: > On 24 Out 2011 01h03 WEST, nginx-forum at nginx.us wrote: > >> I have inserted my adsense code into my site in certain areas, and >> the issue is very strange: ads only randomly work on some pages, >> and others the ad block still 'loads', but nothing appears. Just a >> black box. >> >> When you load the homepage page, you see the ad...but clicking on >> the forums tab takes you to another page with the **exact same ad >> code**, but nothing loads. You can even rightclick where the ad >> should be and you can see the iframe it inserted. If you go to the >> forums and navigate the member list, random profiles show ads, >> others do not. Certain forums show ads, other ads do not. Certain >> forum topics show ads, other don't. Refreshing the page does not >> help. This stays consistent across multiple browsers. >> >> The forum has a "SEO" function available, which I have enabled so >> the URLs look better. The .htaccess file if I had gone with apache >> is structured as follows: >> >> >> Options -MultiViews >> RewriteEngine On >> RewriteBase / >> RewriteCond %{REQUEST_FILENAME} !-f >> RewriteCond %{REQUEST_FILENAME} !-d >> RewriteRule . /index.php [L] >> >> >> Turning the SEO URL function to 'off' removes the issue of ads not >> appearing, but this isn't acceptable for us. It just makes me think >> I have done something wrong in the NGINX config file. >> >> Here is the site-available file I have done for this website: >> >> ------------------------------------------------- >> >> ##redirect to www >> server { >> server_name twinkinfo.com; >> rewrite ^/(.*) http://www.twinkinfo.com/$1 permanent; >> } > > Like this: > > server { > server_name twinkinfo.com; > return 301 http://www.twinkinfo.com; > } Oops. $request_uri is missing: server { server_name twinkinfo.com; return 301 http://www.twinkinfo.com$request_uri; } --- appa From nginx-forum at nginx.us Tue Oct 25 00:28:49 2011 From: nginx-forum at nginx.us (Skolde) Date: Mon, 24 Oct 2011 20:28:49 -0400 Subject: Blank Adsense ads on certain pages In-Reply-To: References: Message-ID: <050f7523190417e518c9ce647df09094.NginxMailingListEnglish@forum.nginx.org> >The catch all location is falling back to index.php without any arguments. Is that the way it's supposed to be? Yes, adding arguments causes a redirect loop for some reason. >The URIs starting with page have a fallback to index.php with args. Those pages use in-line javascript editing which requires args to be appended to index.php. Unlike the earlier catch all location, this does not cause a redirecting issue. >Is index.php your PHP "handler"? If it is then use this: >location = /index.php { >include fastcgi_params; >include fastcgi_config; >fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; >} I tried that, but the site no longer loaded any styling and was just giant text and white background. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217145,217258#msg-217258 From lists at ruby-forum.com Tue Oct 25 04:19:16 2011 From: lists at ruby-forum.com (Graham D.) Date: Tue, 25 Oct 2011 06:19:16 +0200 Subject: Nginx NAS serving large files In-Reply-To: References: Message-ID: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> Any ideas guys - I need to get this resolved asap. Otherwise i need to figure another solution for our NSF NAS Nginx configuration... -- Posted via http://www.ruby-forum.com/. From andrew at nginx.com Tue Oct 25 08:23:54 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Tue, 25 Oct 2011 12:23:54 +0400 Subject: Nginx NAS serving large files In-Reply-To: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> References: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> Message-ID: Graham, Forgive my ignorance, what's "port 182" in your original email? In your tests did you use a single nginx instance and a single Apache against that 1 logical disk on Netapp? Can you show sections on nginx configuration relevant to disk operations (also, how many workers per nginx server)? Do you use any specific tunables to adjust the network settings for Netapp? How many files on Netapp partition? What's your OS? On Oct 25, 2011, at 8:19 AM, Graham D. wrote: > Any ideas guys - I need to get this resolved asap. > > > Otherwise i need to figure another solution for our NSF NAS Nginx > configuration... > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From al-nginx at none.at Tue Oct 25 09:04:11 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Tue, 25 Oct 2011 11:04:11 +0200 Subject: Nginx NAS serving large files In-Reply-To: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> References: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> Message-ID: <84a12b9aca5b050e7a6391c567144a6c@none.at> Hi, On 25.10.2011 06:19, Graham D. wrote: > Any ideas guys - I need to get this resolved asap. > > > Otherwise i need to figure another solution for our NSF NAS Nginx > configuration... Which HW do you have (Networkcard, ...)? Do you have anything in the messages/syslog file about some limits? Do you use connection track in the iptables? Cheers Aleks From igor at sysoev.ru Tue Oct 25 09:25:34 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 25 Oct 2011 13:25:34 +0400 Subject: Nginx NAS serving large files In-Reply-To: References: Message-ID: <20111025092534.GB9463@nginx.com> On Sat, Oct 22, 2011 at 08:29:05PM +0200, Graham D. wrote: > Hello Ladies and Gentlemen, > > We have a very frustrating problem with a NAS configuration that we > recently set-up. After running a filesharing website on 8 servers for 1+ > years we decided to switch to a NAS configuration. We set-up our NAS > (24x1TB Raid 5) to serve files to 9 front end servers over a private > switch - doing 9 servers on 1 disk(logical)... not sure if nginx can > handle this. Since we've moved to the NAS BW usage has dropped > significantly even though our traffic has stayed the same. Download > speeds are pretty bad aswell but this is due to IO issues that are being > created by NGINX. so here's the problem we are facing... > > In theory nginx is creating an io bottleneck because it's opening to > many times without closing. We're using nginx on our front end servers > to grab files off our nas - each file will stay alive though for 45+ > minutes. Instead of opening it for 10 seconds, reading into memory, and > closing - it's opening it for 10 seconds, reading into memory, streaming > it for 45 minutes, THEN closing. We ran a test with nginx and we were > only able to download at 30kbps on port 182, how-ever over apache we > were able to reach speeds of 20mb/s. > > We've re-compiled nignx and installed the most recent stable version but > that didn't fix anything. > > Can someone please suggest a fix here? I've ran out of ideas... What OS do you use ? Try the following: worker_processes 32; http { sendfile off; output_buffers 1 1m; ... } -- Igor Sysoev From igor at sysoev.ru Tue Oct 25 09:58:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 25 Oct 2011 13:58:48 +0400 Subject: Confirm event model In-Reply-To: References: Message-ID: <20111025095848.GC9463@nginx.com> On Mon, Oct 24, 2011 at 03:27:32PM -0400, Ilan Berkner wrote: > Is there a way to confirm / see which event model Nginx is using? > > i.e. "select", "epoll", "kqueue", etc.? Just write explictly: events { use epoll; } If nginx can not use this method it will complain in error_log. -- Igor Sysoev From b.yordanov at exsisto.com Tue Oct 25 10:04:20 2011 From: b.yordanov at exsisto.com (Boyko Yordanov) Date: Tue, 25 Oct 2011 13:04:20 +0300 Subject: Confirm event model In-Reply-To: <20111025095848.GC9463@nginx.com> References: <20111025095848.GC9463@nginx.com> Message-ID: <9924F8A5-E31D-453C-87AF-662C5E63F584@exsisto.com> Hi! Maybe kind of off topic, but I would like to have some light on this. Is it scheduled to implement more extended server-status which would eventually provide this info? The FeatureRequests page includes such thing with state "Maybe?" - http://wiki.nginx.org/FeatureRequests Thanks and regards, Boyko -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at nginx.com Tue Oct 25 10:18:25 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Tue, 25 Oct 2011 14:18:25 +0400 Subject: Confirm event model In-Reply-To: <9924F8A5-E31D-453C-87AF-662C5E63F584@exsisto.com> References: <20111025095848.GC9463@nginx.com> <9924F8A5-E31D-453C-87AF-662C5E63F584@exsisto.com> Message-ID: Yes, work in progress On Oct 25, 2011, at 2:04 PM, Boyko Yordanov wrote: > Hi! > > Maybe kind of off topic, but I would like to have some light on this. > > Is it scheduled to implement more extended server-status which would eventually provide this info? > > The FeatureRequests page includes such thing with state "Maybe?" - http://wiki.nginx.org/FeatureRequests > > Thanks and regards, > > Boyko > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Tue Oct 25 10:34:53 2011 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Tue, 25 Oct 2011 11:34:53 +0100 Subject: Time To First Byte and proxy_buffering In-Reply-To: <20111024225350.GZ62535@mdounin.ru> References: <20111024225350.GZ62535@mdounin.ru> Message-ID: On 24 October 2011 23:53, Maxim Dounin wrote: > Hello! > > On Mon, Oct 24, 2011 at 11:17:05PM +0100, Jonathan Matthews wrote: > >> Does "proxy_buffering on" (especially when it'll definitely buffer to >> disk) imply that the client will *not* be sent the first part of the >> response until nginx has received and buffered the entire response >> from the upstream server? > > No. > >> Or does/can the upstream response buffering >> happen in parallel with the client-side response being sent? > > Yes. > > There is a caveat though: individual buffers (see proxy_buffers > directive) will be sent to client only once they are fully filled. > And that's why "proxy_buffering off" exists: it allows pass all > data without any delay even if buffer isn't yet filled, as this > may be critical in some use cases (streaming, some server push > cases). Many thanks for the clarification, Maxim. I submit that this would a useful addition to the documentation, especially as the current (English) documentation's wording /could/ suggest the opposite, if only by inference: http://wiki.nginx.org/HttpProxyModule#proxy_buffering: "If buffering is switched off, then the response is synchronously transferred to client immediately" ... perhaps implying that if switched /on/, the response is *not* "transferred to client immediately". Cheers, Jonathan -- Jonathan Matthews London, UK http://www.jpluscplusm.com/contact.html From iberkner at gmail.com Tue Oct 25 12:01:24 2011 From: iberkner at gmail.com (iberkner at gmail.com) Date: Tue, 25 Oct 2011 12:01:24 +0000 Subject: Confirm event model Message-ID: <1840867811-1319544086-cardhu_decombobulator_blackberry.rim.net-1088136863-@b2.c5.bise6.blackberry> Thanks Igor. Is epoll considered the best polling method if available? ------Original Message------ From: Igor Sysoev Sender: nginx-bounces at nginx.org To: nginx at nginx.org ReplyTo: nginx at nginx.org Subject: Re: Confirm event model Sent: Oct 25, 2011 5:58 AM On Mon, Oct 24, 2011 at 03:27:32PM -0400, Ilan Berkner wrote: > Is there a way to confirm / see which event model Nginx is using? > > i.e. "select", "epoll", "kqueue", etc.? Just write explictly: events { use epoll; } If nginx can not use this method it will complain in error_log. -- Igor Sysoev _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From igor at sysoev.ru Tue Oct 25 12:20:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 25 Oct 2011 16:20:48 +0400 Subject: Confirm event model In-Reply-To: <1840867811-1319544086-cardhu_decombobulator_blackberry.rim.net-1088136863-@b2.c5.bise6.blackberry> References: <1840867811-1319544086-cardhu_decombobulator_blackberry.rim.net-1088136863-@b2.c5.bise6.blackberry> Message-ID: <20111025122048.GB13805@nginx.com> On Tue, Oct 25, 2011 at 12:01:24PM +0000, iberkner at gmail.com wrote: > Thanks Igor. > > Is epoll considered the best polling method if available? On Linux - yes. > ------Original Message------ > From: Igor Sysoev > Sender: nginx-bounces at nginx.org > To: nginx at nginx.org > ReplyTo: nginx at nginx.org > Subject: Re: Confirm event model > Sent: Oct 25, 2011 5:58 AM > > On Mon, Oct 24, 2011 at 03:27:32PM -0400, Ilan Berkner wrote: > > Is there a way to confirm / see which event model Nginx is using? > > > > i.e. "select", "epoll", "kqueue", etc.? > > Just write explictly: > > events { > use epoll; > } > > If nginx can not use this method it will complain in error_log. -- Igor Sysoev From igor at sysoev.ru Tue Oct 25 13:27:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 25 Oct 2011 17:27:03 +0400 Subject: Confirm event model In-Reply-To: <20111025095848.GC9463@nginx.com> References: <20111025095848.GC9463@nginx.com> Message-ID: <20111025132702.GB13886@nginx.com> On Tue, Oct 25, 2011 at 01:58:48PM +0400, Igor Sysoev wrote: > On Mon, Oct 24, 2011 at 03:27:32PM -0400, Ilan Berkner wrote: > > Is there a way to confirm / see which event model Nginx is using? > > > > i.e. "select", "epoll", "kqueue", etc.? > > Just write explictly: > > events { > use epoll; > } > > If nginx can not use this method it will complain in error_log. BTW, nginx loges on the notice level: "using the "..." event method". -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Tue Oct 25 13:53:22 2011 From: nginx-forum at nginx.us (baalchina) Date: Tue, 25 Oct 2011 09:53:22 -0400 Subject: Does nginx plan to support spdy? Message-ID: <5df5dc3fd8dcea296814b9583ffc457a.NginxMailingListEnglish@forum.nginx.org> http://en.wikipedia.org/wiki/SPDY It seems spdy much faster than http? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217299,217299#msg-217299 From b.yordanov at exsisto.com Tue Oct 25 13:54:42 2011 From: b.yordanov at exsisto.com (Boyko Yordanov) Date: Tue, 25 Oct 2011 16:54:42 +0300 Subject: Confirm event model In-Reply-To: References: <20111025095848.GC9463@nginx.com> <9924F8A5-E31D-453C-87AF-662C5E63F584@exsisto.com> Message-ID: <51D78CFE-4A02-4155-82DD-AAE5B32E0AAF@exsisto.com> On Oct 25, 2011, at 1:18 PM, Andrew Alexeev wrote: > Yes, work in progress Great, thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at nginx.com Tue Oct 25 13:56:51 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Tue, 25 Oct 2011 17:56:51 +0400 Subject: Does nginx plan to support spdy? In-Reply-To: <5df5dc3fd8dcea296814b9583ffc457a.NginxMailingListEnglish@forum.nginx.org> References: <5df5dc3fd8dcea296814b9583ffc457a.NginxMailingListEnglish@forum.nginx.org> Message-ID: So far we have a plan to do an R&D (shortly), no ETA yet. On Oct 25, 2011, at 5:53 PM, baalchina wrote: > http://en.wikipedia.org/wiki/SPDY > > It seems spdy much faster than http? > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217299,217299#msg-217299 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From lists at ruby-forum.com Tue Oct 25 16:06:22 2011 From: lists at ruby-forum.com (Graham D.) Date: Tue, 25 Oct 2011 18:06:22 +0200 Subject: Nginx NAS serving large files In-Reply-To: References: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> Message-ID: <6ec43e6c85f2be260ef384e5e41b3537@ruby-forum.com> Andrew Alexeev wrote in post #1028314: > Graham, > > Forgive my ignorance, what's "port 182" in your original email? > > In your tests did you use a single nginx instance and a single Apache > against that 1 logical disk on Netapp? > > Can you show sections on nginx configuration relevant to disk operations > (also, how many workers per nginx server)? > > Do you use any specific tunables to adjust the network settings for > Netapp? > > How many files on Netapp partition? > > What's your OS? Hello Andrew, where not using a high end NAS and our OS is Centos 64 Bit Aleksandar Lazic wrote in post #1028318: > > Which HW do you have (Networkcard, ...)? > Do you have anything in the messages/syslog file about some limits? > Do you use connection track in the iptables? > > Cheers > Aleks Hello Aleksandar, Our NAS is working fine and there are no errors in the logs. The problem is with nginx it self. > What OS do you use ? > > Try the following: > > worker_processes 32; > > http { > sendfile off; > output_buffers 1 1m; > ... > } > > > -- > Igor Sysoev Hello Igor, we are using Centos 64 Bit. We haven't tried using output_buffers yet so we will try that shortly... Right now nginx is keeping the filehandle open after the file is cached in ram. So we end up with 3,000 filehandles open for the duration of a 45 minute download. This is a very frustrating problem. -- Posted via http://www.ruby-forum.com/. From olfativo at hotmail.com Tue Oct 25 16:56:05 2011 From: olfativo at hotmail.com (=?iso-8859-1?B?RmVybmFuZG8gR2FyY+1hIFRvcnJlcw==?=) Date: Tue, 25 Oct 2011 18:56:05 +0200 Subject: rewrite don't work in a multilanguage MVC site Message-ID: Hi!Im trying to move from Apache to nginx (v1.1.6), but you know, rewrite newbie here... In my site when a user types http://site.com he's redirected to http://site.com/en/, and all the other URLs are internally handled by an index.php. This is my actual Apache htaccess: RewriteEngine On RewriteCond %{HTTP:Accept-Language} ^en [NC] RewriteRule ^$ /en/ [L,R=301] RewriteCond %{HTTP:Accept-Language} ^es [NC] RewriteRule ^$ /es/ [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php?ctr=$1 [QSA,L] And this my translation to nginx: location / { if (-f $request_filename) { expires 30d; break; } if ($http_accept_language ~* "^es") { rewrite ^/$ /es/ permanent; break; } if ($http_accept_language ~* "^en") { rewrite ^/$ /en/ permanent; break; } if (!-e $request_filename) { rewrite (.*) /index.php?ctr=$1 last; } } location ~ \.php$ { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; ... With this, when I type http://site.com I'm being redirected to http://site.com/en/, great, but I get a 404 error, and in the error.log I have this line: "/bla/bla/html/en/index.php" is not found So, why is not nginx looking for the URI /index.php?ctr=/en/? -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Oct 25 17:15:38 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 25 Oct 2011 18:15:38 +0100 Subject: rewrite don't work in a multilanguage MVC site In-Reply-To: References: Message-ID: <87wrbtt2kl.wl%appa@perusio.net> On 25 Out 2011 17h56 WEST, olfativo at hotmail.com wrote: > [1 ] > [1.1 ] > > Hi!Im trying to move from Apache to nginx (v1.1.6), but you know, > rewrite newbie here... In my site when a user types http://site.com > he's redirected to http://site.com/en/, and all the other URLs are > internally handled by an index.php. This is my actual Apache Try this: At the http level. map $http_accept_language $is_english { default 0; ~^en 1; } map $http_accept_language $is_spanish { default 0; ~^es 1; } location / { expires 30d; if ($is_english) { return 301 /en; } if ($is_spanish) { return 301 /es; } location /es {} location /en {} try_files $uri $uri/ /index.php?ctr=$uri; } location ~\.php$ { # PHP stuff } --- appa From olfativo at hotmail.com Tue Oct 25 18:17:48 2011 From: olfativo at hotmail.com (=?iso-8859-1?B?RmVybmFuZG8gR2FyY+1hIFRvcnJlcw==?=) Date: Tue, 25 Oct 2011 20:17:48 +0200 Subject: rewrite don't work in a multilanguage MVC site In-Reply-To: <87wrbtt2kl.wl%appa@perusio.net> References: , <87wrbtt2kl.wl%appa@perusio.net> Message-ID: Tried, and same results, redirect OK but 404 response. Thanks!! > Date: Tue, 25 Oct 2011 18:15:38 +0100 > From: appa at perusio.net > To: nginx at nginx.org > Subject: Re: rewrite don't work in a multilanguage MVC site > > On 25 Out 2011 17h56 WEST, olfativo at hotmail.com wrote: > > > [1 ] > > [1.1 ] > > > > Hi!Im trying to move from Apache to nginx (v1.1.6), but you know, > > rewrite newbie here... In my site when a user types http://site.com > > he's redirected to http://site.com/en/, and all the other URLs are > > internally handled by an index.php. This is my actual Apache > > Try this: > > At the http level. > > map $http_accept_language $is_english { > default 0; > ~^en 1; > } > > map $http_accept_language $is_spanish { > default 0; > ~^es 1; > } > > location / { > > expires 30d; > > if ($is_english) { > return 301 /en; > } > > if ($is_spanish) { > return 301 /es; > } > > location /es {} > > location /en {} > > try_files $uri $uri/ /index.php?ctr=$uri; > } > > location ~\.php$ { > # PHP stuff > } > > --- appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Oct 25 18:33:15 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 25 Oct 2011 19:33:15 +0100 Subject: rewrite don't work in a multilanguage MVC site In-Reply-To: References: Message-ID: <87vcrcudjo.wl%appa@perusio.net> On 25 Out 2011 19h17 WEST, olfativo at hotmail.com wrote: > > Tried, and same results, redirect OK but 404 response. > Thanks!! Show your complete config. --- appa From olfativo at hotmail.com Tue Oct 25 19:00:32 2011 From: olfativo at hotmail.com (=?iso-8859-1?B?RmVybmFuZG8gR2FyY+1hIFRvcnJlcw==?=) Date: Tue, 25 Oct 2011 21:00:32 +0200 Subject: rewrite don't work in a multilanguage MVC site In-Reply-To: <87vcrcudjo.wl%appa@perusio.net> References: , <87vcrcudjo.wl%appa@perusio.net> Message-ID: > Date: Tue, 25 Oct 2011 19:33:15 +0100 > From: appa at perusio.net > To: nginx at nginx.org > Subject: Re: rewrite don't work in a multilanguage MVC site > > On 25 Out 2011 19h17 WEST, olfativo at hotmail.com wrote: > > > > > Tried, and same results, redirect OK but 404 response. > > Thanks!! > > Show your complete config. > > --- appa > Here we go. Those includes are the standard locations por PHP-FPM and static content: map $http_accept_language $is_english { default 0; ~^en 1;} map $http_accept_language $is_spanish { default 0; ~^es 1;} server { listen 80; server_name localhost; root blah/blah; location / { auth_basic "Restricted"; auth_basic_user_file htpasswd; index index.php index.html; expires 30d; if ($is_english) { return 301 /en; } if ($is_spanish) { return 301 /es; } location /es {} location /en {} try_files $uri $uri/ /index.php?ctr=$uri; } include /usr/local/nginx/conf/staticfiles.conf; include /usr/local/nginx/conf/php.conf; include /usr/local/nginx/conf/drop.conf;} -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at akins.org Tue Oct 25 19:09:41 2011 From: brian at akins.org (Brian Akins) Date: Tue, 25 Oct 2011 15:09:41 -0400 Subject: Nginx NAS serving large files In-Reply-To: <6ec43e6c85f2be260ef384e5e41b3537@ruby-forum.com> References: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> <6ec43e6c85f2be260ef384e5e41b3537@ruby-forum.com> Message-ID: We are using a NFS appliance with a very simple nginx config and having no issues. we have this set: sendfile off; tcp_nopush off And that's all we really did as far as tuning is concerned. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at akins.org Tue Oct 25 19:12:15 2011 From: brian at akins.org (Brian Akins) Date: Tue, 25 Oct 2011 15:12:15 -0400 Subject: Does nginx plan to support spdy? In-Reply-To: References: <5df5dc3fd8dcea296814b9583ffc457a.NginxMailingListEnglish@forum.nginx.org> Message-ID: The main reason SPDY is "faster" than HTTP because it supports multiplexing so you can better utilize the TCP connections. -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Tue Oct 25 20:22:52 2011 From: francis at daoine.org (Francis Daly) Date: Tue, 25 Oct 2011 21:22:52 +0100 Subject: rewrite don't work in a multilanguage MVC site In-Reply-To: References: Message-ID: <20111025202252.GD27078@craic.sysops.org> On Tue, Oct 25, 2011 at 06:56:05PM +0200, Fernando Garc?a Torres wrote: Hi there, > RewriteEngine On > RewriteCond %{HTTP:Accept-Language} ^en [NC] RewriteRule ^$ /en/ [L,R=301] > RewriteCond %{HTTP:Accept-Language} ^es [NC] RewriteRule ^$ /es/ [L,R=301] > RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php?ctr=$1 [QSA,L] If I read this right, it only redirects the request for "/" to "/en/" or "/es/" if the Accept-Language header begins with one of those strings; otherwise, if the file-or-directory exists, serve it; otherwise, redirect to index.php?ctr=(the original request). Note that nginx and apache differ in the leading / of the url, so you'll want to make sure that you allow for that. I'm going to assume that you want to redirect to /index.php for all otherwise-404s. Also note that you'll want to check whether apache writes index.php?ctr=request or index.php?ctr=/request. The check what you configure nginx to write, and see if it works too. And as a final note -- checking the first two characters of Accept-Language is not the right way to process that header. But it's your site, and you get to do what you want on it. > And this my translation to nginx: > location / { if (-f $request_filename) { expires 30d; break; } > if ($http_accept_language ~* "^es") { rewrite ^/$ /es/ permanent; break; } > if ($http_accept_language ~* "^en") { rewrite ^/$ /en/ permanent; break; } > if (!-e $request_filename) { rewrite (.*) /index.php?ctr=$1 last; } } I suggest writing this as two locations: location = / { if ($http_accept_language ~* "^en") { return 301 /en/; } if ($http_accept_language ~* "^es") { return 301 /es/; } } location / { try_files $uri $uri/ /index.php?ctr=$uri; } > location ~ \.php$ { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; ... I would be more explicit, unless you have more php scripts: location = /index.php { fastcgi_pass unix:php.sock; } with include fastcgi.conf; at server level. But however you want to handle php is probably fine. > With this, when I type http://site.com I'm being redirected to http://site.com/en/, great, but I get a 404 error, and in the error.log I have this line: > "/bla/bla/html/en/index.php" is not found I get a 403 Forbidden, not a 404, so I must have some other configuration difference from you. > So, why is not nginx looking for the URI /index.php?ctr=/en/? Per the config, if the directory exists, it is served. In my tests /en/ exists and returns 403, /ex/ doesn't and returns the same content as /index.php?ctr=/ex/ does, apart from REQUEST_URI being different. Good luck with it, f -- Francis Daly francis at daoine.org From andrewmbenton at gmail.com Tue Oct 25 21:09:39 2011 From: andrewmbenton at gmail.com (Andrew Benton) Date: Tue, 25 Oct 2011 14:09:39 -0700 Subject: can nginx calculate the content-length header for fastcgi proxied requests Message-ID: i'm not sure whether this question even makes sense. i don't know whether nginx is buffering responses that it receives from proxying requests to a fastcgi process or its streaming that back to the client. but i would like to be able to have nginx calculate the content-length header for requests that are fastcgi_pass-ed. couldn't find anything online or in the documentation relating to this. thanks! amb From vk at jasystem.net Tue Oct 25 21:11:40 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Wed, 26 Oct 2011 01:11:40 +0400 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 Message-ID: <223831319577101@web40.yandex.ru> Hello, i have an issue with getting users' real IP. I am using nginx as frontend with thttpd as backend. I've added such options to my default server in nginx config: location ~ \.cgi|pl$ { proxy_pass http://127.0.0.1:8000; include /etc/nginx/proxy.conf; } /etc/nginx/proxy.conf has such options among others: proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; and I have patched latest thttpd (http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz) with this patch: http://wiki.nginx.org/ThttpdRealIP also i had to rename "getline" to "mygetline" in thttpd-2.25b/extras/htpasswd.c because i was getting an error "htpasswd.c:52: error: conflicting types for 'getline'" during compilation. the whole thttpd config is: host=127.0.0.1 port=8000 dir=/var/www/default user=www-data cgipat=**.cgi|**.pl vhost charset=utf-8 logfile=/var/log/thttpd.log pidfile=/var/run/thttpd.pid after installing and starting both webservers I saved this script as index.cgi and opened it in browser(i'm using Opera): #!/bin/sh echo "Content-type: text/html; charset=UTF-8"; echo; echo "i am cgi script

"; echo "env:

"; env when I opened it with Opera Turbo enabled (thus using Opera's proxy server), I see output like this: . . GATEWAY_INTERFACE=CGI/1.1 REMOTE_ADDR=127.0.0.1 HTTP_USER_AGENT=Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.51 . . . and when I open it without Opera Turbo (with my real IP), I'm getting my real IP in the output (a part was hidden): . . GATEWAY_INTERFACE=CGI/1.1 REMOTE_ADDR=178.177.***.*** HTTP_USER_AGENT=Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.51 . . . what could I have done wrong with configuration? //Jef, sorry for CC, but I don't know the cause of this issue, and it still could be thttpd. though i hope it's just my hands :) Cheers, Vladimir From zzz at zzz.org.ua Tue Oct 25 21:29:17 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Wed, 26 Oct 2011 00:29:17 +0300 Subject: can nginx calculate the content-length header for fastcgi proxied requests In-Reply-To: References: Message-ID: On Wed, Oct 26, 2011 at 12:09 AM, Andrew Benton wrote: > i'm not sure whether this question even makes sense. i don't know > whether nginx is buffering responses that it receives from proxying > requests to a fastcgi process or its streaming that back to the > client. > but i would like to be able to have nginx calculate the content-length > header for requests that are fastcgi_pass-ed. couldn't find anything > online or in the documentation relating to this. Well, there is nothing to find. Nginx cannot do this. From francis at daoine.org Tue Oct 25 22:10:11 2011 From: francis at daoine.org (Francis Daly) Date: Tue, 25 Oct 2011 23:10:11 +0100 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <223831319577101@web40.yandex.ru> References: <223831319577101@web40.yandex.ru> Message-ID: <20111025221011.GE27078@craic.sysops.org> On Wed, Oct 26, 2011 at 01:11:40AM +0400, ???????? ???????? wrote: Hi there, > /etc/nginx/proxy.conf has such options among others: > > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; That should cause two variables HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR to be visible in the CGI output. > and I have patched latest thttpd (http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz) with this patch: http://wiki.nginx.org/ThttpdRealIP That patch looks like it will write the value of the X-Forwarded-For header into something internal to thttpd. > #!/bin/sh > echo "Content-type: text/html; charset=UTF-8"; > echo; > echo "i am cgi script

"; > echo "env:

"; > env > What are HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR in the output of this cgi script? If they are not what you expect, check what nginx is doing. If they are what you expect, check what your patched thttpd is doing. Good luck with it, f -- Francis Daly francis at daoine.org From vk at jasystem.net Tue Oct 25 22:17:37 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Wed, 26 Oct 2011 02:17:37 +0400 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <20111025221011.GE27078@craic.sysops.org> References: <223831319577101@web40.yandex.ru> <20111025221011.GE27078@craic.sysops.org> Message-ID: <96251319581057@web145.yandex.ru> Hello, thanks for your answer. 26.10.2011, 02:10, "Francis Daly" : > On Wed, Oct 26, 2011 at 01:11:40AM +0400, ???????? ???????? wrote: > That should cause two variables HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR > to be visible in the CGI output. alas, no. the full output is (when using proxy): i am cgi script

env:

GATEWAY_INTERFACE=CGI/1.1 REMOTE_ADDR=127.0.0.1 HTTP_USER_AGENT=Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.51 CGI_PATTERN=**.cgi|**.pl HTTP_ACCEPT=text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 HTTP_HOST=***hidden*** SERVER_SOFTWARE=thttpd/2.25b 29dec2003 PATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin HTTP_ACCEPT_LANGUAGE=ru, en SERVER_PROTOCOL=HTTP/1.0 REQUEST_METHOD=GET PWD=/var/www/default SERVER_PORT=8000 SCRIPT_NAME=/index.cgi SERVER_NAME=127.0.0.1 > That patch looks like it will write the value of the X-Forwarded-For > header into something internal to thttpd. yes, it is intended to change X-Forwarded-For into Remote-Addr, but seems that it doesn't work. > What are HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR in the output of this > cgi script? there are no such vars at all. > If they are not what you expect, check what nginx is doing. how could i do that? Cheers, Vladimir From al-nginx at none.at Tue Oct 25 22:40:30 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Wed, 26 Oct 2011 00:40:30 +0200 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <96251319581057@web145.yandex.ru> References: <223831319577101@web40.yandex.ru> <20111025221011.GE27078@craic.sysops.org> <96251319581057@web145.yandex.ru> Message-ID: <93610fbabd5e8a69be4377493b9a365e@none.at> Hi, On 26.10.2011 00:17, ???????? ???????? wrote: > Hello, > > thanks for your answer. > > 26.10.2011, 02:10, "Francis Daly" : [snipp] >> If they are not what you expect, check what nginx is doing. > > how could i do that? http://www.nginx.org/en/docs/debugging_log.html Aleks From al-nginx at none.at Tue Oct 25 22:43:03 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Wed, 26 Oct 2011 00:43:03 +0200 Subject: Nginx NAS serving large files In-Reply-To: <6ec43e6c85f2be260ef384e5e41b3537@ruby-forum.com> References: <4a5d72a61e6439ef6722e6be82eeeb48@ruby-forum.com> <6ec43e6c85f2be260ef384e5e41b3537@ruby-forum.com> Message-ID: On 25.10.2011 18:06, Graham D. wrote: [snipp] > Aleksandar Lazic wrote in post #1028318: >> >> Which HW do you have (Networkcard, ...)? >> Do you have anything in the messages/syslog file about some limits? >> Do you use connection track in the iptables? >> >> Cheers >> Aleks > > Hello Aleksandar, Our NAS is working fine and there are no errors in > the > logs. The problem is with nginx it self. I mean on your nginx server. From egriffith92 at gmail.com Wed Oct 26 02:58:33 2011 From: egriffith92 at gmail.com (Eric Griffith) Date: Tue, 25 Oct 2011 22:58:33 -0400 Subject: New denial of service tool knocks out encrypting servers Message-ID: http://www.h-online.com/security/news/item/New-denial-of-service-tool-knocks-out-encrypting-servers-1366564.html I link the article to make sure everyone see's it; but also to frame a question. The "Fix" seems to be to simply disable SSL-Renegotiation so that its not hammered over and over. The question: How do you disable SSL Renegotiation on Nginx? I tried googling "Nginx Disable SSL Renegotiation" but all that came back was patches to add the ability TO disable it in Nginx, no actual config option. Anyone know? From lvella at gmail.com Wed Oct 26 05:08:56 2011 From: lvella at gmail.com (Lucas Clemente Vella) Date: Wed, 26 Oct 2011 03:08:56 -0200 Subject: New denial of service tool knocks out encrypting servers In-Reply-To: References: Message-ID: 2011/10/26 Eric Griffith : > http://www.h-online.com/security/news/item/New-denial-of-service-tool-knocks-out-encrypting-servers-1366564.html > > I link the article to make sure everyone see's it; but also to frame a > question. The "Fix" seems to be to simply disable SSL-Renegotiation so > that its not hammered over and over. The question: How do you disable > SSL Renegotiation on Nginx? I tried googling "Nginx Disable SSL > Renegotiation" but all that came back was patches to add the ability > TO disable it in Nginx, no actual config option. Anyone know? The real thing is here: http://www.thc.org/thc-ssl-dos/ Just by looking over it, it seems there is no generic solution to the problem, but a specific defense to this attack could be to limit the throughput of SSL handshakes, and to queue pending requests, prioritizing the host with the least number of handshake requests in this queue. Also, more than a sane number of handshake requests from a single host could be dropped. -- Lucas Clemente Vella lvella at gmail.com From mdounin at mdounin.ru Wed Oct 26 05:35:01 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 26 Oct 2011 09:35:01 +0400 Subject: New denial of service tool knocks out encrypting servers In-Reply-To: References: Message-ID: <20111026053501.GK62535@mdounin.ru> Hello! On Tue, Oct 25, 2011 at 10:58:33PM -0400, Eric Griffith wrote: > http://www.h-online.com/security/news/item/New-denial-of-service-tool-knocks-out-encrypting-servers-1366564.html > > I link the article to make sure everyone see's it; but also to frame a > question. The "Fix" seems to be to simply disable SSL-Renegotiation so > that its not hammered over and over. The question: How do you disable > SSL Renegotiation on Nginx? I tried googling "Nginx Disable SSL > Renegotiation" but all that came back was patches to add the ability > TO disable it in Nginx, no actual config option. Anyone know? Renegotiation is unconditionally disabled since nginx 0.8.23 / 0.7.64, see CHANGES: Changes with nginx 0.8.23 11 Nov 2009 *) Security: now SSL/TLS renegotiation is disabled. Changes with nginx 0.7.64 16 Nov 2009 *) Security: now SSL/TLS renegotiation is disabled. Maxim Dounin From egriffith92 at gmail.com Wed Oct 26 05:38:09 2011 From: egriffith92 at gmail.com (egriffith92 at gmail.com) Date: Wed, 26 Oct 2011 01:38:09 -0400 Subject: New denial of service tool knocks out encrypting servers In-Reply-To: <20111026053501.GK62535@mdounin.ru> Message-ID: <4ea79cc2.c259340a.3520.1c60@mx.google.com> An HTML attachment was scrubbed... URL: From quan.nexthop at gmail.com Wed Oct 26 05:47:55 2011 From: quan.nexthop at gmail.com (Geoge.Q) Date: Wed, 26 Oct 2011 13:47:55 +0800 Subject: An upstream response is buffered to a temporary file In-Reply-To: References: <20111021194407.GD62535@mdounin.ru> Message-ID: For time_wait issue., pls try keepalive enable if it act as proxy. 2011/10/22, Ilan Berkner : > Thanks, > > I increased the fastcgi_buffers as follows: > > fastcgi_buffers 256 4k; > > and that took care of this problem. > > Another problem I'm trying to deal with is: > > netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c > 12 CLOSING > 1176 ESTABLISHED > 58 FIN_WAIT1 > 218 FIN_WAIT2 > 23 LAST_ACK > 43 LISTEN > 91 SYN_RECV > 3606 TIME_WAIT > > I'm trying to understand why there are so many connections in TIME_WAIT > status. Any ideas on how to research this issue? > > On Fri, Oct 21, 2011 at 3:44 PM, Maxim Dounin wrote: > >> Hello! >> >> On Fri, Oct 21, 2011 at 03:36:23PM -0400, iberkner wrote: >> >> > What settings / parameters can be tweaked to increase the amount of >> > buffers available as to not go to a temporary file? >> > >> > We are seeing many of these: >> > >> > 2011/10/21 14:01:24 [warn] 24547#0: *2408454 an upstream response is >> > buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695 >> > while reading upstream, client: 1.1.1.1, server: www.someserver.com, >> > request: "GET /edit.html?id=6816841 HTTP/1.1", upstream: >> > "fastcgi://192.168.1.5:9000", host: "www.someserver.com", referrer: >> > "http://www.someserver.com/c.html" >> > >> > I tried messing around with proxy_buffer settings, but not sure if I'm >> > on the right track. >> >> This is a warning message which is here to let you know that >> response was buffered to disk. Depending on your use case you may >> want either to tune fastcgi_buffers/fastcgi_buffer_size, or disable >> disk buffering with "fastcgi_max_temp_file 0", or just ignore this >> warning. >> >> Maxim Dounin >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > > -- > > Ilan Berkner > Chief Technology Officer > Time4Learning.com > > 6300 NE 1st Ave., Suite 203 > Ft. Lauderdale, FL 33334 > (954) 771-0914 > > > > > > Time4Learning.com - Online interactive curriculum for home use, PreK-8th > Grade. > Time4Writing.com - Online writing tutorials for high, middle, and elementary > school students. > Time4Learning.net - A forum to chat with parents online about kids, > education, parenting and more. > spellingcity.com - Online vocabulary and spelling activities for teachers, > parents and students. > -- ????????? From francis at daoine.org Wed Oct 26 13:02:58 2011 From: francis at daoine.org (Francis Daly) Date: Wed, 26 Oct 2011 14:02:58 +0100 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <96251319581057@web145.yandex.ru> References: <223831319577101@web40.yandex.ru> <20111025221011.GE27078@craic.sysops.org> <96251319581057@web145.yandex.ru> Message-ID: <20111026130258.GF27078@craic.sysops.org> On Wed, Oct 26, 2011 at 02:17:37AM +0400, ???????? ???????? wrote: > 26.10.2011, 02:10, "Francis Daly" : > > On Wed, Oct 26, 2011 at 01:11:40AM +0400, ???????? ???????? wrote: Hi there, > > That should cause two variables HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR > > to be visible in the CGI output. > > alas, no. the full output is (when using proxy): Ah, this thttpd doesn't expose the full http header as HTTP_* environment variables. So scratch that as a test. > > That patch looks like it will write the value of the X-Forwarded-For > > header into something internal to thttpd. > > yes, it is intended to change X-Forwarded-For into Remote-Addr, but seems that it doesn't work. Test the thttpd side: curl -H 'X-Forwarded-For: 127.0.0.2' http://[thttpd-server]/env.cgi If you don't see REMOTE_ADDR=127.0.0.2, then your thttpd is not acting as you expect. Nothing nginx can do can help you in that case. And note what curl -H 'X-Forwarded-For: 127.0.0.2, 127.0.0.3' http://[thttpd-server]/env.cgi shows that is different. If thttpd directly works (as above) and through nginx doesn't, then check the nginx debug log to see what exactly nginx is sending to thttpd -- it'll be the line with http script copy: "X-Forwarded-For: " and the next line will show the value. Test using curl http://[nginx-server]/env.cgi and possibly curl -H 'X-Forwarded-For: 127.0.0.2' http://[nginx-server]/env.cgi > > If they are not what you expect, check what nginx is doing. > > how could i do that? debug log. Overall, when I test here, it all works as expected, by which I mean: when I access nginx on 10.0.2.15 which proxy_pass'es to thttpd on 127.0.0.1, I see REMOTE_ADDR=10.0.2.15 when I access nginx on 10.0.2.15 through any other proxy, so that X-Forwarded-For is set before it gets to nginx, I see REMOTE_ADDR=127.0.0.1 This patch to thttpd seems to require that X-Forwarded-For contains exactly one address, which means that you must not set it in nginx using proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; You'll instead want something like proxy_set_header X-Forwarded-For $remote_addr; with some careful thought about what to do if X-Forwarded-For was set in the request to nginx. Good luck, f -- Francis Daly francis at daoine.org From igor at sysoev.ru Wed Oct 26 14:26:53 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 26 Oct 2011 18:26:53 +0400 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <223831319577101@web40.yandex.ru> References: <223831319577101@web40.yandex.ru> Message-ID: <20111026142653.GG44149@nginx.com> On Wed, Oct 26, 2011 at 01:11:40AM +0400, ???????? ???????? wrote: > Hello, > > i have an issue with getting users' real IP. I am using nginx as frontend with thttpd as backend. I've added such options to my default server in nginx config: > > location ~ \.cgi|pl$ { > proxy_pass http://127.0.0.1:8000; > include /etc/nginx/proxy.conf; > } > > /etc/nginx/proxy.conf has such options among others: > > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > and I have patched latest thttpd (http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz) with this patch: http://wiki.nginx.org/ThttpdRealIP > also i had to rename "getline" to "mygetline" in thttpd-2.25b/extras/htpasswd.c because i was getting an error "htpasswd.c:52: error: conflicting types for 'getline'" during compilation. > > the whole thttpd config is: > > host=127.0.0.1 > port=8000 > dir=/var/www/default > user=www-data > cgipat=**.cgi|**.pl > vhost > charset=utf-8 > logfile=/var/log/thttpd.log > pidfile=/var/run/thttpd.pid > > > after installing and starting both webservers I saved this script as index.cgi and opened it in browser(i'm using Opera): > > #!/bin/sh > echo "Content-type: text/html; charset=UTF-8"; > echo; > echo "i am cgi script

"; > echo "env:

"; > env > > when I opened it with Opera Turbo enabled (thus using Opera's proxy server), I see output like this: > > . . > GATEWAY_INTERFACE=CGI/1.1 REMOTE_ADDR=127.0.0.1 HTTP_USER_AGENT=Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.51 . . . > > and when I open it without Opera Turbo (with my real IP), I'm getting my real IP in the output (a part was hidden): > > . . > GATEWAY_INTERFACE=CGI/1.1 REMOTE_ADDR=178.177.***.*** HTTP_USER_AGENT=Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.51 . . . > > what could I have done wrong with configuration? > > //Jef, sorry for CC, but I don't know the cause of this issue, and it still could be thttpd. though i hope it's just my hands :) You may want to use mini_httpd instead of thttpd. There is patch to support "X-Real-IP" header in mini_httpd: http://mailman.nginx.org/pipermail/nginx/2010-October/023292.html -- Igor Sysoev From vk at jasystem.net Wed Oct 26 14:33:15 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Wed, 26 Oct 2011 18:33:15 +0400 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <20111026130258.GF27078@craic.sysops.org> References: <223831319577101@web40.yandex.ru> <20111025221011.GE27078@craic.sysops.org> <96251319581057@web145.yandex.ru> <20111026130258.GF27078@craic.sysops.org> Message-ID: <817371319639595@web39.yandex.ru> Hello, 26.10.2011, 17:02, "Francis Daly" : > Test the thttpd side: > > curl -H 'X-Forwarded-For: 127.0.0.2' http://[thttpd-server]/env.cgi > > If you don't see REMOTE_ADDR=127.0.0.2, then your thttpd is not acting > as you expect. Nothing nginx can do can help you in that case. localhost> curl -H 'X-Forwarded-For: 127.0.0.2' http://***myserver***:8000/index.cgi | grep -i remote % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 471 0 471 0 0 3007 0 --:--:-- --:--:-- --:--:-- 5962 REMOTE_ADDR=***myrealip*** myserver# grep -i x-forward /ramdisk/nginx_debug.log 2011/10/26 17:20:08 [debug] 11877#0: *3 http header: "X-Forwarded-For: 127.0.0.2" well, seems that it's thttpd issue. 26.10.2011, 18:26, "Igor Sysoev" : > You may want to use mini_httpd instead of thttpd. > There is patch to support "X-Real-IP" header in mini_httpd: > http://mailman.nginx.org/pipermail/nginx/2010-October/023292.html thanks, i'll follow your advice. Cheers, Vladimir From nginx-forum at nginx.us Wed Oct 26 14:49:47 2011 From: nginx-forum at nginx.us (wdmchaft) Date: Wed, 26 Oct 2011 10:49:47 -0400 Subject: nginx support multithread Message-ID: I saw multithread support in the source code, but why multithread is not supported in current version? And is any one know whether and when multithread will be supported? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217370,217370#msg-217370 From igor at sysoev.ru Wed Oct 26 14:57:51 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 26 Oct 2011 18:57:51 +0400 Subject: nginx support multithread In-Reply-To: References: Message-ID: <20111026145750.GN44149@nginx.com> On Wed, Oct 26, 2011 at 10:49:47AM -0400, wdmchaft wrote: > I saw multithread support in the source code, but why multithread is not > supported in current version? Because threads support is broken. > And is any one know whether and when > multithread will be supported? Probably, in 2.0. -- Igor Sysoev From nginx-forum at nginx.us Wed Oct 26 15:36:00 2011 From: nginx-forum at nginx.us (artemg) Date: Wed, 26 Oct 2011 11:36:00 -0400 Subject: add variable in module, change value in config Message-ID: <1b51cc240ba3b08e72a1b84478ab9853.NginxMailingListEnglish@forum.nginx.org> I want to control behaviour of my module at runtime(body filtering phase), depending on different data (reg exp in headers, value of different variables...), so I decided to add variable in my module, and then set value in nginx config with "set" operation in rewrite module. I am adding variable via ngx_http_add_variable() in pre-config, set set_handler, and when I am doing "set $my_variable "0" " in nginx config, I get "duplicate variable my_variable" on nginx start up. What I am doing wrong? May be I need to set variable by set, and In my module get index, and then get value of variable? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217375,217375#msg-217375 From vk at jasystem.net Wed Oct 26 15:49:34 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Wed, 26 Oct 2011 19:49:34 +0400 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <20111026142653.GG44149@nginx.com> References: <223831319577101@web40.yandex.ru> <20111026142653.GG44149@nginx.com> Message-ID: <444681319644174@web122.yandex.ru> Hello, during applying the patch i've got these warnings: # patch mini_httpd.c -i realip.patch patching file mini_httpd.c patching file mini_httpd.c Hunk #1 FAILED at 27. Hunk #2 FAILED at 163. 2 out of 2 hunks FAILED -- saving rejects to file mini_httpd.c.rej so i've added failed hunks manually. after installing and configuring i've checked the output from env-script, but REMOTE_ADDR still was 127.0.0.1. also when i'm requesting that script without any additional headers, it's ok, but when i add "X-Real-IP" it looks like mini-httpd just closes the connection: # curl -H 'X-Real-IP: 127.0.0.2' http://127.0.0.1:8000/index.cgi curl: (52) Empty reply from server then i've changed "X-Real-IP" to "X-Forwarded-For" in mini_httpd.c: else if ( strncasecmp( line, "X-Forwarded-For:", 16 ) == 0 ) { if ( strcmp(remote_addr, xrealip ) == 0 ) { cp = &line[16]; cp += strspn( cp, " \t" ); remote_addr = cp; } } and after compiling there is same result: # curl -H 'X-Forwarded-For: 127.0.0.2' http://127.0.0.1:8000/index.cgi curl: (52) Empty reply from server with no additional headers script works ok. Could you please suggest me any other way to run cgi programs with nginx, but with getting real IPs from clients, not "127.0.0.1"? using apache httpd as backend will be huge performance impact. Thanks in advance. Cheers, Vladimir From al-nginx at none.at Wed Oct 26 15:50:47 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Wed, 26 Oct 2011 17:50:47 +0200 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <223831319577101@web40.yandex.ru> References: <223831319577101@web40.yandex.ru> Message-ID: <36f60c05285bbb8b8927f3be88eec486@none.at> On 25.10.2011 23:11, ???????? ???????? wrote: > Hello, > > i have an issue with getting users' real IP. I am using nginx as > frontend with thttpd as backend. I've added such options to my > default > server in nginx config: > > location ~ \.cgi|pl$ { > > proxy_pass http://127.0.0.1:8000; > > include /etc/nginx/proxy.conf; > > } Maybe you will need another cgi executer ;-) http://nginx.localdomain.pl/wiki/FcgiWrap or http://www.hiawatha-webserver.org/manpages/cgi-wrapper Cheers Aleks From mdounin at mdounin.ru Wed Oct 26 16:19:25 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 26 Oct 2011 20:19:25 +0400 Subject: add variable in module, change value in config In-Reply-To: <1b51cc240ba3b08e72a1b84478ab9853.NginxMailingListEnglish@forum.nginx.org> References: <1b51cc240ba3b08e72a1b84478ab9853.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111026161925.GS62535@mdounin.ru> Hello! On Wed, Oct 26, 2011 at 11:36:00AM -0400, artemg wrote: > I want to control behaviour of my module at runtime(body filtering > phase), depending on different data (reg exp in headers, value of > different variables...), so I decided to add variable in my module, and > then set value in nginx config with "set" operation in rewrite module. > I am adding variable via ngx_http_add_variable() in pre-config, set > set_handler, and when I am doing "set $my_variable "0" " in nginx > config, I get "duplicate variable my_variable" on nginx start up. > What I am doing wrong? Most likely you forgot to use NGX_HTTP_VAR_CHANGEABLE flag in ngx_http_add_variable() call. > May be I need to set variable by set, and In my > module get index, and then get value of variable? This may be a better approach. Or just accept a variable (or a complex value) in your module configuration directive. Maxim Dounin From nginx-forum at nginx.us Wed Oct 26 16:59:10 2011 From: nginx-forum at nginx.us (dannynoonan) Date: Wed, 26 Oct 2011 12:59:10 -0400 Subject: odd behavior from ndk.set_var.set_quote_sql_str Message-ID: <382dab62b52cf70a461df7f2fa8ed23a.NginxMailingListEnglish@forum.nginx.org> ndk.set_var.set_quote_sql_str sometimes treats the variable supplied as a param as if it were an empty string. the following config: location /luaset { content_by_lua " local version = '2011.10.13+0000' --ngx.say(version) --ngx.log(ngx.ERR, version) local e_version = ndk.set_var.set_encode_base32(version) local s_version= ndk.set_var.set_quote_sql_str(version) ngx.say(e_version) ngx.say(s_version) "; } when hit with a basic get request: [david at dev-3]$ curl http://:8080/luaset 68o32c9e64o2sc9j5co30c1g '' returns a quoted empty string. if i uncomment *either* the ngx.log or ngx.say, the quoted string is not empty: [david at dev-3]$ curl http://honey:8080/luaset 68o32c9e64o2sc9j5co30c1g '2011.10.13+0000' is there something about lua variables i don't understand? how could referencing the variable once before the sql conversion have an effect? i can repro this over and over. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217260,217260#msg-217260 From vk at jasystem.net Wed Oct 26 20:37:38 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Thu, 27 Oct 2011 00:37:38 +0400 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <36f60c05285bbb8b8927f3be88eec486@none.at> References: <223831319577101@web40.yandex.ru> <36f60c05285bbb8b8927f3be88eec486@none.at> Message-ID: <529731319661458@web21.yandex.ru> Hello, 26.10.2011, 19:50, "Aleksandar Lazic" : > http://nginx.localdomain.pl/wiki/FcgiWrap installed fcgiwrap, now everything works flawlessly. Thanks for your advice. Cheers, Vladimir From al-nginx at none.at Wed Oct 26 21:02:41 2011 From: al-nginx at none.at (Aleksandar Lazic) Date: Wed, 26 Oct 2011 23:02:41 +0200 Subject: nginx and thttpd + cgi, remote_addr = 127.0.0.1 In-Reply-To: <529731319661458@web21.yandex.ru> References: <223831319577101@web40.yandex.ru> <36f60c05285bbb8b8927f3be88eec486@none.at> <529731319661458@web21.yandex.ru> Message-ID: <2f953c7fcf9882c04009854bdc959a85@none.at> On 26.10.2011 22:37, ???????? ???????? wrote: > Hello, > > 26.10.2011, 19:50, "Aleksandar Lazic" : >> http://nginx.localdomain.pl/wiki/FcgiWrap > > installed fcgiwrap, now everything works flawlessly. Thanks for your > advice. your welcome. From brian at akins.org Wed Oct 26 21:43:33 2011 From: brian at akins.org (Brian Akins) Date: Wed, 26 Oct 2011 17:43:33 -0400 Subject: nginx support multithread In-Reply-To: <20111026145750.GN44149@nginx.com> References: <20111026145750.GN44149@nginx.com> Message-ID: On Wed, Oct 26, 2011 at 10:57 AM, Igor Sysoev wrote: > > And is any one know whether and when > > multithread will be supported? > > Probably, in 2.0. > What would be the usage of multi-threads? -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinloy.uy at gmail.com Wed Oct 26 23:07:56 2011 From: martinloy.uy at gmail.com (Martin Loy) Date: Wed, 26 Oct 2011 21:07:56 -0200 Subject: nginx support multithread In-Reply-To: References: <20111026145750.GN44149@nginx.com> Message-ID: As far as I understand, nginx is event driven and support a bunch of different schedule strategies at kernel level.. that should be enough.. but in any case.. you can always run N nginx bounded to different cpu's in case you really needed Regards M On Wed, Oct 26, 2011 at 7:43 PM, Brian Akins wrote: > > > On Wed, Oct 26, 2011 at 10:57 AM, Igor Sysoev wrote: >> >> > And is any one know whether and when >> > multithread will be supported? >> >> Probably, in 2.0. > > What would be the usage of multi-threads? > > > > _______________________________________________ > 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 delta.yeh at gmail.com Thu Oct 27 01:42:51 2011 From: delta.yeh at gmail.com (Delta Yeh) Date: Thu, 27 Oct 2011 09:42:51 +0800 Subject: nginx support multithread In-Reply-To: References: <20111026145750.GN44149@nginx.com> Message-ID: Multiple worker threads against worker process? 2011/10/27 Brian Akins : > > > On Wed, Oct 26, 2011 at 10:57 AM, Igor Sysoev wrote: >> >> > And is any one know whether and when >> > multithread will be supported? >> >> Probably, in 2.0. > > What would be the usage of multi-threads? > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Thu Oct 27 05:08:03 2011 From: nginx-forum at nginx.us (vidan) Date: Thu, 27 Oct 2011 01:08:03 -0400 Subject: nginx for cs-cart In-Reply-To: <452702e5fdf6d240d45e8ea2964e3366.NginxMailingListEnglish@forum.nginx.org> References: <452702e5fdf6d240d45e8ea2964e3366.NginxMailingListEnglish@forum.nginx.org> Message-ID: <479829a3f4170749bc2a7ade4adb266b.NginxMailingListEnglish@forum.nginx.org> update pls Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216707,217391#msg-217391 From agentzh at gmail.com Thu Oct 27 07:41:24 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 27 Oct 2011 15:41:24 +0800 Subject: nginx support multithread In-Reply-To: References: <20111026145750.GN44149@nginx.com> Message-ID: On Thu, Oct 27, 2011 at 5:43 AM, Brian Akins wrote: > On Wed, Oct 26, 2011 at 10:57 AM, Igor Sysoev wrote: >> >> > And is any one know whether and when >> > multithread will be supported? >> >> Probably, in 2.0. > > What would be the usage of multi-threads? > Mostly for (blocking) disk I/O and other syscalls that have to block the main thread of an nginx worker :) Regards, -agentzh From nginx-forum at nginx.us Thu Oct 27 08:27:32 2011 From: nginx-forum at nginx.us (amastr) Date: Thu, 27 Oct 2011 04:27:32 -0400 Subject: Response with error code Message-ID: Hi, all. I need a help in the following question. I send a request to the nginx server and I need to support only 1.1 version of the http protocol. If version is differ from "1.1", the error code should be sent in the response. For this purpose I set "err_status" parameter of the ngx_http_request_t to error code and then call ngx_http_discard_request_body(ngx_http_request_t *r); After that I call ngx_http_send_header(ngx_http_request_t *r) and ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *chain); (where chain is NULL). But in this case client receives 0 bytes in the response. Could you help me to find a problem? NOTE: If version is set to "1.1" in the request, the response is successfully sent and has OK status Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217395,217395#msg-217395 From brian at akins.org Thu Oct 27 11:06:29 2011 From: brian at akins.org (Brian Akins) Date: Thu, 27 Oct 2011 07:06:29 -0400 Subject: nginx support multithread In-Reply-To: References: <20111026145750.GN44149@nginx.com> Message-ID: <8AE72F6B-6CF5-4058-8B72-8455E4AB596C@akins.org> On Oct 27, 2011, at 3:41 AM, agentzh wrote: >> >> What would be the usage of multi-threads? >> > > Mostly for (blocking) disk I/O and other syscalls that have to block > the main thread of an nginx worker :) > True. I've seen some systems where the overhead of the thread/queue management was more than just letting the system call block the main thread. We generally run 2 nginx procs per CPU core. I just worry about bloat. There is a reason nginx's market share is rising and Apache's is falling. --Brian From calin at presslabs.com Thu Oct 27 11:56:21 2011 From: calin at presslabs.com (Calin Don) Date: Thu, 27 Oct 2011 14:56:21 +0300 Subject: Filtering backend set-cookie Message-ID: Hi, Is there a way to filter the cookies set by backend on a caching frontend? What I need is to be able to cache on frontend even if some cookies are set. If I do proxy_ignore_headers: Set-Cookie than all cookies will be ignored on frontend and page will be cached regardless of what cookie backend sets. I cannot control the backend, that's why I need to do it on frontend. -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Thu Oct 27 11:57:38 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 27 Oct 2011 19:57:38 +0800 Subject: odd behavior from ndk.set_var.set_quote_sql_str In-Reply-To: <382dab62b52cf70a461df7f2fa8ed23a.NginxMailingListEnglish@forum.nginx.org> References: <382dab62b52cf70a461df7f2fa8ed23a.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Oct 27, 2011 at 12:59 AM, dannynoonan wrote: > ndk.set_var.set_quote_sql_str sometimes treats the variable supplied as > a param as if it were an empty string. the following config: > Thanks for the report and the use case to reproduce the problem! I've just fixed a memory uninitialization issue in ngx_lua's ndk.set_var.DIRECTIVE implementation which could cause the problem that you've described and released ngx_lua v0.3.1rc23 to include this fix: https://github.com/chaoslawful/lua-nginx-module/tags Could you please try it out on your side? If you're using the ngx_openresty bundle, you can also try out the devel release 1.0.8.25 here: http://openresty.org/#Download Thanks! -agentzh From calin at presslabs.com Thu Oct 27 12:19:23 2011 From: calin at presslabs.com (Calin Don) Date: Thu, 27 Oct 2011 15:19:23 +0300 Subject: Filtering backend set-cookie In-Reply-To: References: Message-ID: I've tried using $upstream_http_set_cookie but it contains only one line, the first cookie. So, if the upstream responds with in this order: Set-Cookie: some_cookie=one Set-Cookie: another_cookie=two Set-Cookie: third_cookie=three $upstream_http_set_cookie will contain 'some_cookie=one' On Thu, Oct 27, 2011 at 14:56, Calin Don wrote: > Hi, > > Is there a way to filter the cookies set by backend on a caching frontend? > > What I need is to be able to cache on frontend even if some cookies are > set. > If I do proxy_ignore_headers: Set-Cookie than all cookies will be ignored > on frontend and page will be cached regardless of what cookie backend sets. > > I cannot control the backend, that's why I need to do it on frontend. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Thu Oct 27 13:22:37 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 27 Oct 2011 17:22:37 +0400 Subject: nginx support multithread In-Reply-To: References: <20111026145750.GN44149@nginx.com> Message-ID: <20111027132237.GA81492@nginx.com> On Thu, Oct 27, 2011 at 03:41:24PM +0800, agentzh wrote: > On Thu, Oct 27, 2011 at 5:43 AM, Brian Akins wrote: > > On Wed, Oct 26, 2011 at 10:57 AM, Igor Sysoev wrote: > >> > >> > And is any one know whether and when > >> > multithread will be supported? > >> > >> Probably, in 2.0. > > > > What would be the usage of multi-threads? > > Mostly for (blocking) disk I/O and other syscalls that have to block > the main thread of an nginx worker :) Yes. Primarily auxiliary threads to offload openning of not recently used files, disk i/o, etc. Second goal is to make nginx internals being thread-safe to allow experiments with different processing models. -- Igor Sysoev From nginx-forum at nginx.us Thu Oct 27 13:58:01 2011 From: nginx-forum at nginx.us (rsawer) Date: Thu, 27 Oct 2011 09:58:01 -0400 Subject: Strange log entries (upstream time/request_time) Message-ID: Hi, I'm running a simple nginx->memcache->backend architecture, and I'm currently facing some backend problems. While debugging the situation I've run on some strange log entries which look like nginx was incorrectly giving the summary request_time value : 91.180.100.2 www.mydomain.com "23/Oct/2011:22:30:05 +0200" "10.1.0.41:11211 : 10.1.0.48:90" "GET /images/footer-simple.gif HTTP/1.1" 200 (404 : 200) UP_RESPONSE 0.001 : 60.001 request_time 120.004 So, nginx check's for content in memcache, memcache (10.1.0.41) gives 404 in less than 1ms, then nginx goes to the overloaded apache backend, which gives 200 status content in 60 seconds. What bothers me is the $request_time value, which shows that it took's 120second for nginx to handle the request, and it's not the sum of memcache and backend request_time. For example I'm giving you another log entry where nginx evaluates the value correctly: 91.180.100.1 www.mydomain.com "23/Oct/2011:21:11:03 +0200" "10.1.0.41:11211 : 10.1.0.48:82, 10.1.0.46:82" "GET /?zanpid=1563268107744039936 HTTP/1.1" 301 (404 : 502, 301) UP_RESPONSE 0.001 : 67.387, 35.46 6 request_time 102.854 Here you see that memcache + backends reponse values are equal to the $request_time value, and this is what I see in my logs by default, the problematic situation occurs very rarely. Here is my logformat: log_format upstream '$remote_addr $host "$time_local" "$upstream_addr" "$request" $status ($upstream_status) UP_RESPONSE $upstream_response_time request_time $request_time'; Anybody can explain that behaviour? Greetz, Rafal Sawer Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217430,217430#msg-217430 From mdounin at mdounin.ru Thu Oct 27 14:33:01 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 27 Oct 2011 18:33:01 +0400 Subject: Strange log entries (upstream time/request_time) In-Reply-To: References: Message-ID: <20111027143301.GI62535@mdounin.ru> Hello! On Thu, Oct 27, 2011 at 09:58:01AM -0400, rsawer wrote: > Hi, > > I'm running a simple nginx->memcache->backend architecture, and I'm > currently facing some backend problems. > > While debugging the situation I've run on some strange log entries which > look like nginx was incorrectly giving the summary request_time value : > > > 91.180.100.2 www.mydomain.com "23/Oct/2011:22:30:05 +0200" > "10.1.0.41:11211 : 10.1.0.48:90" "GET /images/footer-simple.gif > HTTP/1.1" 200 (404 : 200) UP_RESPONSE 0.001 : 60.001 request_time > 120.004 > > So, nginx check's for content in memcache, memcache (10.1.0.41) gives > 404 in less than 1ms, then nginx goes to the overloaded apache backend, > which gives 200 status content in 60 seconds. What bothers me is the > $request_time value, which shows that it took's 120second for nginx to > handle the request, and it's not the sum of memcache and backend > request_time. > > For example I'm giving you another log entry where nginx evaluates the > value correctly: > > 91.180.100.1 www.mydomain.com "23/Oct/2011:21:11:03 +0200" > "10.1.0.41:11211 : 10.1.0.48:82, 10.1.0.46:82" "GET > /?zanpid=1563268107744039936 HTTP/1.1" 301 (404 : 502, 301) UP_RESPONSE > 0.001 : 67.387, 35.46 > 6 request_time 102.854 > > Here you see that memcache + backends reponse values are equal to the > $request_time value, and this is what I see in my logs by default, the > problematic situation occurs very rarely. > > Here is my logformat: > log_format upstream '$remote_addr $host "$time_local" "$upstream_addr" > "$request" $status ($upstream_status) UP_RESPONSE > $upstream_response_time request_time $request_time'; > > Anybody can explain that behaviour? The $request_time variable counts full request lifetime, including reading request from client and sending response to client. The 120.004 in log entry which bothers you may indicate that client wasn't reading response fast enough (or just gave up waiting and silently gone) and response was actually terminated due to send_timeout (which defaults to 60s). Maxim Dounin From nginx-forum at nginx.us Thu Oct 27 17:28:52 2011 From: nginx-forum at nginx.us (dannynoonan) Date: Thu, 27 Oct 2011 13:28:52 -0400 Subject: odd behavior from ndk.set_var.set_quote_sql_str In-Reply-To: References: Message-ID: Thanks! I'll try it out and report back. P.S. I love the ngx_openresty bundle, I've got a project I'll open source soon that utilizes it pretty heavily. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217260,217433#msg-217433 From nginx-forum at nginx.us Thu Oct 27 19:27:26 2011 From: nginx-forum at nginx.us (Alex Andrienko) Date: Thu, 27 Oct 2011 15:27:26 -0400 Subject: Proposed Patch - url encoding all upper case... In-Reply-To: References: Message-ID: <56d73fffd42e98c2d2f2d7b7148358d3.NginxMailingListEnglish@forum.nginx.org> Please excuse me for the necroposting, but what's the decision for the proposed patch? My Nginx reverse proxy malfunctions due to this problem.( Is there any workaround for the problem? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1918,217439#msg-217439 From ilan at time4learning.com Thu Oct 27 19:57:51 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Thu, 27 Oct 2011 15:57:51 -0400 Subject: Questions about stub status numbers Message-ID: Below is a snapshot of what the stub status returns: Active connections: 2617 server accepts handled requests 15883769 15883769 52195337 Reading: 96 Writing: 56 Waiting: 2465 Is the fact that we have 2K+ processes waiting a problem, meaning, on a high traffic, optimized server, should the number of waiting connections be much less? Let me ask different, is having 2K+ connections waiting considered a problem? Should that number ideally be as close to "0" as possible? Thanks -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r at roze.lv Thu Oct 27 21:02:19 2011 From: r at roze.lv (Reinis Rozitis) Date: Fri, 28 Oct 2011 00:02:19 +0300 Subject: Questions about stub status numbers In-Reply-To: References: Message-ID: > Is the fact that we have 2K+ processes waiting a problem, meaning, on a > high traffic, optimized server, should the number of waiting connections > be much less? > Let me ask different, is having 2K+ connections waiting considered a > problem? Should that number ideally be as close to "0" as possible? No and no. In fact on high traffic server there could be even more. Waiting are just keepalive connections. It is also mentioned in documentation: http://wiki.nginx.org/HttpStubStatusModule#stub_status rr From nginx-forum at nginx.us Thu Oct 27 23:39:00 2011 From: nginx-forum at nginx.us (dannynoonan) Date: Thu, 27 Oct 2011 19:39:00 -0400 Subject: odd behavior from ndk.set_var.set_quote_sql_str In-Reply-To: <382dab62b52cf70a461df7f2fa8ed23a.NginxMailingListEnglish@forum.nginx.org> References: <382dab62b52cf70a461df7f2fa8ed23a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <598e54ef1e52db5e64ea6b119406050a.NginxMailingListEnglish@forum.nginx.org> ndk.set_var.set_quote_sql_str works as expected with 1.0.8.25 [david at dev-3 ~]# curl http://localhost:8080/luaset -D - HTTP/1.1 200 OK Server: ngx_openresty/1.0.8.25 Date: Thu, 27 Oct 2011 23:38:33 GMT Content-Type: text/plain Transfer-Encoding: chunked Connection: keep-alive 68o32c9e64o2sc9j5co30c1g '2011.10.13+0000' Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217260,217445#msg-217445 From nginx-forum at nginx.us Fri Oct 28 03:26:17 2011 From: nginx-forum at nginx.us (Giang) Date: Thu, 27 Oct 2011 23:26:17 -0400 Subject: Help with convert .htaccess to nginx :( Message-ID: Hi guys, It's me again :( I was trying to install siwapp on my webserver but I couldn't make it work with nginx, here is the .htaccess file content: Options +FollowSymLinks +ExecCGI AddDefaultCharset utf-8 Order deny,allow Deny from all Order deny,allow Deny from all RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something RewriteCond %{REQUEST_URI} \..+$ RewriteCond %{REQUEST_URI} !\.html$ RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L] I've tried to convert to: rewrite ^ index.php last; But it didn't work. When I access http://myurl.com/installer.php nginx could display the page correctly, but when I clicked Next button, it said: "404 Not Found" (new URL: http://myurl.com/installer.php/step1) Anyone has any solution for this? Thank in advanced, Giang Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217447,217447#msg-217447 From edho at myconan.net Fri Oct 28 03:34:31 2011 From: edho at myconan.net (Edho Arief) Date: Fri, 28 Oct 2011 10:34:31 +0700 Subject: Help with convert .htaccess to nginx :( In-Reply-To: References: Message-ID: On Fri, Oct 28, 2011 at 10:26 AM, Giang wrote: > Hi guys, > > It's me again :( I was trying to install siwapp on my webserver but I > couldn't make it work with nginx, here is the .htaccess file content: > > Options +FollowSymLinks +ExecCGI > > AddDefaultCharset utf-8 > > > ? > ? ?Order deny,allow > ? ?Deny ?from all > ? > location ~ \.(lock|conf)$ { deny all; } > ? > ? ?Order deny,allow > ? ?Deny ?from all > ? > > location ~ pre_.+\.php$ { deny all; } > > > ?RewriteEngine On > > ?# uncomment the following line, if you are having trouble > ?# getting no_script_name to work > ?#RewriteBase / > > ?# we skip all files with .something > ?RewriteCond %{REQUEST_URI} \..+$ > ?RewriteCond %{REQUEST_URI} !\.html$ > ?RewriteRule .* - [L] > > ?# we check if the .html version is here (caching) > ?RewriteRule ^$ index.html [QSA] > ?RewriteRule ^([^.]+)$ $1.html [QSA] > ?RewriteCond %{REQUEST_FILENAME} !-f > > ?# no, so we redirect to our front web controller > ?RewriteRule ^(.*)$ index.php [QSA,L] > > location ~ /[^.]+$ { try_files $uri $uri/ $uri.html /index.php; } -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From edho at myconan.net Fri Oct 28 03:36:36 2011 From: edho at myconan.net (Edho Arief) Date: Fri, 28 Oct 2011 10:36:36 +0700 Subject: Help with convert .htaccess to nginx :( In-Reply-To: References: Message-ID: On Fri, Oct 28, 2011 at 10:26 AM, Giang wrote: > When I access http://myurl.com/installer.php nginx could display the > page correctly, but when I clicked Next button, it said: "404 Not Found" > (new URL: http://myurl.com/installer.php/step1) > As for this one, you need something with fastcgi_split_path. I'm not really familiar but I think something like this: location ~ \.php(/.+)$ { fastcgi_split_path ... ... } -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From nginx-forum at nginx.us Fri Oct 28 03:58:01 2011 From: nginx-forum at nginx.us (Giang) Date: Thu, 27 Oct 2011 23:58:01 -0400 Subject: Help with convert .htaccess to nginx :( In-Reply-To: References: Message-ID: Thank you. I've changed as you suggested, but it still hasn't worked. When I clicked Next button, it just reloaded the page. Here is my new nginx configuration file content: location ~ \.(lock|conf)$ { deny all; } location ~ pre_.+\.php$ { deny all; } location ~ /[^.]+$ { try_files $uri $uri/ $uri.html /index.php; } location ~ \.php(/.+)$ { fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME /var/www/siwapp/web$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217447,217451#msg-217451 From nginx-forum at nginx.us Fri Oct 28 05:15:44 2011 From: nginx-forum at nginx.us (artemg) Date: Fri, 28 Oct 2011 01:15:44 -0400 Subject: add variable in module, change value in config In-Reply-To: <1b51cc240ba3b08e72a1b84478ab9853.NginxMailingListEnglish@forum.nginx.org> References: <1b51cc240ba3b08e72a1b84478ab9853.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks for the answer, yes, I forgot NGX_HTTP_VAR_CHANGEABLE flag. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217375,217453#msg-217453 From igor at sysoev.ru Fri Oct 28 06:26:09 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 28 Oct 2011 10:26:09 +0400 Subject: nginx support multithread In-Reply-To: <8AE72F6B-6CF5-4058-8B72-8455E4AB596C@akins.org> References: <20111026145750.GN44149@nginx.com> <8AE72F6B-6CF5-4058-8B72-8455E4AB596C@akins.org> Message-ID: <20111028062609.GA5527@nginx.com> On Thu, Oct 27, 2011 at 07:06:29AM -0400, Brian Akins wrote: > > On Oct 27, 2011, at 3:41 AM, agentzh wrote: > >> > >> What would be the usage of multi-threads? > >> > > > > Mostly for (blocking) disk I/O and other syscalls that have to block > > the main thread of an nginx worker :) > > > > True. I've seen some systems where the overhead of the thread/queue management was more than just letting the system call block the main thread. Could you eleborate this case ? For example, on non-SSD disk, I/O blocking may take several milliseconds, while very expensive fork() syscall takes about 100-200 microseconds on modern CPU. -- Igor Sysoev From citrin at citrin.ru Fri Oct 28 10:01:54 2011 From: citrin at citrin.ru (Anton Yuzhaninov) Date: Fri, 28 Oct 2011 14:01:54 +0400 Subject: Questions about stub status numbers In-Reply-To: References: Message-ID: <4EAA7D92.2000508@citrin.ru> On 10/27/11 23:57, Ilan Berkner wrote: > Is the fact that we have 2K+ processes waiting a problem, meaning, on a high > traffic, optimized server, should the number of waiting connections be much less? > It is normal if keep-alive enabled. 2k+ is a small number for big site. And in most cases you should not disable keep-alive. > Let me ask different, is having 2K+ connections waiting considered a problem? > Should that number ideally be as close to "0" as possible? No. But don't forget to tune server - rise maxfiles, maxsockets and worker_connections if this number will be close to current limits. About stab_status numbers - graph them (e. g. by rrdtool) and see trends on graph. Is some number stable for a long time, and then grow rapidly - this can be problem indicator. -- Anton Yuzhaninov From nginx-forum at nginx.us Fri Oct 28 12:39:12 2011 From: nginx-forum at nginx.us (rsawer) Date: Fri, 28 Oct 2011 08:39:12 -0400 Subject: Strange log entries (upstream time/request_time) In-Reply-To: References: Message-ID: <194979f4228584a8565dee1f0af11e38.NginxMailingListEnglish@forum.nginx.org> Hi, thanks Maxim for quick answer, I can always count on you :) This could be the send_timeout, but that would be a little bit odd, because there were lots of client requests with this kind of issue and the server didn't have any load at that time. I'll will monitor this situation, and let you know if I'll get some more info. Best regards, Rafa? Sawer Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217430,217463#msg-217463 From nginx-forum at nginx.us Fri Oct 28 13:13:13 2011 From: nginx-forum at nginx.us (MyName) Date: Fri, 28 Oct 2011 09:13:13 -0400 Subject: High Load mysql server Message-ID: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> Hello brothers, uncles all the master ...^_^ Please help all of you. I was again in trouble ya its very high cpu load, but the beginning does not problematic, it is good to use nginx now .. uh .. keep up the cpu load specifications for vps RAM = 768M SWAP = 1567M CPU = 2 This config my.cnf [mysqld] #skip-name-resolve safe-show-database #old_passwords back_log = 50 skip-innodb max_connections = 500 key_buffer_size = 1536M myisam_sort_buffer_size = 64M join_buffer_size = 1M read_buffer_size = 1M sort_buffer_size = 2M table_cache = 5000 thread_cache_size = 384 wait_timeout = 20 connect_timeout = 10 tmp_table_size = 64M max_heap_table_size = 64M max_allowed_packet = 64M net_buffer_length = 16384 max_connect_errors = 100000 thread_concurrency = 4 concurrent_insert = 2 table_lock_wait_timeout = 30 read_rnd_buffer_size = 786432 bulk_insert_buffer_size = 8M query_cache_limit = 3M query_cache_size = 64M query_cache_type = 1 query_prealloc_size = 262144 query_alloc_block_size = 65536 range_alloc_block_size = 4096 transaction_alloc_block_size = 8192 transaction_prealloc_size = 4096 default-storage-engine = MyISAM max_write_lock_count = 8 [mysqld_safe] nice = -5 open_files_limit = 8192 [mysqldump] quick max_allowed_packet = 64M [myisamchk] key_buffer_size = 144M sort_buffer_size = 16M read_buffer_size = 16M write_buffer_size = 16M for cpu load images like this .. http://video.eurekapage.com/files/photos/1319808563e83d46_o.jpg Please help the master ... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217465,217465#msg-217465 From vk at jasystem.net Fri Oct 28 13:20:17 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Fri, 28 Oct 2011 17:20:17 +0400 Subject: High Load mysql server In-Reply-To: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> References: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> Message-ID: <512051319808017@web56.yandex.ru> Hello, > key_buffer_size = 1536M owh. i'd suggest you to try this tool: http://mysqltuner.pl/mysqltuner.pl Cheers, Vladimir From noah at forward.co.uk Fri Oct 28 13:16:50 2011 From: noah at forward.co.uk (Noah Cantor) Date: Fri, 28 Oct 2011 14:16:50 +0100 Subject: DNS TTLs being ignored Message-ID: I have recently come across several related issues which I have tracked down to nginx and the way it handles DNS. I run nginx as a proxy for several back end services. It works really well, except for 1 thing. My proxy_pass refers to an upstream which points to a DNS entry. That DNS entry is a CNAME with a TTL of 60 seconds. Nginx doesn't appear to be honoring that TTL. This has happened twice now. My upstream DNS information has changed, pointing to a new IP address. Instead of recovering withing 1 minute (which would happen if TTLs were being honored), I have had to restart nginx. When I searched for it, I found that nginx doesn't appear to honor TTLs, at all (http://www.ruby-forum.com/topic/2657341). What I'm hoping to find out, is why? Why does nginx cache DNS entries, instead of referring to the operating system? The OS has DNS handling built in. It respects TTLs, and it works perfectly. Nginx, on the other hand, is effectively broken as a load balancer, since upstreams might change IP addresses at any time (which is why we're using DNS names, instead of IP addresses. Thanks, Noah -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at nginx.com Fri Oct 28 14:50:43 2011 From: andrew at nginx.com (Andrew Alexeev) Date: Fri, 28 Oct 2011 18:50:43 +0400 Subject: DNS TTLs being ignored In-Reply-To: References: Message-ID: <74204B14-5EAA-4358-B02A-55744DE2CE39@nginx.com> Noah, Right, thanks for your observation. It really took a while, but we're actually about to fix this one shortly. On Oct 28, 2011, at 5:16 PM, Noah Cantor wrote: > I have recently come across several related issues which I have tracked down to nginx and the way it handles DNS. > I run nginx as a proxy for several back end services. It works really well, except for 1 thing. > My proxy_pass refers to an upstream which points to a DNS entry. > That DNS entry is a CNAME with a TTL of 60 seconds. > Nginx doesn't appear to be honoring that TTL. This has happened twice now. > My upstream DNS information has changed, pointing to a new IP address. Instead of recovering withing 1 minute (which would happen if TTLs were being honored), I have had to restart nginx. > When I searched for it, I found that nginx doesn't appear to honor TTLs, at all (http://www.ruby-forum.com/topic/2657341). > > What I'm hoping to find out, is why? > Why does nginx cache DNS entries, instead of referring to the operating system? The OS has DNS handling built in. It respects TTLs, and it works perfectly. Nginx, on the other hand, is effectively broken as a load balancer, since upstreams might change IP addresses at any time (which is why we're using DNS names, instead of IP addresses. > > Thanks, > Noah > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Fri Oct 28 14:56:06 2011 From: francis at daoine.org (Francis Daly) Date: Fri, 28 Oct 2011 15:56:06 +0100 Subject: nginx for cs-cart In-Reply-To: <479829a3f4170749bc2a7ade4adb266b.NginxMailingListEnglish@forum.nginx.org> References: <452702e5fdf6d240d45e8ea2964e3366.NginxMailingListEnglish@forum.nginx.org> <479829a3f4170749bc2a7ade4adb266b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111028145606.GH27078@craic.sysops.org> On Thu, Oct 27, 2011 at 01:08:03AM -0400, vidan wrote: Hi there, > update pls a) what do you do? b) what do you see? c) what do you expect to see? As a very specific example: when you do curl -v http://localhost/url.html and the file url.html *does not* exist, what do you want to have happen? And what do you actually see happen? And when you do curl -v http://localhost/url/ and the directory url *does* exist, what do you see, and what do you want to see? And when the directory url does *not* exist, what do you see, and what do you want to see? >From and nginx config perspective, I'm not seeing any problems in what has been suggested to you. So if you are seeing problems, and you want some help, it would be to your advantage to make it easy for people to help you. All the best, f -- Francis Daly francis at daoine.org From agentzh at gmail.com Fri Oct 28 15:19:06 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 28 Oct 2011 23:19:06 +0800 Subject: odd behavior from ndk.set_var.set_quote_sql_str In-Reply-To: <598e54ef1e52db5e64ea6b119406050a.NginxMailingListEnglish@forum.nginx.org> References: <382dab62b52cf70a461df7f2fa8ed23a.NginxMailingListEnglish@forum.nginx.org> <598e54ef1e52db5e64ea6b119406050a.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Fri, Oct 28, 2011 at 7:39 AM, dannynoonan wrote: > ndk.set_var.set_quote_sql_str works as expected with 1.0.8.25 > > > [david at dev-3 ~]# curl http://localhost:8080/luaset ?-D - > HTTP/1.1 200 OK > Server: ngx_openresty/1.0.8.25 > Date: Thu, 27 Oct 2011 23:38:33 GMT > Content-Type: text/plain > Transfer-Encoding: chunked > Connection: keep-alive > > 68o32c9e64o2sc9j5co30c1g > '2011.10.13+0000' > Great! Happy Lua hacking! Thanks! -agentzh From agentzh at gmail.com Fri Oct 28 15:19:58 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 28 Oct 2011 23:19:58 +0800 Subject: odd behavior from ndk.set_var.set_quote_sql_str In-Reply-To: References: Message-ID: On Fri, Oct 28, 2011 at 1:28 AM, dannynoonan wrote: > P.S. I love the ngx_openresty bundle, I've got a project I'll open > source soon that utilizes it pretty heavily. > Oh, I'm looking forward to that! :D Thanks! -agentzh From nginx-forum at nginx.us Fri Oct 28 16:34:19 2011 From: nginx-forum at nginx.us (cob) Date: Fri, 28 Oct 2011 12:34:19 -0400 Subject: nginx not logging access Message-ID: <52bf2f0a4173503dc46299624953b044.NginxMailingListEnglish@forum.nginx.org> It does seem to be logging some access (on my local network and then looping back in from my router's IP), but I'm not seeing access from someone external to my house. I can see that a connection exists in netstat, I can see my transmitted bytes incrementing when I look at eth0, but nginx has failed to log this to the access.log. Obfuscations were made to protect the innocent. Here is netstat: tcp 0 197100 home-srv.local:8000 ip1-2-3-5.aj.:52927 ESTABLISHED Here you can see eth0 tx incrementing (pulled within a second of each other): root at home-srv:/var/log# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 48:5b:39:86:b0:09 inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::4a5b:39ff:fe86:b009/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:367829 errors:0 dropped:0 overruns:0 frame:0 TX packets:481053 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:26445268 (26.4 MB) TX bytes:707235638 (707.2 MB) Interrupt:41 Base address:0x6000 root at home-srv:/var/log# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 48:5b:39:86:b0:09 inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::4a5b:39ff:fe86:b009/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:367948 errors:0 dropped:0 overruns:0 frame:0 TX packets:481279 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:26453570 (26.4 MB) TX bytes:707562874 (707.5 MB) Interrupt:41 Base address:0x6000 And here you can see nginx has not logged any file access today. This is where the log ends, I have not accessed the server today. 99.99.99.99 was my wife accessing the URL I sent her for this file she was trying to get to her friend, she clicked the link I emailed her, which was to our external IP on port 8000 (residential VDSL, incoming 80 is blocked). 192.168.1.104 - - [27/Oct/2011:22:46:34 -0500] "GET / HTTP/1.1" 200 133 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0" 192.168.1.104 - - [27/Oct/2011:22:46:34 -0500] "GET /favicon.ico HTTP/1.1" 200 133 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0" 192.168.1.104 - - [27/Oct/2011:22:46:34 -0500] "GET /favicon.ico HTTP/1.1" 200 133 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0" 192.168.1.104 - - [27/Oct/2011:22:50:27 -0500] "GET /file.zip HTTP/1.1" 200 194826552 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0" 192.168.1.104 - - [27/Oct/2011:22:53:52 -0500] "GET /file.zip HTTP/1.1" 200 154165552 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0" 99.99.99.99 - - [27/Oct/2011:22:58:42 -0500] "GET /file.zip HTTP/1.1" 200 24232852 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217477,217477#msg-217477 From nginx-forum at nginx.us Fri Oct 28 17:11:02 2011 From: nginx-forum at nginx.us (MyName) Date: Fri, 28 Oct 2011 13:11:02 -0400 Subject: High Load mysql server In-Reply-To: <512051319808017@web56.yandex.ru> References: <512051319808017@web56.yandex.ru> Message-ID: ???????? ???????? Wrote: ------------------------------------------------------- > Hello, > > > key_buffer_size = 1536M > > owh. i'd suggest you to try this tool: > http://mysqltuner.pl/mysqltuner.pl > > > Cheers, > > Vladimir > Thx for help, i was run that config but still load my CPU is high.. this is after installation : -------- General Statistics -------------------------------------------------- [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.0.77 [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: -Archive +BDB -Federated -InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 3M (Tables: 6) [!!] BDB is enabled but isn't being used [!!] Total fragmented tables: 4 -------- Security Recommendations ------------------------------------------- [OK] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [--] Up for: 4h 9m 43s (5M q [378.161 qps], 1M conn, TX: 15B, RX: 259M) [--] Reads / Writes: 85% / 15% [--] Total buffers: 1.6G global + 5.0M per thread (500 max threads) [!!] Maximum possible memory usage: 4.1G (543% of installed RAM) [OK] Slow queries: 0% (0/5M) [OK] Highest usage of available connections: 2% (12/500) [OK] Key buffer size / total MyISAM indexes: 1.5G/945.0K [OK] Key buffer hit rate: 99.8% (419K cached / 1K reads) [OK] Query cache efficiency: 33.9% (667K cached / 1M selects) [OK] Query cache prunes per day: 0 [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 346K sorts) [OK] Temporary tables created on disk: 0% (23 on disk / 5K total) [OK] Thread cache hit rate: 99% (12 created / 1M connections) [OK] Table cache hit rate: 39% (37 open / 94 opened) [OK] Open file limit used: 0% (59/10K) [OK] Table locks acquired immediately: 96% (1M immediate / 1M locks) -------- Recommendations ----------------------------------------------------- General recommendations: Add skip-bdb to MySQL configuration to disable BDB Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Reduce your overall MySQL memory footprint for system stability Enable the slow query log to troubleshoot bad queries So, what i`ve must to do again.? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217465,217478#msg-217478 From vk at jasystem.net Fri Oct 28 17:35:33 2011 From: vk at jasystem.net (=?koi8-r?B?68nSwNvLyc4g98zBxMnNydI=?=) Date: Fri, 28 Oct 2011 21:35:33 +0400 Subject: High Load mysql server In-Reply-To: References: <512051319808017@web56.yandex.ru> Message-ID: <36191319823333@web26.yandex.ru> Hello, > So, what i`ve must to do again.? you should do this: > General recommendations: > ????Add skip-bdb to MySQL configuration to disable BDB > ????Run OPTIMIZE TABLE to defragment tables for better performance > ????Reduce your overall MySQL memory footprint for system stability > ????Enable the slow query log to troubleshoot bad queries also you should lower key_buffer_size to e.g. 64M (recommendation = "Reduce your overall MySQL memory footprint for system stability") Cheers, Vladimir From nginx at nginxuser.net Fri Oct 28 19:17:12 2011 From: nginx at nginxuser.net (Nginx User) Date: Fri, 28 Oct 2011 22:17:12 +0300 Subject: High Load mysql server In-Reply-To: References: <512051319808017@web56.yandex.ru> Message-ID: On 28 October 2011 20:11, MyName wrote: > ? ?MySQL started within last 24 hours - recommendations may be > inaccurate ... > So, what i`ve must to do again.? Wait until it can give you reliable recommendations From nginx-forum at nginx.us Fri Oct 28 19:33:13 2011 From: nginx-forum at nginx.us (cob) Date: Fri, 28 Oct 2011 15:33:13 -0400 Subject: nginx not logging access In-Reply-To: <52bf2f0a4173503dc46299624953b044.NginxMailingListEnglish@forum.nginx.org> References: <52bf2f0a4173503dc46299624953b044.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1982b8a63da0c24093f8027074fb3fbf.NginxMailingListEnglish@forum.nginx.org> I just noticed that after the user's download was complete, the access.log was updated. Not sure I particularly like that behavior...I'd prefer to have it logged when contact is initiated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217477,217483#msg-217483 From mdounin at mdounin.ru Fri Oct 28 20:14:22 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 29 Oct 2011 00:14:22 +0400 Subject: nginx not logging access In-Reply-To: <1982b8a63da0c24093f8027074fb3fbf.NginxMailingListEnglish@forum.nginx.org> References: <52bf2f0a4173503dc46299624953b044.NginxMailingListEnglish@forum.nginx.org> <1982b8a63da0c24093f8027074fb3fbf.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20111028201422.GT62535@mdounin.ru> Hello! On Fri, Oct 28, 2011 at 03:33:13PM -0400, cob wrote: > I just noticed that after the user's download was complete, the > access.log was updated. Not sure I particularly like that > behavior...I'd prefer to have it logged when contact is initiated. Typical behaviour of http servers (and nginx isn't an exception) is to log request once response is sent. With current state of http as used for almost everything, including long streaming and so on, it's probably good idea to have an option to log request once it's got from client. Though it's not something we currently have. Maxim Dounin From ilan at time4learning.com Fri Oct 28 22:26:15 2011 From: ilan at time4learning.com (Ilan Berkner) Date: Fri, 28 Oct 2011 18:26:15 -0400 Subject: Confirmation of AIO In-Reply-To: <562BAFA2-BA7B-4154-A4C6-594916E17106@waeme.net> References: <1873471172-1319461679-cardhu_decombobulator_blackberry.rim.net-1701464188-@b2.c5.bise6.blackberry> <562BAFA2-BA7B-4154-A4C6-594916E17106@waeme.net> Message-ID: Thanks, now that I have it working, what particular files does it make send to send using AIO? Its interesting that in the example given here: http://wiki.nginx.org/HttpCoreModule (see below) the location referes to the "video" directory, i.e. implying that AIO should really be used for media file delivery. Would SWF files for example fall in that category? location /video { aio on; directio 512; output_buffers 1 128k; } What kind of test could be run to discern the advantage of using AIO on any type of file? Thanks On Mon, Oct 24, 2011 at 9:54 AM, Sergey Budnevitch wrote: > > On 24.10.2011, at 17:07, iberkner at gmail.com wrote: > > > CentOS > > Run nginx under strace: > > strace -f -e trace=io_submit /usr/sbin/nginx > > You will see something like > > [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 > [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 > [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 > [pid 1993] io_submit(139867403759616, 1, {{0x19a7ab0, 0, 0, 0, 10}}) = 1 > ... > > if aio is working. > > > > > ------Original Message------ > > From: Sergey Budnevitch > > Sender: nginx-bounces at nginx.org > > To: nginx at nginx.org > > ReplyTo: nginx at nginx.org > > Subject: Re: Confirmation of AIO > > Sent: Oct 24, 2011 8:30 AM > > > > > > On 24.10.2011, at 1:48, Ilan Berkner wrote: > > > >> Hi All, > >> > >> I'm trying to understand the advantages of AIO and how using it with > Nginx can improve performance. > >> > >> I've compiled Nginx from source with the AIO option. > >> > >> I've enabled AIO in my Nginx configuration. > >> > >> How can I confirm that its working? If the server is serving pages, > does it mean that its using AIO? > > > > What OS are you using? > > _______________________________________________ > > 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 > -- Ilan Berkner Chief Technology Officer Time4Learning.com 6300 NE 1st Ave., Suite 203 Ft. Lauderdale, FL 33334 (954) 771-0914 Time4Learning.com - Online interactive curriculum for home use, PreK-8th Grade. Time4Writing.com - Online writing tutorials for high, middle, and elementary school students. Time4Learning.net - A forum to chat with parents online about kids, education, parenting and more. spellingcity.com - Online vocabulary and spelling activities for teachers, parents and students. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Oct 28 22:26:35 2011 From: nginx-forum at nginx.us (cob) Date: Fri, 28 Oct 2011 18:26:35 -0400 Subject: nginx not logging access In-Reply-To: <52bf2f0a4173503dc46299624953b044.NginxMailingListEnglish@forum.nginx.org> References: <52bf2f0a4173503dc46299624953b044.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5572c02c4ab9e9e1f5b42af02c87924c.NginxMailingListEnglish@forum.nginx.org> Ok, guess I've just never noticed this with Apache or lighttpd. It would be nice to have a config option to log on-access instead, but I appreciate the info. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217477,217494#msg-217494 From nginx-forum at nginx.us Fri Oct 28 22:42:50 2011 From: nginx-forum at nginx.us (kernelheaders) Date: Fri, 28 Oct 2011 18:42:50 -0400 Subject: NFS 0-byte problem Message-ID: <23e77a7c493b60454b8b7af0bc43f822.NginxMailingListEnglish@forum.nginx.org> Hello all , We're using nginx 1.1.6 ver. 5 server connected NetApp storage via NFS . (/var/www ) Sometimes 1 or 2 server return cache size 0-byte and don't answer http request. Other 3 server working well . If i restarted nginx or delete cache file , 0-byte problem resolve. Example service conf : upstream upstream.test.com { server 1.1.1.1:80; server 2.2.2.2:80 backup; server 3.3.3.3:80 backup; } server { listen 80; server_name video.test.com; access_log off; location / { proxy_pass http://upstream.test.com; proxy_ignore_headers Expires Cache-Control Set-Cookie; proxy_cache_valid 200 30d; proxy_cache $host; proxy_connect_timeout 5; proxy_read_timeout 10; proxy_next_upstream error timeout http_500 http_502 http_503 http_504 http_404; set $maincache "main-a:"; proxy_cache_key $maincache$host$uri; proxy_redirect off; proxy_set_header Host $proxy_host; proxy_max_temp_file_size 0; proxy_hide_header Cache-Control; proxy_hide_header X-Powered-By; proxy_hide_header X-AspNet-Version; expires 30d; } location ~ /delete(/.*) { allow 5.5.5.5; deny all; set $deluri $1; set $maincache "main-a:"; proxy_cache_purge $host $maincache$host$deluri; } } Where i'm mising ? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217496#msg-217496 From brian at akins.org Fri Oct 28 23:00:24 2011 From: brian at akins.org (Brian Akins) Date: Fri, 28 Oct 2011 19:00:24 -0400 Subject: NFS 0-byte problem In-Reply-To: <23e77a7c493b60454b8b7af0bc43f822.NginxMailingListEnglish@forum.nginx.org> References: <23e77a7c493b60454b8b7af0bc43f822.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3E17516A-5CB3-419D-B1A0-91D324107D32@akins.org> Is nginx accessing the NFS or just the upstream servers? From nginx-forum at nginx.us Fri Oct 28 23:06:55 2011 From: nginx-forum at nginx.us (kernelheaders) Date: Fri, 28 Oct 2011 19:06:55 -0400 Subject: NFS 0-byte problem In-Reply-To: <3E17516A-5CB3-419D-B1A0-91D324107D32@akins.org> References: <3E17516A-5CB3-419D-B1A0-91D324107D32@akins.org> Message-ID: <603da9cc1630d9ec591b9d0eee309063.NginxMailingListEnglish@forum.nginx.org> nginx caching on NFS if MISS via upstream. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217501#msg-217501 From brian at akins.org Sat Oct 29 00:27:27 2011 From: brian at akins.org (Brian Akins) Date: Fri, 28 Oct 2011 20:27:27 -0400 Subject: NFS 0-byte problem In-Reply-To: <603da9cc1630d9ec591b9d0eee309063.NginxMailingListEnglish@forum.nginx.org> References: <3E17516A-5CB3-419D-B1A0-91D324107D32@akins.org> <603da9cc1630d9ec591b9d0eee309063.NginxMailingListEnglish@forum.nginx.org> Message-ID: <94529EC2-E0F7-4FB1-92A8-C077D7C3F9C3@akins.org> On Oct 28, 2011, at 7:06 PM, kernelheaders wrote: > nginx caching on NFS if MISS via upstream. I wouldn't recommend doing that. Cache should be on local "fast" disk. You need atomic renames, etc, to work reliably. --Brian From nginx-forum at nginx.us Sat Oct 29 01:18:30 2011 From: nginx-forum at nginx.us (kernelheaders) Date: Fri, 28 Oct 2011 21:18:30 -0400 Subject: NFS 0-byte problem In-Reply-To: <94529EC2-E0F7-4FB1-92A8-C077D7C3F9C3@akins.org> References: <94529EC2-E0F7-4FB1-92A8-C077D7C3F9C3@akins.org> Message-ID: <666448a4b06fd58bf7df66dfce910a35.NginxMailingListEnglish@forum.nginx.org> Brian Akins Wrote: ------------------------------------------------------- > On Oct 28, 2011, at 7:06 PM, kernelheaders wrote: > > > nginx caching on NFS if MISS via upstream. > > I wouldn't recommend doing that. Cache should be > on local "fast" disk. You need atomic renames, > etc, to work reliably. > > --Brian > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx We're using 12 x 600 GB SAS 15K Hard drives on NetApp storage, so storage I/O operations very fast. But my problem is not speed . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217508#msg-217508 From nginx-forum at nginx.us Sat Oct 29 08:24:48 2011 From: nginx-forum at nginx.us (JackB) Date: Sat, 29 Oct 2011 04:24:48 -0400 Subject: NFS 0-byte problem In-Reply-To: <23e77a7c493b60454b8b7af0bc43f822.NginxMailingListEnglish@forum.nginx.org> References: <23e77a7c493b60454b8b7af0bc43f822.NginxMailingListEnglish@forum.nginx.org> Message-ID: <22a2f9ee72d4d4d09ed696e654d9a01b.NginxMailingListEnglish@forum.nginx.org> Are they all using the same cache directoy/NFS mount point? Sharing a cache directory seems not to be supported. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217511#msg-217511 From jerome at loyet.net Sat Oct 29 08:27:53 2011 From: jerome at loyet.net (=?ISO-8859-1?B?Suly9G1lIExveWV0?=) Date: Sat, 29 Oct 2011 10:27:53 +0200 Subject: NFS 0-byte problem In-Reply-To: <666448a4b06fd58bf7df66dfce910a35.NginxMailingListEnglish@forum.nginx.org> References: <94529EC2-E0F7-4FB1-92A8-C077D7C3F9C3@akins.org> <666448a4b06fd58bf7df66dfce910a35.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2011/10/29 kernelheaders > > Brian Akins Wrote: > ------------------------------------------------------- > > On Oct 28, 2011, at 7:06 PM, kernelheaders wrote: > > > > > nginx caching on NFS if MISS via upstream. > > > > I wouldn't recommend doing that. Cache should be > > on local "fast" disk. ?You need atomic renames, > > etc, to work reliably. > > > > --Brian > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > We're using 12 x 600 GB SAS 15K Hard drives on NetApp storage, so > storage I/O operations very fast. But my problem is not speed . - what is your netapp appliance ? (just curious) - what are your mount options ? From brian at akins.org Sat Oct 29 12:26:09 2011 From: brian at akins.org (Brian Akins) Date: Sat, 29 Oct 2011 08:26:09 -0400 Subject: NFS 0-byte problem In-Reply-To: <666448a4b06fd58bf7df66dfce910a35.NginxMailingListEnglish@forum.nginx.org> References: <94529EC2-E0F7-4FB1-92A8-C077D7C3F9C3@akins.org> <666448a4b06fd58bf7df66dfce910a35.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0D4B0582-6C1A-4694-B374-54802AD0CE21@akins.org> On Oct 28, 2011, at 9:18 PM, kernelheaders wrote: > > We're using 12 x 600 GB SAS 15K Hard drives on NetApp storage, so > storage I/O operations very fast. But my problem is not speed . > The cache is expected to be used only by a single nginx instance. Sharing it will not work. The cache is made up of the cache directory, temp files, and shared memory. If you really need shared cache as well, then look into using memc with srcache modules. --Brian From nginx-forum at nginx.us Sat Oct 29 17:06:02 2011 From: nginx-forum at nginx.us (kernelheaders) Date: Sat, 29 Oct 2011 13:06:02 -0400 Subject: NFS 0-byte problem In-Reply-To: <22a2f9ee72d4d4d09ed696e654d9a01b.NginxMailingListEnglish@forum.nginx.org> References: <23e77a7c493b60454b8b7af0bc43f822.NginxMailingListEnglish@forum.nginx.org> <22a2f9ee72d4d4d09ed696e654d9a01b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <326e95b47c385f2974242d1bda7c9d60.NginxMailingListEnglish@forum.nginx.org> JackB Wrote: ------------------------------------------------------- > Are they all using the same cache directoy/NFS > mount point? Sharing a cache directory seems not > to be supported. Yeap , same cache and temp directory . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217515#msg-217515 From nginx-forum at nginx.us Sat Oct 29 17:06:54 2011 From: nginx-forum at nginx.us (kernelheaders) Date: Sat, 29 Oct 2011 13:06:54 -0400 Subject: NFS 0-byte problem In-Reply-To: References: Message-ID: <6ade1a914f0810a50087fe666a9cec70.NginxMailingListEnglish@forum.nginx.org> J?r?me Loyet Wrote: ------------------------------------------------------- > 2011/10/29 kernelheaders > > > > Brian Akins Wrote: > > > -------------------------------------------------- > ----- > > > On Oct 28, 2011, at 7:06 PM, kernelheaders > wrote: > > > > > > > nginx caching on NFS if MISS via upstream. > > > > > > I wouldn't recommend doing that. Cache should > be > > > on local "fast" disk. ?You need atomic > renames, > > > etc, to work reliably. > > > > > > --Brian > > > > > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > We're using 12 x 600 GB SAS 15K Hard drives on > NetApp storage, so > > storage I/O operations very fast. But my problem > is not speed . > > - what is your netapp appliance ? (just curious) > > - what are your mount options ? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx - Storage FA2020 - I try UDP , TCP a lot of version . But problem is not about mount. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217516#msg-217516 From thinke365 at gmail.com Sat Oct 29 18:02:53 2011 From: thinke365 at gmail.com (Thinke365) Date: Sun, 30 Oct 2011 02:02:53 +0800 Subject: High Load mysql server In-Reply-To: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> References: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> Message-ID: <98fb7d7e-f778-47b6-ae4f-3729746117e7@email.android.com> maybe you shoud use some cache server in front of MySQL:) MyName wrote: >Hello brothers, uncles all the master ...^_^ > >Please help all of you. >I was again in trouble ya its very high cpu load, but the beginning >does >not problematic, it is good to use nginx now .. uh .. keep up the cpu >load specifications for vps >RAM = 768M >SWAP = 1567M >CPU = 2 > >This config my.cnf > >[mysqld] >#skip-name-resolve >safe-show-database >#old_passwords >back_log = 50 >skip-innodb >max_connections = 500 >key_buffer_size = 1536M >myisam_sort_buffer_size = 64M >join_buffer_size = 1M >read_buffer_size = 1M >sort_buffer_size = 2M >table_cache = 5000 >thread_cache_size = 384 >wait_timeout = 20 >connect_timeout = 10 >tmp_table_size = 64M >max_heap_table_size = 64M >max_allowed_packet = 64M >net_buffer_length = 16384 >max_connect_errors = 100000 >thread_concurrency = 4 >concurrent_insert = 2 >table_lock_wait_timeout = 30 >read_rnd_buffer_size = 786432 >bulk_insert_buffer_size = 8M >query_cache_limit = 3M >query_cache_size = 64M >query_cache_type = 1 >query_prealloc_size = 262144 >query_alloc_block_size = 65536 >range_alloc_block_size = 4096 >transaction_alloc_block_size = 8192 >transaction_prealloc_size = 4096 >default-storage-engine = MyISAM >max_write_lock_count = 8 > >[mysqld_safe] >nice = -5 >open_files_limit = 8192 > >[mysqldump] >quick >max_allowed_packet = 64M > >[myisamchk] >key_buffer_size = 144M >sort_buffer_size = 16M >read_buffer_size = 16M >write_buffer_size = 16M > >for cpu load images like this .. >http://video.eurekapage.com/files/photos/1319808563e83d46_o.jpg > >Please help the master ... > >Posted at Nginx Forum: >http://forum.nginx.org/read.php?2,217465,217465#msg-217465 > >_______________________________________________ >nginx mailing list >nginx at nginx.org >http://mailman.nginx.org/mailman/listinfo/nginx -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. From nginx-forum at nginx.us Sat Oct 29 18:03:29 2011 From: nginx-forum at nginx.us (MyName) Date: Sat, 29 Oct 2011 14:03:29 -0400 Subject: High Load mysql server In-Reply-To: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> References: <5a9001b23d54fccae026215baa174f67.NginxMailingListEnglish@forum.nginx.org> Message-ID: awsome... thx and respect to Thinke365, Nginx User and ???????? ???????? ... my cpu`s load is now normal again.. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217465,217519#msg-217519 From nginx-forum at nginx.us Sat Oct 29 18:06:45 2011 From: nginx-forum at nginx.us (MyName) Date: Sat, 29 Oct 2011 14:06:45 -0400 Subject: Disable access by IP and unknown hosts In-Reply-To: References: Message-ID: Hallo... before i create new thread i want to ask.. i was try with Igor Sysoev tutorials.. but didn`t work. i want to disable access from browser, ex = http://127.0.0.1/ i have to IP address for my server.. how to disable ALL IP access from browser.? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,85212,217520#msg-217520 From nginx at nginxuser.net Sat Oct 29 19:53:11 2011 From: nginx at nginxuser.net (Nginx User) Date: Sat, 29 Oct 2011 22:53:11 +0300 Subject: Disable access by IP and unknown hosts In-Reply-To: References: Message-ID: On 29 October 2011 21:06, MyName wrote: > i want to disable access from browser, > ex = http://127.0.0.1/ To disable access by IP address, try setting your default server, usually in nginx.conf, as follows: # Default server server { listen 80; listen 443; return 403; } From luky-37 at hotmail.com Sat Oct 29 20:31:02 2011 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sat, 29 Oct 2011 22:31:02 +0200 Subject: http_mp4_module broken in v1.0.8? Message-ID: Hello list, the new mp4 module (--with-http_mp4_module) doesn't work for me at all in v1.0.8 (JWPlayer just stalls and keeps buffering after seeking), but it works great with nginx v1.1.6. Same configuration, same mp4 file. Please see the following HTTP HEAD on the MP4 file, first request against nginx/1.0.8, second against nginx/1.1.6, please compare Content-Length: > dev:~#curl -I "http://localhost/test.mp4?start=1170.00" > HTTP/1.1 200 OK > Server: nginx/1.0.8 > Date: Sun, 30 Oct 2011 03:28:08 GMT > Content-Type: video/mp4 > Content-Length: 114308289 > Last-Modified: Sun, 30 Oct 2011 02:44:36 GMT > Connection: keep-alive > Expires: Sun, 30 Oct 2011 03:28:18 GMT > Cache-Control: max-age=10 > > > dev:~#curl -I "http://localhost/test.mp4?start=1170.00" > HTTP/1.1 200 OK > Server: nginx/1.1.6 > Date: Sun, 30 Oct 2011 03:44:38 GMT > Content-Type: video/mp4 > Content-Length: 5816030 > Last-Modified: Sun, 30 Oct 2011 02:44:36 GMT > Connection: keep-alive > Expires: Sun, 30 Oct 2011 03:44:48 GMT > Cache-Control: max-age=10 Anyone with --with-http_mp4_module working in nginx/1.0.8? From mdounin at mdounin.ru Sat Oct 29 22:33:54 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 30 Oct 2011 02:33:54 +0400 Subject: http_mp4_module broken in v1.0.8? In-Reply-To: References: Message-ID: <20111029223354.GX62535@mdounin.ru> Hello! On Sat, Oct 29, 2011 at 10:31:02PM +0200, Lukas Tribus wrote: > the new mp4 module (--with-http_mp4_module) doesn't work for me > at all in v1.0.8 (JWPlayer just stalls and keeps buffering after > seeking), but it works great with nginx v1.1.6. Same > configuration, same mp4 file. > > Please see the following HTTP HEAD on the MP4 file, first > request against nginx/1.0.8, second against nginx/1.1.6, please > compare Content-Length: The mp4 module in 1.1.6 has some bugfixes which aren't yet merged into 1.0.x. Likely you are facing one of this bugs, most likely the problem with 32-bit platforms. Maxim Dounin From wangsamp at gmail.com Sat Oct 29 22:42:20 2011 From: wangsamp at gmail.com (Oleksandr V. Typlyns'kyi) Date: Sun, 30 Oct 2011 01:42:20 +0300 (FET) Subject: http_mp4_module broken in v1.0.8? In-Reply-To: References: Message-ID: Yesterday Oct 29, 2011 at 22:31 Lukas Tribus wrote: > the new mp4 module (--with-http_mp4_module) doesn't work for me at all in v1.0.8 (JWPlayer just stalls and keeps buffering after seeking), but it works great with nginx v1.1.6. Same configuration, same mp4 file. http://nginx.org/en/CHANGES Changes with nginx 1.1.6 *) Bugfix: the module ngx_http_mp4_module did not support seeking on 32-bit platforms. http://trac.nginx.org/nginx/changeset/4190/nginx -- WNGS-RIPE From luky-37 at hotmail.com Sun Oct 30 00:03:23 2011 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sun, 30 Oct 2011 02:03:23 +0200 Subject: http_mp4_module broken in v1.0.8? In-Reply-To: References: , Message-ID: That was a hit. I applied changeset 4190 to v1.0.8, now everything works fine and I can work with stable: > dev:~#curl -I "http://localhost/test.mp4?start=1170.00" > HTTP/1.1 200 OK > Server: nginx/1.0.8 > Date: Sun, 30 Oct 2011 07:36:49 GMT > Content-Type: video/mp4 > Content-Length: 5816030 > Last-Modified: Sun, 30 Oct 2011 02:44:36 GMT > Connection: keep-alive > Expires: Sun, 30 Oct 2011 07:36:59 GMT > Cache-Control: max-age=10 Thanks guys! ---------------------------------------- > Date: Sun, 30 Oct 2011 01:42:20 +0300 > From: wangsamp at gmail.com > To: nginx at nginx.org > Subject: Re: http_mp4_module broken in v1.0.8? > > Yesterday Oct 29, 2011 at 22:31 Lukas Tribus wrote: > > > the new mp4 module (--with-http_mp4_module) doesn't work for me at all in v1.0.8 (JWPlayer just stalls and keeps buffering after seeking), but it works great with nginx v1.1.6. Same configuration, same mp4 file. > > http://nginx.org/en/CHANGES > Changes with nginx 1.1.6 > *) Bugfix: the module ngx_http_mp4_module did not support seeking on 32-bit platforms. > > http://trac.nginx.org/nginx/changeset/4190/nginx > > -- > WNGS-RIPE > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Sun Oct 30 01:59:43 2011 From: nginx-forum at nginx.us (kernelheaders) Date: Sat, 29 Oct 2011 21:59:43 -0400 Subject: NFS 0-byte problem In-Reply-To: <0D4B0582-6C1A-4694-B374-54802AD0CE21@akins.org> References: <0D4B0582-6C1A-4694-B374-54802AD0CE21@akins.org> Message-ID: Brian Akins Wrote: ------------------------------------------------------- > On Oct 28, 2011, at 9:18 PM, kernelheaders wrote: > > > > > We're using 12 x 600 GB SAS 15K Hard drives on > NetApp storage, so > > storage I/O operations very fast. But my problem > is not speed . > > > > > The cache is expected to be used only by a single > nginx instance. Sharing it will not work. The > cache is made up of the cache directory, temp > files, and shared memory. > > If you really need shared cache as well, then look > into using memc with srcache modules. > > --Brian > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Can you please explain why only one distance ? If you have same cachekey and structure , cache work all intance even remote locations . And system works well , sometimes and some servers occurs problem . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217496,217533#msg-217533 From nginx-forum at nginx.us Sun Oct 30 03:42:41 2011 From: nginx-forum at nginx.us (Andy) Date: Sat, 29 Oct 2011 23:42:41 -0400 Subject: Confirmation of AIO In-Reply-To: References: Message-ID: I don't think AIO works in Linux unless you're using O_DIRECT. But with O_DIRECT you don't get file cache. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217133,217537#msg-217537 From nginx-forum at nginx.us Sun Oct 30 03:55:22 2011 From: nginx-forum at nginx.us (firestorm) Date: Sat, 29 Oct 2011 23:55:22 -0400 Subject: Problem with fastcgi cache Message-ID: <4974ddde02c516685929d60a0ee705f9.NginxMailingListEnglish@forum.nginx.org> Hello, I?m working with Nginx v1.0.8. I have the configuration for fastcgi cache: server { listen 8080; //many other lines of configuration fastcgi_cache_path /var/www/cache levels=1:2 keys_zone=zera:10m inactive=5m; fastcgi_temp_path /var/www/cache/tmp; server { listen 80; server_name localhost; //more configuration location ~ "^(.+\.php)(/.+)" { set $script $uri; set $path_info ""; error_log logs/debug.log debug; set $script $1; set $path_info $2; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php.sock; fastcgi_cache zera; fastcgi_cache_key $server_addr$request_uri; fastcgi_cache_valid 200 302 1h; fastcgi_cache_valid 301 1d; fastcgi_cache_valid any 1m; fastcgi_cache_min_uses 1; fastcgi_cache_use_stale error timeout invalid_header http_500; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /var/www/myapp/web$script; fastcgi_param SCRIPT_NAME $script; fastcgi_param PATH_INFO $path_info; } I can?t see the nginx creating files in /var/www/cache or /var/www/cache/tmp. The php process is actually doing the work. Looking at the debug logs I can see: 2011/10/29 19:36:18 [debug] 32377#0: *1 post access phase: 10 2011/10/29 19:36:18 [debug] 32377#0: *1 http init upstream, client timer: 0 2011/10/29 19:36:18 [debug] 32377#0: *1 epoll add event: fd:15 op:3 ev:80000005 2011/10/29 19:36:18 [debug] 32377#0: *1 http script var: "10.128.50.101" 2011/10/29 19:36:18 [debug] 32377#0: *1 http script var: "/administration.php/school" 2011/10/29 19:36:18 [debug] 32377#0: *1 http cache key: "10.128.50.101/administration.php/school" 2011/10/29 19:36:18 [debug] 32377#0: *1 add cleanup: 092C6E3C 2011/10/29 19:36:18 [debug] 32377#0: *1 http file cache exists: -5 e:0 2011/10/29 19:36:18 [debug] 32377#0: *1 cache file: "/var/www/cache/8/4f/2de84a2a49161ae7d7d4d8fba314e4f8" 2011/10/29 19:36:18 [debug] 32377#0: *1 add cleanup: 092C6E80 2011/10/29 19:36:18 [debug] 32377#0: *1 http upstream cache: -5 2011/10/29 19:36:18 [debug] 32377#0: *1 http script copy: "QUERY_STRING" I preciate any help with this issue. Thanks in advance. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217538,217538#msg-217538 From nginx at nginxuser.net Sun Oct 30 08:29:04 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 30 Oct 2011 11:29:04 +0300 Subject: Apply Changeset 4207 (Clear old Location Header) to v1.0.8? Message-ID: Hello! I got the diff for changeset 4207 from http://trac.nginx.org/nginx/changeset/4207/nginx and wondering if this can be applied to 1.0.8 for the same end. Thanks From iberkner at gmail.com Sun Oct 30 14:28:30 2011 From: iberkner at gmail.com (iberkner at gmail.com) Date: Sun, 30 Oct 2011 14:28:30 +0000 Subject: Confirmation of AIO Message-ID: <501853065-1319984911-cardhu_decombobulator_blackberry.rim.net-1459193077-@b2.c5.bise6.blackberry> I read that you don't get the file cache, so under what specific circumstances in linux would it be beneficial to use aio (if any)? ------Original Message------ From: Andy Sender: nginx-bounces at nginx.org To: nginx at nginx.org ReplyTo: nginx at nginx.org Subject: Re: Confirmation of AIO Sent: Oct 29, 2011 11:42 PM I don't think AIO works in Linux unless you're using O_DIRECT. But with O_DIRECT you don't get file cache. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217133,217537#msg-217537 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From primoz at slo-tech.com Sun Oct 30 15:34:10 2011 From: primoz at slo-tech.com (Primoz Bratanic) Date: Sun, 30 Oct 2011 16:34:10 +0100 Subject: Question about upstream keepalive + fastcgi + gzip Message-ID: <001c01cc9719$5f534110$1df9c330$@slo-tech.com> Hi, With the keepalive upstream / fastcgi patch nginx is now capable of sending out chunked transfers for content received on fastcgi interface. Is there anyway to get something like apache's flushpackets functionality? Flushpackets -- Determines whether the proxy module will auto-flush the output brigade after each "chunk" of data. This would mean setting up an option to send ngx_http_send_special(r, NGX_HTTP_FLUSH) after every chunk received on fastcgi in order to make it pass gzip module as well? Pointers which module to patch (ngx_http_upstream, ngx_http_upstream_keepalive_module, ngx_http_fastcgi_module) and where are very welcome. Best regards, Primoz -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Oct 30 16:57:42 2011 From: nginx-forum at nginx.us (MyName) Date: Sun, 30 Oct 2011 12:57:42 -0400 Subject: Disable access by IP and unknown hosts In-Reply-To: References: Message-ID: Hallo Nginx User.. i was try with your config, its work, but when i open with my domain is riderect to 403 page.. i cant access my domain, this is for config server user nginx; worker_processes 10; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/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; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; } server { listen 80; listen 443; return 403; server_name domaingue.crots www.domaingue.crots ; location / { root path/to/html; index index.php index.html index.htm; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,85212,217545#msg-217545 From nginx at nginxuser.net Sun Oct 30 17:22:28 2011 From: nginx at nginxuser.net (Nginx User) Date: Sun, 30 Oct 2011 20:22:28 +0300 Subject: Disable access by IP and unknown hosts In-Reply-To: References: Message-ID: On 30 October 2011 19:57, MyName wrote: > server { > ? ?listen ? ? ? 80; > ? ?listen ? ? ? 443; > ? ?return ? ? ?403; > ? ?server_name ?domaingue.crots > ? ? ? ? ? ? ? ? www.domaingue.crots > ? ? ? ? ? ? ? ? ; > > ? ?location / { > ? ? ? ?root ? path/to/html; > ? ? ? ?index ?index.php index.html index.htm; > ? ?} You need a separate server block for your domain. Example below. You need to change to match your specific needs (E.G. location for php) # Default server server { listen 80; listen 443; return 403; } # domaingue.crots server server { server_name domaingue.crots www.domaingue.crots; # Put "root" and "index" directives at the server level root path/to/html; index index.php index.html index.htm; # As many locations as needed location / { try_files $uri $uri/ =404; } # As many locations as needed location ~ .+\.php$ { # Linebelow is important for security location ~ \..*/.*\.php$ { return 400; } #proxy_pass/fastcgi_pass etc } } From nginx-forum at nginx.us Sun Oct 30 18:27:09 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Sun, 30 Oct 2011 14:27:09 -0400 Subject: Question about upstream keepalive + fastcgi + gzip In-Reply-To: <001c01cc9719$5f534110$1df9c330$@slo-tech.com> References: <001c01cc9719$5f534110$1df9c330$@slo-tech.com> Message-ID: <830772d596570726094edd653d616cbe.NginxMailingListEnglish@forum.nginx.org> Have you tried simply disabling the buffers? http://wiki.nginx.org/HttpFcgiModule#fastcgi_buffers Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217544,217548#msg-217548 From primoz at slo-tech.com Sun Oct 30 18:39:17 2011 From: primoz at slo-tech.com (Primoz Bratanic) Date: Sun, 30 Oct 2011 19:39:17 +0100 Subject: Question about upstream keepalive + fastcgi + gzip In-Reply-To: <830772d596570726094edd653d616cbe.NginxMailingListEnglish@forum.nginx.org> References: <001c01cc9719$5f534110$1df9c330$@slo-tech.com> <830772d596570726094edd653d616cbe.NginxMailingListEnglish@forum.nginx.org> Message-ID: <004501cc9733$3ba950a0$b2fbf1e0$@slo-tech.com> Hi, This brings with itself too much of a performance penalty. I would just like to have the behaviour I get in the latest versions without using gzip replicated when using gzip. As everything works like a charm when making a test case using echo_flush, gzip is obviously ready, so just need a pointer where to go (upstream, upstream-keepalive of fastcgi). Best regards, Primoz -----Original Message----- From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of Ensiferous Sent: Sunday, October 30, 2011 7:27 PM To: nginx at nginx.org Subject: Re: Question about upstream keepalive + fastcgi + gzip Have you tried simply disabling the buffers? http://wiki.nginx.org/HttpFcgiModule#fastcgi_buffers Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217544,217548#msg-217548 _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Mon Oct 31 00:40:41 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 31 Oct 2011 03:40:41 +0300 Subject: Confirmation of AIO In-Reply-To: <501853065-1319984911-cardhu_decombobulator_blackberry.rim.net-1459193077-@b2.c5.bise6.blackberry> References: <501853065-1319984911-cardhu_decombobulator_blackberry.rim.net-1459193077-@b2.c5.bise6.blackberry> Message-ID: <20111031004041.GY62535@mdounin.ru> Hello! On Sun, Oct 30, 2011 at 02:28:30PM +0000, iberkner at gmail.com wrote: > I read that you don't get the file cache, so under what specific > circumstances in linux would it be beneficial to use aio (if > any)? Using AIO under Linux would be beneficial if your working set is big compared to memory available and as a result filesystem cache doesn't improve things much. Better disk concurrency may outweigh filesystem cache in such cases. Maxim Dounin From mdounin at mdounin.ru Mon Oct 31 00:47:57 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 31 Oct 2011 03:47:57 +0300 Subject: NFS 0-byte problem In-Reply-To: References: <0D4B0582-6C1A-4694-B374-54802AD0CE21@akins.org> Message-ID: <20111031004757.GZ62535@mdounin.ru> Hello! On Sat, Oct 29, 2011 at 09:59:43PM -0400, kernelheaders wrote: > Brian Akins Wrote: > ------------------------------------------------------- > > On Oct 28, 2011, at 9:18 PM, kernelheaders wrote: > > > > > > > > We're using 12 x 600 GB SAS 15K Hard drives on > > NetApp storage, so > > > storage I/O operations very fast. But my problem > > is not speed . > > > > > > > > > The cache is expected to be used only by a single > > nginx instance. Sharing it will not work. The > > cache is made up of the cache directory, temp > > files, and shared memory. > > > > If you really need shared cache as well, then look > > into using memc with srcache modules. > > Can you please explain why only one distance ? If you have same cachekey > and structure , cache work all intance even remote locations . > And system works well , sometimes and some servers occurs problem . As Brian already wrote, nginx currently doesn't allow sharing of the same cache directory between several nginx instances. It doesn't expect cache files to appear or be changed by another nginx instance. If you share cache directory between multiple nginx instances - weird things will happen, and problem you see is one of them. Maxim Dounin From iberkner at gmail.com Mon Oct 31 01:26:31 2011 From: iberkner at gmail.com (iberkner at gmail.com) Date: Mon, 31 Oct 2011 01:26:31 +0000 Subject: Confirmation of AIO Message-ID: <1726338410-1320024522-cardhu_decombobulator_blackberry.rim.net-1651838245-@b2.c5.bise6.blackberry> How would you go about determining whether or not the benefits are there? What metrics or quantitative analysis can you do to determine whether or not to use it? ------Original Message------ From: Maxim Dounin Sender: nginx-bounces at nginx.org To: nginx at nginx.org ReplyTo: nginx at nginx.org Subject: Re: Confirmation of AIO Sent: Oct 30, 2011 8:40 PM Hello! On Sun, Oct 30, 2011 at 02:28:30PM +0000, iberkner at gmail.com wrote: > I read that you don't get the file cache, so under what specific > circumstances in linux would it be beneficial to use aio (if > any)? Using AIO under Linux would be beneficial if your working set is big compared to memory available and as a result filesystem cache doesn't improve things much. Better disk concurrency may outweigh filesystem cache in such cases. Maxim Dounin _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From igor at sysoev.ru Mon Oct 31 14:58:42 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 31 Oct 2011 18:58:42 +0400 Subject: nginx-1.1.7 Message-ID: <20111031145842.GD45607@nginx.com> Changes with nginx 1.1.7 31 Oct 2011 *) Feature: support of several resolvers in the "resolver" directive. Thanks to Kirill A. Korinskiy. *) Bugfix: a segmentation fault occurred on start or while reconfiguration if the "ssl" directive was used at http level and there was no "ssl_certificate" defined. *) Bugfix: reduced memory consumption while proxying of big files if they were buffered to disk. *) Bugfix: a segmentation fault might occur in a worker process if "proxy_http_version 1.1" directive was used. *) Bugfix: in the "expires @time" directive. -- Igor Sysoev From lists at ruby-forum.com Mon Oct 31 15:07:21 2011 From: lists at ruby-forum.com (Avi K.) Date: Mon, 31 Oct 2011 16:07:21 +0100 Subject: Problem with serving swf files with reverse proxy Message-ID: <1d13fe2206d835642ab99b128d3c67cb@ruby-forum.com> Hi, I'm using nginx with reverse proxy to apache. I have a wired problem, When i set .swf files to go with reverse proxy, everything works ok. When i set .swf files to be served from nginx, i get tons of errors because nginx try to find the file from http://www.url.com/page/path/to/swf. Any idea why this is happand? Thanks Avi -- Posted via http://www.ruby-forum.com/. From amoiz.shine at gmail.com Mon Oct 31 15:11:59 2011 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Mon, 31 Oct 2011 23:11:59 +0800 Subject: nginx-1.1.7 In-Reply-To: <20111031145842.GD45607@nginx.com> References: <20111031145842.GD45607@nginx.com> Message-ID: <4EAEBABF.1050100@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ? 2011?10?31? 22:58, Igor Sysoev ??: > Changes with nginx 1.1.7 31 Oct 2011 > > *) Feature: support of several resolvers in the "resolver" directive. > Thanks to Kirill A. Korinskiy. > > *) Bugfix: a segmentation fault occurred on start or while > reconfiguration if the "ssl" directive was used at http level and > there was no "ssl_certificate" defined. > > *) Bugfix: reduced memory consumption while proxying of big files if > they were buffered to disk. > > *) Bugfix: a segmentation fault might occur in a worker process if > "proxy_http_version 1.1" directive was used. > > *) Bugfix: in the "expires @time" directive. > > good job,i will test it later. - -- 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOrrq3AAoJEEYmNy4jisTjTnIIALE0xsXASbTVUumlmAahEm4+ TuH7nIWrMJfuOiLeZME9WOhkEiUnS5WKAYkf2BXg2b2c3oNp6wHDAnhMvpt1WLml 77AzF9i5esgmxDAyPkc12CJuxugl7FauCzB/ApHCZDW4Gu3htx3BX1mG+QkmN/D4 bnKnxMaJ4gHNWvYNX+6eKoPZDuInIYbAlVANmFrkbiU2YN7aCczO/AjcS13MdRO+ Cs6mZbJyycE46LmOGJqA+gD8mKhUw9mKtjQ9i9mb9NgdiK2YDIQpIi1PwS6VwZ+c 2z2mZgXpp/KWjKIdmIo7VgdUhM1KdD15z/K6nmHZPuU1Zu3k8jzJgt8prg+92kw= =2AMe -----END PGP SIGNATURE----- From nginx-forum at nginx.us Mon Oct 31 15:20:50 2011 From: nginx-forum at nginx.us (morayi) Date: Mon, 31 Oct 2011 11:20:50 -0400 Subject: Apache .htaccess to Nginx rewrite Message-ID: <0ec0a3146bd39144c9ae4148e4c2087c.NginxMailingListEnglish@forum.nginx.org> Hi All, I have a WP plugin and one of the futures is locking down the folder based on access level of the member. But they only support .htaccess / Apache. I don't want to scrap my nice NGINX installation for this problem. Can you any of you help me in converting the following .htaccess files to nginx config? Thanks, ===== each folder has a .htaccess file and they are as follows /files/Silver/.htaccess Options FollowSymLinks RewriteEngine on #RewriteCond %{REQUEST_URI} ^Silver/* RewriteRule ^(.*)$ /index.php?wlmfolder=Silver&restoffolder=$1 [L] /files/Gold/.htaccess RewriteEngine on #RewriteCond %{REQUEST_URI} ^Silver/* RewriteRule ^(.*)$ /index.php?wlmfolder=Gold&restoffolder=$1 [L] /files/Platinum/.htaccess RewriteEngine on #RewriteCond %{REQUEST_URI} ^Silver/* RewriteRule ^(.*)$ /index.php?wlmfolder=Platinum&restoffolder=$1 [L] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217553,217553#msg-217553 From appa at perusio.net Mon Oct 31 15:35:49 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Mon, 31 Oct 2011 15:35:49 +0000 Subject: Apache .htaccess to Nginx rewrite In-Reply-To: <0ec0a3146bd39144c9ae4148e4c2087c.NginxMailingListEnglish@forum.nginx.org> References: <0ec0a3146bd39144c9ae4148e4c2087c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87y5w1qilm.wl%appa@perusio.net> On 31 Out 2011 15h20 WET, nginx-forum at nginx.us wrote: > Hi All, > > I have a WP plugin and one of the futures is locking down the folder > based on access level of the member. But they only support .htaccess > / Apache. > > I don't want to scrap my nice NGINX installation for this > problem. Can you any of you help me in converting the following > .htaccess files to nginx config? > > Thanks, > > ===== > > each folder has a .htaccess file and they are as follows > > /files/Silver/.htaccess > > Options FollowSymLinks > RewriteEngine on > #RewriteCond %{REQUEST_URI} ^Silver/* > RewriteRule ^(.*)$ /index.php?wlmfolder=Silver&restoffolder=$1 [L] > > > > > /files/Gold/.htaccess > > RewriteEngine on > #RewriteCond %{REQUEST_URI} ^Silver/* > RewriteRule ^(.*)$ /index.php?wlmfolder=Gold&restoffolder=$1 [L] > > > > /files/Platinum/.htaccess > > RewriteEngine on > #RewriteCond %{REQUEST_URI} ^Silver/* > RewriteRule ^(.*)$ /index.php?wlmfolder=Platinum&restoffolder=$1 [L] > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,217553,217553#msg-217553 If you're ok with an explicit redirect, try this for each folder: location ^~ Silver/ { return 302 /index.php?wlmfolder=Silver&restoffolder=$uri; } location ^~ Gold/ { return 302 /index.php?wlmfolder=Gold&restoffolder=$uri; } location ^~ Platinum/ { return 302 /index.php?wlmfolder=Platinum&restoffolder=$uri; } --- appa From lists at ruby-forum.com Mon Oct 31 15:38:04 2011 From: lists at ruby-forum.com (Avi K.) Date: Mon, 31 Oct 2011 16:38:04 +0100 Subject: Problem with serving swf files with reverse proxy In-Reply-To: <1d13fe2206d835642ab99b128d3c67cb@ruby-forum.com> References: <1d13fe2206d835642ab99b128d3c67cb@ruby-forum.com> Message-ID: Ok, got it fixed. Insted of using: location ~* ^.+.(swf)$ { I set the swf folder as a location: location /swf-folder { Thanks -- Posted via http://www.ruby-forum.com/.