From lyninx at gmail.com Sun Apr 1 06:05:48 2012 From: lyninx at gmail.com (guo rong zhang) Date: Sun, 1 Apr 2012 14:05:48 +0800 Subject: post Message-ID: -------------- next part -------------- An HTML attachment was scrubbed... URL: From amoiz.shine at gmail.com Sun Apr 1 13:33:23 2012 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Sun, 1 Apr 2012 21:33:23 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: are you sure that NOT a joke of April Fools' Day, like taolinux (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? 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. 2012/3/31 Joshua Zhu : > Hi folks! > > We're pleased to announce that Tengine-1.2.4 has been released. You can > either download the tar ball > from?http://tengine.taobao.org/download/tengine-1.2.4.tar.gz ,?or checkout > the code from https://github.com/taobao/tengine > > As this release, Tengine is based on Nginx-1.0.14. The highlight is a brand > new 'user_agent' module which would be a good replacement for the 'browser' > module in standard Nginx.?It's more efficient and flexible?than the > 'browser' module. Other changes include: > * Feature: added the 'log_escape' directive. > * Bugfix: fixed a bug in the limit_req module. > * Bugfix: fixed a bug in subrequest. > > Regards, > > -- > Joshua Zhu > Senior Software Engineer > Server Platforms Team at Taobao > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From smallfish.xy at gmail.com Sun Apr 1 13:58:46 2012 From: smallfish.xy at gmail.com (smallfish) Date: Sun, 1 Apr 2012 21:58:46 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: hah, perhaps just a joke. but nothing is impossable. :) -- blog: http://chenxiaoyu.org ? 2012?4?1? ??9:33?Sharl.Jimh.Tsin ??? > are you sure that NOT a joke of April Fools' Day, like taolinux > (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? > > 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. > > > > 2012/3/31 Joshua Zhu : > > Hi folks! > > > > We're pleased to announce that Tengine-1.2.4 has been released. You can > > either download the tar ball > > from http://tengine.taobao.org/download/tengine-1.2.4.tar.gz , or > checkout > > the code from https://github.com/taobao/tengine > > > > As this release, Tengine is based on Nginx-1.0.14. The highlight is a > brand > > new 'user_agent' module which would be a good replacement for the > 'browser' > > module in standard Nginx. It's more efficient and flexible than the > > 'browser' module. Other changes include: > > * Feature: added the 'log_escape' directive. > > * Bugfix: fixed a bug in the limit_req module. > > * Bugfix: fixed a bug in subrequest. > > > > Regards, > > > > -- > > Joshua Zhu > > Senior Software Engineer > > Server Platforms Team at Taobao > > > > _______________________________________________ > > 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 varia at e-healthexpert.org Sun Apr 1 19:32:14 2012 From: varia at e-healthexpert.org (Mark Alan) Date: Sun, 1 Apr 2012 20:32:14 +0100 Subject: proxmox: how to use nginx instead of apache Message-ID: <20120401203214.1899b7c7@e-healthexpert.org> Hello list, I wonder if anybody in this list was successful at (completely) replacing apache for nginx as the web server for the proxmox VE management system . As for simply proxying it, I know that the following has beeen used to simply proxy clients to apache: server { listen 80 default_server; server_name ~^(www\.)?(?.+)$; return 302 https://$domain$request_uri; } server { listen 443 default_server ssl; server_name _; ssl_certificate /etc/pve/local/pve-ssl.pem; ssl_certificate_key /etc/pve/local/pve-ssl.key; location / { proxy_pass https://127.0.0.1:8006 ; } } Thank you, M. From kevanstannard at gmail.com Mon Apr 2 00:19:12 2012 From: kevanstannard at gmail.com (Kevan Stannard) Date: Mon, 2 Apr 2012 10:19:12 +1000 Subject: Understanding host value in nginx error log files Message-ID: I typically see entries in my error.log files of hack attempts where the host entry is the IP address of my server, but I also see some entries with host values that are domain names I don't recognise. Example 1: 012/04/01 06:12:49 [error] 644#0: *882 "/var/www/nginx-default/ab1e27867d53d8f4942095a891183ce0cacd3dbf/0d4fc9bfe7c5f26b02522d088dd98da95a9ed8d7/074977cbb342d6ffa7743ae477a5c0054fef5512/index.html" is not found (2: No such file or directory), client: 150.70.75.37, server: localhost, request: "GET /ab1e27867d53d8f4942095a891183ce0cacd3dbf/0d4fc9bfe7c5f26b02522d088dd98da95a9ed8d7/074977cbb342d6ffa7743ae477a5c0054fef5512/ HTTP/1.0", host: "deepspacer.com" Example 2: 2012/02/03 01:38:41 [error] 592#0: *14019 open() "/var/www/nginx-default/home.php" failed (2: No such file or directory), client: 216.104.15.130, server: localhost, request: "GET /home.php?SES=517a4bfc0137889f05d67314df2715a1&from_diary=1&cpl=1&from=102_4 HTTP/1.0", host: "www.au.mytelecomsurvey.com" Example 3: 2012/02/03 11:57:56 [error] 592#0: *18075 open() "/var/www/nginx-default/sites/default/files/js/js_b3ffc00633d66887fcb4ecdfc2d1c13a.jsmin.js" failed (2: No such file or directory), client: 150.70.64.197, server: localhost, request: "GET /sites/default/files/js/js_b3ffc00633d66887fcb4ecdfc2d1c13a.jsmin.js HTTP/1.0", host: "www.formalites-juridiques.net" I was hoping someone could explain what it means if I'm seeing these domain names as host values and if it's something I need to be concerned about. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Mon Apr 2 01:31:42 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Mon, 2 Apr 2012 01:31:42 +0000 Subject: How to limit_req depending if the requests has a REFERER or not. Message-ID: Hello. I have something like this... I need to be able to apply three different limit_req depending: a.) If the referer to click.php is domain.com ... apply zone1 b.) If there is some other referer apply zone2 on click.php c.) If there is no referer apply zone3 on click.php location /click.php { limit_req zone=one nodelay; proxy_pass http://22.136.1.121:80/; } Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Mon Apr 2 04:09:14 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Mon, 2 Apr 2012 04:09:14 +0000 Subject: Anyway to assign # of workers per server {} ? Message-ID: Hello, Id like to isolate the resources each one of my server {} consumes... in case any of my sites gets DoSed .. id like to try to contain possible effects related to used worker processes within its respective site. Is there anyway to achieve this? Regards, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Apr 2 04:56:56 2012 From: nginx-forum at nginx.us (niraj) Date: Mon, 2 Apr 2012 00:56:56 -0400 (EDT) Subject: Not easy replacement of Apache with Ngnix due to error log Message-ID: <69aa2109190fe2d487f2667e9bfb1765.NginxMailingListEnglish@forum.nginx.org> Hi All I having the html files and cgi files for that I was using the apache, Its running fine. I heard about the Nginx and I was trying to setup the same in locally first. but during that I was getting the error the error of Nginx not reflect the exact issue with the application. the error of Nginx is not system admin friendly at all. from the below error we are not able to conclude anything. how to solve the such kind of issue by checking the error log ?????? 2012/03/30 09:58:05 [error] 29619#0: *1 upstream closed prematurely FastCGI stdout while reading response header from upstream, client: 192.168.1.44, server: localhost, request: "GET /cgi-bin/baybuy_vendx/index.cgi?vendx_action=myoffice_commonuser&userid=53616c7465645f5f1fed4bcaa10a7da569ecb5a53e5a718a&page=1b662ecc4610f940ec530e3bc8762169&BusinessGrID=1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "192.168.1.225:90", referrer: "http://192.168.1.225:90/cgi-bin/baybuy_vendx/index.cgi?vendx_action=validate_both2" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224747,224747#msg-224747 From ru at nginx.com Mon Apr 2 06:16:10 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Mon, 2 Apr 2012 10:16:10 +0400 Subject: Anyway to assign # of workers per server {} ? In-Reply-To: References: Message-ID: <20120402061610.GA56549@lo0.su> On Mon, Apr 02, 2012 at 04:09:14AM +0000, Micheal Wolfskill wrote: > Id like to isolate the resources each one of my server {} consumes... in > case any of my sites gets DoSed .. id like to try to contain possible > effects related to used worker processes within its respective site. Is > there anyway to achieve this? If your servers use different address/port pairs, an obvious solution would be to run several instances of nginx, one per address/port. From ru at nginx.com Mon Apr 2 06:28:11 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Mon, 2 Apr 2012 10:28:11 +0400 Subject: Understanding host value in nginx error log files In-Reply-To: References: Message-ID: <20120402062811.GB56549@lo0.su> On Mon, Apr 02, 2012 at 10:19:12AM +1000, Kevan Stannard wrote: > I typically see entries in my error.log files of hack attempts where the > host entry is the IP address of my server, but I also see some entries with > host values that are domain names I don't recognise. > > Example 1: > > 012/04/01 06:12:49 [error] 644#0: *882 > "/var/www/nginx-default/ab1e27867d53d8f4942095a891183ce0cacd3dbf/0d4fc9bfe7c5f26b02522d088dd98da95a9ed8d7/074977cbb342d6ffa7743ae477a5c0054fef5512/index.html" > is not found (2: No such file or directory), client: 150.70.75.37, server: > localhost, request: "GET > /ab1e27867d53d8f4942095a891183ce0cacd3dbf/0d4fc9bfe7c5f26b02522d088dd98da95a9ed8d7/074977cbb342d6ffa7743ae477a5c0054fef5512/ > HTTP/1.0", host: "deepspacer.com" > > Example 2: > > 2012/02/03 01:38:41 [error] 592#0: *14019 open() > "/var/www/nginx-default/home.php" failed (2: No such file or directory), > client: 216.104.15.130, server: localhost, request: "GET > /home.php?SES=517a4bfc0137889f05d67314df2715a1&from_diary=1&cpl=1&from=102_4 > HTTP/1.0", host: "www.au.mytelecomsurvey.com" > > Example 3: > > 2012/02/03 11:57:56 [error] 592#0: *18075 open() > "/var/www/nginx-default/sites/default/files/js/js_b3ffc00633d66887fcb4ecdfc2d1c13a.jsmin.js" > failed (2: No such file or directory), client: 150.70.64.197, server: > localhost, request: "GET > /sites/default/files/js/js_b3ffc00633d66887fcb4ecdfc2d1c13a.jsmin.js > HTTP/1.0", host: "www.formalites-juridiques.net" > > I was hoping someone could explain what it means if I'm seeing these domain > names as host values and if it's something I need to be concerned about. It is just a value of the Host request header field. This could happen due to client's DNS misconfiguration. This could equally be a sign of malicious entity probing your site. From mansab.uppal at gmail.com Mon Apr 2 06:33:17 2012 From: mansab.uppal at gmail.com (Mansab Uppal) Date: Mon, 2 Apr 2012 12:03:17 +0530 Subject: Encountered '403 Forbidden Error' Message-ID: After configuring the nginx on windows, received '403 Frobidden Error' while opening the web page for the web site's 'index.php' page placed at the document root of the web server: html/v4/index.php' Any suggestions ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Apr 2 07:50:38 2012 From: nginx-forum at nginx.us (mscheel) Date: Mon, 2 Apr 2012 03:50:38 -0400 (EDT) Subject: $https with SSL proxy Message-ID: <7050ef8172d12a965c73c428d3950776.NginxMailingListEnglish@forum.nginx.org> Dear all, starting with version 1.1.11 the $https variable is activated by default. This is good as many applications rely on them because apache is using this header. However, now i cannot set or map this variable (nginx: [emerg] the duplicate "https" variable). We have a load balancer in front of the web servers which does all SSL traffic. The nginx servers can only differ between http and https via a header sent by the load balancer, the nginx port is the same. That hasn't been a problem in < 1.1.11. Many plugins, codings in applications use this $https header so it would be nice if i could assign it manually. Any ideas? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224756,224756#msg-224756 From appa at perusio.net Mon Apr 2 08:00:09 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 2 Apr 2012 10:00:09 +0200 Subject: $https with SSL proxy In-Reply-To: <7050ef8172d12a965c73c428d3950776.NginxMailingListEnglish@forum.nginx.org> References: <7050ef8172d12a965c73c428d3950776.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8211b4188417939839a07dd6e1b9b56f.squirrel@damiao.org> > Dear all, > > starting with version 1.1.11 the $https variable is activated by > default. This is good as many applications rely on them because apache > is using this header. > However, now i cannot set or map this variable (nginx: [emerg] the > duplicate "https" variable). We have a load balancer in front of the web > servers which does all SSL traffic. The nginx servers can only differ > between http and https via a header sent by the load balancer, the nginx > port is the same. That hasn't been a problem in < 1.1.11. Many plugins, > codings in applications use this $https header so it would be nice if i > could assign it manually. Have you tried explicitly setting the fastcgi_param, like in: fastcgi_param HTTPS $my_https; where $my_https is a variable that you set as you want it? --appa From nginx-forum at nginx.us Mon Apr 2 08:05:16 2012 From: nginx-forum at nginx.us (mscheel) Date: Mon, 2 Apr 2012 04:05:16 -0400 (EDT) Subject: $https with SSL proxy In-Reply-To: <8211b4188417939839a07dd6e1b9b56f.squirrel@damiao.org> References: <8211b4188417939839a07dd6e1b9b56f.squirrel@damiao.org> Message-ID: Antonio P.P. Almeida Wrote: ------------------------------------------------------- > > Dear all, > > > > starting with version 1.1.11 the $https variable > is activated by > > default. This is good as many applications rely > on them because apache > > is using this header. > > However, now i cannot set or map this variable > (nginx: [emerg] the > > duplicate "https" variable). We have a load > balancer in front of the web > > servers which does all SSL traffic. The nginx > servers can only differ > > between http and https via a header sent by the > load balancer, the nginx > > port is the same. That hasn't been a problem in > < 1.1.11. Many plugins, > > codings in applications use this $https header > so it would be nice if i > > could assign it manually. > > Have you tried explicitly setting the > fastcgi_param, like in: > > fastcgi_param HTTPS $my_https; > > where $my_https is a variable that you set as you > want it? > > --appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx The problem is that all applications rely on this "https" header, changing the code of all applications makes no sense to me. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224756,224758#msg-224758 From appa at perusio.net Mon Apr 2 08:10:52 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 2 Apr 2012 10:10:52 +0200 Subject: $https with SSL proxy In-Reply-To: References: <8211b4188417939839a07dd6e1b9b56f.squirrel@damiao.org> Message-ID: > The problem is that all applications rely on this "https" header, > changing the code of all applications makes no sense to me. AFAIK it's not a header but rather a parameter that is passed through CGI and in PHP, for example, you recover via $_SERVER['HTTPS']. This has nothing to do with headers. Of course you can set a header based on it. X-Forwarded-Proto $https; or X-Forwarded-Proto $my_https; ---appa From appa at perusio.net Mon Apr 2 08:35:35 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 2 Apr 2012 10:35:35 +0200 Subject: $https with SSL proxy In-Reply-To: References: <8211b4188417939839a07dd6e1b9b56f.squirrel@damiao.org> Message-ID: >> The problem is that all applications rely on this "https" header, >> changing the code of all applications makes no sense to me. > > AFAIK it's not a header but rather a parameter that is passed through CGI > and in PHP, for example, you recover via $_SERVER['HTTPS']. This has > nothing to do with headers. Of course you can set a header based on it. > > X-Forwarded-Proto $https; > > or > > X-Forwarded-Proto $my_https; Oops. My bad. I meant: X-Forwarded-Proto $scheme; --appa From nginx-forum at nginx.us Mon Apr 2 08:39:55 2012 From: nginx-forum at nginx.us (mscheel) Date: Mon, 2 Apr 2012 04:39:55 -0400 (EDT) Subject: $https with SSL proxy In-Reply-To: <7050ef8172d12a965c73c428d3950776.NginxMailingListEnglish@forum.nginx.org> References: <7050ef8172d12a965c73c428d3950776.NginxMailingListEnglish@forum.nginx.org> Message-ID: Your right, setting it for fastcgi as param works fine. I had a problem in the past setting variables in the fastcgi_params, they've just been ignored. This seems to be gone. Then i have to rewrite the nginx internal logic of my substitions/mappings based on this variable. I still think allowing a manual override of this variable should be allowed. If any other plugin relies on this header users with SSL Accelerators will definately have a problem. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224756,224761#msg-224761 From nginx-forum at nginx.us Mon Apr 2 09:23:30 2012 From: nginx-forum at nginx.us (shrinath.m) Date: Mon, 2 Apr 2012 05:23:30 -0400 (EDT) Subject: if proxy_read_timeout - then do something? Message-ID: <8d456b14891f54100a6c46111ad2eba9.NginxMailingListEnglish@forum.nginx.org> Hi, I would like to put a proxy_read_timeout and if it times out, I want to do a specific action in php and return some response to the user. Is this possible? How? Thanks, Shrinath Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224764,224764#msg-224764 From john at jmsd.co.uk Mon Apr 2 09:50:35 2012 From: john at jmsd.co.uk (John Moore) Date: Mon, 02 Apr 2012 10:50:35 +0100 Subject: nginx as remote proxy - limit number of concurrent connections? Message-ID: <4F79766B.2070909@jmsd.co.uk> I'm using nginx as a remote proxy server in front of a bunch of Tomcat instances, and occasionally I'm running into a situation where all available threads are used up in the Tomcat instances, which causes various problems. Rather than trying to deal with these problems in that layer, I was wondering about preventing the situation from arising by limiting the number of concurrent connections to the upstream servers in nginx. I'm not entirely sure how to do this, but I have no doubt it's doable. Suggestions, please! From appa at perusio.net Mon Apr 2 09:54:04 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 2 Apr 2012 11:54:04 +0200 Subject: nginx as remote proxy - limit number of concurrent connections? In-Reply-To: <4F79766B.2070909@jmsd.co.uk> References: <4F79766B.2070909@jmsd.co.uk> Message-ID: > I'm using nginx as a remote proxy server in front of a bunch of Tomcat > instances, and occasionally I'm running into a situation where all > available threads are used up in the Tomcat instances, which causes > various problems. Rather than trying to deal with these problems in that > layer, I was wondering about preventing the situation from arising by > limiting the number of concurrent connections to the upstream servers in > nginx. I'm not entirely sure how to do this, but I have no doubt it's > doable. Suggestions, please! Try this: http://nginx.localdomain.pl/wiki/UpstreamFair with the weight_mode=peak option. --appa From mdounin at mdounin.ru Mon Apr 2 10:57:08 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 Apr 2012 14:57:08 +0400 Subject: if proxy_read_timeout - then do something? In-Reply-To: <8d456b14891f54100a6c46111ad2eba9.NginxMailingListEnglish@forum.nginx.org> References: <8d456b14891f54100a6c46111ad2eba9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120402105708.GB13466@mdounin.ru> Hello! On Mon, Apr 02, 2012 at 05:23:30AM -0400, shrinath.m wrote: > Hi, > > I would like to put a proxy_read_timeout and if it times out, I want to > do a specific action in php and return some response to the user. Is > this possible? How? http://nginx.org/r/error_page You have to handle 504 (Gateway Timeout) errors. Maxim Dounin From mdounin at mdounin.ru Mon Apr 2 11:17:54 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 Apr 2012 15:17:54 +0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> Message-ID: <20120402111754.GD13466@mdounin.ru> Hello! On Sat, Mar 31, 2012 at 06:39:37PM -0400, Floren Munteanu wrote: > Hi Maxim, > > On 3/26/2012 12:47 PM, Maxim Dounin wrote: > >As already suggested - you may build nginx with any particular > >openssl version statically, by using --with-openssl= configure > >argument. > > I followed your advice and built a backlevel RPM for libcripto.so6 > and libssl.so6 so none of the deps are broken in CentOS 5. Then, I > built the OpenSSL 1.0.1 RPM's and rebuilt Nginx against the latest > libs: > # yum list openssl* nginx > Loaded plugins: fastestmirror > Loading mirror speeds from cached hostfile > * base: mirrors.manchester.icecolo.com > * extras: mirrors.manchester.icecolo.com > * updates: mirrors.manchester.icecolo.com > Installed Packages > nginx.x86_64 1.0.14-1.el5 installed > openssl.x86_64 1.0.1-1.el5 installed > openssl-libs.x86_64 1.0.1-1.el5 installed > openssl098e.x86_64 0.9.8e-1.el5 installed > > # nginx -V > nginx version: nginx/1.0.14 > built by gcc 4.1.2 20080704 (Red Hat 4.1.2-52) > TLS SNI support enabled > configure arguments: --user=nginx --group=nginx > --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx > --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid > --error-log-path=/var/log/nginx/error.log > --http-log-path=/var/log/nginx/access.log > --http-client-body-temp-path=/var/lib/nginx/client > --http-fastcgi-temp-path=/var/lib/nginx/fastcgi > --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/subsys/nginx --with-cc-opt='-O3 -g -m64 > -mtune=nocona -m128bit-long-double -mmmx -msse3 -mfpmath=sse' > --with-file-aio --with-http_addition_module --with-http_dav_module > --with-http_degradation_module --with-http_flv_module > --with-http_geoip_module --with-http_gzip_static_module > --with-http_image_filter_module --with-http_mp4_module > --with-http_perl_module --with-http_random_index_module > --with-http_realip_module --with-http_secure_link_module > --with-http_ssl_module --with-http_stub_status_module > --with-http_sub_module --with-http_xslt_module --with-mail > --with-mail_ssl_module --with-poll_module --with-rtsig_module > --with-select_module Please also check if nginx actually uses new openssl library, ldd should be helpful here. > > http { > ... > ssl_prefer_server_ciphers on; > ssl_ciphers RC4:HIGH:!aNULL:!MD5; > ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; > ssl_session_cache shared:SSL:5m; > ssl_session_timeout 10m; > ... > > server { > listen 192.168.1.3:443 ssl default_server; > server_name www.domain.com; > access_log off; > error_log /var/log/nginx/localhost.error.log error; > root /var/www/domain.com; > index index.php index.html; > ssl_certificate domain.com.crt; > ssl_certificate_key domain.com.key; > ... > } > } > > Even if I eliminated the OpenSSL version issues, I still have random > [crit] SSL_write() failures at the same frequency as before. They > are also accompanied by open socket alerts, of this format: > [alert] 2380#0: open socket #34 left in connection 12 > > I'm looking forward to your suggestions. As already suggested, it whould be cool to check if you see the same problem in 1.1.x. And to proceed further we need debug log, see here: http://wiki.nginx.org/Debugging Note you'll need to recompile nginx with "--with-debug" configure argument to obtain one. Maxim Dounin From nginx-forum at nginx.us Mon Apr 2 13:28:54 2012 From: nginx-forum at nginx.us (shrinath.m) Date: Mon, 2 Apr 2012 09:28:54 -0400 (EDT) Subject: if proxy_read_timeout - then do something? In-Reply-To: <8d456b14891f54100a6c46111ad2eba9.NginxMailingListEnglish@forum.nginx.org> References: <8d456b14891f54100a6c46111ad2eba9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <98a3cd9dbeb8fda659db0536b7fca9e7.NginxMailingListEnglish@forum.nginx.org> I tried to catch 504, not working. Anything wrong in the following? error_page 504 =200 @checkstatus; location @checkstatus { rewrite ^(.*)$ /k/binarystatus/check?original_uri=$1 break; proxy_pass https://shrinath.blah.com; proxy_hide_header Last-Modified; proxy_read_timeout 10s; proxy_intercept_errors on; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224764,224776#msg-224776 From nginx-forum at nginx.us Mon Apr 2 13:37:01 2012 From: nginx-forum at nginx.us (shrinath.m) Date: Mon, 2 Apr 2012 09:37:01 -0400 (EDT) Subject: if proxy_read_timeout - then do something? In-Reply-To: <98a3cd9dbeb8fda659db0536b7fca9e7.NginxMailingListEnglish@forum.nginx.org> References: <8d456b14891f54100a6c46111ad2eba9.NginxMailingListEnglish@forum.nginx.org> <98a3cd9dbeb8fda659db0536b7fca9e7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <10e88af288d55ad5b2e0a390b613fd47.NginxMailingListEnglish@forum.nginx.org> Oops... I take it back, it works... Ignorant me had one more line few lines above the said code: error_page 500 504 =500 @error50x; Solved now... Thanks :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224764,224777#msg-224777 From admin at yqed.com Mon Apr 2 16:15:10 2012 From: admin at yqed.com (Floren Munteanu) Date: Mon, 02 Apr 2012 12:15:10 -0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <20120402111754.GD13466@mdounin.ru> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> <20120402111754.GD13466@mdounin.ru> Message-ID: Hi Maxim, On 4/2/2012 7:17 AM, Maxim Dounin wrote: > As already suggested, it whould be cool to check if you see the > same problem in 1.1.x. > > And to proceed further we need debug log, see here: > > http://wiki.nginx.org/Debugging > > Note you'll need to recompile nginx with "--with-debug" configure > argument to obtain one. How safe is to put in production a debug built of Nginx? I could easily compile a different built, but I'm concerned of running this on a live environment as this is where the errors occur. Regards, Floren Munteanu From mdounin at mdounin.ru Mon Apr 2 17:06:37 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 Apr 2012 21:06:37 +0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> <20120402111754.GD13466@mdounin.ru> Message-ID: <20120402170637.GJ13466@mdounin.ru> Hello! On Mon, Apr 02, 2012 at 12:15:10PM -0400, Floren Munteanu wrote: > Hi Maxim, > > On 4/2/2012 7:17 AM, Maxim Dounin wrote: > >As already suggested, it whould be cool to check if you see the > >same problem in 1.1.x. > > > >And to proceed further we need debug log, see here: > > > >http://wiki.nginx.org/Debugging > > > >Note you'll need to recompile nginx with "--with-debug" configure > >argument to obtain one. > > How safe is to put in production a debug built of Nginx? > I could easily compile a different built, but I'm concerned of > running this on a live environment as this is where the errors > occur. It's safe and only adds minimal overhead on logging level checks as long as debug log isn't enabled. Note though that writing debug logs consume extra resources, and it may be noticeable under high load. The debug_connection directive allows to enable debug logging only for selected ip addresses to minimize impact. Maxim Dounin From citrin at citrin.ru Mon Apr 2 17:22:39 2012 From: citrin at citrin.ru (Anton Yuzhaninov) Date: Mon, 02 Apr 2012 21:22:39 +0400 Subject: Not easy replacement of Apache with Ngnix due to error log In-Reply-To: <69aa2109190fe2d487f2667e9bfb1765.NginxMailingListEnglish@forum.nginx.org> References: <69aa2109190fe2d487f2667e9bfb1765.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F79E05F.1040302@citrin.ru> On 04/02/12 08:56, niraj wrote: > the error of Nginx is not system admin friendly at all. from the below > error we are not able to conclude anything. nginx error logs is very friendly and useful. > how to solve the such kind of issue by checking the error log ?????? > > > 2012/03/30 09:58:05 [error] 29619#0: *1 upstream closed prematurely > FastCGI stdout while reading response header from upstream, client: > 192.168.1.44, server: localhost, request: "GET > /cgi-bin/baybuy_vendx/index.cgi?vendx_action=myoffice_commonuser&userid=53616c7465645f5f1fed4bcaa10a7da569ecb5a53e5a718a&page=1b662ecc4610f940ec530e3bc8762169&BusinessGrID=1 > HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: > "192.168.1.225:90", referrer: > "http://192.168.1.225:90/cgi-bin/baybuy_vendx/index.cgi?vendx_action=validate_both2" words "upstream closed prematurely FastCGI stdout" show, that problem is probably in FastCGI server. See FastCGI manager error logs, and OS logs (one of usual problem is segfault in FastCGI process). -- Anton Yuzhaninov From nginx-forum at nginx.us Mon Apr 2 21:21:39 2012 From: nginx-forum at nginx.us (Nginx_User777) Date: Mon, 2 Apr 2012 17:21:39 -0400 (EDT) Subject: memc_flags_to_last_modified and srcache , no 304 possible ? Message-ID: <6e2bc7fac8512842fa34ca858100f61b.NginxMailingListEnglish@forum.nginx.org> Hello All, Is it possible to use the memc_flags_to_last_modified directive with srcache ? It doesn't work for me. When a browser request nginx with a "If-Modified-Since" header, I would like that nginx lookup in memcached to verify if the "Last Modified" is the same and honor the 304 request without hit the proxied server (in another country). Impossible to get a 304, so no bandwith saved ... But my provider is happy :) Thanks for your help ! I working on for several days, i'll really go mad :) My config: #user nobody; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 0; server_tokens off; upstream memc1 { server XX.XX.XX.XX:11211; server unix:/tmp/memcached.sock backup; keepalive 1024; } upstream memc2 { server XX.XX.XX.XX:11211; keepalive 1024; } upstream_list MemCluster memc1 memc2; access_log /var/log/nginx/access.log; server { listen 80; server_name localhost; location = /memc { internal; set $memc_key $query_string; set $memc_exptime 0; set_hashed_upstream $backend MemCluster $memc_key; memc_pass $backend; memc_flags_to_last_modified on; } location / { set $key $uri; srcache_fetch GET /memc $key; srcache_store PUT /memc $key; proxy_pass http://the-far-far-away-server; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } Regards Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224793,224793#msg-224793 From siefke_listen at web.de Mon Apr 2 22:13:23 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Tue, 3 Apr 2012 00:13:23 +0200 Subject: PHP with FPM on Gentoo Message-ID: <20120403001323.c03997dd.siefke_listen@web.de> Hello, i try run Nginx with PHP-FPM under Gentoo. Under my FreeBSD Rootserver it run without any problems but under Gentoo want not run. nginx.conf > http://nopaste.info/72a40e9c5e.html php-fpm.conf > http://nopaste.info/94a9de62d5.html emerge --info php nginx > http://nopaste.info/225b12e106.html The last change in config is: server { listen 80 default; server_name localhost; access_log /var/log/nginx/localhost.access_log main; error_log /var/log/nginx/localhost.error_log debug; root /var/www/localhost/htdocs; location ~ (.*)\.php$ { include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs$fastcgi_script_name; } } The last Logs which i has: 192.168.0.20 - - [02/Apr/2012:17:59:05 +0200] "GET / HTTP/1.1" 200 633 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19" "-" 192.168.0.20 - - [02/Apr/2012:17:59:05 +0200] "GET /favicon.ico HTTP/1.1" 200 1650 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19" "-" 192.168.0.20 - - [02/Apr/2012:17:59:21 +0200] "GET /info.php HTTP/1.1" 200 289 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19" "0.47" 192.168.0.20 - - [02/Apr/2012:17:59:24 +0200] "-" 400 0 "-" "-" "-" 2012/04/02 17:59:24 [info] 21288#0: *4 client closed prematurely connection while reading client request line, client: 192.168.0.20, server: localhost I really not understand where is my mistake. Has someone a idea? Regards Silvio From kevanstannard at gmail.com Mon Apr 2 23:15:25 2012 From: kevanstannard at gmail.com (Kevan Stannard) Date: Tue, 3 Apr 2012 09:15:25 +1000 Subject: Understanding host value in nginx error log files In-Reply-To: <20120402062811.GB56549@lo0.su> References: <20120402062811.GB56549@lo0.su> Message-ID: Thanks Ruslan On 2 April 2012 16:28, Ruslan Ermilov wrote: > On Mon, Apr 02, 2012 at 10:19:12AM +1000, Kevan Stannard wrote: > > I typically see entries in my error.log files of hack attempts where the > > host entry is the IP address of my server, but I also see some entries > with > > host values that are domain names I don't recognise. > > > > Example 1: > > > > 012/04/01 06:12:49 [error] 644#0: *882 > > > "/var/www/nginx-default/ab1e27867d53d8f4942095a891183ce0cacd3dbf/0d4fc9bfe7c5f26b02522d088dd98da95a9ed8d7/074977cbb342d6ffa7743ae477a5c0054fef5512/index.html" > > is not found (2: No such file or directory), client: 150.70.75.37, > server: > > localhost, request: "GET > > > /ab1e27867d53d8f4942095a891183ce0cacd3dbf/0d4fc9bfe7c5f26b02522d088dd98da95a9ed8d7/074977cbb342d6ffa7743ae477a5c0054fef5512/ > > HTTP/1.0", host: "deepspacer.com" > > > > Example 2: > > > > 2012/02/03 01:38:41 [error] 592#0: *14019 open() > > "/var/www/nginx-default/home.php" failed (2: No such file or directory), > > client: 216.104.15.130, server: localhost, request: "GET > > > /home.php?SES=517a4bfc0137889f05d67314df2715a1&from_diary=1&cpl=1&from=102_4 > > HTTP/1.0", host: "www.au.mytelecomsurvey.com" > > > > Example 3: > > > > 2012/02/03 11:57:56 [error] 592#0: *18075 open() > > > "/var/www/nginx-default/sites/default/files/js/js_b3ffc00633d66887fcb4ecdfc2d1c13a.jsmin.js" > > failed (2: No such file or directory), client: 150.70.64.197, server: > > localhost, request: "GET > > /sites/default/files/js/js_b3ffc00633d66887fcb4ecdfc2d1c13a.jsmin.js > > HTTP/1.0", host: "www.formalites-juridiques.net" > > > > I was hoping someone could explain what it means if I'm seeing these > domain > > names as host values and if it's something I need to be concerned about. > > It is just a value of the Host request header field. This could happen > due to client's DNS misconfiguration. This could equally be a sign of > malicious entity probing your site. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Kevan Stannard Mob: 0411 757 433 -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at yqed.com Tue Apr 3 01:08:47 2012 From: admin at yqed.com (Floren Munteanu) Date: Mon, 02 Apr 2012 21:08:47 -0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <20120402170637.GJ13466@mdounin.ru> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> <20120402111754.GD13466@mdounin.ru> <20120402170637.GJ13466@mdounin.ru> Message-ID: Hi Maxim, On 4/2/2012 1:06 PM, Maxim Dounin wrote: > It's safe and only adds minimal overhead on logging level checks > as long as debug log isn't enabled. > > Note though that writing debug logs consume extra resources, and > it may be noticeable under high load. The debug_connection > directive allows to enable debug logging only for selected ip > addresses to minimize impact. I've built a nginx-debug RPM but I'm tempted to try 1.1.18 now. :) I will use instead 1.0.14, just in case is a nasty bug hidden somewhere in Nginx. In this way, we fix both versions. These are the compile cflags I used: gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -O3 -g -m64 -mtune=nocona -m128bit-long-double -mmmx -msse3 -mfpmath=sse I'm going to leave the error_log set on error and give it a 256k buffer so it should not affect the performance. Since we only deal [crit], I don't think we need to debug anything lower than error. I'll add the following settings into http: debug_points abort; worker_rlimit_core 512M; working_directory /var/lib/nginx/; Let me know please if I should do anything extra. Regards, Floren From tdgh2323 at hotmail.com Tue Apr 3 04:56:20 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Tue, 3 Apr 2012 04:56:20 +0000 Subject: Possible trigger actio of clearing cache within location /clearcache { } Message-ID: Is it possible to somehow (and without installing PHP) invoking the action of clearing the nginx cache (rm -fr /var/www/cache/*) by simply visiting a location {} of the server {} ? Obviously I would allow only specific IPs to that location. Regards, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Apr 3 05:47:53 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 3 Apr 2012 01:47:53 -0400 (EDT) Subject: Not easy replacement of Apache with Ngnix due to error log In-Reply-To: <4F79E05F.1040302@citrin.ru> References: <4F79E05F.1040302@citrin.ru> Message-ID: Hi Anton As u suggested, words "upstream closed prematurely FastCGI stdout" show, that problem is probably in FastCGI server. This is what I am telling u that Nginx error log misguide us. Actually Problem was one perl module was not installed in that so I was getting the above error. Earlier I used apache so if any module related error then it was reflect in apache's error log .............. that actually not happening with Nginx , this create a problem for system admin. If any idea to get details error logs for nginx then please sugeest. how to set fcgiwraper error log ?????? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224747,224814#msg-224814 From quintinpar at gmail.com Tue Apr 3 06:43:35 2012 From: quintinpar at gmail.com (Quintin Par) Date: Tue, 3 Apr 2012 12:13:35 +0530 Subject: Serve from cache but fire request to upstream server to increment page view counter Message-ID: Hi all, I have a strange case, not sure if this is addressed by nginx yet My site is cached as follows. location = / { proxy_pass http://localhost:82; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding ""; proxy_ignore_headers Set-Cookie; proxy_ignore_headers Cache-Control; proxy_ignore_headers Expires; proxy_ignore_headers X-Accel-Expires; add_header X-Cache-Status $upstream_cache_status; proxy_cache cache; proxy_cache_key $scheme$host$request_uri$cookie_site_sessionid; proxy_cache_valid 200 302 30s; proxy_cache_use_stale updating; } One issue I encounter with this is that I can?t increment the page view counter that I maintain in redis. Is there is way nginx can fire a request to the backend web ? to some URI so that I can take the request and increment the associated counter? I know I can achieve this with SSI, but I wanted to check if there is a better pattern. -Quintin -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Apr 3 08:02:14 2012 From: nginx-forum at nginx.us (locojohn) Date: Tue, 3 Apr 2012 04:02:14 -0400 (EDT) Subject: PHP with FPM on Gentoo In-Reply-To: <20120403001323.c03997dd.siefke_listen@web.de> References: <20120403001323.c03997dd.siefke_listen@web.de> Message-ID: <728e86fdb5c831482000d8acc06540fb.NginxMailingListEnglish@forum.nginx.org> Hi, Do you actually get any content, apart from errors in nginx error_log? The message "client closed prematurely connection while reading client request line, client: ..." shouldn't be a problem itself. "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. I can see from your access_log that requests are processed normally and responses are OK (code 200) for all your files including PHP files (request: /info.php). You can also use sockets for fastcgi connections, but that's a matter of preference and probably won't solve your issue, which I do not fully understand yet. shell: mkdir -p /var/run/fastcgi/php-fpm.sock php-fpm.conf: ;listen = 127.0.0.1:9000 ;listen.allowed_clients = 127.0.0.1 listen = /var/run/fastcgi/php-fpm.sock listen.owner = nginx listen.group = nginx nginx.conf: location \.php$ { include fastcgi_params; fastcgi_pass unix:/var/run/fastcgi/php-fpm.sock; } Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224804,224821#msg-224821 From gpakosz at yahoo.fr Tue Apr 3 08:49:40 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Tue, 3 Apr 2012 10:49:40 +0200 Subject: nginx + php-fpm "modern configuration way" Message-ID: Hello, Everyone knows there are many nginx tutorials out there and I would like to know what's the "modern way" when writing a php location block, I'm doing (nginx 1.1.: location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm/www-data.sock; } And it works pretty well. I quick tested phpinfo, drupal, joomla, wordpress and they all run correctly with SEF urls etc. However, I often see the following directives being used, how important/useful are they? fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; Regards, Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From edho at myconan.net Tue Apr 3 08:51:30 2012 From: edho at myconan.net (Edho Arief) Date: Tue, 3 Apr 2012 15:51:30 +0700 Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: 2012/4/3 Gr?gory Pakosz : > However, I often see the following directives being used, how > important/useful are they? > > fastcgi_split_path_info ^(.+\.php)(/.+)$; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > Those are to handle urls like www.example.com/index.php/some/para/meters. From gpakosz at yahoo.fr Tue Apr 3 09:02:07 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Tue, 3 Apr 2012 11:02:07 +0200 Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: > > > > > fastcgi_split_path_info ^(.+\.php)(/.+)$; > > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > > > > Those are to handle urls like www.example.com/index.php/some/para/meters. > > Well then Wordpress, Drupal and Joomla can do without them. From your remark, I deduce some other PHP scripts can't Regards, Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Apr 3 09:05:55 2012 From: nginx-forum at nginx.us (locojohn) Date: Tue, 3 Apr 2012 05:05:55 -0400 (EDT) Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: <27b4608086c25028f86c8e29d09e102e.NginxMailingListEnglish@forum.nginx.org> Edho Arief Wrote: ------------------------------------------------------- > Those are to handle urls like > www.example.com/index.php/some/para/meters. > Or, in other words, where PHP scripts require PATH_INFO / PATH_TRANSLATED environment variables to be set appropriately to the request, such as shown above. It isn't a popular practice these days, though, because URLs can be something like: /index.php/path/to/another/index.php/path... Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224829,224834#msg-224834 From appa at perusio.net Tue Apr 3 09:07:16 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 3 Apr 2012 11:07:16 +0200 Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: <74a27dfa34e47e04723227174f0a1acc.squirrel@damiao.org> > Hello, > > Everyone knows there are many nginx tutorials out there and I would like > to > know what's the "modern way" when writing a php location block, I'm doing > (nginx 1.1.: > > location ~ \.php$ { > try_files $uri =404; > > include fastcgi_params; > fastcgi_pass unix:/var/run/php5-fpm/www-data.sock; > } This is a "generic" way. This way you don't enumerate all the PHP scripts that are to be executed. The above is just the Nginx translation of "default" Apache way. There are better ways IMHO. But they require more effort to put in place. Also there's no need to use fcgi_split_pathinfo even if your app uses PATHINFO, like Chive for example. You can get the same employing named captures with regex based locations. --appa From appa at perusio.net Tue Apr 3 10:18:00 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 3 Apr 2012 12:18:00 +0200 Subject: Possible trigger actio of clearing cache within location /clearcache { } In-Reply-To: References: Message-ID: > Is it possible to somehow (and without installing PHP) invoking the action > of clearing the nginx cache (rm -fr /var/www/cache/*) by simply visiting a > location {} of the server {} ? Obviously I would allow only specific IPs > to that location. Yes with Lua. Try: location = /clearcache { allow 127.0.0.1; allow ::1; deny all; content_by_lua 'local status = os.execute("rm -fr /var/www/cache/*") if status == 0 then ngx.say("Cache cleared") else ngx.say("Cache not cleared") end'; } --appa From adrianhayter at gmail.com Tue Apr 3 10:19:52 2012 From: adrianhayter at gmail.com (Adrian Hayter) Date: Tue, 3 Apr 2012 11:19:52 +0100 Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: A lot of forums use it for their "archive mode". Look at vBulletin / MyBB for examples. 2012/4/3 Gr?gory Pakosz > > >> > fastcgi_split_path_info ^(.+\.php)(/.+)$; >> > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; >> > fastcgi_param SCRIPT_NAME $fastcgi_script_name; >> > >> >> Those are to handle urls like www.example.com/index.php/some/para/meters. >> >> > Well then Wordpress, Drupal and Joomla can do without them. From your > remark, I deduce some other PHP scripts can't > > Regards, > Gregory > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Adrian Hayter -------------- next part -------------- An HTML attachment was scrubbed... URL: From siefke_listen at web.de Tue Apr 3 10:48:21 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Tue, 3 Apr 2012 12:48:21 +0200 Subject: PHP with FPM on Gentoo In-Reply-To: <728e86fdb5c831482000d8acc06540fb.NginxMailingListEnglish@forum.nginx.org> References: <20120403001323.c03997dd.siefke_listen@web.de> <728e86fdb5c831482000d8acc06540fb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120403124821.a25db2e3.siefke_listen@web.de> Hello, On Tue, 3 Apr 2012 04:02:14 -0400 (EDT) "locojohn" wrote: > mkdir -p /var/run/fastcgi/php-fpm.sock > > php-fpm.conf: > > ;listen = 127.0.0.1:9000 > ;listen.allowed_clients = 127.0.0.1 > listen = /var/run/fastcgi/php-fpm.sock > listen.owner = nginx > listen.group = nginx > > nginx.conf: > > location \.php$ { > include fastcgi_params; > fastcgi_pass unix:/var/run/fastcgi/php-fpm.sock; > } Thx for advice. But will not run. When i start nginx it come only gentoo-desk ~ # /etc/init.d/nginx start * Checking nginx' configuration ... nginx: [emerg] invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35 nginx: configuration file /etc/nginx/nginx.conf test failed nginx: [emerg] invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35 nginx: configuration file /etc/nginx/nginx.conf test failed * failed, please correct errors above [ !! ] * ERROR: nginx failed to start 2012/04/03 12:44:52 [emerg] 2062#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35 2012/04/03 12:44:52 [emerg] 2063#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35 2012/04/03 12:45:02 [emerg] 2073#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35 2012/04/03 12:45:02 [emerg] 2074#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35 Mmh can it be that nginx and / or php not right build with emerge? Regards Silvio From rainer at ultra-secure.de Tue Apr 3 10:56:02 2012 From: rainer at ultra-secure.de (Rainer Duffner) Date: Tue, 3 Apr 2012 12:56:02 +0200 Subject: PHP with FPM on Gentoo In-Reply-To: <20120403124821.a25db2e3.siefke_listen@web.de> References: <20120403001323.c03997dd.siefke_listen@web.de> <728e86fdb5c831482000d8acc06540fb.NginxMailingListEnglish@forum.nginx.org> <20120403124821.a25db2e3.siefke_listen@web.de> Message-ID: <20120403125602.21849408@suse2.iptech.internal> Am Tue, 3 Apr 2012 12:48:21 +0200 schrieb Silvio Siefke : > Hello, > > On Tue, 3 Apr 2012 04:02:14 -0400 (EDT) > "locojohn" wrote: > > > mkdir -p /var/run/fastcgi/php-fpm.sock Shouldn't that only be: mkdir -p /var/run/fastcgi/ though, on FreeBSD, I think this is created automatically. Remove the php-fpm.sock directory. Rainer From nginx-forum at nginx.us Tue Apr 3 10:59:24 2012 From: nginx-forum at nginx.us (locojohn) Date: Tue, 3 Apr 2012 06:59:24 -0400 (EDT) Subject: PHP with FPM on Gentoo In-Reply-To: <20120403125602.21849408@suse2.iptech.internal> References: <20120403125602.21849408@suse2.iptech.internal> Message-ID: <18bfc0e6a8380be7be9f6eaf2e7120a6.NginxMailingListEnglish@forum.nginx.org> Rainer Duffner Wrote: ------------------------------------------------------- > Am Tue, 3 Apr 2012 12:48:21 +0200 > schrieb Silvio Siefke : > > > > mkdir -p /var/run/fastcgi/php-fpm.sock > > > > Shouldn't that only be: > > mkdir -p /var/run/fastcgi/ Right, of course! My stupid mistake. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224804,224850#msg-224850 From siefke_listen at web.de Tue Apr 3 11:02:41 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Tue, 3 Apr 2012 13:02:41 +0200 Subject: PHP with FPM on Gentoo In-Reply-To: <20120403125602.21849408@suse2.iptech.internal> References: <20120403001323.c03997dd.siefke_listen@web.de> <728e86fdb5c831482000d8acc06540fb.NginxMailingListEnglish@forum.nginx.org> <20120403124821.a25db2e3.siefke_listen@web.de> <20120403125602.21849408@suse2.iptech.internal> Message-ID: <20120403130241.e672847b.siefke_listen@web.de> Hello, On Tue, 3 Apr 2012 12:56:02 +0200 Rainer Duffner wrote: > Shouldn't that only be: > > mkdir -p /var/run/fastcgi/ > > though, on FreeBSD, I think this is created automatically. > > > Remove the php-fpm.sock directory. > > > Rainer > Thank u, yes thats right i have only run mkdir -p /var/run/fastcgi, that i know from freebsd. But it wont not run. When i run complete mkdir -p /var/run/fastcgi/php-fpm.sock it give mistakes have try both ways. Regards Silvio From osa at FreeBSD.org.ru Tue Apr 3 11:03:15 2012 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Tue, 3 Apr 2012 15:03:15 +0400 Subject: [ANN] ngx_http_redis-0.3.6 released Message-ID: <20120403110314.GC52498@FreeBSD.org.ru> ngx_http_redis module version 0.3.6 released, available for immediate download at http://people.freebsd.org/~osa/ngx_http_redis-0.3.6.tar.gz SHA256 (ngx_http_redis-0.3.6.tar.gz) = 9e5d8c0f1317a6910710c94d27f9aca4968c48ee1de271e5034525a1e9b6c70e SIZE (ngx_http_redis-0.3.6.tar.gz) = 12099 *) Feature: redis_gzip_flag. Usefull if you are prefer to store data compressed in redis. Works with ngx_http_gunzip_filter module. Thanks to Maxim Dounin. *) Bugfix: ngx_http_redis_module might issue the error message "redis sent invalid trailer". Thanks to agentzh. -- Sergey A. Osokin osa at FreeBSD.ORG.ru osa at FreeBSD.ORG From nginx-forum at nginx.us Tue Apr 3 11:07:04 2012 From: nginx-forum at nginx.us (tikonen) Date: Tue, 3 Apr 2012 07:07:04 -0400 (EDT) Subject: Possible HTTP response read bug in Nginx 1.0.12 Message-ID: Hi, I've nginx server setup that terminates SSL connections from clients and forwards plain HTTP requests to backend servers. Some of these requests can last pretty long (up to 1 minute) and usually get very short 15 byte reply. (Ajax polling) However, we see often these kind of errors that indicate that backend servers would have disconnected socket while writing reply. 2012/03/03 06:46:38 [error] 13394#0: *2100 upstream prematurely closed connection while reading response header from upstream, client: XX.XX.XX.XX, server: secure.example.com, request: "GET /url/example?par=12345 HTTP/1.1", upstream: "http://127.0.0.1:8082/url/example?par=12345", host: "secure.example.com", referrer: "https://secure.example.com/" Strangely I can see correponding 200 OK responses from our server logs at the same timestamp, so at least backend server is trying to respond correctly. Then we captured the traffic between nginx and backend server with wireshark and noticed that when this happens the response from server is actually sent in two TCP packets. The first packet has headers and the second packet has small 15 byte HTTP body. I suspect that nginx fails to read the second packet in some conditions and thinks backend server disconnected prematurely. Any insights? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224853,224853#msg-224853 From contact at jpluscplusm.com Tue Apr 3 11:13:25 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Tue, 3 Apr 2012 12:13:25 +0100 Subject: Not easy replacement of Apache with Ngnix due to error log In-Reply-To: References: <4F79E05F.1040302@citrin.ru> Message-ID: On 3 April 2012 06:47, niraj wrote: > Hi ?Anton > > ? ? ? ? ? ? ? As u suggested, It's "you", not "u". We're not teenagers swapping text messages here. > ? ? ? ? ? ? ? words "upstream closed prematurely FastCGI stdout" show, > that problem is > probably in FastCGI server. > > ? ? ? ? ? ? ? ? ?This is what I am telling u that Nginx error log > misguide us. No, it told you exactly where to aim your troubleshooting lens. At the FCGI process. > ? ? ? ? ? ? ?Actually Problem was one perl module was not installed in > that so I was getting the above error. > > ? ? Earlier I used apache so if any module related error then it was > reflect in apache's error log .............. That's because of an architectural decision for Apache to host the perl process, and for nginx to outsource it. Each has their advantages and disadvantages and both are valid approaches. Learn to use the tools in your toolkit. > that actually not happening with Nginx , this create a problem for > system admin. If your system administrator is unable to configure a debug log from your perl process or its FCGI wrapper, after being given the earlier information that the problem is *inside* the FCGI process, then your problem is not with nginx: it is with your incompetent system administrator. > If any idea to get details error logs for nginx ?then please sugeest. > > how to set ?fcgiwraper error log ?????? I don't know if this thread is useful: http://www.ruby-forum.com/topic/180064 You may have to search for other people's solutions to getting the verbose logs into nginx logs. It appears people have achieved this. I don't have any pertinent information other than what I found searching for the problem. Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From nginx-forum at nginx.us Tue Apr 3 12:32:42 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 3 Apr 2012 08:32:42 -0400 (EDT) Subject: Not easy replacement of Apache with Ngnix due to error log In-Reply-To: References: Message-ID: <0f7940628730140292547d241360dd5c.NginxMailingListEnglish@forum.nginx.org> Hi First of all sorry for ''u". I am the system admin. I was stuck when I was getting the above error. I will try to find for the informative error log in Nginx. I just shared the thing that was happened with me. If error log was informative like apache then It could be the solved earlier. I totally agree with Each has their advantages and disadvantages and both are valid approaches. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224747,224858#msg-224858 From nginx-forum at nginx.us Tue Apr 3 12:35:02 2012 From: nginx-forum at nginx.us (double) Date: Tue, 3 Apr 2012 08:35:02 -0400 (EDT) Subject: if( variable exists ) Message-ID: <2a3eaa6476032378a1a7e1be4c005723.NginxMailingListEnglish@forum.nginx.org> Hello, Is there a chance to test if a "$arg_variable" (empty value) exists? The problem: "if" condition returns "false". URL: http://example.com/?variable nginx.conf: location / { if( $arg_variable ) { rewrite ^.*$ /other-location; } } Thanks a lot Marcus Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224860,224860#msg-224860 From contact at jpluscplusm.com Tue Apr 3 13:13:57 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Tue, 3 Apr 2012 14:13:57 +0100 Subject: Config variable inheritance: docs and rules Message-ID: Hi all - http://www.ruby-forum.com/topic/188742 seems to contain some information I've not found explicitly stated anywhere else: that config variable inheritance is an all or nothing mechanism. Have I missed some docs somewhere? Following on from this, I'd like to understand if there's anything I can reliably determine from a variable's name about the impact that defining it will have on *other* variables inheritance. Can I, for instance, assume that defining an xyx_ prefixed variable in a sub-scope will affect *only* the inheritance of other xyz_ prefixed variables? Or can there be inheritance side-effects between, say $abc and $def that I can't possibly determine without documentation or trial and error? Equally, can I assume that *all* xyz_ prefixed variables will have their inheritance affected by the sub-scope definition of *any* other xyz_ prefixed variable? Or are there examples where defining $xyz_foo does *not* invalidate the inheritance of $xyz_bar ? Thanks, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From adrianhayter at gmail.com Tue Apr 3 13:21:21 2012 From: adrianhayter at gmail.com (Adrian Hayter) Date: Tue, 3 Apr 2012 14:21:21 +0100 Subject: Not easy replacement of Apache with Ngnix due to error log In-Reply-To: <0f7940628730140292547d241360dd5c.NginxMailingListEnglish@forum.nginx.org> References: <0f7940628730140292547d241360dd5c.NginxMailingListEnglish@forum.nginx.org> Message-ID: > > I just shared the thing that was happened with me. If error log was > informative like apache then It could be the solved earlier. > It was informative. It told you which process was actually having the error (FastCGI). Nginx should be expected to handle it's own error messages well, but if the error is in another process, it only has what that process gives back to it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Apr 3 14:56:31 2012 From: lists at ruby-forum.com (Ton Hoekstra) Date: Tue, 03 Apr 2012 16:56:31 +0200 Subject: Rewrite URL's Glype Message-ID: Hi all, I've a Glype proxy and I want to rewrite the URL's. All URLs on the page are automatically converted to: http://proxy.com/browse.php?u=URL HERE Example: If I go to /browse on The Pirate Bay on my proxy I want to convert the URL from this: http://proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Fbrowse&b=0 To this: http://proxy.com/tpb/browse Also if i go to: http://proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Ftop&b=0 Then I want to convert to: http://proxy.com/tpb/top As you can see, the whole part: browse.php?u=http%3A%2F%2Fthepiratebay.se%2F Is gone (and the `&b=0` what is behind the URL). And it has the same domain structure as The Pirate Bay. I've tried something like this, in the .htaccess file: location /tpb/ { rewrite ^/browse.php?u=(.*)$ /$1? last; break; } But it is not working. Somebody has an answer? An other function is also welcome. (Such as `fastcgi_split_path_info` or something else what is compatible with nginx) (If you want see a example go to tpb.piratenpartij.nl but I'm not sure if they are using Glype) -- Posted via http://www.ruby-forum.com/. From francis at daoine.org Tue Apr 3 15:52:03 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 3 Apr 2012 16:52:03 +0100 Subject: Config variable inheritance: docs and rules In-Reply-To: References: Message-ID: <20120403155203.GA26052@craic.sysops.org> On Tue, Apr 03, 2012 at 02:13:57PM +0100, Jonathan Matthews wrote: Hi there, > http://www.ruby-forum.com/topic/188742 seems to contain some > information I've not found explicitly stated anywhere else: that > config variable inheritance is an all or nothing mechanism. Have I > missed some docs somewhere? That thread refers to configuration directives, not variables. The difference might not matter, but for clarity it's worth making sure that we all understand the same thing. In the above thread, the (wrong) expectation was that "fastcgi_param" at one level would add to "fastcgi_param" from an enclosing level. In fact, nginx doesn't add between levels. That is how nginx configuration works. Each request is handled by exactly one location. Only the configuration in that location, and inherited into that location, matters. Inheritance is global > http > server > location. If a directive is used in that location, it overrides any might-have-been-inherited values for that directive. This is as true for single-valued directives like "root" as it is for multi-valued directives like "fastcgi_param". Whether a particular directive can be inherited depends on the module that processes it -- which means "depends on the documentation". But if it *can* be inherited, it should follow the above rules. (Or it's a bug.) The rest of your mail talks specifically about defining variables; I'm talking about directives. Someone else may be able to explain the variable rules; if you do mean "directives", then the above should make it clear what the answer in each case is. There are some subtleties about what exactly is "a request"; and what locations are involved when "if" is used; and how nested locations work. But for trying to find what configuration applies to a particular incoming http request, the "inherit or replace, but never add" rule makes it straightforward to understand. f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Tue Apr 3 16:15:30 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 Apr 2012 20:15:30 +0400 Subject: Possible HTTP response read bug in Nginx 1.0.12 In-Reply-To: References: Message-ID: <20120403161530.GS13466@mdounin.ru> Hello! On Tue, Apr 03, 2012 at 07:07:04AM -0400, tikonen wrote: > Hi, > > I've nginx server setup that terminates SSL connections from clients and > forwards plain HTTP requests to backend servers. Some of these requests > can last pretty long (up to 1 minute) and usually get very short 15 byte > reply. (Ajax polling) > > However, we see often these kind of errors that indicate that backend > servers would have disconnected socket while writing reply. > > 2012/03/03 06:46:38 [error] 13394#0: *2100 upstream prematurely closed > connection while reading response header from upstream, client: > XX.XX.XX.XX, server: secure.example.com, request: "GET > /url/example?par=12345 HTTP/1.1", upstream: > "http://127.0.0.1:8082/url/example?par=12345", host: > "secure.example.com", referrer: "https://secure.example.com/" > > Strangely I can see correponding 200 OK responses from our server logs > at the same timestamp, so at least backend server is trying to respond > correctly. > Then we captured the traffic between nginx and backend server with > wireshark and noticed that when this happens the response from server is > actually sent in two TCP packets. > > The first packet has headers and the second packet has small 15 byte > HTTP body. I suspect that nginx fails to read the second packet in some > conditions and thinks backend server disconnected prematurely. > > Any insights? Thanks! Please try 1.1.x to see if this is already resolved. If not, please provide traffic capture and corresponding debug log, see http://wiki.nginx.org/Debugging Maxim Dounin From mdounin at mdounin.ru Tue Apr 3 16:32:13 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 Apr 2012 20:32:13 +0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> <20120402111754.GD13466@mdounin.ru> <20120402170637.GJ13466@mdounin.ru> Message-ID: <20120403163212.GU13466@mdounin.ru> Hello! On Mon, Apr 02, 2012 at 09:08:47PM -0400, Floren Munteanu wrote: > Hi Maxim, > > On 4/2/2012 1:06 PM, Maxim Dounin wrote: > >It's safe and only adds minimal overhead on logging level checks > >as long as debug log isn't enabled. > > > >Note though that writing debug logs consume extra resources, and > >it may be noticeable under high load. The debug_connection > >directive allows to enable debug logging only for selected ip > >addresses to minimize impact. > > I've built a nginx-debug RPM but I'm tempted to try 1.1.18 now. :) > I will use instead 1.0.14, just in case is a nasty bug hidden > somewhere in Nginx. In this way, we fix both versions. These are the I'm afraid we aren't going to fix 1.0.x anyway. The 1.1.x branch will become stable in serveral weeks, and 1.0.x is expected to get only security fixes. > compile cflags I used: > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter > -Wunused-function -Wunused-variable -Wunused-value -Werror -g -O3 -g > -m64 -mtune=nocona -m128bit-long-double -mmmx -msse3 -mfpmath=sse > > I'm going to leave the error_log set on error and give it a 256k > buffer so it should not affect the performance. Since we only deal The error log doesn't support buffering. > [crit], I don't think we need to debug anything lower than error. I need complete request debug log to understand what's going on during request processing (and what's going wrong). > I'll add the following settings into http: > debug_points abort; > worker_rlimit_core 512M; > working_directory /var/lib/nginx/; > > Let me know please if I should do anything extra. For now, please capture debug log. Anything else (including gdb dump of the request in question) isn't that important, but if you are going to obtain one it might be good idea to recompile nginx without -O3 as it might produce undesired side-effects in gdb output. The -O used by default is good enough. Maxim Dounin From cliff at develix.com Tue Apr 3 16:54:47 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 03 Apr 2012 09:54:47 -0700 Subject: proxmox: how to use nginx instead of apache In-Reply-To: <20120401203214.1899b7c7@e-healthexpert.org> References: <20120401203214.1899b7c7@e-healthexpert.org> Message-ID: <1333472087.2428.15.camel@portable-evil> On Sun, 2012-04-01 at 20:32 +0100, Mark Alan wrote: > Hello list, > > I wonder if anybody in this list was successful at (completely) > replacing apache for nginx as the web server for the proxmox VE > management system . AFAIK, Proxmox is implemented in mod_perl and uses mod_perl specific features. It's tied to Apache. Cliff From ne at vbart.ru Tue Apr 3 16:56:30 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 3 Apr 2012 20:56:30 +0400 Subject: if( variable exists ) In-Reply-To: <2a3eaa6476032378a1a7e1be4c005723.NginxMailingListEnglish@forum.nginx.org> References: <2a3eaa6476032378a1a7e1be4c005723.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201204032056.30563.ne@vbart.ru> On Tuesday 03 April 2012 16:35:02 double wrote: > Hello, > > Is there a chance to test if a "$arg_variable" (empty value) exists? > The problem: "if" condition returns "false". > > URL: > http://example.com/?variable > if ($args ~ variable) { ... } wbr, Valentin V. Bartenev From contact at jpluscplusm.com Tue Apr 3 17:07:13 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Tue, 3 Apr 2012 18:07:13 +0100 Subject: Config variable inheritance: docs and rules In-Reply-To: <20120403155203.GA26052@craic.sysops.org> References: <20120403155203.GA26052@craic.sysops.org> Message-ID: On 3 April 2012 16:52, Francis Daly wrote: > On Tue, Apr 03, 2012 at 02:13:57PM +0100, Jonathan Matthews wrote: > > Hi there, > >> http://www.ruby-forum.com/topic/188742 seems to contain some >> information I've not found explicitly stated anywhere else: that >> config variable inheritance is an all or nothing mechanism. Have I >> missed some docs somewhere? > > That thread refers to configuration directives, not variables. > > The difference might not matter, but for clarity it's worth making sure > that we all understand the same thing. You're absolutely correct; I'm referring to config directives, but was thinking too hard about the question to notice I'd mixed my terminologies. I'll correct it, and resend the email in a new thread for list archive niceness. It'd be great if you could cherry pick the stuff you feel is relevant from your reply and resend it. If only for those who come after ... :-) Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From contact at jpluscplusm.com Tue Apr 3 17:20:13 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Tue, 3 Apr 2012 18:20:13 +0100 Subject: Config directive inheritance: docs and rules (was: Config variable inheritance) Message-ID: Hi all - http://www.ruby-forum.com/topic/188742 seems to contain some information I've not found explicitly stated anywhere else: that config directive inheritance is an all or nothing mechanism. Have I missed some docs somewhere? Following on from this, I'd like to understand if there's anything I can reliably determine from a directive's name about the impact that defining it will have on *other* directives' inheritability. Can I, for instance, assume that defining an xyx_ prefixed directive in a sub-scope will affect *only* the inheritance of other xyz_ prefixed directives? Or can there be inheritance side-effects between, say, directive "abc" and "def" that I can't possibly determine without documentation or trial and error? Equally, can I assume that *all* xyz_ prefixed directives will have their inheritance affected by the sub-scope definition of any *other* xyz_ prefixed directive? Or are there examples where defining "xyz_foo" does *not* impact the inheritance of "xyz_bar"? I'm thinking specifically of proxy_* directives, whereas the thread I link to above is talking about multiple fastcgi_param directives. Here, I'm interested in how, say, proxy_set_header affects the inheritance of higher scope's proxy_pass directive - i.e. where the prefix matches but they're *not* the same directive. Does nginx (core) derive or imply anything relating to the name-spacing of directives before (in my example) the proxy module sees the config, or is it entirely down to how each module implements the configuration aggregation/inheritance? Many thanks, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From varia at e-healthexpert.org Tue Apr 3 18:52:15 2012 From: varia at e-healthexpert.org (Mark Alan) Date: Tue, 3 Apr 2012 19:52:15 +0100 Subject: proxmox: how to use nginx instead of apache In-Reply-To: <1333472087.2428.15.camel@portable-evil> References: <20120401203214.1899b7c7@e-healthexpert.org> <1333472087.2428.15.camel@portable-evil> Message-ID: <20120403195215.65c4882b@e-healthexpert.org> On Tue, 03 Apr 2012 09:54:47 -0700, Cliff Wells wrote: > > I wonder if anybody in this list was successful at (completely) > > replacing apache for nginx as the web server for the proxmox VE > > management system . > > AFAIK, Proxmox is implemented in mod_perl and uses mod_perl specific > features. It's tied to Apache. > > Cliff Thank you Cliff, I was hoping that someone had already start some work (based on from http://wiki.nginx.org/NginxEmbeddedPerlModule ?). It would be much more light, secure and would, perhaps, avoid loading a full perl instance for each apache child process. Well, I won't give up on it yet. M. From gpakosz at yahoo.fr Tue Apr 3 18:56:12 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Tue, 3 Apr 2012 20:56:12 +0200 Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: Thank you all for your reply So, adding fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; doesn't really hurt. The box I'm running does shared hosting for a couple of users and I don't really know in advance what they want to install on their account. I'm going to keep those 3 lines in hope it helps some php scripts out there to run correctly. Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From baishen.lists at gmail.com Tue Apr 3 20:13:08 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Tue, 3 Apr 2012 16:13:08 -0400 Subject: Custom error pages In-Reply-To: <20120328211619.GB3899@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> <20120316151856.GP18773@craic.sysops.org> <20120328211619.GB3899@craic.sysops.org> Message-ID: My conf looks like this. server { listen 192.168.1.1:80; server_name example.com; error_page 503 /maint/503.html; location /maint/503.html { internal; } location /maint/ { root /etc/nginx/html; } server { listen 192.168.1.1:80; server_name example.com; location / { proxy_pass http://192.168.1.2; } } To show the 503 page instead of my site, I uncomment the top server block. When I want to bring the site back, I comment the top block out. The /maint/ location was what I changed to get the css and images to work. However, I'm not sure that it's the best solution. Also, I'm assuming that there's a better way to show/hide the 503 page than commenting out the whole server block. On Wed, Mar 28, 2012 at 5:16 PM, Francis Daly wrote: > On Wed, Mar 28, 2012 at 03:42:45PM -0400, Bai Shen wrote: > > Hi there, > > > I got my error page to show up. However, the css and image files don't > > load. I tried changing the location, but that doesn't seem to work. > > > > Any suggestions? > > Try changing the location again. Maybe it will work this time. > > > Or alternatively: > > Please fill in the details: > > > > what did you do? > > That will be something like "curl -i http://myserver/myfile.css" > > > > what did you see? > > That will be whatever you got back -- the content of /var/tmp/myfile.css, > or the content of another file, or some error message. There might be > more details available in log files. > > > > what did you expect to see? > > That will be something like "http 200 and the content of > /usr/local/nginx/html/myfile.css". > > > > and the more specific you are, the easier it will be for someone else > to > > > reproduce the problem you are reporting. > > Provide the relevant part of nginx.conf from a machine where you saw > the problem. If you don't know what is the relevant part, provide the > whole thing. > > It doesn't have to be your "live" config, but it should be a config that > you ran on a test machine. The smaller the config, the better. > > If you make it easy for someone to run the same server config as you, > and run the same client commands as you, and see the same error output > as you; then you make it easy for that person to try to help resolve the > problem you saw. > > If you don't, you don't. > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yvldwt at gmail.com Tue Apr 3 20:30:39 2012 From: yvldwt at gmail.com (=?UTF-8?B?RMW+ZW4=?=) Date: Tue, 03 Apr 2012 22:30:39 +0200 Subject: try_files ignored in combination with error_page and named locations Message-ID: <4F7B5DEF.8030107@gmail.com> Hello, For some reason the following nginx configuration snippet doesn't work as expected, try_files seems to be ignored. When / is requested (or any other URI which points to a file which doesn't exist), nginx's default 503 page is returned instead of the existing index.html. Requesting /index.html works correctly. location @maintenance { root /var/nginx/$hostid-maintenance; index index.html; try_files $uri $uri/ / =500; } error_page 503 @maintenance; if ( -d $document_root/$hostid-maintenance ) { return 503; } Any thoughts? Running nginx version 1.0.12 here. Kind regards -- D?en From caldcv at gmail.com Tue Apr 3 20:59:09 2012 From: caldcv at gmail.com (Chris) Date: Tue, 3 Apr 2012 16:59:09 -0400 Subject: proxmox: how to use nginx instead of apache In-Reply-To: <20120403195215.65c4882b@e-healthexpert.org> References: <20120401203214.1899b7c7@e-healthexpert.org> <1333472087.2428.15.camel@portable-evil> <20120403195215.65c4882b@e-healthexpert.org> Message-ID: You mean for the Proxmox VE Web GUI? From nginx-forum at nginx.us Tue Apr 3 21:12:33 2012 From: nginx-forum at nginx.us (locojohn) Date: Tue, 3 Apr 2012 17:12:33 -0400 (EDT) Subject: nginx + php-fpm "modern configuration way" In-Reply-To: References: Message-ID: Well, in that case you may as well support SCRIPT_URL / SCRIPT_URI, as there are some [old] PHP scripts that rely on these variables set normally by Apache. nginx.conf: http { ... map $uri $script_url { ~^(?.+\.(php|html))(?.+)$ $path_info; ~^(?.+\.(php|html))$ $script_filename; } ... } fastcgi_php.conf: include fastcgi_params; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_URL $script_url; fastcgi_param SCRIPT_URI $scheme://$http_host$script_url; try_files $fastcgi_script_name = 404; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224829,224900#msg-224900 From siefke_listen at web.de Tue Apr 3 21:39:16 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Tue, 3 Apr 2012 23:39:16 +0200 Subject: PHP with FPM on Gentoo In-Reply-To: <20120403001323.c03997dd.siefke_listen@web.de> References: <20120403001323.c03997dd.siefke_listen@web.de> Message-ID: <20120403233916.d0943f2e.siefke_listen@web.de> Hello, Could someone possibly provide me the USE flags available if someone has run Nginx, PHP and Fpm. It were nice. Regards Silvio From tdgh2323 at hotmail.com Tue Apr 3 22:09:29 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Tue, 3 Apr 2012 22:09:29 +0000 Subject: How to limit_req depending if the requests has a REFERER or not. In-Reply-To: References: Message-ID: Hello. I have something like this... I need to be able to apply three different limit_req depending: a.) If the referer to click.php is domain.com ... apply zone1 b.) If there is some other referer apply zone2 on click.php c.) If there is no referer apply zone3 on click.php location /click.php { limit_req zone=one nodelay; proxy_pass http://22.136.1.121:80/; } Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdorfman at netdna.com Tue Apr 3 22:10:07 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Tue, 3 Apr 2012 15:10:07 -0700 Subject: Location URI Wildcard Message-ID: Hello, I am trying to find a way to redirect a bunch of jpg files to an html page. This way is not working: location = /attach/201204*.jpg { root /usr/local/nginx/html; index suspend.html; } Here is a real world file name: 201204031012088721.jpg Thanks! Regards, Justin Dorfman -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Tue Apr 3 22:20:40 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 4 Apr 2012 02:20:40 +0400 Subject: Location URI Wildcard In-Reply-To: References: Message-ID: <20120403222039.GV13466@mdounin.ru> Hello! On Tue, Apr 03, 2012 at 03:10:07PM -0700, Justin Dorfman wrote: > Hello, > > I am trying to find a way to redirect a bunch of jpg files to an html page. > > This way is not working: > > location = /attach/201204*.jpg { > root /usr/local/nginx/html; > index suspend.html; > } > > Here is a real world file name: 201204031012088721.jpg location ~ ^/attach/201204.*\.jpg$ { alias /usr/local/nginx/html/suspend.html; } Maxim Dounin From jdorfman at netdna.com Tue Apr 3 22:26:57 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Tue, 3 Apr 2012 15:26:57 -0700 Subject: Location URI Wildcard In-Reply-To: <20120403222039.GV13466@mdounin.ru> References: <20120403222039.GV13466@mdounin.ru> Message-ID: Perfect thanks Maxim! Regards, Justin Dorfman NetDNA ? The Science of Acceleration? Email / gtalk: jdorfman at netdna.com P: 1.323.301.1400 x 272 Skype: netdna-justind Twitter: @jdorfman www.NetDNA.com | www.MaxCDN.com @NetDNA | @MaxCDN On Tue, Apr 3, 2012 at 3:20 PM, Maxim Dounin wrote: > Hello! > > On Tue, Apr 03, 2012 at 03:10:07PM -0700, Justin Dorfman wrote: > > > Hello, > > > > I am trying to find a way to redirect a bunch of jpg files to an html > page. > > > > This way is not working: > > > > location = /attach/201204*.jpg { > > root /usr/local/nginx/html; > > index suspend.html; > > } > > > > Here is a real world file name: 201204031012088721.jpg > > location ~ ^/attach/201204.*\.jpg$ { > alias /usr/local/nginx/html/suspend.html; > } > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Apr 4 01:06:12 2012 From: nginx-forum at nginx.us (tikonen) Date: Tue, 3 Apr 2012 21:06:12 -0400 (EDT) Subject: Possible HTTP response read bug in Nginx 1.0.12 In-Reply-To: <20120403161530.GS13466@mdounin.ru> References: <20120403161530.GS13466@mdounin.ru> Message-ID: <0897eea6bf171e32cb305273ccc3d6a2.NginxMailingListEnglish@forum.nginx.org> Hi, Thanks for advice, I'll try next with 1.1.X and see if that helps. In case 1.1.X does not solve the problem. Server load is pretty big and only minor % of requests have the error so the debug log and capture dump would be Huge to catch even one case. (Still these errors are frequent enough to cause ip_hash to flag node failed and cause havoc in the cluster). To narrow down needed data, can you recommend proper debugging settings, should I start server or global level? Also, should I make debug log againts 1.1.X or 1.0.12 ? Thanks, Teemu Maxim Dounin Wrote: ------------------------------------------------------- > Please try 1.1.x to see if this is already > resolved. If not, > please provide traffic capture and corresponding > debug log, see > http://wiki.nginx.org/Debugging Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224853,224907#msg-224907 From agentzh at gmail.com Wed Apr 4 03:23:12 2012 From: agentzh at gmail.com (agentzh) Date: Wed, 4 Apr 2012 11:23:12 +0800 Subject: memc_flags_to_last_modified and srcache , no 304 possible ? In-Reply-To: <6e2bc7fac8512842fa34ca858100f61b.NginxMailingListEnglish@forum.nginx.org> References: <6e2bc7fac8512842fa34ca858100f61b.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Tue, Apr 3, 2012 at 5:21 AM, Nginx_User777 wrote: > Is it possible to use the memc_flags_to_last_modified directive with > srcache ? > It doesn't work for me. > > When a browser request nginx with a "If-Modified-Since" header, I would > like that nginx lookup in memcached to verify if the "Last Modified" is > the same and honor the 304 request without hit the proxied server (in > another country). > > Impossible to get a 304, so no bandwith saved ... But my provider is > happy :) > > Thanks for your help ! > I working on for several days, i'll really go mad :) > This is a TODO item for ngx_srcache. I'll look into this in the near future. Thanks for reminding me of this :) Best regards, -agentzh From quintinpar at gmail.com Wed Apr 4 04:08:25 2012 From: quintinpar at gmail.com (Quintin Par) Date: Wed, 4 Apr 2012 09:38:25 +0530 Subject: Serve from cache but fire request to upstream server to increment page view counter In-Reply-To: References: Message-ID: Hi all, Can someone please help me on this? The pattern is similar to proxy_cache_use_stale updating but just that the backend request is a fire-and-forget. If I am to do this in SSI I?ll end up spending time to service the code path in SSI whereas there is no much need to that urgently. The next cache bypass will update it and that?s good enough for me. -Quintin On Tue, Apr 3, 2012 at 12:13 PM, Quintin Par wrote: > Hi all, > > I have a strange case, not sure if this is addressed by nginx yet > > My site is cached as follows. > > location = / { > > proxy_pass http://localhost:82; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > proxy_set_header Accept-Encoding ""; > > proxy_ignore_headers Set-Cookie; > > proxy_ignore_headers Cache-Control; > > proxy_ignore_headers Expires; > > proxy_ignore_headers X-Accel-Expires; > > add_header X-Cache-Status $upstream_cache_status; > > proxy_cache cache; > > proxy_cache_key > $scheme$host$request_uri$cookie_site_sessionid; > > proxy_cache_valid 200 302 30s; > > proxy_cache_use_stale updating; > > } > > One issue I encounter with this is that I can?t increment the page view > counter that I maintain in redis. > > Is there is way nginx can fire a request to the backend web ? to some URI > so that I can take the request and increment the associated counter? > > I know I can achieve this with SSI, but I wanted to check if there is a > better pattern. > > -Quintin > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Apr 4 06:14:41 2012 From: nginx-forum at nginx.us (niraj) Date: Wed, 4 Apr 2012 02:14:41 -0400 (EDT) Subject: Not easy replacement of Apache with Ngnix due to error log In-Reply-To: References: Message-ID: Hi My view is that only if Nginx error log more informative then it will be very userful for system admin who wants to switch from apache to Nginx. Its need to be more informative. "As I am system admin and I was face that issue and at that time there were no error log which guide me to solve the issue. who are new to switch with Nginx this logs not that much informative." My personal view if Nginx having more informative error log then anybody can easily adopt the Nginx. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224747,224911#msg-224911 From varia at e-healthexpert.org Wed Apr 4 08:01:03 2012 From: varia at e-healthexpert.org (Mark Alan) Date: Wed, 4 Apr 2012 09:01:03 +0100 Subject: proxmox: how to use nginx instead of apache In-Reply-To: References: <20120401203214.1899b7c7@e-healthexpert.org> <1333472087.2428.15.camel@portable-evil> <20120403195215.65c4882b@e-healthexpert.org> Message-ID: <20120404090103.40a30405@e-healthexpert.org> On Tue, 3 Apr 2012 16:59:09 -0400, Chris wrote: > You mean for the Proxmox VE Web GUI? Yes. The idea is to use Nginx Instead of Apache to serve the Proxmox VE Web GUI. M. From appa at perusio.net Wed Apr 4 08:09:43 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Wed, 4 Apr 2012 10:09:43 +0200 Subject: Serve from cache but fire request to upstream server to increment page view counter In-Reply-To: References: Message-ID: <77590aa60cbf956e5fa84ac68220edca.squirrel@damiao.org> There's the post_action directive. But AFAIK is not that reliable. I would use Lua with the "new" cosocket API and do an HTTP request. Here's an example of a library built around it that talks with a Redis backend: https://github.com/agentzh/lua-resty-redis As stated post_action is another option: http://wiki.nginx.org/HttpCoreModule#post_action --appa From nginx-forum at nginx.us Wed Apr 4 08:12:49 2012 From: nginx-forum at nginx.us (tikonen) Date: Wed, 4 Apr 2012 04:12:49 -0400 (EDT) Subject: Possible HTTP response read bug in Nginx 1.0.12 In-Reply-To: References: Message-ID: <5f12ff38be70c57ffc2353ffac5ea907.NginxMailingListEnglish@forum.nginx.org> I can confirm that problem exisits also with Nginx 1.1.18. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224853,224917#msg-224917 From ru at nginx.com Wed Apr 4 08:16:10 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Wed, 4 Apr 2012 12:16:10 +0400 Subject: try_files ignored in combination with error_page and named locations In-Reply-To: <4F7B5DEF.8030107@gmail.com> References: <4F7B5DEF.8030107@gmail.com> Message-ID: <20120404081610.GA44137@lo0.su> On Tue, Apr 03, 2012 at 10:30:39PM +0200, D?en wrote: > For some reason the following nginx configuration snippet doesn't work > as expected, try_files seems to be ignored. When / is requested (or any > other URI which points to a file which doesn't exist), nginx's default > 503 page is returned instead of the existing index.html. Requesting > /index.html works correctly. > > location @maintenance { > root /var/nginx/$hostid-maintenance; > index index.html; > try_files $uri $uri/ / =500; > } > > error_page 503 @maintenance; > > if ( -d $document_root/$hostid-maintenance ) { > return 503; > } > > Any thoughts? Running nginx version 1.0.12 here. First, this is a wacky config, and I don't quite understand what you're trying to achieve with it. :) Here's what happens with the request of "/", assuming that "if" condition holds true. The status code is set to 503, and further processing happends in the named location @maintenance. It tries "$uri", find that directory, but because argument does not end with a slash (i.e., we're testing a file, not directory), this variant is ignored. It then tries "$uri/", and succeeds. $uri is set to "/$hostid-maintenance/". As documentation of "try_files" says, the further processing is done in thi same (named) location. What happens next is since a request now ends with a slash, the static module handler ignores it, and a request is processed by the index module. The index module then verifies that the "/var/nginx/$hostid-maintenance/index.html" file exists and does an internal redirect to a new $uri. (The fact that it does an internal redirect is also documented.) This in turn gets processed by the server's default location which is configured to return 503. Because "recursive_error_pages" aren't enabled, the server ends up returning status code 503 with the standard content. (What happens when you enable is left as an excercise to a reader.) When OTOH you request "/index.html", try_files checks that the _file_ exists, and the processing is performed by the static module in the context of location @maintenance. There are no more internal redirects involved, so the server ends up sending you the status code 503 with the contents of index.html. I agree that this might not be obvious, but this is how it works. The important bit here is that requests that end up with "/", and get processed by the index module, do an internal redirect. This is quite logical if you think about it, because they *usually* get processed by the static module, as if a request ended up with "/" followed by the name of index file. From arissirajawali at gmail.com Wed Apr 4 08:29:19 2012 From: arissirajawali at gmail.com (aris) Date: Wed, 4 Apr 2012 15:29:19 +0700 Subject: install nginx dan php debian In-Reply-To: <1215987271.1017595069@informatik.hu> References: <4F756EE7.401@esiee.fr> <1215987271.1017595069@informatik.hu> Message-ID: hi all, after I finished install nginx with apt-get install nginx, what steps should I do so nginxcan walk? ----------------------------- On Fri, Mar 30, 2012 at 10:17 PM, Vuki wrote: > Hi! > > Check file permissions and the index directive, and index files! > > Vukii > > ------- Original message ------- > >> From: aris >> To: surfchen at gmail.com >> Cc: nginx at nginx.org >> Sent: '12-03-30, 15:28 >> >> >> dear all, >> why is my nginx 403 Forbidden? >> Where such errors >> please help me, thank you >> >> >> On Fri, Mar 30, 2012 at 4:01 PM, Chen Ze wrote: >> >>> Google and RTFM >>> >>> On Fri, Mar 30, 2012 at 4:29 PM, Frank Bonnet wrote: >>> >>>> On 03/30/2012 06:19 AM, aris wrote: >>>> >>>> please help me, I just wanted to start >>>> the install nginx and php on **debian linux, >>>> that I question is: how to install nginx and php on **debian, please send >>>> it >>>> to me once in the tutorial how to install nginx and php. >>>> Thank you so much before >>>> >>>> ______________________________**_________________ >>>> nginx mailing list >>>> nginx at nginx.org >>>> http://mailman.nginx.org/**mailman/listinfo/nginx >>>> >>>> >>>> http://www.howtoforge.com/**installing-php-5.3-nginx-and-** >>>> php-fpm-on-ubuntu-debian >>>> >>>> >>>> ______________________________**_________________ >>>> 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 yvldwt at gmail.com Wed Apr 4 08:48:01 2012 From: yvldwt at gmail.com (=?utf-8?B?RMW+ZW4=?=) Date: Wed, 4 Apr 2012 10:48:01 +0200 Subject: try_files ignored in combination with error_page and named locations In-Reply-To: <20120404081610.GA44137@lo0.su> References: <4F7B5DEF.8030107@gmail.com> <20120404081610.GA44137@lo0.su> Message-ID: <20120404084801.GA11638@azarath.acceleris.ch> Thank you very much for your clarifying explanation. Seems like the only thing missing was "recursive_error_pages on" for it to work like I wanted it to have. On 04/04/12 12:16pm, Ruslan Ermilov wrote: > [...] > > First, this is a wacky config, and I don't quite understand what > you're trying to achieve with it. :) Just to make you understand what I was trying to achieve with this config: my maintenance page contains img tags pointing to images located in $document_root. I used to add a simple try_files /$hostid-maintenance/ @backend; to my configuration, but as expected a request to /foo.png returns the contents of /$hostid-maintenance/index.html instead. Thus I was looking for a solution to use a whole directory as an error page (being able to request other files which are located inside the maintenance $document_root). > Here's what happens with the request of "/", assuming that "if" > condition holds true. > > The status code is set to 503, and further processing happends in > the named location @maintenance. > > It tries "$uri", find that directory, but because argument does > not end with a slash (i.e., we're testing a file, not directory), > this variant is ignored. That's OK in my case, since the maintenance "environment" might contain other directories. > It then tries "$uri/", and succeeds. $uri is set to > "/$hostid-maintenance/". As documentation of "try_files" says, > the further processing is done in thi same (named) location. I'm not really sure whether $uri is set to "/$hostid-maintenance/" if "$uri/" is tried (since root is set to /var/nginx/$hostid-maintenance/ already). That works as expected and a request to / will actually just try / relative to $document_root. > What happens next is since a request now ends with a slash, the > static module handler ignores it, and a request is processed by > the index module. The index module then verifies that the > "/var/nginx/$hostid-maintenance/index.html" file exists and does > an internal redirect to a new $uri. (The fact that it does an > internal redirect is also documented.) > > This in turn gets processed by the server's default location > which is configured to return 503. Because > "recursive_error_pages" aren't enabled, the server ends up > returning status code 503 with the standard content. Thanks, that's what I forgot about. > (What happens when you enable is left as an excercise to a > reader.) > > When OTOH you request "/index.html", try_files checks that the > _file_ exists, and the processing is performed by the static > module in the context of location @maintenance. There are no > more internal redirects involved, so the server ends up sending > you the status code 503 with the contents of index.html. > > I agree that this might not be obvious, but this is how it works. > > The important bit here is that requests that end up with "/", and > get processed by the index module, do an internal redirect. This > is quite logical if you think about it, because they *usually* > get processed by the static module, as if a request ended up with > "/" followed by the name of index file. Thanks again and kind regards -- D?en From edho at myconan.net Wed Apr 4 09:03:30 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 4 Apr 2012 16:03:30 +0700 Subject: try_files ignored in combination with error_page and named locations In-Reply-To: <20120404084801.GA11638@azarath.acceleris.ch> References: <4F7B5DEF.8030107@gmail.com> <20120404081610.GA44137@lo0.su> <20120404084801.GA11638@azarath.acceleris.ch> Message-ID: 2012/4/4 D?en : > Thank you very much for your clarifying explanation. Seems like the only > thing missing was "recursive_error_pages on" for it to work like I > wanted it to have. > > On 04/04/12 12:16pm, Ruslan Ermilov wrote: >> [...] >> >> First, this is a wacky config, and I don't quite understand what >> you're trying to achieve with it. ?:) > > Just to make you understand what I was trying to achieve with this > config: my maintenance page contains img tags pointing to images located > in $document_root. I used to add a simple > > ? ? ? ?try_files /$hostid-maintenance/ @backend; > > to my configuration, but as expected a request to /foo.png returns the > contents of /$hostid-maintenance/index.html instead. Thus I was looking > for a solution to use a whole directory as an error page (being able to > request other files which are located inside the maintenance > $document_root). > location /maintenance-static/ { } location / { try_files /$hostid-maintenance/ @backend; } From nginx-forum at nginx.us Wed Apr 4 09:33:47 2012 From: nginx-forum at nginx.us (Nginx_User777) Date: Wed, 4 Apr 2012 05:33:47 -0400 (EDT) Subject: memc_flags_to_last_modified and srcache , no 304 possible ? In-Reply-To: References: Message-ID: <94dbd74a50f2b2281a62e87e00228e32.NginxMailingListEnglish@forum.nginx.org> Hi Agentzh, Thanks for your answer. I'll continue to work with a srcache_fetch_skip to honor 304. And a really big thanks for these excellent modules, it's great !!!! Best Regards. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224793,224923#msg-224923 From siefke_listen at web.de Wed Apr 4 09:44:33 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Wed, 4 Apr 2012 11:44:33 +0200 Subject: PHP with FPM on Gentoo In-Reply-To: <4F7BEA7A.8060304@gentoo.org> References: <20120403001323.c03997dd.siefke_listen@web.de> <20120403233916.d0943f2e.siefke_listen@web.de> <4F7BEA7A.8060304@gentoo.org> Message-ID: <20120404114433.49d17c07.siefke_listen@web.de> Hello, On Wed, 04 Apr 2012 08:30:18 +0200 Ole Markus With wrote: > Did you see the Gentoo install instructions [1]? Yes i have read. > You only need the fpm USE flag enabled for php. > Nginx require NGINX_MODULES_HTTP="fastcgi" In PHP is activated and Nginx i have reinstalled yesterdays with fastcgi Flag. I use Google normaly before. > With those set, fpm + nginx should work pretty much out of the box after > adding the fastcgi_pass line to nginx.conf. No work not pretty. On FreeBSD yes, on Gentoo nothing. > TCP sockets are the easiest to configure. If you want to use unix > sockets, you have to make sure the file permissions are correct etc. Has set again the IPs, which permissions must habe Unix sockets? Owner is normal, nginx but chmod? Regards Silvio From ol.morel at linkbynet.com Wed Apr 4 09:58:49 2012 From: ol.morel at linkbynet.com (morel) Date: Wed, 4 Apr 2012 11:58:49 +0200 Subject: Question about Vhost Message-ID: <4F7C1B59.2060209@linkbynet.com> hy i have installed nginx on my web server, i can run the configtest on nginx.conf but i would want also check the configuration of my vhost . When i try diverse handling like this /usr/local/nginx/sbin/nginx -c -t /etc/nginx/conf/vhosts-available/Site1.conf all the time i get the same error * nginx: [emerg] unknown directive "server" in /usr/local/nginx/vhosts-available/Site1.conf * nginx: configuration file /usr/local/nginx/vhosts-available/rSite1.conf test failed My question is do you know theyre is possibility to test vhost conf ? Cordially Oliver -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Wed Apr 4 10:41:50 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 4 Apr 2012 11:41:50 +0100 Subject: Question about Vhost In-Reply-To: <4F7C1B59.2060209@linkbynet.com> References: <4F7C1B59.2060209@linkbynet.com> Message-ID: On 4 April 2012 10:58, morel wrote: > i have installed nginx on my web server, i can run the configtest on > nginx.conf but i would want also check the configuration of my vhost . By testing your main config, you're automatically testing all included files as well. Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From mdounin at mdounin.ru Wed Apr 4 11:09:58 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 4 Apr 2012 15:09:58 +0400 Subject: Possible HTTP response read bug in Nginx 1.0.12 In-Reply-To: <0897eea6bf171e32cb305273ccc3d6a2.NginxMailingListEnglish@forum.nginx.org> References: <20120403161530.GS13466@mdounin.ru> <0897eea6bf171e32cb305273ccc3d6a2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120404110958.GW13466@mdounin.ru> Hello! On Tue, Apr 03, 2012 at 09:06:12PM -0400, tikonen wrote: > Hi, > > Thanks for advice, I'll try next with 1.1.X and see if that helps. > > In case 1.1.X does not solve the problem. Server load is pretty big and > only minor % of requests have the error so the debug log and capture > dump would be Huge to catch even one case. (Still these errors are > frequent enough to cause ip_hash to flag node failed and cause havoc in > the cluster). > > To narrow down needed data, can you recommend proper debugging settings, > should I start server or global level? It's better to have debugging activated at global level to be able to see events reported by the kernel. > Also, should I make debug log againts 1.1.X or 1.0.12 ? The 1.1.x would be better. Maxim Dounin From nginx-forum at nginx.us Wed Apr 4 11:46:05 2012 From: nginx-forum at nginx.us (locojohn) Date: Wed, 4 Apr 2012 07:46:05 -0400 (EDT) Subject: PHP with FPM on Gentoo In-Reply-To: <20120403233916.d0943f2e.siefke_listen@web.de> References: <20120403233916.d0943f2e.siefke_listen@web.de> Message-ID: Silvio Siefke Wrote: ------------------------------------------------------- > Hello, > > > Could someone possibly provide me the USE flags > available > if someone has run Nginx, PHP and Fpm. /etc/make.conf: NGINX_MODULES_HTTP="access autoindex browser charset \ empty_gif fastcgi flv geoip gzip limit_zone \ map proxy rewrite stub_status upstream_ip_hash \ upload_progress" /etc/portage/package.use: www-servers/nginx aio dev-lang/php -* fpm cli bcmath ssl ctype curl fileinfo filter ftp gd hash iconv json mysqlnd mysql mysqli nls pcntl pcre posix readline reflection session simplexml sharedmem spl sysvipc tokenizer truetype unicode xml zlib xmlreader xmlwriter --- www-servers/nginx-1.1.18::x-portage USE="aio http http-cache pcre ssl -debug -ipv6 -libatomic -pcre-jit -vim-syntax" NGINX_MODULES_HTTP="access autoindex browser charset empty_gif fastcgi flv geoip gzip limit_zone map proxy rewrite stub_status upload_progress upstream_ip_hash -addition -auth_basic -cache_purge -dav -degradation -geo -gzip_static -headers_more -image_filter -limit_req -memcached -mp4 -passenger -perl -push -random_index -realip -referer -scgi -secure_link -slowfs_cache -split_clients -ssi -sub -upload -userid -uwsgi -xslt" NGINX_MODULES_MAIL="-imap -pop3 -smtp" 0 kB dev-lang/php-5.3.10-r2 USE="bcmath cli ctype curl fileinfo filter fpm ftp gd hash iconv json mysql mysqli mysqlnd nls pcntl posix readline session sharedmem simplexml ssl sysvipc tokenizer truetype unicode xml xmlreader xmlwriter zlib -apache2 -berkdb -bzip2 -calendar -cdb -cgi -cjk -crypt -curlwrappers -debug -doc -embed -enchant -exif -firebird -flatfile (-frontbase) -gdbm -gmp -imap -inifile -intl -iodbc -ipv6 -kerberos -kolab -ldap -ldap-sasl -libedit -mhash -mssql -oci8-instant-client -odbc -pdo -phar -pic -postgres -qdbm -recode -snmp -soap -sockets -spell -sqlite -sqlite3 -suhosin (-sybase-ct) -threads -tidy -wddx -xmlrpc -xpm -xsl -zip" 0 kB > Has set again the IPs, which permissions must habe Unix sockets? Owner > is normal, nginx but chmod? The socket file configured in php-fpm.conf should be readable and writeable by nginx. Naturally, if socket owner/group in php-fpm are set to nginx:nginx, nginx should work with php fpm over socket connection just fine. One question: do you use selinux? Any specific Gentoo installation? Please send me your /etc/make.conf file. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224804,224931#msg-224931 From quintinpar at gmail.com Wed Apr 4 12:17:22 2012 From: quintinpar at gmail.com (Quintin Par) Date: Wed, 4 Apr 2012 17:47:22 +0530 Subject: Serve from cache but fire request to upstream server to increment page view counter In-Reply-To: <77590aa60cbf956e5fa84ac68220edca.squirrel@damiao.org> References: <77590aa60cbf956e5fa84ac68220edca.squirrel@damiao.org> Message-ID: Thanks Appa. Why would you say this is not reliable? Is there data or experience to suggest? The semantic is awesome. Precisely what I?ve been looking for. -Cherian On Wed, Apr 4, 2012 at 1:39 PM, Antonio P.P. Almeida wrote: > There's the post_action directive. But AFAIK is not that reliable. > > I would use Lua with the "new" cosocket API and do an HTTP request. > > Here's an example of a library built around it that talks with a Redis > backend: https://github.com/agentzh/lua-resty-redis > > As stated post_action is another option: > > http://wiki.nginx.org/HttpCoreModule#post_action > > > --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 Wed Apr 4 12:21:49 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Wed, 4 Apr 2012 14:21:49 +0200 Subject: Serve from cache but fire request to upstream server to increment page view counter In-Reply-To: References: <77590aa60cbf956e5fa84ac68220edca.squirrel@damiao.org> Message-ID: <0b0d1d41b7b059cd1add3ed5f8755d1b.squirrel@damiao.org> > Thanks Appa. > > Why would you say this is not reliable? Is there data or experience to > suggest? The semantic is awesome. Precisely what I've been looking for. > > -Cherian Well from remarks that core devs of Nginx have posted here before, referring to it as "hack" (SIC). In fact it's not even documented in the official docs. I'm not sure if that's an overlook or has deeper meanings related to the quality of the said directive concept/code. --appa From contact at jpluscplusm.com Wed Apr 4 12:27:32 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 4 Apr 2012 13:27:32 +0100 Subject: Serve from cache but fire request to upstream server to increment page view counter In-Reply-To: References: <77590aa60cbf956e5fa84ac68220edca.squirrel@damiao.org> Message-ID: On 4 April 2012 13:17, Quintin Par wrote: > Thanks Appa. > > Why would you say this is not reliable? Is there data or experience to > suggest? The semantic is awesome. Precisely what I?ve been looking for. I'd also be interested in discovering any unreliability of this mechanism, as I'm planning to use it for some real-time logging shortly. The weaknesses that I've discovered thus far, which I think should all be fixed -- or at least modified as indicated below -- are * The client connection is held open until the post_action call completes * The response code returned to the client is the post_action's response code * The access.log entry logged reflects the post_action's URI, response code and (possibly; I forget) content length All of these render it difficult to use post_action as its name implies - to be competed *after* the client request is completely dealt with. I hope that at some point in the future, we'll be able to use post_action in a way which is invisible to the client, and to the logs. Perhaps with a post_action directive flag, indicating that any calls to this specific post_action URI should stay out of the logs and the client's view. J > On Wed, Apr 4, 2012 at 1:39 PM, Antonio P.P. Almeida > wrote: >> >> There's the post_action directive. But AFAIK is not that reliable. >> >> I would use Lua with the "new" cosocket API and do an HTTP request. >> >> Here's an example of a library built around it that talks with a Redis >> backend: https://github.com/agentzh/lua-resty-redis >> >> As stated post_action is another option: >> >> http://wiki.nginx.org/HttpCoreModule#post_action >> >> >> --appa >> >> _______________________________________________ >> 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 -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From francis at daoine.org Wed Apr 4 12:40:40 2012 From: francis at daoine.org (Francis Daly) Date: Wed, 4 Apr 2012 13:40:40 +0100 Subject: Config directive inheritance: docs and rules (was: Config variable inheritance) In-Reply-To: References: Message-ID: <20120404124040.GB26052@craic.sysops.org> On Tue, Apr 03, 2012 at 06:20:13PM +0100, Jonathan Matthews wrote: Hi there, > http://www.ruby-forum.com/topic/188742 seems to contain some > information I've not found explicitly stated anywhere else: that > config directive inheritance is an all or nothing mechanism. Have I > missed some docs somewhere? That refers to inheritance of a *single* directive. > Following on from this, I'd like to understand if there's anything I > can reliably determine from a directive's name about the impact that > defining it will have on *other* directives' inheritability. Yes: it will have no impact on other directives. > Can I, for instance, assume that defining an xyx_ prefixed directive in > a sub-scope will affect *only* the inheritance of other xyz_ prefixed > directives? No. It will affect no other xyz_ prefixed directives. It may make a difference to the *applicability* of other directives -- for example, if fastcgi_pass is not set, then it doesn't really matter whether fastcgi_param is inherited or not, because it's not going to be used. But fastcgi_pass does not affect whether fastcgi_param is inherited. > Or can there be inheritance side-effects between, say, > directive "abc" and "def" that I can't possibly determine without > documentation or trial and error? No, it will have no impact on other directives. > Equally, can I assume that *all* xyz_ prefixed directives will have > their inheritance affected by the sub-scope definition of any *other* > xyz_ prefixed directive? No: it will have no impact on other directives. > Or are there examples where defining > "xyz_foo" does *not* impact the inheritance of "xyz_bar"? Yes: every example. > I'm thinking specifically of proxy_* directives, whereas the thread I > link to above is talking about multiple fastcgi_param directives. Using a directive sets the value of that directive. It does not set the value of different directives. "Not using" a directive means the value of that directive is either unset/default, or is the same value as the upper level. > Here, I'm interested in how, say, proxy_set_header affects the > inheritance of higher scope's proxy_pass directive - i.e. where the > prefix matches but they're *not* the same directive. No impact at all. > Does nginx (core) > derive or imply anything relating to the name-spacing of directives > before (in my example) the proxy module sees the config, or is it > entirely down to how each module implements the configuration > aggregation/inheritance? It's entirely down to how each module implements it. But if a module implements inheritance of a directive as something other than "replace" or "no inheritance", then that should probably be considered a bug. f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Wed Apr 4 13:58:46 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 4 Apr 2012 17:58:46 +0400 Subject: Config directive inheritance: docs and rules (was: Config variable inheritance) In-Reply-To: <20120404124040.GB26052@craic.sysops.org> References: <20120404124040.GB26052@craic.sysops.org> Message-ID: <20120404135846.GX13466@mdounin.ru> Hello! On Wed, Apr 04, 2012 at 01:40:40PM +0100, Francis Daly wrote: > On Tue, Apr 03, 2012 at 06:20:13PM +0100, Jonathan Matthews wrote: > > Hi there, > > > http://www.ruby-forum.com/topic/188742 seems to contain some > > information I've not found explicitly stated anywhere else: that > > config directive inheritance is an all or nothing mechanism. Have I > > missed some docs somewhere? > > That refers to inheritance of a *single* directive. > > > Following on from this, I'd like to understand if there's anything I > > can reliably determine from a directive's name about the impact that > > defining it will have on *other* directives' inheritability. > > Yes: it will have no impact on other directives. > > > Can I, for instance, assume that defining an xyx_ prefixed directive in > > a sub-scope will affect *only* the inheritance of other xyz_ prefixed > > directives? > > No. It will affect no other xyz_ prefixed directives. Not really, there are cases where it will. Examples include (not sure if there are others): 1) allow and deny directives of access module create an array of allow/deny rules, and this array is inherited as a whole; 2) recently introduced xslt_param and xslt_string_param do the same thing with xslt parameters. All such cases are more or less obvious though. [...] Maxim Dounin From francis at daoine.org Wed Apr 4 16:54:44 2012 From: francis at daoine.org (Francis Daly) Date: Wed, 4 Apr 2012 17:54:44 +0100 Subject: Config directive inheritance: docs and rules (was: Config variable inheritance) In-Reply-To: <20120404135846.GX13466@mdounin.ru> References: <20120404124040.GB26052@craic.sysops.org> <20120404135846.GX13466@mdounin.ru> Message-ID: <20120404165444.GA12819@craic.sysops.org> On Wed, Apr 04, 2012 at 05:58:46PM +0400, Maxim Dounin wrote: > On Wed, Apr 04, 2012 at 01:40:40PM +0100, Francis Daly wrote: > > On Tue, Apr 03, 2012 at 06:20:13PM +0100, Jonathan Matthews wrote: Hi there, > > > Can I, for instance, assume that defining an xyx_ prefixed directive in > > > a sub-scope will affect *only* the inheritance of other xyz_ prefixed > > > directives? > > > > No. It will affect no other xyz_ prefixed directives. > > Not really, there are cases where it will. Examples include (not > sure if there are others): > > 1) allow and deny directives of access module create an array of > allow/deny rules, and this array is inherited as a whole; > > 2) recently introduced xslt_param and xslt_string_param do the > same thing with xslt parameters. Ah, thank you for the correction. For the original poster: I was wrong, you *do* need to check or test each time. So read "never" and "always" as "almost never" and "almost always". Sorry about that. I've done a quick analysis of the 1.1.18 codebase, to see if I can find the current complete list (excluding 3rd party modules, of course). The configuration directives are stored in a struct: struct ngx_command_s { ngx_str_t name; ngx_uint_t type; char *(*set)(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); ngx_uint_t conf; ngx_uint_t offset; void *post; }; "name" is the directive name; "*set" is the function to set the value of the directive, and "offset" is the position relative to "conf" where the value is stored. I see 67 arrays of that struct (grep for "static ngx_command_t"). I see 449 "ngx_string" within those arrays. 110 have unique *set values. Of the ones with non-unique *set values, the few that have the same "offset" value are: ngx_event_connections - worker_connections, connections; one deprecated ngx_mail_block - mail, imap; one deprecated ngx_conf_set_sec_slot - open_file_cache_valid, open_file_cache_retest; one deprecated ngx_http_core_root - root, alias: single-valued, only one at a level ngx_http_access_rule - allow, deny; both are valid ngx_http_xslt_param - xslt_param, xslt_string_param; both are valid. And separate from that, the directives which have a duplicate "offset" value of "offsetof(something)" (as in, not-0 or a predefined constant), are: open_file_cache_valid, open_file_cache_retest - one deprecated satisfy, satisfy_any - one deprecated optimize_server_names, server_name_in_redirect - one deprecated If that's an adequate analysis, it suggests that allow/deny and xslt_param/xslt_string_param are the only distributed directives which don't follow the replace-or-inherit-this-directive-only method. > All such cases are more or less obvious though. I wonder, is it worth having a note in the documentation for these exceptions to the common case? I see that there is such a note at http://nginx.org/en/docs/http/ngx_http_xslt_module.html#xslt_param, but not (yet) at http://nginx.org/en/docs/http/ngx_http_access_module.html#allow Thanks, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Wed Apr 4 17:21:27 2012 From: nginx-forum at nginx.us (fiyah2011) Date: Wed, 4 Apr 2012 13:21:27 -0400 (EDT) Subject: POST DATA in cache_key Message-ID: is it possible to use a value found within POST DATA as part of the cache key? for example, the value of variable called 'username' to be part of the cache key. so i basically want the cache to key to simply hash against the connecting IP and the 'username' POST variable. proxy_cache_key "$remote_addr$POST[username]" thanks in advance Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224945,224945#msg-224945 From yvldwt at gmail.com Wed Apr 4 17:27:35 2012 From: yvldwt at gmail.com (=?UTF-8?B?RMW+ZW4=?=) Date: Wed, 04 Apr 2012 19:27:35 +0200 Subject: try_files ignored in combination with error_page and named locations In-Reply-To: References: <4F7B5DEF.8030107@gmail.com> <20120404081610.GA44137@lo0.su> <20120404084801.GA11638@azarath.acceleris.ch> Message-ID: <4F7C8487.4030506@gmail.com> On 04/04/2012 11:03, Edho Arief wrote: [...] > location /maintenance-static/ { > > } > > location / { > try_files /$hostid-maintenance/ @backend; > } Right, this would work just fine. However, requests to /maintenance-static/ would still be possible even if /$hostid-maintenance/ doesn't exist (minor problem, but maybe the backend uses /maintenance-static/ for some reason). Unfortunately, I still haven't found a solution which pleases me. Just to clarify, this is how I want the request to be processed (el-cheapo pseudo code): if the directory /maintenance/ exists, then set root to /maintenance/ if the file $uri exists, then serve $uri with errcode 503 otherwise serve index.html with errcode 503 otherwise proxy_pass http://backend My new attempt: recursive_error_pages on; error_page 599 @maintenance; if ( -d $document_root/$hostid-maintenance ) { return 599; } location @maintenance { root /var/nginx/$hostid-maintenance; index index.html; try_files $uri $uri/ /index.html /; } I used error code 599 because I noticed that for some reason the backend might raise an 503 error although $document_root/$hostid-maintenance doesn't exist. The result in such a situation would be unexpected (an infinite redirect loop?). By using an unused error code like 599, nginx's default 503 error page will be displayed instead, if the backend raises 503. This configuration seems to work, but the 599 error code in the HTTP header isn't that nice. Unfortunately, something like error_page 599 =503 @maintenance; doesn't result in what I expected (it will again just return nginx's default 503 error page, although error 503 is correctly set in the HTTP header). I still think that I misunderstood something, am I right? Kind regards -- D?en From nginx-forum at nginx.us Wed Apr 4 17:41:45 2012 From: nginx-forum at nginx.us (fiyah2011) Date: Wed, 4 Apr 2012 13:41:45 -0400 (EDT) Subject: POST DATA in cache_key In-Reply-To: References: Message-ID: this looks like the solution i am looking for. https://github.com/calio/form-input-nginx-module/blob/master/README Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224945,224947#msg-224947 From mdounin at mdounin.ru Wed Apr 4 18:18:42 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 4 Apr 2012 22:18:42 +0400 Subject: Config directive inheritance: docs and rules (was: Config variable inheritance) In-Reply-To: <20120404165444.GA12819@craic.sysops.org> References: <20120404124040.GB26052@craic.sysops.org> <20120404135846.GX13466@mdounin.ru> <20120404165444.GA12819@craic.sysops.org> Message-ID: <20120404181842.GY13466@mdounin.ru> Hello! On Wed, Apr 04, 2012 at 05:54:44PM +0100, Francis Daly wrote: [...] > If that's an adequate analysis, it suggests that > > allow/deny and xslt_param/xslt_string_param > > are the only distributed directives which don't follow the > replace-or-inherit-this-directive-only method. Mechanical analisys of the codebase might miss some cases with custom directive handlers used. But I suppose the result is correct as it matches one from my memory. :) > > All such cases are more or less obvious though. > > I wonder, is it worth having a note in the documentation for these > exceptions to the common case? > > I see that there is such a note at > > http://nginx.org/en/docs/http/ngx_http_xslt_module.html#xslt_param, > > but not (yet) at > > http://nginx.org/en/docs/http/ngx_http_access_module.html#allow Yes, this surely deserves a note. Maxim Dounin From siefke_listen at web.de Wed Apr 4 20:19:45 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Wed, 4 Apr 2012 22:19:45 +0200 Subject: PHP with FPM on Gentoo In-Reply-To: <20120403001323.c03997dd.siefke_listen@web.de> References: <20120403001323.c03997dd.siefke_listen@web.de> Message-ID: <20120404221945.265d10b0.siefke_listen@web.de> Hello, now i have build php and nginx from source direct, emerge --unmerge, have downloaded the sourcecode and compile it and same it run not. Thats really crazy, what is this? Is this maybe with eselect profile list option? Because i use gentoo-desk imap # eselect profile list Available profile symlink targets: [1] default/linux/x86/10.0 [2] default/linux/x86/10.0/selinux [3] default/linux/x86/10.0/desktop * [4] default/linux/x86/10.0/desktop/gnome [5] default/linux/x86/10.0/desktop/kde [6] default/linux/x86/10.0/developer [7] default/linux/x86/10.0/server [8] hardened/linux/x86 [9] hardened/linux/x86/selinux Is this maybe the mistake or where can be the error? Regards Silvio From nginx-forum at nginx.us Wed Apr 4 20:40:04 2012 From: nginx-forum at nginx.us (shoshomiga) Date: Wed, 4 Apr 2012 16:40:04 -0400 (EDT) Subject: limit_rate dynamically using $arg - security Message-ID: <6421426a61f0bd2e0f8071c6705b87cd.NginxMailingListEnglish@forum.nginx.org> I've been looking for a way to limit videos to their bitrate to save bandwidth and I've come up with this code if ($arg_LIMITSPEED) { set $limit_rate $arg_LIMITSPEED; } It works but I would like to know if this code would be secure to use on a production server. I am not worried about users setting their LIMITSPEED high on their own because I am limiting speeds at the network level as well. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224950,224950#msg-224950 From contact at jpluscplusm.com Wed Apr 4 21:32:49 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 4 Apr 2012 22:32:49 +0100 Subject: limit_rate dynamically using $arg - security In-Reply-To: <6421426a61f0bd2e0f8071c6705b87cd.NginxMailingListEnglish@forum.nginx.org> References: <6421426a61f0bd2e0f8071c6705b87cd.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 4 April 2012 21:40, shoshomiga wrote: > I've been looking for a way to limit videos to their bitrate to save > bandwidth and I've come up with this code > > ? ? ? ? ? ?if ($arg_LIMITSPEED) { > ? ? ? ? ? ? ?set $limit_rate $arg_LIMITSPEED; > ? ? ? ? ? ?} > > It works but I would like to know if this code would be secure to use on > a production server. > > I am not worried about users setting their LIMITSPEED high on their own > because I am limiting speeds at the network level as well. To be honest, I'm not sure what definition of "insecure" you could be thinking of that *isn't* "the user can override it trivially" :-) If you're doing the rate limiting at the network level properly, then why duplicate the effort? It's just one more place you have to change when you upgrade the speed limits. Personally, I'm prototyping a streaming service at the moment using http://wiki.nginx.org/X-accel#X-Accel-Limit-Rate and a double proxy_pass (via X-Accel-Redirect to an internal storage proxy_pass). It all looks like it works nicely, and allows the dumb storage backend to throw data at the nginx router as fast as nginx accepts it, and for the first (intelligent) proxy_pass backend to *decide* the bitrate via X-Accel-Limit-Rate. I'll blog it soonish :-) Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From albert at nn.iij4u.or.jp Thu Apr 5 00:25:44 2012 From: albert at nn.iij4u.or.jp (shin fukuda) Date: Thu, 5 Apr 2012 09:25:44 +0900 Subject: no response nginx Message-ID: <20120405092544.f6c3c2cdd6d87bb9a320da8a@nn.iij4u.or.jp> Hi. I have a problem with nginx-1.1.16 uses proxy_cache_lock on. When high load or many request to nginx, Suddenly nginx seems hang, no response at all. In netstat "SYN_RECV","CLOSE_WAIT" too many. This problem needs restarting nginx, and "CLOSE_WAIT" clear. There is no problem in front-end nginx servers, but backends one. Any clue? -- shin fukuda From quintinpar at gmail.com Thu Apr 5 03:50:50 2012 From: quintinpar at gmail.com (Quintin Par) Date: Thu, 5 Apr 2012 09:20:50 +0530 Subject: Serve from cache but fire request to upstream server to increment page view counter In-Reply-To: References: <77590aa60cbf956e5fa84ac68220edca.squirrel@damiao.org> Message-ID: This seems to very risky. One more question: The whole reason why I?d use post action is to take the time off from doing a SSI. i.e. serve a page from cache in light speed and then let post action take its own sweet time to complete. But from Jonathan?s response I infer that a post actions response code is passed to the client. Which means the client is made to wait till the post action is complete. Right? If yes, that defeats the purpose. On Wed, Apr 4, 2012 at 5:57 PM, Jonathan Matthews wrote: > On 4 April 2012 13:17, Quintin Par wrote: > > Thanks Appa. > > > > Why would you say this is not reliable? Is there data or experience to > > suggest? The semantic is awesome. Precisely what I?ve been looking for. > > I'd also be interested in discovering any unreliability of this > mechanism, as I'm planning to use it for some real-time logging > shortly. > > The weaknesses that I've discovered thus far, which I think should all > be fixed -- or at least modified as indicated below -- are > > * The client connection is held open until the post_action call completes > * The response code returned to the client is the post_action's response > code > * The access.log entry logged reflects the post_action's URI, response > code and (possibly; I forget) content length > > All of these render it difficult to use post_action as its name > implies - to be competed *after* the client request is completely > dealt with. > > I hope that at some point in the future, we'll be able to use > post_action in a way which is invisible to the client, and to the > logs. Perhaps with a post_action directive flag, indicating that any > calls to this specific post_action URI should stay out of the logs and > the client's view. > > J > > > On Wed, Apr 4, 2012 at 1:39 PM, Antonio P.P. Almeida > > wrote: > >> > >> There's the post_action directive. But AFAIK is not that reliable. > >> > >> I would use Lua with the "new" cosocket API and do an HTTP request. > >> > >> Here's an example of a library built around it that talks with a Redis > >> backend: https://github.com/agentzh/lua-resty-redis > >> > >> As stated post_action is another option: > >> > >> http://wiki.nginx.org/HttpCoreModule#post_action > >> > >> > >> --appa > >> > >> _______________________________________________ > >> 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 > > > > -- > Jonathan Matthews > London, Oxford, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arissirajawali at gmail.com Thu Apr 5 04:18:19 2012 From: arissirajawali at gmail.com (aris) Date: Thu, 5 Apr 2012 11:18:19 +0700 Subject: nginx conf Message-ID: Hi all, how to configure nginx.conf, sites-available and sites-enabled I get 403 Forbidden nginx/0.7.67 please check out where my configuration errors *I nginx.conf following:* user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } # mail { # # See sample authentication script at: # # http://wiki.nginx.org/NginxImapAuthenticateWithApachePhpScript # # # auth_http localhost/auth.php; # # pop3_capabilities "TOP" "USER"; # # imap_capabilities "IMAP4rev1" "UIDPLUS"; # # server { # listen localhost:110; # protocol pop3; # proxy on; # } # # server { # listen localhost:143; # protocol imap; # proxy on; # } # } *The following sites-available I have :* # You may add here your # server { # ... # } # statements for each of your virtual hosts server { listen 80; ## listen for ipv4 server_name localhost; access_log /var/log/nginx/localhost.access.log; location / { root /var/www; index index.php; } location /doc { root /usr/share; autoindex on; allow 127.0.0.1; deny all; } location /images { root /usr/share; autoindex on; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; #location = /50x.html { # root /var/www/nginx-default; #} # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #listen 8000; #listen somename:8080; #server_name somename alias another.alias; #location / { #root html; #index index.html index.htm; #} #} # HTTPS server # #server { #listen 443; #server_name localhost; #ssl on; #ssl_certificate cert.pem; #ssl_certificate_key cert.key; #ssl_session_timeout 5m; #ssl_protocols SSLv3 TLSv1; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; #ssl_prefer_server_ciphers on; #location / { #root html; #index index.html index.htm; #} #} *The following sites-enabled I have :* # You may add here your # server { # ... # } # statements for each of your virtual hosts server { listen 80; ## listen for ipv4 server_name localhost; access_log /var/log/nginx/localhost.access.log; location / { root /var/www; index index.php; } location /doc { root /usr/share; autoindex on; allow 127.0.0.1; deny all; } location /images { root /usr/share; autoindex on; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; #location = /50x.html { # root /var/www/nginx-default; #} # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #listen 8000; #listen somename:8080; #server_name somename alias another.alias; #location / { #root html; #index index.html index.htm; #} #} # HTTPS server # #server { #listen 443; #server_name localhost; #ssl on; #ssl_certificate cert.pem; #ssl_certificate_key cert.key; #ssl_session_timeout 5m; #ssl_protocols SSLv3 TLSv1; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; #ssl_prefer_server_ciphers on; #location / { #root html; #index index.html index.htm; #} #} -------------- next part -------------- An HTML attachment was scrubbed... URL: From loco at d0pefish.de Thu Apr 5 07:56:07 2012 From: loco at d0pefish.de (Peter Hinse) Date: Thu, 05 Apr 2012 09:56:07 +0200 Subject: Testing the HttpLimitReqModule without blocking Message-ID: <4F7D5017.5080808@d0pefish.de> Hi all, I want to implement the HttpLimitReqModule within our setup to get rid of people scraping the content of our page. However, since some of our bigger clients are using the same proxy IP to connect to our page, I need to adjust the limit before really blocking users. Any chance to log the attempts without delivering a 503 page? If some of the proxy users would fit into the blocking scheme, is there a chance to define a whitelist? Regards, Peter. From nginx-forum at nginx.us Thu Apr 5 08:56:32 2012 From: nginx-forum at nginx.us (nenad) Date: Thu, 5 Apr 2012 04:56:32 -0400 (EDT) Subject: HttpSecureLinkModule timestamp inside uri Message-ID: I would like to use HttpSecureLinkModule to restrict access to some member photos. Now I would like to have the timestamp inside the path but I'm not sure how to implement that. The timestamp I could get with \/t(\d+)\/ from uri, must I do a rewrite and if yes how? Or exist a "single" operation way? Photo-URL: www.example.aaa/260/7/4/3/4255/4543535/t1331894408/1234_x.jpg?a=1234567888 location ~ _x\.(jpg|jpeg|gif|png)$ { secure_link $arg_a,$???; secure_link_md5 mysecretword$uri$???; root /media/photos ... } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224960,224960#msg-224960 From nginx-forum at nginx.us Thu Apr 5 11:26:06 2012 From: nginx-forum at nginx.us (shoshomiga) Date: Thu, 5 Apr 2012 07:26:06 -0400 (EDT) Subject: limit_rate dynamically using $arg - security In-Reply-To: References: Message-ID: <89fab4a3b8787ce2b1daf91159f681b5.NginxMailingListEnglish@forum.nginx.org> Jonathan Matthews Wrote: ------------------------------------------------------- > On 4 April 2012 21:40, shoshomiga > wrote: > > I've been looking for a way to limit videos to > their bitrate to save > > bandwidth and I've come up with this code > > > > ? ? ? ? ? ?if ($arg_LIMITSPEED) { > > ? ? ? ? ? ? ?set $limit_rate > $arg_LIMITSPEED; > > ? ? ? ? ? ?} > > > > It works but I would like to know if this code > would be secure to use on > > a production server. > > > > I am not worried about users setting their > LIMITSPEED high on their own > > because I am limiting speeds at the network > level as well. > > To be honest, I'm not sure what definition of > "insecure" you could be > thinking of that *isn't* "the user can override it > trivially" :-) > > If you're doing the rate limiting at the network > level properly, then > why duplicate the effort? It's just one more place > you have to change > when you upgrade the speed limits. > > Personally, I'm prototyping a streaming service at > the moment using > http://wiki.nginx.org/X-accel#X-Accel-Limit-Rate > and a double > proxy_pass (via X-Accel-Redirect to an internal > storage proxy_pass). > It all looks like it works nicely, and allows the > dumb storage backend > to throw data at the nginx router as fast as nginx > accepts it, and for > the first (intelligent) proxy_pass backend to > *decide* the bitrate via > X-Accel-Limit-Rate. I'll blog it soonish :-) > > Jonathan > -- > Jonathan Matthews > London, Oxford, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx By security I meant vulnerability to buffer overflows and other exploits since limit_rate is probably not meant to recieve that kind of unsanitized input. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224950,224967#msg-224967 From ne at vbart.ru Thu Apr 5 12:04:08 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 5 Apr 2012 16:04:08 +0400 Subject: HttpSecureLinkModule timestamp inside uri In-Reply-To: References: Message-ID: <201204051604.08712.ne@vbart.ru> On Thursday 05 April 2012 12:56:32 nenad wrote: > I would like to use HttpSecureLinkModule to restrict access to some > member photos. Now I would like to have the timestamp inside the path > but I'm not sure how to implement that. > > The timestamp I could get with \/t(\d+)\/ from uri, must I do a rewrite > and if yes how? Or exist a "single" operation way? > > Photo-URL: > www.example.aaa/260/7/4/3/4255/4543535/t1331894408/1234_x.jpg?a=1234567888 > > location ~ _x\.(jpg|jpeg|gif|png)$ { > > secure_link $arg_a,$???; > secure_link_md5 mysecretword$uri$???; > > root /media/photos > ... > } > location ~ t(?P\d+)/\d+_x\.(?:jpe?g|gif|png)$ { secure_link $arg_a,$t; secure_link_md5 mysecretword$uri$t; root /media/photos ... } wbr, Valentin V. Bartenev From loco at d0pefish.de Thu Apr 5 14:30:35 2012 From: loco at d0pefish.de (Peter Hinse) Date: Thu, 05 Apr 2012 16:30:35 +0200 Subject: Combine if clauses for denial Message-ID: <4F7DAC8B.3040304@d0pefish.de> Hi all, I know how to block requests with an empty user-agent or with an empty referrer - is it possible to combine these two criteria and deny access when a request has no referrer AND no user-agent? Regards, Peter From mdounin at mdounin.ru Thu Apr 5 14:44:04 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 5 Apr 2012 18:44:04 +0400 Subject: limit_rate dynamically using $arg - security In-Reply-To: <89fab4a3b8787ce2b1daf91159f681b5.NginxMailingListEnglish@forum.nginx.org> References: <89fab4a3b8787ce2b1daf91159f681b5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120405144404.GC13466@mdounin.ru> Hello! On Thu, Apr 05, 2012 at 07:26:06AM -0400, shoshomiga wrote: > Jonathan Matthews Wrote: > ------------------------------------------------------- > > On 4 April 2012 21:40, shoshomiga > > wrote: > > > I've been looking for a way to limit videos to > > their bitrate to save > > > bandwidth and I've come up with this code > > > > > > ? ? ? ? ? ?if ($arg_LIMITSPEED) { > > > ? ? ? ? ? ? ?set $limit_rate > > $arg_LIMITSPEED; > > > ? ? ? ? ? ?} > > > > > > It works but I would like to know if this code > > would be secure to use on > > > a production server. [...] > By security I meant vulnerability to buffer overflows and other exploits > since limit_rate is probably not meant to recieve that kind of > unsanitized input. It should be safe. Note though that it will log error if there are invalid values passed, which may in turn be used as a DoS vector. To be on safe side, I would recommend sanitizing the input, e.g. with map{}. Something like this should work: map $arg_speed $speed { default 64k; 64k 64k; 128k 128k; 256k 256k; } ... set $limit_rate $speed; Maxim Dounin From mdounin at mdounin.ru Thu Apr 5 14:56:11 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 5 Apr 2012 18:56:11 +0400 Subject: no response nginx In-Reply-To: <20120405092544.f6c3c2cdd6d87bb9a320da8a@nn.iij4u.or.jp> References: <20120405092544.f6c3c2cdd6d87bb9a320da8a@nn.iij4u.or.jp> Message-ID: <20120405145610.GD13466@mdounin.ru> Hello! On Thu, Apr 05, 2012 at 09:25:44AM +0900, shin fukuda wrote: > Hi. > > I have a problem with nginx-1.1.16 uses proxy_cache_lock on. > When high load or many request to nginx, Suddenly nginx seems hang, > no response at all. > In netstat "SYN_RECV","CLOSE_WAIT" too many. This problem needs > restarting nginx, and "CLOSE_WAIT" clear. > > There is no problem in front-end nginx servers, but backends one. > > Any clue? I would suggest you are hitting some system limits. Check nginx and system logs, as well as various system stats. Check the state of nginx worker processes, most importantly wait channel (wchan, "ps -alx" should show one at least on FreeBSD and Linux). Maxim Dounin From nginx-forum at nginx.us Thu Apr 5 15:06:32 2012 From: nginx-forum at nginx.us (shoshomiga) Date: Thu, 5 Apr 2012 11:06:32 -0400 (EDT) Subject: limit_rate dynamically using $arg - security In-Reply-To: <20120405144404.GC13466@mdounin.ru> References: <20120405144404.GC13466@mdounin.ru> Message-ID: Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Thu, Apr 05, 2012 at 07:26:06AM -0400, > shoshomiga wrote: > > > Jonathan Matthews Wrote: > > > -------------------------------------------------- > ----- > > > On 4 April 2012 21:40, shoshomiga > > > wrote: > > > > I've been looking for a way to limit videos > to > > > their bitrate to save > > > > bandwidth and I've come up with this code > > > > > > > > ? ? ? ? ? ?if ($arg_LIMITSPEED) { > > > > ? ? ? ? ? ? ?set $limit_rate > > > $arg_LIMITSPEED; > > > > ? ? ? ? ? ?} > > > > > > > > It works but I would like to know if this > code > > > would be secure to use on > > > > a production server. > > [...] > > > By security I meant vulnerability to buffer > overflows and other exploits > > since limit_rate is probably not meant to > recieve that kind of > > unsanitized input. > > It should be safe. Note though that it will log > error if there > are invalid values passed, which may in turn be > used as a DoS > vector. > > To be on safe side, I would recommend sanitizing > the input, e.g. > with map{}. Something like this should work: > > map $arg_speed $speed { > default 64k; > 64k 64k; > 128k 128k; > 256k 256k; > } > > ... > > set $limit_rate $speed; Is there a way to typecast to int instead? map{} won't give me enough flexibility and it would probably be slower than a typecast. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224950,224974#msg-224974 From ft at falkotimme.com Thu Apr 5 15:11:41 2012 From: ft at falkotimme.com (Falko Timme) Date: Thu, 5 Apr 2012 17:11:41 +0200 Subject: Combine if clauses for denial References: <4F7DAC8B.3040304@d0pefish.de> Message-ID: <6CE56A81A763433C8B10A87FEFC97F7E@notebook> This should give you the idea: http://rosslawley.co.uk/2010/01/nginx-how-to-multiple-if-statements.html ----- Original Message ----- From: "Peter Hinse" To: Sent: Thursday, April 05, 2012 4:30 PM Subject: Combine if clauses for denial > Hi all, > > I know how to block requests with an empty user-agent or with an empty > referrer - is it possible to combine these two criteria and deny access > when a request has no referrer AND no user-agent? > > Regards, > > Peter > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From admin at yqed.com Thu Apr 5 15:17:20 2012 From: admin at yqed.com (Floren Munteanu) Date: Thu, 05 Apr 2012 11:17:20 -0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <20120403163212.GU13466@mdounin.ru> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> <20120402111754.GD13466@mdounin.ru> <20120402170637.GJ13466@mdounin.ru> <20120403163212.GU13466@mdounin.ru> Message-ID: Hi Maxim, On 4/3/2012 12:32 PM, Maxim Dounin wrote: > I'm afraid we aren't going to fix 1.0.x anyway. The 1.1.x branch > will become stable in serveral weeks, and 1.0.x is expected to get > only security fixes. Thanks, I will install a debug version of 1.1.18 into live server. > For now, please capture debug log. Anything else (including gdb > dump of the request in question) isn't that important, but if you > are going to obtain one it might be good idea to recompile nginx > without -O3 as it might produce undesired side-effects in gdb > output. The -O used by default is good enough. I'm afraid I will have to keep the -O3 for sake of compile consistency with other RPM's. I will do a debug capture on latest devel version, the [crit] errors still occur with 1.1.18 version and OpenSSL 1.0.1. Regards, Floren From loco at d0pefish.de Thu Apr 5 15:21:30 2012 From: loco at d0pefish.de (Peter Hinse) Date: Thu, 05 Apr 2012 17:21:30 +0200 Subject: Combine if clauses for denial In-Reply-To: <6CE56A81A763433C8B10A87FEFC97F7E@notebook> References: <4F7DAC8B.3040304@d0pefish.de> <6CE56A81A763433C8B10A87FEFC97F7E@notebook> Message-ID: <4F7DB87A.6010604@d0pefish.de> Am 05.04.2012 17:11, schrieb Falko Timme: > http://rosslawley.co.uk/2010/01/nginx-how-to-multiple-if-statements.html Thanks, that will do it I guess. From amoiz.shine at gmail.com Thu Apr 5 15:26:37 2012 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Thu, 5 Apr 2012 23:26:37 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: from your profile in LinkedIn website,i found that you are a student of HuaiYin Normal University.right? 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. ? 2012?4?1? ??9:58?smallfish ??? > hah, perhaps just a joke. but?nothing is impossable. :) > -- > blog: http://chenxiaoyu.org > > > > ? 2012?4?1? ??9:33?Sharl.Jimh.Tsin ??? >> >> are you sure that NOT a joke of April Fools' Day, like taolinux >> (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? >> >> 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. >> >> >> >> 2012/3/31 Joshua Zhu : >> > Hi folks! >> > >> > We're pleased to announce that Tengine-1.2.4 has been released. You can >> > either download the tar ball >> > from?http://tengine.taobao.org/download/tengine-1.2.4.tar.gz ,?or >> > checkout >> > the code from https://github.com/taobao/tengine >> > >> > As this release, Tengine is based on Nginx-1.0.14. The highlight is a >> > brand >> > new 'user_agent' module which would be a good replacement for the >> > 'browser' >> > module in standard Nginx.?It's more efficient and flexible?than the >> > 'browser' module. Other changes include: >> > * Feature: added the 'log_escape' directive. >> > * Bugfix: fixed a bug in the limit_req module. >> > * Bugfix: fixed a bug in subrequest. >> > >> > Regards, >> > >> > -- >> > Joshua Zhu >> > Senior Software Engineer >> > Server Platforms Team at Taobao >> > >> > _______________________________________________ >> > 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 jdorfman at netdna.com Thu Apr 5 18:55:43 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Thu, 5 Apr 2012 11:55:43 -0700 Subject: nginx conf In-Reply-To: References: Message-ID: Hello, What are the permissions on /etc/nginx/sites-enabled/? You might need to give nginx rwx rights. Regards, Justin Dorfman NetDNA ? The Science of Acceleration? Email / gtalk: jdorfman at netdna.com P: 1.323.301.1400 x 272 Skype: netdna-justind Twitter: @jdorfman www.NetDNA.com | www.MaxCDN.com @NetDNA | @MaxCDN On Wed, Apr 4, 2012 at 9:18 PM, aris wrote: > Hi all, > how to configure nginx.conf, sites-available and sites-enabled > I get 403 Forbidden nginx/0.7.67 > please check out where my configuration errors > > *I nginx.conf following:* > > user www-data; > worker_processes 1; > > error_log /var/log/nginx/error.log; > pid /var/run/nginx.pid; > > events { > worker_connections 1024; > # multi_accept on; > } > > http { > include /etc/nginx/mime.types; > > access_log /var/log/nginx/access.log; > > sendfile on; > #tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 65; > tcp_nodelay on; > > gzip on; > gzip_disable "MSIE [1-6]\.(?!.*SV1)"; > > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; > } > > # mail { > # # See sample authentication script at: > # # http://wiki.nginx.org/NginxImapAuthenticateWithApachePhpScript > # > # # auth_http localhost/auth.php; > # # pop3_capabilities "TOP" "USER"; > # # imap_capabilities "IMAP4rev1" "UIDPLUS"; > # > # server { > # listen localhost:110; > # protocol pop3; > # proxy on; > # } > # > # server { > # listen localhost:143; > # protocol imap; > # proxy on; > # } > # } > > > *The following sites-available I have :* > # You may add here your > # server { > # ... > # } > # statements for each of your virtual hosts > > server { > > listen 80; ## listen for ipv4 > server_name localhost; > access_log /var/log/nginx/localhost.access.log; > > location / { > root /var/www; > index index.php; > } > > location /doc { > root /usr/share; > autoindex on; > allow 127.0.0.1; > deny all; > } > > location /images { > root /usr/share; > autoindex on; > } > > > > #error_page 404 /404.html; > > # redirect server error pages to the static page /50x.html > # > #error_page 500 502 503 504 /50x.html; > #location = /50x.html { > # root /var/www/nginx-default; > #} > > # proxy the PHP scripts to Apache listening on 127.0.0.1:80 > # > #location ~ \.php$ { > #proxy_pass http://127.0.0.1; > #} > > # pass the PHP scripts to FastCGI server listening on > 127.0.0.1:9000 > # > #location ~ \.php$ { > #fastcgi_pass 127.0.0.1:9000; > #fastcgi_index index.php; > #fastcgi_param SCRIPT_FILENAME > /scripts$fastcgi_script_name; > #includefastcgi_params; > #} > > # deny access to .htaccess files, if Apache's document root > # concurs with nginx's one > # > #location ~ /\.ht { > #deny all; > #} > } > > > # another virtual host using mix of IP-, name-, and port-based > configuration > # > #server { > #listen 8000; > #listen somename:8080; > #server_name somename alias another.alias; > > #location / { > #root html; > #index index.html index.htm; > #} > #} > > > # HTTPS server > # > #server { > #listen 443; > #server_name localhost; > > #ssl on; > #ssl_certificate cert.pem; > #ssl_certificate_key cert.key; > > #ssl_session_timeout 5m; > > #ssl_protocols SSLv3 TLSv1; > #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; > #ssl_prefer_server_ciphers on; > > #location / { > #root html; > #index index.html index.htm; > #} > #} > > *The following sites-enabled I have :* > # You may add here your > # server { > # ... > # } > # statements for each of your virtual hosts > > server { > > listen 80; ## listen for ipv4 > server_name localhost; > access_log /var/log/nginx/localhost.access.log; > > location / { > root /var/www; > index index.php; > } > > location /doc { > root /usr/share; > autoindex on; > allow 127.0.0.1; > deny all; > } > > location /images { > root /usr/share; > autoindex on; > } > > > > #error_page 404 /404.html; > > # redirect server error pages to the static page /50x.html > # > #error_page 500 502 503 504 /50x.html; > #location = /50x.html { > # root /var/www/nginx-default; > #} > > # proxy the PHP scripts to Apache listening on 127.0.0.1:80 > # > #location ~ \.php$ { > #proxy_pass http://127.0.0.1; > #} > > # pass the PHP scripts to FastCGI server listening on > 127.0.0.1:9000 > # > #location ~ \.php$ { > #fastcgi_pass 127.0.0.1:9000; > #fastcgi_index index.php; > #fastcgi_param SCRIPT_FILENAME > /scripts$fastcgi_script_name; > #includefastcgi_params; > #fastcgi_param SCRIPT_FILENAME > /scripts$fastcgi_script_name; > #includefastcgi_params; > #} > > # deny access to .htaccess files, if Apache's document root > # concurs with nginx's one > # > #location ~ /\.ht { > #deny all; > #} > } > > > # another virtual host using mix of IP-, name-, and port-based > configuration > # > #server { > #listen 8000; > #listen somename:8080; > #server_name somename alias another.alias; > > #location / { > #root html; > #index index.html index.htm; > #} > #} > > > # HTTPS server > # > #server { > #listen 443; > #server_name localhost; > > #ssl on; > #ssl_certificate cert.pem; > #ssl_certificate_key cert.key; > > #ssl_session_timeout 5m; > > #ssl_protocols SSLv3 TLSv1; > #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; > #ssl_prefer_server_ciphers on; > > #location / { > #root html; > #index index.html index.htm; > #} > #} > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashishs.dev at gmail.com Thu Apr 5 23:33:31 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Thu, 5 Apr 2012 16:33:31 -0700 Subject: multiget support in memcache/memc nginx modules Message-ID: Hi, It looks like neither the nginx memc module, nor the memcache standard module supports multi-get out of the box. Is there an implementation openly available, that supports the same? How about support for larger keys? (If implementation is based on text protocol, key-length seems limited to 250 chars vs 65K in binary protocol) Thanks, Ashish From albert at nn.iij4u.or.jp Fri Apr 6 01:47:03 2012 From: albert at nn.iij4u.or.jp (shin fukuda) Date: Fri, 6 Apr 2012 10:47:03 +0900 Subject: no response nginx In-Reply-To: <20120405145610.GD13466@mdounin.ru> References: <20120405092544.f6c3c2cdd6d87bb9a320da8a@nn.iij4u.or.jp> <20120405145610.GD13466@mdounin.ru> Message-ID: <20120406104703.8d8a5d9d04229d835c791b0b@nn.iij4u.or.jp> Hello, Maxim. On Thu, 5 Apr 2012 18:56:11 +0400 Maxim Dounin wrote: > Hello! > > On Thu, Apr 05, 2012 at 09:25:44AM +0900, shin fukuda wrote: > > > Hi. > > > > I have a problem with nginx-1.1.16 uses proxy_cache_lock on. > > When high load or many request to nginx, Suddenly nginx seems hang, > > no response at all. > > In netstat "SYN_RECV","CLOSE_WAIT" too many. This problem needs > > restarting nginx, and "CLOSE_WAIT" clear. > > > > There is no problem in front-end nginx servers, but backends one. > > > > Any clue? > > I would suggest you are hitting some system limits. Check nginx > and system logs, as well as various system stats. Check the state > of nginx worker processes, most importantly wait channel (wchan, > "ps -alx" should show one at least on FreeBSD and Linux). Set kernel parameter like ... net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_max_syn_backlog = 8192 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_fin_timeout = 15 net.ipv4.tcp_keepalive_time = 300 But, no good result so far. Anyway, I check workers details, and find this, 15832 write(4, "2012/04/04 19:56:10 [info] 15832#0: sigtimedwait() failed (4: Interrupted system"..., 87) = 87 15832 rt_sigtimedwait([ALRM IO RT_12 RT_13], 0x691220) = -1 EAGAIN (Resource temporarily unavailable) 15832 rt_sigtimedwait([ALRM IO RT_12 RT_13], 0x691220) = -1 EAGAIN (Resource temporarily unavailable) .... .... Is this normal status ? > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- shin fukuda From lists at ruby-forum.com Fri Apr 6 01:48:30 2012 From: lists at ruby-forum.com (MOHAMMED A.) Date: Fri, 06 Apr 2012 03:48:30 +0200 Subject: I need the best nginx configuration please Message-ID: <4f38466f869baed03ed613553a19acf0@ruby-forum.com> Hello, Please, I need the best nginx configuration for my servers My servers for images hosting In any server, From 2 to 5 million images The problem is that images do not appear quickly, a long time, Slow Please help me in this, I need the best nginx configuration Thanks. The configuration now user nobody; # no need for more workers in the proxy mode worker_processes 2; error_log /var/log/nginx/error.log info; worker_rlimit_nofile 20480; events { worker_connections 5120; # increase for busier servers use epoll; # you should use epoll here for Linux kernels 2.6.x } http { upload_progress_header id; upload_progress uploads 5m; server_name_in_redirect off; server_names_hash_max_size 10240; server_names_hash_bucket_size 1024; include mime.types; default_type application/octet-stream; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 5; gzip on; gzip_vary on; gzip_disable "MSIE [1-6]\."; gzip_proxied any; gzip_http_version 1.1; gzip_min_length 1000; gzip_comp_level 6; gzip_buffers 16 8k; # You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml; ignore_invalid_headers on; client_header_timeout 360m; client_body_timeout 360m; send_timeout 360m; reset_timedout_connection on; connection_pool_size 256; client_header_buffer_size 256k; large_client_header_buffers 4 256k; client_max_body_size 2048M; client_body_buffer_size 1024k; request_pool_size 32k; output_buffers 4 32k; postpone_output 1460; proxy_temp_path /home/matarNginx/nginx_proxy/; client_body_in_file_only on; log_format bytes_log "$msec $bytes_sent ."; include "/etc/nginx/vhosts/*"; } -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri Apr 6 09:15:23 2012 From: nginx-forum at nginx.us (haonhien) Date: Fri, 6 Apr 2012 05:15:23 -0400 (EDT) Subject: Problem add http_400 for module upstream Message-ID: Hello every body! I want to add http_400 in directive proxy_next_upstream of module upstream: 1. Add code below in file src/http/ngx_http_upstream.h: #define NGX_HTTP_UPSTREAM_FT_HTTP_502 0x00000020 #define NGX_HTTP_UPSTREAM_FT_HTTP_503 0x00000040 #define NGX_HTTP_UPSTREAM_FT_HTTP_504 0x00000080 #define NGX_HTTP_UPSTREAM_FT_HTTP_404 0x00000100 #define NGX_HTTP_UPSTREAM_FT_HTTP_400 0x00000120 //---> not right 2.Add code below in file ngx_http_upstream.c: { 500, NGX_HTTP_UPSTREAM_FT_HTTP_500 }, { 502, NGX_HTTP_UPSTREAM_FT_HTTP_502 }, { 503, NGX_HTTP_UPSTREAM_FT_HTTP_503 }, { 504, NGX_HTTP_UPSTREAM_FT_HTTP_504 }, { 404, NGX_HTTP_UPSTREAM_FT_HTTP_404 }, { 400, NGX_HTTP_UPSTREAM_FT_HTTP_400 }, //add code here 3.Add code below in file src/http/modules/ngx_http_proxy_module.c: { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 }, { ngx_string("http_502"), NGX_HTTP_UPSTREAM_FT_HTTP_502 }, { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, { ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 }, { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, { ngx_string("http_400"), NGX_HTTP_UPSTREAM_FT_HTTP_400 }, // add code here Plz help me Thank you so much. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225010,225010#msg-225010 From c.kworr at gmail.com Fri Apr 6 08:06:54 2012 From: c.kworr at gmail.com (Volodymyr Kostyrko) Date: Fri, 06 Apr 2012 11:06:54 +0300 Subject: I need the best nginx configuration please In-Reply-To: <4f38466f869baed03ed613553a19acf0@ruby-forum.com> References: <4f38466f869baed03ed613553a19acf0@ruby-forum.com> Message-ID: <4F7EA41E.3090504@gmail.com> MOHAMMED A. wrote: > Hello, > > Please, I need the best nginx configuration for my servers > My servers for images hosting > In any server, From 2 to 5 million images > The problem is that images do not appear quickly, a long time, Slow > Please help me in this, I need the best nginx configuration > > Thanks. > > The configuration now > > user nobody; > # no need for more workers in the proxy mode > worker_processes 2; > error_log /var/log/nginx/error.log info; > worker_rlimit_nofile 20480; > events { > worker_connections 5120; # increase for busier servers > use epoll; # you should use epoll here for Linux kernels 2.6.x > } > http { > upload_progress_header id; > upload_progress uploads 5m; > server_name_in_redirect off; > server_names_hash_max_size 10240; > server_names_hash_bucket_size 1024; > include mime.types; > default_type application/octet-stream; > server_tokens off; > sendfile on; > tcp_nopush on; > tcp_nodelay on; > keepalive_timeout 5; > gzip on; > gzip_vary on; > gzip_disable "MSIE [1-6]\."; > gzip_proxied any; > gzip_http_version 1.1; > gzip_min_length 1000; > gzip_comp_level 6; > gzip_buffers 16 8k; > # You can remove image/png image/x-icon image/gif image/jpeg if you have > slow CPU > gzip_types text/plain text/xml text/css application/x-javascript > application/xml image/png image/x-icon image/gif image/jpeg > application/xml+rss text/javascript application/atom+xml; > ignore_invalid_headers on; > client_header_timeout 360m; > client_body_timeout 360m; > send_timeout 360m; > reset_timedout_connection on; > connection_pool_size 256; > client_header_buffer_size 256k; > large_client_header_buffers 4 256k; > client_max_body_size 2048M; > client_body_buffer_size 1024k; > request_pool_size 32k; > output_buffers 4 32k; > postpone_output 1460; > proxy_temp_path /home/matarNginx/nginx_proxy/; > client_body_in_file_only on; > log_format bytes_log "$msec $bytes_sent ."; Everything looks good. Some options point to default values and can be omitted. > include "/etc/nginx/vhosts/*"; > } This line includes all files under listed directory. Whole your config is only about nginx configuration and lack particular site configuration. Maybe posting those would give anyone better clue on whats going on with your system. -- Sphinx of black quartz judge my vow. From pobreiluso at gmail.com Fri Apr 6 10:48:18 2012 From: pobreiluso at gmail.com (=?ISO-8859-1?Q?Antonio_Jerez_Guill=E9n?=) Date: Fri, 6 Apr 2012 12:48:18 +0200 Subject: I need the best nginx configuration please In-Reply-To: <4F7EA41E.3090504@gmail.com> References: <4f38466f869baed03ed613553a19acf0@ruby-forum.com> <4F7EA41E.3090504@gmail.com> Message-ID: Hi there! I guess, that your problem could be O.S. related and not Nginx related. I meant, probably, you are using more files per directory than your O.S. could support, in many cases, this limit is about 32.000 files per directory, but it may depends of your filesystem. take a look to the link below: http://stackoverflow.com/questions/466521/how-many-files-in-a-directory-is-too-many In order to solve this issue, you must add a two or three directory levels structure. For example: I guess your current directory structure is something like: /img/abcdefghijklmn?opqrstuvwxyz.jpg And you must try something like: /img/*ab/cd/ef/*abcdefghijklmn?opqrstuvwxyz.jpg Or also works for somebody, to add a modulus function to the directories, for example: /img/*01/02/*abcdefghijklmn?opqrstuvwxyz.jpg Hope it helps. El 6 de abril de 2012 10:06, Volodymyr Kostyrko escribi?: > > > MOHAMMED A. wrote: > >> Hello, >> >> Please, I need the best nginx configuration for my servers >> My servers for images hosting >> In any server, From 2 to 5 million images >> The problem is that images do not appear quickly, a long time, Slow >> Please help me in this, I need the best nginx configuration >> >> Thanks. >> >> The configuration now >> >> user nobody; >> # no need for more workers in the proxy mode >> worker_processes 2; >> error_log /var/log/nginx/error.log info; >> worker_rlimit_nofile 20480; >> events { >> worker_connections 5120; # increase for busier servers >> use epoll; # you should use epoll here for Linux kernels 2.6.x >> } >> http { >> upload_progress_header id; >> upload_progress uploads 5m; >> server_name_in_redirect off; >> server_names_hash_max_size 10240; >> server_names_hash_bucket_size 1024; >> include mime.types; >> default_type application/octet-stream; >> server_tokens off; >> sendfile on; >> tcp_nopush on; >> tcp_nodelay on; >> keepalive_timeout 5; >> gzip on; >> gzip_vary on; >> gzip_disable "MSIE [1-6]\."; >> gzip_proxied any; >> gzip_http_version 1.1; >> gzip_min_length 1000; >> gzip_comp_level 6; >> gzip_buffers 16 8k; >> # You can remove image/png image/x-icon image/gif image/jpeg if you have >> slow CPU >> gzip_types text/plain text/xml text/css application/x-javascript >> application/xml image/png image/x-icon image/gif image/jpeg >> application/xml+rss text/javascript application/atom+xml; >> ignore_invalid_headers on; >> client_header_timeout 360m; >> client_body_timeout 360m; >> send_timeout 360m; >> reset_timedout_connection on; >> connection_pool_size 256; >> client_header_buffer_size 256k; >> large_client_header_buffers 4 256k; >> client_max_body_size 2048M; >> client_body_buffer_size 1024k; >> request_pool_size 32k; >> output_buffers 4 32k; >> postpone_output 1460; >> proxy_temp_path /home/matarNginx/nginx_proxy/; >> client_body_in_file_only on; >> log_format bytes_log "$msec $bytes_sent ."; >> > > Everything looks good. Some options point to default values and can be > omitted. > > include "/etc/nginx/vhosts/*"; >> } >> > > This line includes all files under listed directory. Whole your config is > only about nginx configuration and lack particular site configuration. > Maybe posting those would give anyone better clue on whats going on with > your system. > > -- > Sphinx of black quartz judge my vow. > > > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Apr 6 12:32:16 2012 From: nginx-forum at nginx.us (shrinath.m) Date: Fri, 6 Apr 2012 08:32:16 -0400 (EDT) Subject: proxy_buffering on - doesn't return files with large data? Message-ID: <8e10eb48ce3782d66f10e4ae8386362e.NginxMailingListEnglish@forum.nginx.org> Hi, We have setup like so : 1. Nginx is configured as server which recieves user request 2. The user request is proxy_passed to another server which is also Nginx. Now when user requests for a file(401481 bytes) over AJAX, it is not being served. This problem doesn't happen for every file, just for random files. The same file doesn't load every time. I tried disabling proxy_buffering off, it worked. BTW, it is not the file size problem. It is working for larger file than the one that is not loading. I would love to know why. Thanks, Shrinath Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225015,225015#msg-225015 From bruno.premont at restena.lu Fri Apr 6 13:24:52 2012 From: bruno.premont at restena.lu (Bruno =?UTF-8?B?UHLDqW1vbnQ=?=) Date: Fri, 6 Apr 2012 15:24:52 +0200 Subject: limit_req_zone and limit_req: rate too strict Message-ID: <20120406152452.5729f6e0@pluto.restena.lu> Hi, I have started using limit_req_zone + limit_req but am seeing more delayed log entries than I would expect. I have the following: limit_req_zone $binary_remote_addr zone=one:10m rate=3r/s; ... server { ... location ~ .*\.php$ { limit_req zone=one burst=10; ... } In the logs I see that when 2 requests happen near simultaneously from the same IP address (e.g. page redirect to second PHP page or single PHP-generated image referenced by page) the second and third request get delayed if they arrive too early during the same second. I would wish to limit the user to 3 requests within a 1s window though not setting any constraint as to spacing between those requests, how can I accomplish it or what changes to limit_req module would be needed to not have a minimum 0.33s spacing between requests for above configuration? Thanks, Bruno From nginx-forum at nginx.us Fri Apr 6 13:25:53 2012 From: nginx-forum at nginx.us (nenad) Date: Fri, 6 Apr 2012 09:25:53 -0400 (EDT) Subject: HttpSecureLinkModule timestamp inside uri In-Reply-To: References: Message-ID: <5086ab5410a967ea6017e179cd4884b6.NginxMailingListEnglish@forum.nginx.org> thank you, that worked! can you also say me how i can point to correct root without /t{time}, now it try to open the file in a folder with timestamp in. www.example.aaa/260/7/4/3/4255/4543535/t1331894408/1234_x.jpg?a=1234567888 means it try to open it in: /media/photos/260/7/4/3/4255/4543535/t1331894408/1234_x.jpg instead /srv/media/260/7/4/3/4255/4543535/1234_x.jpg Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224960,225018#msg-225018 From nginx-forum at nginx.us Fri Apr 6 13:41:59 2012 From: nginx-forum at nginx.us (zuckbin) Date: Fri, 6 Apr 2012 09:41:59 -0400 (EDT) Subject: serve static content on static domain Message-ID: Hi, How to serve static content on static domain cookieless. I use ngix to serve static content then apache to dynamic content. Want to serve on static.mydomain.com all static content: jpeg, css, js, ... Here my actual conf: server { listen 80; client_max_body_size 50M; server_name www.mydoamin.com; access_log /var/log/nginx/localhost.access_log main; error_log /var/log/nginx/localhost.error_log info; location / { proxy_pass http://IP:8080/; proxy_redirect default; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ { root /home/www/domain.com; expires 30d; add_header Pragma public; add_header Cache-Control "public"; } } Want all my static content will be delivered only with: static.domain.com (no duplicate content) Thanks for your help Bye Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225020,225020#msg-225020 From edho at myconan.net Fri Apr 6 13:46:26 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 6 Apr 2012 20:46:26 +0700 Subject: serve static content on static domain In-Reply-To: References: Message-ID: 2012/4/6 zuckbin : > Hi, > > How to serve static content on static domain cookieless. > > I use ngix to serve static content then apache to dynamic content. > > Want to serve on static.mydomain.com all static content: jpeg, css, js, > ... > Then you should tell your app to link static contents at static.mydomain.com instead of mydomain.com and then add its server block. From ne at vbart.ru Fri Apr 6 16:03:19 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Fri, 6 Apr 2012 20:03:19 +0400 Subject: HttpSecureLinkModule timestamp inside uri In-Reply-To: <5086ab5410a967ea6017e179cd4884b6.NginxMailingListEnglish@forum.nginx.org> References: <5086ab5410a967ea6017e179cd4884b6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201204062003.19924.ne@vbart.ru> On Friday 06 April 2012 17:25:53 nenad wrote: > thank you, that worked! > > can you also say me how i can point to correct root without /t{time}, > now it try to open the file in a folder with timestamp in. > > www.example.aaa/260/7/4/3/4255/4543535/t1331894408/1234_x.jpg?a=1234567888 > > means it try to open it in: > /media/photos/260/7/4/3/4255/4543535/t1331894408/1234_x.jpg instead > /srv/media/260/7/4/3/4255/4543535/1234_x.jpg > http://nginx.org/r/alias location ~ ^(.+)/t(?P\d+)(/\d+_x\.(?:jpe?g|gif|png))$ { secure_link $arg_a,$t; secure_link_md5 mysecretword$uri$t; alias /srv/media$1$3; ... } wbr, Valentin V. Bartenev From ne at vbart.ru Fri Apr 6 16:06:36 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Fri, 6 Apr 2012 20:06:36 +0400 Subject: limit_req_zone and limit_req: rate too strict In-Reply-To: <20120406152452.5729f6e0@pluto.restena.lu> References: <20120406152452.5729f6e0@pluto.restena.lu> Message-ID: <201204062006.36424.ne@vbart.ru> On Friday 06 April 2012 17:24:52 Bruno Pr?mont wrote: > Hi, > > I have started using limit_req_zone + limit_req but am seeing more delayed > log entries than I would expect. > > I have the following: > > limit_req_zone $binary_remote_addr zone=one:10m rate=3r/s; > ... > server { > ... > location ~ .*\.php$ { > limit_req zone=one burst=10; > ... > } > > > In the logs I see that when 2 requests happen near simultaneously from the > same IP address (e.g. page redirect to second PHP page or single > PHP-generated image referenced by page) the second and third request get > delayed if they arrive too early during the same second. > > > I would wish to limit the user to 3 requests within a 1s window though > not setting any constraint as to spacing between those requests, how can I > accomplish it or what changes to limit_req module would be needed to > not have a minimum 0.33s spacing between requests for above configuration? > http://nginx.org/r/limit_req limit_req zone=one burst=10 nodelay; wbr, Valentin V. Bartenev From mdounin at mdounin.ru Fri Apr 6 16:35:25 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 6 Apr 2012 20:35:25 +0400 Subject: proxy_buffering on - doesn't return files with large data? In-Reply-To: <8e10eb48ce3782d66f10e4ae8386362e.NginxMailingListEnglish@forum.nginx.org> References: <8e10eb48ce3782d66f10e4ae8386362e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120406163525.GK13466@mdounin.ru> Hello! On Fri, Apr 06, 2012 at 08:32:16AM -0400, shrinath.m wrote: > Hi, > > We have setup like so : > > 1. Nginx is configured as server which recieves user request > 2. The user request is proxy_passed to another server which is also > Nginx. > > Now when user requests for a file(401481 bytes) over AJAX, it is not > being served. This problem doesn't happen for every file, just for > random files. The same file doesn't load every time. > > I tried disabling proxy_buffering off, it worked. > BTW, it is not the file size problem. It is working for larger file than > the one that is not loading. I would love to know why. First of all try looking into error logs. If it doesn't help, please provide debug log, see here for details: http://wiki.nginx.org/Debugging Maxim Dounin From bruno.premont at restena.lu Fri Apr 6 19:38:59 2012 From: bruno.premont at restena.lu (Bruno =?UTF-8?B?UHLDqW1vbnQ=?=) Date: Fri, 6 Apr 2012 21:38:59 +0200 Subject: limit_req_zone and limit_req: rate too strict In-Reply-To: <201204062006.36424.ne@vbart.ru> References: <20120406152452.5729f6e0@pluto.restena.lu> <201204062006.36424.ne@vbart.ru> Message-ID: <20120406213859.61e809bd@neptune> On Fri, 06 April 2012 "Valentin V. Bartenev" wrote: > On Friday 06 April 2012 17:24:52 Bruno Pr?mont wrote: > > Hi, > > > > I have started using limit_req_zone + limit_req but am seeing more delayed > > log entries than I would expect. > > > > I have the following: > > > > limit_req_zone $binary_remote_addr zone=one:10m rate=3r/s; > > ... > > server { > > ... > > location ~ .*\.php$ { > > limit_req zone=one burst=10; > > ... > > } > > > > > > In the logs I see that when 2 requests happen near simultaneously from the > > same IP address (e.g. page redirect to second PHP page or single > > PHP-generated image referenced by page) the second and third request get > > delayed if they arrive too early during the same second. > > > > > > I would wish to limit the user to 3 requests within a 1s window though > > not setting any constraint as to spacing between those requests, how can I > > accomplish it or what changes to limit_req module would be needed to > > not have a minimum 0.33s spacing between requests for above configuration? > > > > http://nginx.org/r/limit_req > > limit_req zone=one burst=10 nodelay; In that case legitimate (from my point of view) requests get rejected which is even worse! I wish those that fall under rate to not be delayed to get nice distribution (in my case 1s sample-rate!), but to have those between rate and burst being delayed to the following seconds. As an example of what I expect (rate=3r/s, burst=5): Time Request Id 0.0s 1 initial request 0.1s 2 second request, should not get delayed 0.1s 3 third request, should not get delayed 3.5s 4 new initial request 3.6s 5 new second request, should not get delayed 3.7s 6 new third request, should not get delayed 3.8s 7 new fourth request, should get delayed until t=4.6s 3.9s 8 new fifth request, should get delayed until t=4.7s 4.0s 9 new sixth request, should get delayed until t=4.8s 4.1s 10 new seventh request, should get delayed until t=5.6s 4.2s 11 new eighth request, should get delayed until t=5.7s 4.3s 12 new ninth request, should get rejected with 503 (exceeds burst) 4.4s 13 new tenth request, should get rejected with 503 (exceeds burst) but I do get like: 0.0s 1 initial request 0.1s 2 second request, delayed until 0.33s 0.1s 3 third request, delayed until 0.66s Bruno From lists at ruby-forum.com Fri Apr 6 20:27:17 2012 From: lists at ruby-forum.com (Ashish S Dev) Date: Fri, 06 Apr 2012 22:27:17 +0200 Subject: Memcache module implementation with multi-get support? Message-ID: Hi, Is there a memcache module implementation with multi-get support? Thanks, Ashish -- Posted via http://www.ruby-forum.com/. From ne at vbart.ru Fri Apr 6 20:56:05 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Sat, 7 Apr 2012 00:56:05 +0400 Subject: limit_req_zone and limit_req: rate too strict In-Reply-To: <20120406213859.61e809bd@neptune> References: <20120406152452.5729f6e0@pluto.restena.lu> <201204062006.36424.ne@vbart.ru> <20120406213859.61e809bd@neptune> Message-ID: <201204070056.05706.ne@vbart.ru> On Friday 06 April 2012 23:38:59 Bruno Pr?mont wrote: > > > > http://nginx.org/r/limit_req > > > > limit_req zone=one burst=10 nodelay; > > In that case legitimate (from my point of view) requests get rejected > which is even worse! No, with "nodelay" parameter they won't be rejected or delayed until the overflow of burst. > I wish those that fall under rate to not be delayed to get nice > distribution (in my case 1s sample-rate!), but to have those between rate > and burst being delayed to the following seconds. [...] There's no discrete "sample-rate". The limit_req module implements classical "leaky bucket" algorithm, which is simple, cheap and very common in the telecom world. http://en.wikipedia.org/wiki/Leaky_bucket wbr, Valentin V. Bartenev From brian at akins.org Fri Apr 6 21:40:14 2012 From: brian at akins.org (Brian Akins) Date: Fri, 6 Apr 2012 17:40:14 -0400 Subject: Memcache module implementation with multi-get support? In-Reply-To: References: Message-ID: <26880F2B-B366-40C5-ABDE-A1B8B525CAE8@akins.org> On Apr 6, 2012, at 4:27 PM, Ashish S Dev wrote: > > Is there a memcache module implementation with multi-get support? Probably be pretty simple to add it to https://github.com/agentzh/lua-resty-memcached From matthieu.tourne at gmail.com Fri Apr 6 22:00:33 2012 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Fri, 6 Apr 2012 15:00:33 -0700 Subject: Memcache module implementation with multi-get support? In-Reply-To: <26880F2B-B366-40C5-ABDE-A1B8B525CAE8@akins.org> References: <26880F2B-B366-40C5-ABDE-A1B8B525CAE8@akins.org> Message-ID: On Fri, Apr 6, 2012 at 2:40 PM, Brian Akins wrote: > > On Apr 6, 2012, at 4:27 PM, Ashish S Dev wrote: > > > > Is there a memcache module implementation with multi-get support? > > Probably be pretty simple to add it to > https://github.com/agentzh/lua-resty-memcached > > I think it already supports it if you pass an array of keys to the memc:get() function Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Sat Apr 7 00:42:07 2012 From: agentzh at gmail.com (agentzh) Date: Sat, 7 Apr 2012 08:42:07 +0800 Subject: Memcache module implementation with multi-get support? In-Reply-To: References: <26880F2B-B366-40C5-ABDE-A1B8B525CAE8@akins.org> Message-ID: On Sat, Apr 7, 2012 at 6:00 AM, Matthieu Tourne wrote: > On Fri, Apr 6, 2012 at 2:40 PM, Brian Akins wrote: >> On Apr 6, 2012, at 4:27 PM, Ashish S Dev wrote: >> > >> > Is there a memcache module implementation with multi-get support? >> >> Probably be pretty simple to add it to >> https://github.com/agentzh/lua-resty-memcached >> > > I think it already supports it if you pass an array of keys to the > memc:get() function > Yes, it does. Below is a test case for this feature: https://github.com/agentzh/lua-resty-memcached/blob/master/t/sanity.t#L1413 The lua-resty-memcached library is not an nginx module itself, but rather a (nonblocking) Lua library that is intended to be used with the ngx_lua module :) Best regards, -agentzh From nginx-forum at nginx.us Mon Apr 9 08:26:01 2012 From: nginx-forum at nginx.us (niraj) Date: Mon, 9 Apr 2012 04:26:01 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: References: <20120327085508.GA12789@nginx.com> <93f51c1c0f37415b621ae6a794042639.NginxMailingListEnglish@forum.nginx.org> Message-ID: <7e72081cefac23b42757af8f94d6912d.NginxMailingListEnglish@forum.nginx.org> Hi As mentioned above the different condition for Nginx, If anybody know in details then please guide me. It will help me to understand the Nginx rewrite rule in details. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,225057#msg-225057 From lists at ruby-forum.com Mon Apr 9 11:42:41 2012 From: lists at ruby-forum.com (Tariq wali) Date: Mon, 09 Apr 2012 13:42:41 +0200 Subject: nginx upstream prematurely closed connection In-Reply-To: References: Message-ID: Maxim, I see the same error on few of our lamp servers and nginx serving static content . I have looked for clues in apache error logs and syslog messages but can't establish a connection .. 2012/03/21 00:00:01 [error] 569#0: *10867863 upstream prematurely closed connection while reading response header from upstream, client: 121.243.22.130, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "servername.net" 2012/03/22 00:00:01 [error] 568#0: *10869967 upstream prematurely closed connection while reading response header from upstream, client: 121.243.22.130, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "servername.net" 2012/03/23 00:00:01 [error] 569#0: *10872221 upstream prematurely closed connection while reading response header from upstream, client: 121.243.22.130, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "servername.net" I would appreciate a direction I can take this issue in ..' T -- Posted via http://www.ruby-forum.com/. From nbubingo at gmail.com Mon Apr 9 13:28:26 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Mon, 9 Apr 2012 21:28:26 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: Hello, Can you just focus on the technical problem? If you have any detail question to ask, we are pleased to serve you. Thanks. 2012/4/5 Sharl.Jimh.Tsin : > from your profile in LinkedIn website,i found that you are a student > of HuaiYin Normal University.right? > > 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. > > > > ? 2012?4?1? ??9:58?smallfish ??? >> hah, perhaps just a joke. but nothing is impossable. :) >> -- >> blog: http://chenxiaoyu.org >> >> >> >> ? 2012?4?1? ??9:33?Sharl.Jimh.Tsin ??? >>> >>> are you sure that NOT a joke of April Fools' Day, like taolinux >>> (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? >>> >>> 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. >>> >>> >>> >>> 2012/3/31 Joshua Zhu : >>> > Hi folks! >>> > >>> > We're pleased to announce that Tengine-1.2.4 has been released. You can >>> > either download the tar ball >>> > from http://tengine.taobao.org/download/tengine-1.2.4.tar.gz , or >>> > checkout >>> > the code from https://github.com/taobao/tengine >>> > >>> > As this release, Tengine is based on Nginx-1.0.14. The highlight is a >>> > brand >>> > new 'user_agent' module which would be a good replacement for the >>> > 'browser' >>> > module in standard Nginx. It's more efficient and flexible than the >>> > 'browser' module. Other changes include: >>> > * Feature: added the 'log_escape' directive. >>> > * Bugfix: fixed a bug in the limit_req module. >>> > * Bugfix: fixed a bug in subrequest. >>> > >>> > Regards, >>> > >>> > -- >>> > Joshua Zhu >>> > Senior Software Engineer >>> > Server Platforms Team at Taobao >>> > >>> > _______________________________________________ >>> > 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 nbubingo at gmail.com Mon Apr 9 13:34:56 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Mon, 9 Apr 2012 21:34:56 +0800 Subject: nginx upstream prematurely closed connection In-Reply-To: References: Message-ID: This is also proxy log, not the static content request log. You should be sure you have enough resources in your backend server, like memory, connection... 2012/4/9 Tariq wali : > Maxim, > > I see the same error on few of our lamp servers and nginx serving static > content . > I have looked for clues in apache error logs and syslog messages but > can't establish a connection .. > > 2012/03/21 00:00:01 [error] 569#0: *10867863 upstream prematurely closed > connection while reading response header from upstream, client: > 121.243.22.130, server: _, request: "GET / HTTP/1.1", upstream: > "http://127.0.0.1:8080/", host: "servername.net" > 2012/03/22 00:00:01 [error] 568#0: *10869967 upstream prematurely closed > connection while reading response header from upstream, client: > 121.243.22.130, server: _, request: "GET / HTTP/1.1", upstream: > "http://127.0.0.1:8080/", host: "servername.net" > 2012/03/23 00:00:01 [error] 569#0: *10872221 upstream prematurely closed > connection while reading response header from upstream, client: > 121.243.22.130, server: _, request: "GET / HTTP/1.1", upstream: > "http://127.0.0.1:8080/", host: "servername.net" > > I would appreciate a direction I can take this issue in ..' > > > T > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Mon Apr 9 13:41:54 2012 From: nginx-forum at nginx.us (auxbuss) Date: Mon, 9 Apr 2012 09:41:54 -0400 (EDT) Subject: Rewrites for sites without SSL on same IP address as those using SSL Message-ID: <980ba766245be3167fb1f1a2770fa2d6.NginxMailingListEnglish@forum.nginx.org> I have a few sites on a single IP and a single nginx instance. Some domains have SSL certificates (and listen on ports 80 and 443) and some don't (and only listen on port 80). For those domains that don't have an SSL certificate, including a server block listening on port 443 to rewrite to port 80 does not work. I understand this is because the SSL exchange happens prior to the server name being inspected. When browsing over https to one of the sites without an SSL certificate, the current behaviour is that a security warning is presented to the client that lists the certificate for the default_server and not the appropriate domain. Is there a way to rewrite https requests to http (for the domains with an SSL certificate) while retaining the appropriate domain? If not, is the best way to resolve this to add an additional IP and use one for those sites requiring ports 80 and 443 and another for those only using port 80? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225064,225064#msg-225064 From igor at sysoev.ru Mon Apr 9 13:55:15 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 9 Apr 2012 17:55:15 +0400 Subject: Rewrites for sites without SSL on same IP address as those using SSL In-Reply-To: <980ba766245be3167fb1f1a2770fa2d6.NginxMailingListEnglish@forum.nginx.org> References: <980ba766245be3167fb1f1a2770fa2d6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120409135515.GA49392@nginx.com> On Mon, Apr 09, 2012 at 09:41:54AM -0400, auxbuss wrote: > I have a few sites on a single IP and a single nginx instance. Some > domains have SSL certificates (and listen on ports 80 and 443) and some > don't (and only listen on port 80). > > For those domains that don't have an SSL certificate, including a server > block listening on port 443 to rewrite to port 80 does not work. I > understand this is because the SSL exchange happens prior to the server > name being inspected. > > When browsing over https to one of the sites without an SSL certificate, > the current behaviour is that a security warning is presented to the > client that lists the certificate for the default_server and not the > appropriate domain. > > Is there a way to rewrite https requests to http (for the domains with > an SSL certificate) while retaining the appropriate domain? Do you mean the domains WITHOUT an SSL certificate ? > If not, is the best way to resolve this to add an additional IP and use > one for those sites requiring ports 80 and 443 and another for those > only using port 80? Yes, in this case Firefox will show ----- Unable to connect Firefox can't establish a connection to the server at ... ----- -- Igor Sysoev From nginx-forum at nginx.us Mon Apr 9 13:57:46 2012 From: nginx-forum at nginx.us (auxbuss) Date: Mon, 9 Apr 2012 09:57:46 -0400 (EDT) Subject: Rewrites for sites without SSL on same IP address as those using SSL In-Reply-To: <980ba766245be3167fb1f1a2770fa2d6.NginxMailingListEnglish@forum.nginx.org> References: <980ba766245be3167fb1f1a2770fa2d6.NginxMailingListEnglish@forum.nginx.org> Message-ID: Yes, I mean domains without an SSL certificate. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225064,225066#msg-225066 From jdorfman at netdna.com Mon Apr 9 19:49:43 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Mon, 9 Apr 2012 12:49:43 -0700 Subject: could not build the referers_hash In-Reply-To: <1333144207.2204.8.camel@portable-evil> References: <1333071717.2082.3.camel@portable-evil> <1333120642.2082.7.camel@portable-evil> <1333144207.2204.8.camel@portable-evil> Message-ID: Our senior engineer figured how to fix it. What he did was edited this file: src/http/modules/ngx_http_referer_module.c and changed this line: prev->referer_hash_bucket_size, 64); to: prev->referer_hash_bucket_size, 128); Then recompiled nginx. Hope that helps someone in the future. Regards, Justin Dorfman On Fri, Mar 30, 2012 at 2:50 PM, Cliff Wells wrote: > On Fri, 2012-03-30 at 09:08 -0700, Justin Dorfman wrote: > > Hey Cliff, > > > > > > Here are the current values: > > > > > > server_names_hash_max_size 65536; > > server_names_hash_bucket_size 256; > > These are not the hashes you are looking for =) Your error message > specified "you should increase referers_hash_bucket_size", indicating > that it is currently 64. > > Regards, > Cliff > > > _______________________________________________ > 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 Mon Apr 9 20:00:05 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 9 Apr 2012 21:00:05 +0100 Subject: Chunked input module problem with http_dav Message-ID: Hi all - I'm running the latest tagged version of the chunked input body module as per https://github.com/agentzh/chunkin-nginx-module/tags (0.23rc2) and nginx 1.0.14 with the http_dav module. I'm seeing some failures which are, to my eye, stopping chunkin work at /all/ in this combination. I'm using http_dav to provide an some upload space. After an upload completes (I started at 400MB, and still see the following problem with 4MB uploads), I get the following in the debug/error logs: 2012/04/09 20:38:02 [crit] 1485#0: *3 chmod() "/srv/tmp/0000000001" failed (2: No such file or directory), client: 10.0.10.183, server: upload.server, request: "PUT /external/testing123 HTTP/1.1", host: "upload.server:81" 2012/04/09 20:38:02 [crit] 1485#0: *3 unlink() "/srv/tmp/0000000001" failed (2: No such file or directory), client: 10.0.10.183, server: upload.server, request: "PUT /external/testing123 HTTP/1.1", host: "upload.server:81" Then the client receives a 500. "/srv/tmp" (the client body temp location) *is* on the same partition as the final resting place as the data. If I *don't* use chunked input, then the upload works fine. Here's the site config: --------------------------------------------------------------------- server { listen *:81; server_name upload.server; chunkin on; error_page 411 = @my_411_error; location @my_411_error { chunkin_resume; } location / { root /srv/data/; client_body_temp_path /srv/tmp/ client_max_body_size 500m; dav_methods PUT DELETE MKCOL COPY MOVE; create_full_put_path off; dav_access group:rw all:r; } } ... and here's the nginx-V output: nginx version: nginx/1.0.14 built by gcc 4.4.5 (Debian 4.4.5-8) configure arguments: --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_dav_module --with-http_realip_module --with-http_stub_status_module --with-http_sub_module --add-module=/root/src/nginx-modules/agentzh-chunkin-nginx-module-ddc0dd5 --prefix=/usr Any ideas what's causing this and how I can fix it? Or is chunkin just not supposed to be run in this way with http_dav? Cheers, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From nginx-forum at nginx.us Tue Apr 10 01:28:23 2012 From: nginx-forum at nginx.us (spacerobot) Date: Mon, 9 Apr 2012 21:28:23 -0400 (EDT) Subject: Nginx returning 414 even when large_client_header_buffers is set Message-ID: <8b19edbb6b2d137c94eae907213f378f.NginxMailingListEnglish@forum.nginx.org> My nginx server needs a request whose URI is about 4k long, it currently returns 414 with message Request-URI Too Long. I looked online and added: large_client_header_buffers 4 16k; to the http block in nginx.conf, restarted nginx, still returns 414. I also tried to add client_header_buffer_size and set to 16k and well but didn't help. I have nginx 1.0.12 and built with the following options: "--with-http_ssl_module", "--with-http_gzip_static_module", "--add-module=../git/nginx-x-rid-header", "--with-ld-opt=-luuid", "--with-http_stub_status_module" Anybody has any insights on the 414 problem? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225093,225093#msg-225093 From ashishs.dev at gmail.com Tue Apr 10 01:44:24 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Mon, 9 Apr 2012 18:44:24 -0700 Subject: Memcache module implementation with multi-get support? In-Reply-To: References: <26880F2B-B366-40C5-ABDE-A1B8B525CAE8@akins.org> Message-ID: Thanks, everyone. This works. --Ashish On Fri, Apr 6, 2012 at 5:42 PM, agentzh wrote: > On Sat, Apr 7, 2012 at 6:00 AM, Matthieu Tourne > wrote: >> On Fri, Apr 6, 2012 at 2:40 PM, Brian Akins wrote: >>> On Apr 6, 2012, at 4:27 PM, Ashish S Dev wrote: >>> > >>> > Is there a memcache module implementation with multi-get support? >>> >>> Probably be pretty simple to add it to >>> https://github.com/agentzh/lua-resty-memcached >>> >> >> I think it already supports it if you pass an array of keys to the >> memc:get() function >> > > Yes, it does. > > Below is a test case for this feature: > > https://github.com/agentzh/lua-resty-memcached/blob/master/t/sanity.t#L1413 > > The lua-resty-memcached library is not an nginx module itself, but > rather a (nonblocking) Lua library that is intended to be used with > the ngx_lua module :) > > Best regards, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From ashishs.dev at gmail.com Tue Apr 10 02:02:10 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Mon, 9 Apr 2012 19:02:10 -0700 Subject: Program hangs when modifying u->buffer while using proxy module to talk to upstream backend Message-ID: Hi, I currently use upstream to talk to a back-end, which sends me some response. In my module, i am trying to re-format the plain-text upstream backend response, to XML, and I also add some new data to it, based on an in-memory lookup within my module. What would be the best way to do this? In my setup, I am able to parse response from upstream (u->buffer), construct a modified string and assign it back to u->buffer, and am I setting u->headers_in.content_length_n and r->headers_out.content_length_n correctly. The issue i face is, every *second* request hangs, if i am trying the request through the browser. (However, trying through command-line & curl, works everytime). And I always see this error message in the logs: "client prematurely closed connection, so upstream connection is closed too while sending to client, client: 127.0.0.1". What am i doing wrong? Thanks, Ashish From nbubingo at gmail.com Tue Apr 10 05:17:17 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Tue, 10 Apr 2012 13:17:17 +0800 Subject: Program hangs when modifying u->buffer while using proxy module to talk to upstream backend In-Reply-To: References: Message-ID: see the fastcgi module as an example 2012/4/10 Ashish S : > Hi, > > I currently use upstream to talk to a back-end, which sends me some > response. In my module, i am trying to re-format the plain-text > upstream backend response, to XML, and I also add some new data to it, > based on an in-memory lookup within my module. ?What would be the best > way to do this? > > In my setup, I am able to parse response from upstream (u->buffer), > construct a modified string and assign it back to u->buffer, and am I > setting ?u->headers_in.content_length_n and > r->headers_out.content_length_n correctly. The issue i face is, every > *second* request hangs, if i am trying the request through the > browser. (However, trying through command-line & curl, works > everytime). And I always see this error message in the logs: "client > prematurely closed connection, so upstream connection is closed too > while sending to client, client: 127.0.0.1". ? What am i doing wrong? > > Thanks, > Ashish > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Apr 10 07:47:12 2012 From: nginx-forum at nginx.us (zuckbin) Date: Tue, 10 Apr 2012 03:47:12 -0400 (EDT) Subject: serve static content on static domain In-Reply-To: References: Message-ID: <7b3d5fd92177e2f34fe20ec621a93193.NginxMailingListEnglish@forum.nginx.org> What is the server block ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225020,225098#msg-225098 From ne at vbart.ru Tue Apr 10 08:52:17 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 10 Apr 2012 12:52:17 +0400 Subject: serve static content on static domain In-Reply-To: <7b3d5fd92177e2f34fe20ec621a93193.NginxMailingListEnglish@forum.nginx.org> References: <7b3d5fd92177e2f34fe20ec621a93193.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201204101252.17233.ne@vbart.ru> On Tuesday 10 April 2012 11:47:12 zuckbin wrote: > What is the server block ? > http://nginx.org/r/server wbr, Valentin V. Bartenev From nginx-forum at nginx.us Tue Apr 10 10:07:40 2012 From: nginx-forum at nginx.us (sibsoft) Date: Tue, 10 Apr 2012 06:07:40 -0400 (EDT) Subject: MP4 - start time is out mp4 stts samples In-Reply-To: <5e238ac1a229e14931b6ea72c107997c.NginxMailingListEnglish@forum.nginx.org> References: <20111117050603.GA10385@nginx.com> <5e238ac1a229e14931b6ea72c107997c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9d8ab115b3e9176b7c4111e95478bbc7.NginxMailingListEnglish@forum.nginx.org> Dealing with this trouble again (nginx 1.0.12, 1.0.14): 2012/04/10 12:06:59 [alert] 22812#0: *1571 pread() read only 0 of 1048576 from "/var/www/cgi-bin/uploads/03/00364/z46j20qdp6gt" while sending mp4 to client, client: 95.131.10.226, server: gorillavid.com, request: "GET /mgobz2aj6gu4rqukwztlpbbrdqzwmtcoid2bk6t6xenwqd3fwvt6z3pyqy/video.mp4?start=1190.84 HTTP/1.1", host: "85.17.30.216:8182" 2012/04/10 12:07:00 [error] 22815#0: *1630 start time is out mp4 stts samples in "/var/www/cgi-bin/uploads/03/00001/k2hhvgyfdmmu", client: 86.18.83.8, server: gorillavid.com, request: "GET /mgobznkw5ku4tqukwyf3nfjxilouln5pl5abqotvftlq7rqggvegaydxva/video.flv?start=0 HTTP/1.1", host: "85.17.30.216:8182" I believe that I have this patch already applied: if (start_time < (uint64_t) count * duration) { start_sample += (ngx_uint_t) (start_time / duration); count -= start_sample; ngx_mp4_set_32value(entry->count, count); goto found; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,218451,225103#msg-225103 From nginx-forum at nginx.us Tue Apr 10 10:10:34 2012 From: nginx-forum at nginx.us (sibsoft) Date: Tue, 10 Apr 2012 06:10:34 -0400 (EDT) Subject: MP4 - start time is out mp4 stts samples In-Reply-To: <3c2ccb0e721cdc80d2dd4bf09ec014ea.NginxMailingListEnglish@forum.nginx.org> References: <3c2ccb0e721cdc80d2dd4bf09ec014ea.NginxMailingListEnglish@forum.nginx.org> Message-ID: Dealing with this trouble again (nginx 1.0.12, 1.0.14): 2012/04/10 12:06:59 [alert] 22812#0: *1571 pread() read only 0 of 1048576 from "/var/www/cgi-bin/uploads/03/00364/z46j20qdp6gt" while sending mp4 to client, client: ....., server: ....., request: "GET /mgobz2aj6gu4rqukwztlpbbrdqzwmtcoid2bk6t6xenwqd3fwvt6z3pyqy/video.mp4?start=1190.84 HTTP/1.1", host: "....." 2012/04/10 12:07:00 [error] 22815#0: *1630 start time is out mp4 stts samples in "/var/www/cgi-bin/uploads/03/00001/k2hhvgyfdmmu", client: ....., server: ....., request: "GET /mgobznkw5ku4tqukwyf3nfjxilouln5pl5abqotvftlq7rqggvegaydxva/video.flv?start=0 HTTP/1.1", host: "....." I believe that I have this patch already applied: if (start_time < (uint64_t) count * duration) { start_sample += (ngx_uint_t) (start_time / duration); count -= start_sample; ngx_mp4_set_32value(entry->count, count); goto found; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,218451,225104#msg-225104 From rajnesh.siwal at gmail.com Tue Apr 10 10:53:14 2012 From: rajnesh.siwal at gmail.com (Rajnesh Kumar Siwal) Date: Tue, 10 Apr 2012 16:23:14 +0530 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario Message-ID: Hi, The KeepAlive Timeout is set to 2 hours, but we can see that the connections start terminating after a few minutes. The KeepAlive module does not seems to be behaving as expected. The connections are created on port :343. The configuration file nginx.conf is :- ------------------------------------------------------------------- user nginx; worker_processes 16; error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; events { #worker_connections 16192; #worker_connections 161920; worker_connections 40960; use epoll; multi_accept on; } 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; keepalive_timeout 7200 7200; tcp_keepalive on; tcp_keepcnt 10; tcp_keepidle 3600; tcp_keepintvl 1m; #gzip on; # # The default server # server { listen 4443; server_name _; location /nginx_status { # copied from http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/ stub_status on; access_log off; } } server { listen 80; server_name _; # keepalive_timeout 7200 7200; #charset koi8-r; access_log logs/host.access.log main; location / { proxy_pass http://172.31.253.50:180/; include /etc/nginx/proxy.conf; } } server { listen 443 ssl; ssl on; ssl_verify_client on; server_name _; ssl_certificate /home/rsiwal/cps.chargepoint.net.crt; #ssl_client_certificate /etc/httpd/certs/ chargepoint.net/server/certs/cps.chargepoint.net.crt; ssl_client_certificate /home/rsiwal/chargepoint.net.crt; ssl_certificate_key /home/rsiwal/cps.chargepoint.net.pem; location / { proxy_pass http://172.31.253.50:1443/; include /etc/nginx/proxy.conf; } } server { listen 343 ssl; ssl on; ssl_verify_client on; server_name _; #ssl_session_cache shared:SSL:40m; # Works fine upto 15K ssl_session_cache shared:SSL:70m; #######ssl_session_timeout 5m; # ssl_session_timeout 120m; # tcp_keepalive on; tcp_keepcnt 10; tcp_keepidle 7200; tcp_keepintvl 1m; access_log logs/ssl-access.log main; error_log logs/ssl-error.log debug; keepalive_requests 10000; #keepalive_disable none sendfile on; tcp_nopush on; tcp_nodelay on; client_header_timeout 300; client_body_timeout 300; ssl_certificate /home/rsiwal/cps.chargepoint.net.crt; ssl_certificate_key /home/rsiwal/cps.chargepoint.net.pem; ssl_client_certificate /home/rsiwal/chargepoint.net.crt; location / { proxy_pass http://172.31.253.50:1343/; include /etc/nginx/proxy.conf; } } include /etc/nginx/conf.d/*.conf; } ----------------------------------------------------------------------------------------------------------------------------- Thanks in advance -- Regards, Rajnesh Kumar Siwal -------------- next part -------------- An HTML attachment was scrubbed... URL: From amoiz.shine at gmail.com Tue Apr 10 10:55:36 2012 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Tue, 10 Apr 2012 18:55:36 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: sorry for those non-technical posts,maybe i should send him directly instead of mailing-list. BTW,is there any improvements of tengine on CGI? 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. ? 2012?4?9? ??9:28???? ??? > Hello, > > Can you just focus on the technical problem? If you have any detail > question to ask, we are pleased to serve you. > > Thanks. > > 2012/4/5 Sharl.Jimh.Tsin : >> from your profile in LinkedIn website,i found that you are a student >> of HuaiYin Normal University.right? >> >> 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. >> >> >> >> ? 2012?4?1? ??9:58?smallfish ??? >>> hah, perhaps just a joke. but nothing is impossable. :) >>> -- >>> blog: http://chenxiaoyu.org >>> >>> >>> >>> ? 2012?4?1? ??9:33?Sharl.Jimh.Tsin ??? >>>> >>>> are you sure that NOT a joke of April Fools' Day, like taolinux >>>> (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? >>>> >>>> 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. >>>> >>>> >>>> >>>> 2012/3/31 Joshua Zhu : >>>> > Hi folks! >>>> > >>>> > We're pleased to announce that Tengine-1.2.4 has been released. You can >>>> > either download the tar ball >>>> > from http://tengine.taobao.org/download/tengine-1.2.4.tar.gz , or >>>> > checkout >>>> > the code from https://github.com/taobao/tengine >>>> > >>>> > As this release, Tengine is based on Nginx-1.0.14. The highlight is a >>>> > brand >>>> > new 'user_agent' module which would be a good replacement for the >>>> > 'browser' >>>> > module in standard Nginx. It's more efficient and flexible than the >>>> > 'browser' module. Other changes include: >>>> > * Feature: added the 'log_escape' directive. >>>> > * Bugfix: fixed a bug in the limit_req module. >>>> > * Bugfix: fixed a bug in subrequest. >>>> > >>>> > Regards, >>>> > >>>> > -- >>>> > Joshua Zhu >>>> > Senior Software Engineer >>>> > Server Platforms Team at Taobao >>>> > >>>> > _______________________________________________ >>>> > nginx mailing list >>>> > nginx at nginx.org >>>> > http://mailman.nginx.org/mailman/listinfo/nginx >>>> >>>> _______________________________________________ >>>> nginx mailing list >>>> nginx at nginx.org >>>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >>> >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Tue Apr 10 11:16:04 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 10 Apr 2012 15:16:04 +0400 Subject: could not build the referers_hash In-Reply-To: References: <1333071717.2082.3.camel@portable-evil> <1333120642.2082.7.camel@portable-evil> <1333144207.2204.8.camel@portable-evil> Message-ID: <20120410111604.GO13466@mdounin.ru> Hello! On Mon, Apr 09, 2012 at 12:49:43PM -0700, Justin Dorfman wrote: > Our senior engineer figured how to fix it. > > What he did was edited this file: src/http/modules/ngx_http_referer_module.c > > and changed this line: > prev->referer_hash_bucket_size, 64); > > to: > prev->referer_hash_bucket_size, 128); > > Then recompiled nginx. > > Hope that helps someone in the future. There is configuration directive to adjust this, referer_hash_bucket_size. You don't need to edit the code. Maxim Dounin > > Regards, > > Justin Dorfman > > > > > On Fri, Mar 30, 2012 at 2:50 PM, Cliff Wells wrote: > > > On Fri, 2012-03-30 at 09:08 -0700, Justin Dorfman wrote: > > > Hey Cliff, > > > > > > > > > Here are the current values: > > > > > > > > > server_names_hash_max_size 65536; > > > server_names_hash_bucket_size 256; > > > > These are not the hashes you are looking for =) Your error message > > specified "you should increase referers_hash_bucket_size", indicating > > that it is currently 64. > > > > Regards, > > Cliff > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Tue Apr 10 12:13:38 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 10 Apr 2012 16:13:38 +0400 Subject: Program hangs when modifying u->buffer while using proxy module to talk to upstream backend In-Reply-To: References: Message-ID: <20120410121337.GR13466@mdounin.ru> Hello! On Mon, Apr 09, 2012 at 07:02:10PM -0700, Ashish S wrote: > Hi, > > I currently use upstream to talk to a back-end, which sends me some > response. In my module, i am trying to re-format the plain-text > upstream backend response, to XML, and I also add some new data to it, > based on an in-memory lookup within my module. What would be the best > way to do this? Unless you are working on custom protocol module, you may want to use filter module to re-format data instead. > In my setup, I am able to parse response from upstream (u->buffer), > construct a modified string and assign it back to u->buffer, and am I > setting u->headers_in.content_length_n and > r->headers_out.content_length_n correctly. The issue i face is, every > *second* request hangs, if i am trying the request through the > browser. (However, trying through command-line & curl, works > everytime). And I always see this error message in the logs: "client > prematurely closed connection, so upstream connection is closed too > while sending to client, client: 127.0.0.1". What am i doing wrong? It's hard to say anything without seeing the code, but most likely you fail to set u->length properly. See e.g. memcached module for a simple example of non-buffered protocol handler. Maxim Dounin From mdounin at mdounin.ru Tue Apr 10 13:03:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 10 Apr 2012 17:03:03 +0400 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario In-Reply-To: References: Message-ID: <20120410130303.GT13466@mdounin.ru> Hello! On Tue, Apr 10, 2012 at 04:23:14PM +0530, Rajnesh Kumar Siwal wrote: > The KeepAlive Timeout is set to 2 hours, but we can see that the > connections start terminating after a few minutes. > The KeepAlive module does not seems to be behaving as expected. > The connections are created on port :343. > The configuration file nginx.conf is :- [...] > keepalive_timeout 7200 7200; How do you test? Note: many (most?) browsers won't keep connections open for such a long time and will close them after a minute or so. E.g. Chrome unconditionally closes connections after 5 minutes. Note well: nginx itself might close keepalive connections before timeout passes if it's short on worker_connections. Though I suppose you are hitting browsers behaviour instead. Maxim Dounin From ne at vbart.ru Tue Apr 10 13:03:14 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 10 Apr 2012 17:03:14 +0400 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario In-Reply-To: References: Message-ID: <201204101703.14125.ne@vbart.ru> On Tuesday 10 April 2012 14:53:14 Rajnesh Kumar Siwal wrote: > Hi, > > The KeepAlive Timeout is set to 2 hours, but we can see that the > connections start terminating after a few minutes. > The KeepAlive module does not seems to be behaving as expected. So, what's in the error log? Are you sure that the client doesn't close the connection? Some browsers actually do after a minute or few. [...] > tcp_keepalive on; > tcp_keepcnt 10; > tcp_keepidle 7200; > tcp_keepintvl 1m; There are no such directives in the official nginx distribution. But you can set SO_KEEPALIVE by parameter of the listen directive: listen 443 ssl so_keepalive=2h:1m:10; Please, take a look at the docs: http://nginx.org/r/listen wbr, Valentin V. Bartenev From mp3geek at gmail.com Tue Apr 10 13:53:08 2012 From: mp3geek at gmail.com (Ryan Brown) Date: Wed, 11 Apr 2012 01:53:08 +1200 Subject: could not build the referers_hash In-Reply-To: <20120410111604.GO13466@mdounin.ru> References: <1333071717.2082.3.camel@portable-evil> <1333120642.2082.7.camel@portable-evil> <1333144207.2204.8.camel@portable-evil> <20120410111604.GO13466@mdounin.ru> Message-ID: > There is configuration directive to adjust this, > referer_hash_bucket_size. ?You don't need to edit the code. > > Maxim Dounin I got caught by this bug too, Seems a bit strange why the defaults (if not set) complains that its not enough.. I can see why people edit the code directly. If 64 isn't clearly enough when referer_hash_bucket_size isn't set, why not just up the default to 128 to avoid this unnecessary complaint by nginx. From mdounin at mdounin.ru Tue Apr 10 14:05:00 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 10 Apr 2012 18:05:00 +0400 Subject: MP4 - start time is out mp4 stts samples In-Reply-To: <9d8ab115b3e9176b7c4111e95478bbc7.NginxMailingListEnglish@forum.nginx.org> References: <20111117050603.GA10385@nginx.com> <5e238ac1a229e14931b6ea72c107997c.NginxMailingListEnglish@forum.nginx.org> <9d8ab115b3e9176b7c4111e95478bbc7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120410140500.GV13466@mdounin.ru> Hello! On Tue, Apr 10, 2012 at 06:07:40AM -0400, sibsoft wrote: > Dealing with this trouble again (nginx 1.0.12, 1.0.14): > > 2012/04/10 12:06:59 [alert] 22812#0: *1571 pread() read only 0 of > 1048576 from "/var/www/cgi-bin/uploads/03/00364/z46j20qdp6gt" while > sending mp4 to client, client: 95.131.10.226, server: gorillavid.com, > request: "GET > /mgobz2aj6gu4rqukwztlpbbrdqzwmtcoid2bk6t6xenwqd3fwvt6z3pyqy/video.mp4?start=1190.84 > HTTP/1.1", host: "85.17.30.216:8182" The message suggests video.mp4 is corrupted (or just truncated). > 2012/04/10 12:07:00 [error] 22815#0: *1630 start time is out mp4 stts > samples in "/var/www/cgi-bin/uploads/03/00001/k2hhvgyfdmmu", client: > 86.18.83.8, server: gorillavid.com, request: "GET > /mgobznkw5ku4tqukwyf3nfjxilouln5pl5abqotvftlq7rqggvegaydxva/video.flv?start=0 > HTTP/1.1", host: "85.17.30.216:8182" The "video.flv" file isn't likely to be an mp4 file. You have to use flv module for flv pseudo-streaming, not mp4. http://nginx.org/r/flv Maxim Dounin From mdounin at mdounin.ru Tue Apr 10 14:44:28 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 10 Apr 2012 18:44:28 +0400 Subject: could not build the referers_hash In-Reply-To: References: <1333071717.2082.3.camel@portable-evil> <1333120642.2082.7.camel@portable-evil> <1333144207.2204.8.camel@portable-evil> <20120410111604.GO13466@mdounin.ru> Message-ID: <20120410144428.GW13466@mdounin.ru> Hello! On Wed, Apr 11, 2012 at 01:53:08AM +1200, Ryan Brown wrote: > > There is configuration directive to adjust this, > > referer_hash_bucket_size. ?You don't need to edit the code. > > > > Maxim Dounin > > I got caught by this bug too, > > Seems a bit strange why the defaults (if not set) complains that its > not enough.. I can see why people edit the code directly. > > If 64 isn't clearly enough when referer_hash_bucket_size isn't set, > why not just up the default to 128 to avoid this unnecessary complaint > by nginx. The default is enough in most cases. There are some specific situations (long values in hash, multiple colliding values) which trigger the message, and the message itself explains what to do (and we have the page at http://nginx.org/en/docs/hash.html which explains details). We might want to better (read: automatically) handle some situation like non-colliding long values, where the only sensible solution is to increase ..._hash_bucket_size, but this has nothing to do with defaults change. With any default one will be able to write a configuration which triggers the "could not build hash" message. Maxim Dounin From ashishs.dev at gmail.com Tue Apr 10 18:16:10 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Tue, 10 Apr 2012 11:16:10 -0700 Subject: Program hangs when modifying u->buffer while using proxy module to talk to upstream backend In-Reply-To: <20120410121337.GR13466@mdounin.ru> References: <20120410121337.GR13466@mdounin.ru> Message-ID: Hi Maxim, Here is a simple test code i wrote, (for my process header method), which shows the same behavior. ============ ngx_int_t ngx_http_my_process_header(ngx_http_request_t *r) { ngx_http_upstream_t *u = r->upstream; std::string tmpString ("Test string"); ngx_memcpy(u->buffer.start, tmpString.c_str(), tmpString.length()); u->buffer.pos = u->buffer.start; u->buffer.last = u->buffer.pos + tmpString.length(); u->length = u->headers_in.content_length_n = tmpString.length(); r->headers_out.content_length_n = tmpString.length(); u->headers_in.status_n = NGX_HTTP_OK; u->state->status = NGX_HTTP_OK; return NGX_OK; } ============ Thanks, Ashish On Tue, Apr 10, 2012 at 5:13 AM, Maxim Dounin wrote: > Hello! > > On Mon, Apr 09, 2012 at 07:02:10PM -0700, Ashish S wrote: > >> Hi, >> >> I currently use upstream to talk to a back-end, which sends me some >> response. In my module, i am trying to re-format the plain-text >> upstream backend response, to XML, and I also add some new data to it, >> based on an in-memory lookup within my module. ?What would be the best >> way to do this? > > Unless you are working on custom protocol module, you may want to > use filter module to re-format data instead. > >> In my setup, I am able to parse response from upstream (u->buffer), >> construct a modified string and assign it back to u->buffer, and am I >> setting ?u->headers_in.content_length_n and >> r->headers_out.content_length_n correctly. The issue i face is, every >> *second* request hangs, if i am trying the request through the >> browser. (However, trying through command-line & curl, works >> everytime). And I always see this error message in the logs: "client >> prematurely closed connection, so upstream connection is closed too >> while sending to client, client: 127.0.0.1". ? What am i doing wrong? > > It's hard to say anything without seeing the code, but most likely > you fail to set u->length properly. ?See e.g. memcached module for > a simple example of non-buffered protocol handler. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Apr 10 20:03:50 2012 From: nginx-forum at nginx.us (spacerobot) Date: Tue, 10 Apr 2012 16:03:50 -0400 (EDT) Subject: Nginx returning 414 even when large_client_header_buffers is set In-Reply-To: <8b19edbb6b2d137c94eae907213f378f.NginxMailingListEnglish@forum.nginx.org> References: <8b19edbb6b2d137c94eae907213f378f.NginxMailingListEnglish@forum.nginx.org> Message-ID: It appears that no matter how big I set the value of large_client_header_buffers to be, nginx just doesn't care of the setting and still returns 414 on a long request. I tried to make it 16k, 32k, 256k, and 512k, etc and POSTing a request with 1.5k long URL returns 414. It works when I reduce the request URI length to about 1k, regardless of the large_client_header_buffers value as well. I also tried to set proxy_buffers to a large value and didn't help. Is there any other settings I need to look at to make the nginx box take longer request URI without returning 414? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225093,225135#msg-225135 From mdounin at mdounin.ru Tue Apr 10 20:09:56 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 11 Apr 2012 00:09:56 +0400 Subject: Nginx returning 414 even when large_client_header_buffers is set In-Reply-To: References: <8b19edbb6b2d137c94eae907213f378f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120410200956.GB13466@mdounin.ru> Hello! On Tue, Apr 10, 2012 at 04:03:50PM -0400, spacerobot wrote: > It appears that no matter how big I set the value of > large_client_header_buffers to be, nginx just doesn't care of the > setting and still returns 414 on a long request. > > I tried to make it 16k, 32k, 256k, and 512k, etc and POSTing a request > with 1.5k long URL returns 414. It works when I reduce the request URI > length to about 1k, regardless of the large_client_header_buffers value > as well. > > I also tried to set proxy_buffers to a large value and didn't help. > > Is there any other settings I need to look at to make the nginx box take > longer request URI without returning 414? Most likely you are trying to configure client_header_buffer_size/large_client_header_buffers in a pure virtual server{}. This won't work as request headers parsing happens before Host header is known (and virtual server is selected), hence parseing happens in a context of the default server for a listen socket. You have to configure client_header_buffer_size/large_client_header_buffers in a default server (or at http level). Maxim Dounin From nginx-forum at nginx.us Tue Apr 10 20:26:25 2012 From: nginx-forum at nginx.us (spacerobot) Date: Tue, 10 Apr 2012 16:26:25 -0400 (EDT) Subject: Nginx returning 414 even when large_client_header_buffers is set In-Reply-To: <20120410200956.GB13466@mdounin.ru> References: <20120410200956.GB13466@mdounin.ru> Message-ID: > Most likely you are trying to configure > client_header_buffer_size/large_client_header_buff > ers in a pure > virtual server{}. This won't work as request > headers parsing > happens before Host header is known (and virtual > server is > selected), hence parseing happens in a context of > the default > server for a listen socket. > > You have to configure > client_header_buffer_size/large_client_header_buff > ers > in a default server (or at http level). > I tried to set it in the http context of the main /etc/nginx/nginx.conf file: http { large_client_header_buffers 8 512k; ... include /etc/nginx/sites-enabled/*; } And my server contexts are defined in a conf file in sites-enabled. But large_client_header_buffers still appears to be ignored. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225093,225138#msg-225138 From massimo.ferrari at gmail.com Tue Apr 10 20:32:31 2012 From: massimo.ferrari at gmail.com (massimo ferrari) Date: Tue, 10 Apr 2012 22:32:31 +0200 Subject: Redis2_pass with : from $args fail [maxf3r] Message-ID: I'm trying to address several redis instances, dispatching it on a host:port basis (one single backend location) here part of my nginx.conf location ... location /redis_backend { internal; set_unescape_uri $verb $arg_verb; set_unescape_uri $key $arg_key; set_unescape_uri $r_host $arg_host; set_unescape_uri $r_port $arg_port; redis2_query $verb $key; redis2_pass $r_host:$r_port; } ... I call /redis_backend location from a lua like this: .... r_instance["redis_host"] = '127.0.0.1' r_instance["redis_port"] = '33001' .... local res = ngx.location.capture ( "/redis_backend", { args = { verb = r_verb, key = redis_key, host = r_instance["redis_host"], port = r_instance["redis_port"], } } ) ... in nginx error log (i use the openresty suite ngx_openresty/1.0.10.44), I got this error *2012/04/07 19:25:03 [error] 11715#0: *1 redis2: upstream "127.0.0.1:33001" not found, client: 127.0.0.1, server: ....* I'm sure redis instance is up&running. I'm able to connect to her via redis-cli or, simply setting redis2_pass 127.0.0.1:33001; ciao massimo -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashishs.dev at gmail.com Tue Apr 10 21:03:09 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Tue, 10 Apr 2012 14:03:09 -0700 Subject: Program hangs when modifying u->buffer while using proxy module to talk to upstream backend In-Reply-To: References: <20120410121337.GR13466@mdounin.ru> Message-ID: Hi, I figured the issue. Maxim's intuition was right. u->length was not set correctly (the u->length set in the code i copy-pasted earlier, was modified later by a filter method). After fixing the issue, the code works correctly, no more hangs. Thanks, Ashish On Tue, Apr 10, 2012 at 11:16 AM, Ashish S wrote: > Hi Maxim, > > Here is a simple test code i wrote, (for my process header method), > which shows the same behavior. > > ============ > ngx_int_t > ngx_http_my_process_header(ngx_http_request_t *r) > { > ? ?ngx_http_upstream_t *u = r->upstream; > > ? ?std::string tmpString ("Test string"); > ? ?ngx_memcpy(u->buffer.start, tmpString.c_str(), tmpString.length()); > ? ?u->buffer.pos = u->buffer.start; > ? ?u->buffer.last = u->buffer.pos + tmpString.length(); > > ? ?u->length = u->headers_in.content_length_n = tmpString.length(); > ? ?r->headers_out.content_length_n = tmpString.length(); > ? ?u->headers_in.status_n = NGX_HTTP_OK; > ? ?u->state->status = NGX_HTTP_OK; > > ? ?return NGX_OK; > } > ============ > > Thanks, > Ashish > > > On Tue, Apr 10, 2012 at 5:13 AM, Maxim Dounin wrote: >> Hello! >> >> On Mon, Apr 09, 2012 at 07:02:10PM -0700, Ashish S wrote: >> >>> Hi, >>> >>> I currently use upstream to talk to a back-end, which sends me some >>> response. In my module, i am trying to re-format the plain-text >>> upstream backend response, to XML, and I also add some new data to it, >>> based on an in-memory lookup within my module. ?What would be the best >>> way to do this? >> >> Unless you are working on custom protocol module, you may want to >> use filter module to re-format data instead. >> >>> In my setup, I am able to parse response from upstream (u->buffer), >>> construct a modified string and assign it back to u->buffer, and am I >>> setting ?u->headers_in.content_length_n and >>> r->headers_out.content_length_n correctly. The issue i face is, every >>> *second* request hangs, if i am trying the request through the >>> browser. (However, trying through command-line & curl, works >>> everytime). And I always see this error message in the logs: "client >>> prematurely closed connection, so upstream connection is closed too >>> while sending to client, client: 127.0.0.1". ? What am i doing wrong? >> >> It's hard to say anything without seeing the code, but most likely >> you fail to set u->length properly. ?See e.g. memcached module for >> a simple example of non-buffered protocol handler. >> >> Maxim Dounin >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Apr 10 23:45:21 2012 From: nginx-forum at nginx.us (spacerobot) Date: Tue, 10 Apr 2012 19:45:21 -0400 (EDT) Subject: Nginx returning 414 even when large_client_header_buffers is set In-Reply-To: References: <20120410200956.GB13466@mdounin.ru> Message-ID: Hello, spacerobot Wrote: ------------------------------------------------------- > > Most likely you are trying to configure > > > client_header_buffer_size/large_client_header_buff > > > ers in a pure > > virtual server{}. This won't work as request > > headers parsing > > happens before Host header is known (and > virtual > > server is > > selected), hence parseing happens in a context > of > > the default > > server for a listen socket. > > > > You have to configure > > > client_header_buffer_size/large_client_header_buff > > > ers > > in a default server (or at http level). > > > > I tried to set it in the http context of the main > /etc/nginx/nginx.conf file: > > http { > large_client_header_buffers 8 512k; > > ... > include /etc/nginx/sites-enabled/*; > } > > And my server contexts are defined in a conf file > in sites-enabled. But large_client_header_buffers > still appears to be ignored. I further tried the following things, which didn't help either: - took out most of the configs in my nginx.conf and now I have the simplest configuration possible, as below. - upgraded to 1.0.14 stable from 1.0.12 development. My new simplified nginx.conf: worker_processes 2; daemon off; error_log /var/log/nginx/error.log; events { worker_connections 2048; } http { client_header_buffer_size 256k; large_client_header_buffers 8 1024k; upstream foo.com { server 10.0.0.99:16234; server 10.0.0.20:16234; } server { listen 443; ssl on; ssl_certificate /etc/foo.com.crt; ssl_certificate_key /etc//foo.com.key; server_name foo; access_log /var/log/nginx/access.log main; set $foo "foo.com"; location / { proxy_set_header x-foo-rid $request_id; proxy_redirect http://$foo /; proxy_pass http://$foo; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225093,225146#msg-225146 From ianevans at digitalhit.com Tue Apr 10 23:52:56 2012 From: ianevans at digitalhit.com (Ian M. Evans) Date: Tue, 10 Apr 2012 19:52:56 -0400 Subject: Non-root install of Wordpress in an already running nginx site Message-ID: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> Been running nginx on our server for years. php-fpm, multiple location sections, etc., all working fine. However, for one project we're launching my partner wants to run a wordpress blog from a subdirecory, i.e., example.com/ournewblog Can anyone point me to an example of a location block for the wordpress blog that handles all the wordpress needs while not futzing with all the other locations or causing php problems elsewhere? Thanks! From edho at myconan.net Wed Apr 11 00:02:56 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 11 Apr 2012 07:02:56 +0700 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> Message-ID: 2012/4/11 Ian M. Evans : > Been running nginx on our server for years. php-fpm, multiple location > sections, etc., all working fine. > > However, for one project we're launching my partner wants to run a > wordpress blog from a subdirecory, i.e., example.com/ournewblog > > Can anyone point me to an example of a location block for the wordpress > blog that handles all the wordpress needs while not futzing with all the > other locations or causing php problems elsewhere? > location /ournewblog/ { root ...; try_files $uri /ournewblog/index.php?q=$uri; location ~ \.php$ { fastcgi_pass ... ... } } Hopefully you don't have regex based location on server { } block. Otherwise you can try location ~ ^/ournewblog/ instead. From ianevans at digitalhit.com Wed Apr 11 00:22:45 2012 From: ianevans at digitalhit.com (Ian M. Evans) Date: Tue, 10 Apr 2012 20:22:45 -0400 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> Message-ID: <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> On Tue, April 10, 2012 8:02 pm, Edho Arief wrote: > location /ournewblog/ { > root ...; > try_files $uri /ournewblog/index.php?q=$uri; > location ~ \.php$ { > fastcgi_pass ... > ... > } > } > > Hopefully you don't have regex based location on server { } block. > Otherwise you can try location ~ ^/ournewblog/ instead. I've always been a bit unsure of handling nginx locations so how can I tell if I have a "regex based location"? Most of my locations are like: location / { index index.shtml index.php; } location ~ \.(shtml|php|inc)$ { fastcgi_pass 127.0.0.1:10004; } # start of extensionless stuff location ~ ^/(bunch|of|site|sections)(/.*$|$) { ... } location ~ /(more|extensionless|sections)(/|$) { ... } Thanks. From edho at myconan.net Wed Apr 11 00:26:52 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 11 Apr 2012 07:26:52 +0700 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> Message-ID: 2012/4/11 Ian M. Evans : > On Tue, April 10, 2012 8:02 pm, Edho Arief wrote: >> location /ournewblog/ { >> ? root ...; >> ? try_files $uri /ournewblog/index.php?q=$uri; >> ? location ~ \.php$ { >> ? ? fastcgi_pass ... >> ? ? ... >> ? } >> } >> >> Hopefully you don't have regex based location on server { } block. >> Otherwise you can try location ~ ^/ournewblog/ instead. > > I've always been a bit unsure of handling nginx locations so how can I > tell if I have a "regex based location"? > > Most of my locations are like: > > location / { > index index.shtml index.php; > } > location ~ \.(shtml|php|inc)$ { > fastcgi_pass 127.0.0.1:10004; > } this is regex based location block. It gets higher priority when accessing /ournewblog/index.php . You need location ~ ^/ournewblog/ instead and put it as the first location block (before other locations). From nginx-forum at nginx.us Wed Apr 11 01:36:22 2012 From: nginx-forum at nginx.us (CheezItMan) Date: Tue, 10 Apr 2012 21:36:22 -0400 (EDT) Subject: Nginx and Wordpress Super Cache Message-ID: 'm trying to setup a new server with nginx instead of LAMP using php-fpm. I've got wordpress setup and running, but I'm at a loss to figure out how to get Wordpress Super Cache working. I'd appreciate any help. I'm also trying to figure out how to get rid of the if statements in the wordpress Multisite configuration file. I do know about the ifisevil page. I'd taken my initial configuration from: http://codex.wordpress.org/Nginx My Sites-available file --- # Redirect everything to the main site. server { listen 80 default; server_name *.students.scisdragons.net; rewrite ^ http://students.scisdragons.net$request_uri permanent; } server { server_name students.scisdragons.net; root /var/www/students.scisdragons.net; include global/restrictions.conf; include global/wordpress-ms-subdir.conf; } --- My global wordpress file --- # WordPress multisite subdirectory rules. # Designed to be included in any server {} block. # This order might seem weird - this is attempted to match last if rules below fail. # http://wiki.nginx.org/HttpCoreModule location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; # Directives to send expires headers and turn off 404 error logging. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 48h; log_not_found off; } # Pass uploaded files to wp-includes/ms-files.php. rewrite /files/$ /index.php last; # For multisite: Use a caching plugin/script that creates symlinks to the correct subdirectory structure to get some performance gains. set $cachetest "$document_root/wp-content/cache/ms-filemap/${host}${uri}"; if ($uri ~ /$) { set $cachetest ""; } if (-f $cachetest) { # Rewrites the URI and stops rewrite processing so it doesn't start over and attempt to pass it to the next rule. rewrite ^ /wp-content/cache/ms-filemap/${host}${uri} break; } if ($uri !~ wp-content/plugins) { rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last; } # Uncomment one of the lines below for the appropriate caching plugin (if used). # include global/wordpress-ms-subdir-wp-super-cache.conf; # include global/wordpress-ms-subdir-w3-total-cache.conf; # Rewrite multisite '.../wp-.*' and '.../*.php'. if (!-e $request_filename) { rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last; rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last; } # Pass all .php files onto a php-fpm/php-fcgi server. location ~ \.php$ { # Zero-day exploit defense. # http://forum.nginx.org/read.php?2,88845,page=3 # Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi. # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked. try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_intercept_errors on; fastcgi_pass php; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225151,225151#msg-225151 From nginx-forum at nginx.us Wed Apr 11 01:38:07 2012 From: nginx-forum at nginx.us (activa) Date: Tue, 10 Apr 2012 21:38:07 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification Message-ID: i have made a test security and i have found the fallowing : we have the fallowing synoposis : [root at server4 www]# ls -alh total 144K drwxr-x--- 6 usertest nobody 4.0K Apr 10 20:09 . drwx--x--x 13 usertest usertest 4.0K Apr 7 02:16 .. -rw-r--r-- 1 usertest usertest 184 Apr 6 21:29 .htaccess lrwxrwxrwx 1 usertest usertest 38 Apr 6 22:48 im1.txt -> /home/anotheruser/public_html/config.php -rw-r--r-- 1 usertest usertest 3 May 3 2011 index.html i can read the file of other user without any probleme !!! normally it should verify the ownership of files before handel them . NOTE , i use nginx as proxy of apache . when i use just apache a get a 403 error (this is a normal result) , with nginx i can read the file , becuase nginx hadler the static files + images anyfix for this ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225152#msg-225152 From edho at myconan.net Wed Apr 11 01:42:58 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 11 Apr 2012 08:42:58 +0700 Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: 2012/4/11 activa : > > anyfix for this ? > disable_symlinks if_not_owner; From cliff at develix.com Wed Apr 11 01:47:46 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 10 Apr 2012 18:47:46 -0700 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> Message-ID: <4F84E2C2.6040603@develix.com> On 04/10/2012 05:22 PM, Ian M. Evans wrote: > On Tue, April 10, 2012 8:02 pm, Edho Arief wrote: >> location /ournewblog/ { >> root ...; >> try_files $uri /ournewblog/index.php?q=$uri; >> location ~ \.php$ { >> fastcgi_pass ... >> ... >> } >> } >> >> Hopefully you don't have regex based location on server { } block. >> Otherwise you can try location ~ ^/ournewblog/ instead. > I've always been a bit unsure of handling nginx locations so how can I > tell if I have a "regex based location"? http://nginx.org/en/docs/http/request_processing.html Regards, Cliff From nginx-forum at nginx.us Wed Apr 11 02:25:48 2012 From: nginx-forum at nginx.us (activa) Date: Tue, 10 Apr 2012 22:25:48 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: <7a33c7c8e452dfc4a668b22d7a1c0b44.NginxMailingListEnglish@forum.nginx.org> where shod i add this ? in nginx conf or in vhost conf ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225155#msg-225155 From nginx-forum at nginx.us Wed Apr 11 02:46:31 2012 From: nginx-forum at nginx.us (activa) Date: Tue, 10 Apr 2012 22:46:31 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: <3a58114175502301cd1c9d9be4b64605.NginxMailingListEnglish@forum.nginx.org> as i have found n is only available in developper version , not the stable version . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225156#msg-225156 From nginx-forum at nginx.us Wed Apr 11 04:18:48 2012 From: nginx-forum at nginx.us (activa) Date: Wed, 11 Apr 2012 00:18:48 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: <04a7dc7ec690ac6de5bf7dc953d31448.NginxMailingListEnglish@forum.nginx.org> installed nginx-1.1.18 and probleme was resolved . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225158#msg-225158 From nginx-forum at nginx.us Wed Apr 11 04:50:59 2012 From: nginx-forum at nginx.us (activa) Date: Wed, 11 Apr 2012 00:50:59 -0400 (EDT) Subject: all visitor have same IP (my server IP) Message-ID: i'm using nginx as proxy fro apache . my users ask why 90% of thier vistors has the same IP of the servers . and some php application block the server IP adresse as flood ip . [root at server4 ]# netstat -lanp | grep :8081 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 1 0.0.0.0 3 127.0.0.1 1588 xxx.xxx.xxx.xxx (this is server ip) [root at server4 ]# netstat -lanp | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 1 94.111.122.97 2 150.70.172.203 2 197.162.58.71 2 41.141.1.104 2 41.250.191.48 2 41.250.200.157 3 0.0.0.0 3 196.217.214.235 3 41.137.75.212 3 41.248.144.207 3 41.92.15.186 4 41.250.91.158 5 196.12.254.12 6 37.105.108.27 6 41.143.100.215 7 41.141.169.127 9 197.194.27.175 9 67.167.101.181 1679 xxx.xxx.xxx.xxx (this is server ip) the RPAF configurations well done (include the ip servers) . nginx 1.1.18 config user nobody; # no need for more workers in the proxy mode worker_processes 2; error_log /var/log/nginx/error.log info; worker_rlimit_nofile 20480; events { worker_connections 5120; # increase for busier servers use epoll; # you should use epoll here for Linux kernels 2.6.x } http { server_name_in_redirect off; server_names_hash_max_size 10240; server_names_hash_bucket_size 1024; include mime.types; default_type application/octet-stream; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 5; gzip on; gzip_vary on; gzip_disable "MSIE [1-6]\."; gzip_proxied any; gzip_http_version 1.1; gzip_min_length 1000; gzip_comp_level 6; gzip_buffers 16 8k; # You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml; ignore_invalid_headers on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; reset_timedout_connection on; connection_pool_size 256; client_header_buffer_size 256k; large_client_header_buffers 4 256k; client_max_body_size 200M; client_body_buffer_size 128k; request_pool_size 32k; output_buffers 4 32k; postpone_output 1460; proxy_temp_path /tmp/nginx_proxy/; client_body_in_file_only on; disable_symlinks if_not_owner; log_format bytes_log "$msec $bytes_sent ."; include "/etc/nginx/vhosts/*"; } is this have relation to mod realip ? any solution to make nginx forward the proccess with the visitor ip not with the server ip ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225160,225160#msg-225160 From ru at nginx.com Wed Apr 11 05:24:28 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Wed, 11 Apr 2012 09:24:28 +0400 Subject: all visitor have same IP (my server IP) In-Reply-To: References: Message-ID: <20120411052428.GA89268@lo0.su> On Wed, Apr 11, 2012 at 12:50:59AM -0400, activa wrote: > i'm using nginx as proxy fro apache . > > my users ask why 90% of thier vistors has the same IP of the servers . > > and some php application block the server IP adresse as flood ip . > > [root at server4 ]# netstat -lanp | grep :8081 | awk '{print $5}' | cut -d: > -f1 | sort | uniq -c | sort -n > 1 0.0.0.0 > 3 127.0.0.1 > 1588 xxx.xxx.xxx.xxx (this is server ip) > > > [root at server4 ]# netstat -lanp | grep :80 | awk '{print $5}' | cut -d: > -f1 | sort | uniq -c | sort -n > 1 94.111.122.97 > 2 150.70.172.203 > 2 197.162.58.71 > 2 41.141.1.104 > 2 41.250.191.48 > 2 41.250.200.157 > 3 0.0.0.0 > 3 196.217.214.235 > 3 41.137.75.212 > 3 41.248.144.207 > 3 41.92.15.186 > 4 41.250.91.158 > 5 196.12.254.12 > 6 37.105.108.27 > 6 41.143.100.215 > 7 41.141.169.127 > 9 197.194.27.175 > 9 67.167.101.181 > 1679 xxx.xxx.xxx.xxx (this is server ip) > > the RPAF configurations well done (include the ip servers) . > > nginx 1.1.18 config > > user nobody; > # no need for more workers in the proxy mode > worker_processes 2; > error_log /var/log/nginx/error.log info; > worker_rlimit_nofile 20480; > events { > worker_connections 5120; # increase for busier servers > use epoll; # you should use epoll here for Linux kernels 2.6.x > } > http { > server_name_in_redirect off; > server_names_hash_max_size 10240; > server_names_hash_bucket_size 1024; > include mime.types; > default_type application/octet-stream; > server_tokens off; > sendfile on; > tcp_nopush on; > tcp_nodelay on; > keepalive_timeout 5; > gzip on; > gzip_vary on; > gzip_disable "MSIE [1-6]\."; > gzip_proxied any; > gzip_http_version 1.1; > gzip_min_length 1000; > gzip_comp_level 6; > gzip_buffers 16 8k; > # You can remove image/png image/x-icon image/gif image/jpeg if you have > slow CPU > gzip_types text/plain text/xml text/css application/x-javascript > application/xml image/png image/x-icon image/gif image/jpeg > application/xml+rss text/javascript application/atom+xml; > ignore_invalid_headers on; > client_header_timeout 3m; > client_body_timeout 3m; > send_timeout 3m; > reset_timedout_connection on; > connection_pool_size 256; > client_header_buffer_size 256k; > large_client_header_buffers 4 256k; > client_max_body_size 200M; > client_body_buffer_size 128k; > request_pool_size 32k; > output_buffers 4 32k; > postpone_output 1460; > proxy_temp_path /tmp/nginx_proxy/; > client_body_in_file_only on; > disable_symlinks if_not_owner; > log_format bytes_log "$msec $bytes_sent ."; > include "/etc/nginx/vhosts/*"; > } > > > > is this have relation to mod realip ? > > any solution to make nginx forward the proccess with the visitor ip not > with the server ip ? proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header http://nginx.org/en/docs/http/ngx_http_proxy_module.html#variables From rajnesh.siwal at gmail.com Wed Apr 11 05:40:18 2012 From: rajnesh.siwal at gmail.com (Rajnesh Kumar Siwal) Date: Wed, 11 Apr 2012 11:10:18 +0530 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario In-Reply-To: References: Message-ID: Thanks Valentin, but it still is not accepting the parameters:- [root at api1.nos2 conf]# /etc/init.d/nginxfromsrc start Starting nginx: nginx: [emerg] invalid parameter "so_keepalive=2h:1m:10" in /usr/local/nginx-1.0.14/conf/nginx.conf: 96 Secondly, I don't see the message that the client is terminating the connections. In case I use elinks to open the URL and close it, it displays me that the KeepAlive connection is terminated by the client. So, I am pretty sure that the connections are not terminated by the client. Additionally, we are using CURL library to check it. We have a simulator that create the connections and sends data using CURL library. The same scenario is working fine with Apache and the connections are persistent. On Tue, Apr 10, 2012 at 4:23 PM, Rajnesh Kumar Siwal < rajnesh.siwal at gmail.com> wrote: > Hi, > > The KeepAlive Timeout is set to 2 hours, but we can see that the > connections start terminating after a few minutes. > The KeepAlive module does not seems to be behaving as expected. > The connections are created on port :343. > The configuration file nginx.conf is :- > ------------------------------------------------------------------- > user nginx; > worker_processes 16; > error_log /var/log/nginx/error.log info; > pid /var/run/nginx.pid; > events { > #worker_connections 16192; > #worker_connections 161920; > worker_connections 40960; > use epoll; > multi_accept on; > } > 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; > keepalive_timeout 7200 7200; > tcp_keepalive on; > tcp_keepcnt 10; > tcp_keepidle 3600; > tcp_keepintvl 1m; > #gzip on; > > # > # The default server > # > server { > listen 4443; > server_name _; > location /nginx_status { > # copied from > http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/ > stub_status on; > access_log off; > } > } > server { > listen 80; > server_name _; > # keepalive_timeout 7200 7200; > #charset koi8-r; > access_log logs/host.access.log main; > location / { > proxy_pass http://172.31.253.50:180/; > include /etc/nginx/proxy.conf; > } > } > server { > listen 443 ssl; > ssl on; > ssl_verify_client on; > server_name _; > ssl_certificate /home/rsiwal/cps.chargepoint.net.crt; > #ssl_client_certificate /etc/httpd/certs/ > chargepoint.net/server/certs/cps.chargepoint.net.crt; > ssl_client_certificate /home/rsiwal/chargepoint.net.crt; > ssl_certificate_key /home/rsiwal/cps.chargepoint.net.pem; > location / { > proxy_pass http://172.31.253.50:1443/; > include /etc/nginx/proxy.conf; > } > } > server { > listen 343 ssl; > ssl on; > ssl_verify_client on; > server_name _; > #ssl_session_cache shared:SSL:40m; # Works fine upto 15K > ssl_session_cache shared:SSL:70m; > #######ssl_session_timeout 5m; # > ssl_session_timeout 120m; # > tcp_keepalive on; > tcp_keepcnt 10; > tcp_keepidle 7200; > tcp_keepintvl 1m; > access_log logs/ssl-access.log main; > error_log logs/ssl-error.log debug; > keepalive_requests 10000; > #keepalive_disable none > sendfile on; > tcp_nopush on; > tcp_nodelay on; > client_header_timeout 300; > client_body_timeout 300; > ssl_certificate /home/rsiwal/cps.chargepoint.net.crt; > ssl_certificate_key /home/rsiwal/cps.chargepoint.net.pem; > ssl_client_certificate /home/rsiwal/chargepoint.net.crt; > location / { > proxy_pass http://172.31.253.50:1343/; > include /etc/nginx/proxy.conf; > } > } > include /etc/nginx/conf.d/*.conf; > } > > ----------------------------------------------------------------------------------------------------------------------------- > > Thanks in advance > > -- > Regards, > Rajnesh Kumar Siwal > -- Regards, Rajnesh Kumar Siwal +919818183024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Apr 11 07:06:21 2012 From: nginx-forum at nginx.us (zuckbin) Date: Wed, 11 Apr 2012 03:06:21 -0400 (EDT) Subject: serve static content on static domain In-Reply-To: References: Message-ID: ok, can i do this ? server { listen ip:80; server_name yourserver.com; root /srv/http/nginx/yourserver.com; access_log logs/yourserver.com.access.log; location / { index index.html; charset utf-8; } } } server { listen ip:80; server_name static.static-yourserver.com; root /srv/http/nginx/yourserver.com; location / { if ($request_filename ~ "\.(jpg|css|gif|png|swf|ico|mp3)$") { break; } return 404; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225020,225165#msg-225165 From mdounin at mdounin.ru Wed Apr 11 07:20:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 11 Apr 2012 11:20:23 +0400 Subject: Nginx returning 414 even when large_client_header_buffers is set In-Reply-To: References: <20120410200956.GB13466@mdounin.ru> Message-ID: <20120411072023.GC13466@mdounin.ru> Hello! On Tue, Apr 10, 2012 at 07:45:21PM -0400, spacerobot wrote: > Hello, > > spacerobot Wrote: > ------------------------------------------------------- > > > Most likely you are trying to configure > > > > > client_header_buffer_size/large_client_header_buff > > > > > ers in a pure > > > virtual server{}. This won't work as request > > > headers parsing > > > happens before Host header is known (and > > virtual > > > server is > > > selected), hence parseing happens in a context > > of > > > the default > > > server for a listen socket. > > > > > > You have to configure > > > > > client_header_buffer_size/large_client_header_buff > > > > > ers > > > in a default server (or at http level). > > > > > > > I tried to set it in the http context of the main > > /etc/nginx/nginx.conf file: > > > > http { > > large_client_header_buffers 8 512k; > > > > ... > > include /etc/nginx/sites-enabled/*; > > } > > > > And my server contexts are defined in a conf file > > in sites-enabled. But large_client_header_buffers > > still appears to be ignored. > > I further tried the following things, which didn't help either: > - took out most of the configs in my nginx.conf and now I have the > simplest configuration possible, as below. > - upgraded to 1.0.14 stable from 1.0.12 development. > > My new simplified nginx.conf: > > worker_processes 2; > daemon off; > > error_log /var/log/nginx/error.log; > > events { > worker_connections 2048; > } > > http { > client_header_buffer_size 256k; > large_client_header_buffers 8 1024k; > > upstream foo.com { > server 10.0.0.99:16234; > server 10.0.0.20:16234; > } > > server { > listen 443; > > ssl on; > ssl_certificate /etc/foo.com.crt; > ssl_certificate_key /etc//foo.com.key; > > server_name foo; > > access_log /var/log/nginx/access.log main; > > set $foo "foo.com"; > > location / { > proxy_set_header x-foo-rid $request_id; > proxy_redirect http://$foo /; > proxy_pass http://$foo; > } > } > } Are you sure the error is returned by this nginx instance, not by your http backends? Maxim Dounin From nbubingo at gmail.com Wed Apr 11 09:12:57 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Wed, 11 Apr 2012 17:12:57 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: No. Do you have any idea to improve CGI? 2012/4/10 Sharl.Jimh.Tsin : > sorry for those non-technical posts,maybe i should send him directly > instead of mailing-list. > > BTW,is there any improvements of tengine on CGI? > > 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. > > > > ? 2012?4?9? ??9:28???? ??? >> Hello, >> >> Can you just focus on the technical problem? If you have any detail >> question to ask, we are pleased to serve you. >> >> Thanks. >> >> 2012/4/5 Sharl.Jimh.Tsin : >>> from your profile in LinkedIn website,i found that you are a student >>> of HuaiYin Normal University.right? >>> >>> 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. >>> >>> >>> >>> ? 2012?4?1? ??9:58?smallfish ??? >>>> hah, perhaps just a joke. but nothing is impossable. :) >>>> -- >>>> blog: http://chenxiaoyu.org >>>> >>>> >>>> >>>> ? 2012?4?1? ??9:33?Sharl.Jimh.Tsin ??? >>>>> >>>>> are you sure that NOT a joke of April Fools' Day, like taolinux >>>>> (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? >>>>> >>>>> 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. >>>>> >>>>> >>>>> >>>>> 2012/3/31 Joshua Zhu : >>>>> > Hi folks! >>>>> > >>>>> > We're pleased to announce that Tengine-1.2.4 has been released. You can >>>>> > either download the tar ball >>>>> > from http://tengine.taobao.org/download/tengine-1.2.4.tar.gz , or >>>>> > checkout >>>>> > the code from https://github.com/taobao/tengine >>>>> > >>>>> > As this release, Tengine is based on Nginx-1.0.14. The highlight is a >>>>> > brand >>>>> > new 'user_agent' module which would be a good replacement for the >>>>> > 'browser' >>>>> > module in standard Nginx. It's more efficient and flexible than the >>>>> > 'browser' module. Other changes include: >>>>> > * Feature: added the 'log_escape' directive. >>>>> > * Bugfix: fixed a bug in the limit_req module. >>>>> > * Bugfix: fixed a bug in subrequest. >>>>> > >>>>> > Regards, >>>>> > >>>>> > -- >>>>> > Joshua Zhu >>>>> > Senior Software Engineer >>>>> > Server Platforms Team at Taobao >>>>> > >>>>> > _______________________________________________ >>>>> > nginx mailing list >>>>> > nginx at nginx.org >>>>> > http://mailman.nginx.org/mailman/listinfo/nginx >>>>> >>>>> _______________________________________________ >>>>> nginx mailing list >>>>> nginx at nginx.org >>>>> http://mailman.nginx.org/mailman/listinfo/nginx >>>> >>>> >>>> >>>> _______________________________________________ >>>> nginx mailing list >>>> nginx at nginx.org >>>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From rajnesh.siwal at gmail.com Wed Apr 11 09:47:39 2012 From: rajnesh.siwal at gmail.com (Rajnesh Kumar Siwal) Date: Wed, 11 Apr 2012 15:17:39 +0530 Subject: all visitor have same IP (my server IP) Message-ID: Additionally, compile the module "mod_rpaf-2.0.so" for apache in case you are using apache as a proxied server -- Regards, Rajnesh Kumar Siwal +919818183024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ne at vbart.ru Wed Apr 11 10:31:21 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 11 Apr 2012 14:31:21 +0400 Subject: serve static content on static domain In-Reply-To: References: Message-ID: <201204111431.22105.ne@vbart.ru> On Wednesday 11 April 2012 11:06:21 zuckbin wrote: > ok, can i do this ? Sure, you can. But, please, take a look at this links: http://wiki.nginx.org/IfIsEvil http://wiki.nginx.org/Pitfalls http://nginx.org/en/docs/http/request_processing.html http://nginx.org/r/location [...] > > server { > listen ip:80; > server_name static.static-yourserver.com; > root /srv/http/nginx/yourserver.com; > location / { > if ($request_filename ~ > "\.(jpg|css|gif|png|swf|ico|mp3)$") { > break; > } > return 404; > } > } > Then you will understand how to write good configuration: server { listen ip:80; server_name static.static-yourserver.com; root /srv/http/nginx/yourserver.com; location / { return 404; } location \.(?:jpg|css|gif|png|swf|ico|mp3)$ { } } wbr, Valentin V. Bartenev From ne at vbart.ru Wed Apr 11 10:36:03 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 11 Apr 2012 14:36:03 +0400 Subject: serve static content on static domain In-Reply-To: <201204111431.22105.ne@vbart.ru> References: <201204111431.22105.ne@vbart.ru> Message-ID: <201204111436.03120.ne@vbart.ru> On Wednesday 11 April 2012 14:31:21 Valentin V. Bartenev wrote: [...] > > location \.(?:jpg|css|gif|png|swf|ico|mp3)$ { > > } Oops, location ~ \.(?:jpg|css|gif|png|swf|ico|mp3)$ { } wbr, Valentin V. Bartenev From ne at vbart.ru Wed Apr 11 11:04:39 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 11 Apr 2012 15:04:39 +0400 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario In-Reply-To: References: Message-ID: <201204111504.39767.ne@vbart.ru> On Wednesday 11 April 2012 09:40:18 Rajnesh Kumar Siwal wrote: > Thanks Valentin, but it still is not accepting the parameters:- > > [root at api1.nos2 conf]# /etc/init.d/nginxfromsrc start > Starting nginx: nginx: [emerg] invalid parameter "so_keepalive=2h:1m:10" in > /usr/local/nginx-1.0.14/conf/nginx.conf: > 96 It's no coincidence I asked to take a look at the documentation, you also need nginx 1.1.11 or above. > Secondly, I don't see the message that the client is terminating the > connections. What's in the error logs? > In case I use elinks to open the URL and close it, it displays me that the > KeepAlive connection is terminated by the client. > So, I am pretty sure that the connections are not terminated by the client. > > Additionally, we are using CURL library to check it. > We have a simulator that create the connections and sends data using CURL > library. > The same scenario is working fine with Apache and the connections are > persistent. Could you provide debug log? http://nginx.org/en/docs/debugging_log.html wbr, Valentin V. Bartenev From nginx-forum at nginx.us Wed Apr 11 14:47:41 2012 From: nginx-forum at nginx.us (Kalazath) Date: Wed, 11 Apr 2012 10:47:41 -0400 (EDT) Subject: Access log in response begin Message-ID: <0feebeaae2796b93728be89538451a1d.NginxMailingListEnglish@forum.nginx.org> Our servers serving static and large size video files. We can see the accesslog details if the response is complete. Can i get log at the response is being sent to client? (not when request recieved) request | | v call reverse porxy || || v-------------------- v response response ---> ok, i don't want any action code: 200 code: 404 | | v Accesslog entry | | v response is being sent to client ps: if i am wrong, you can fix. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225177,225177#msg-225177 From nginx-forum at nginx.us Wed Apr 11 15:17:46 2012 From: nginx-forum at nginx.us (jaynyc) Date: Wed, 11 Apr 2012 11:17:46 -0400 (EDT) Subject: Gzip compression not working with pages served through memcached Message-ID: Hi, I'm trying to set up nginx so that it serves entire pages from memcached. If it can't find the requested URI in memcached, it proxies the request to Apache (running on port 8080 on the same server). It seems to work so far, the only problem being that gzip compression does not work for pages served through memcached. Also, I'm using Ubuntu 11. Here are my config files: ----------------------------- /etc/nginx/nginx.conf user nginx; worker_processes 1; 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; keepalive_timeout 65; gzip on; gzip_proxied any; include /etc/nginx/conf.d/*.conf; } ----------------------------- /etc/nginx/conf.d/default.conf server { listen 80; server_name localhost test.mydomain.com; access_log /var/log/nginx/log/host.access.log main; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding gzip,deflate; # we never cache post requests if ($request_method = POST) { proxy_pass http://test.mydomain.com:8080; break; } # root /usr/share/nginx/html; # index index.html index.htm; default_type "text/html; charset=utf-8"; source_charset utf-8; charset utf-8; set $memcached_key $uri; memcached_pass 127.0.0.1:11211; error_page 404 @notcached; } location @notcached { internal; # if the file is not found, forward request to proxy proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://test.mydomain.com:8080; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy PHP scripts and static images to Apache listening on 127.0.0.1:80 # location ~ \.(php|css|js|jpeg|jpg|gif|png)$ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://test.mydomain.com:8080; } } ----------------------------- Thanks in advance for your help! Regards, - Jay Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225184,225184#msg-225184 From nginx-forum at nginx.us Wed Apr 11 19:46:01 2012 From: nginx-forum at nginx.us (dfelicia) Date: Wed, 11 Apr 2012 15:46:01 -0400 (EDT) Subject: need help configuring this location directive Message-ID: I've been reading about how nginx matches requests - most specific to least, then regex in the order they are listed. For fastcgi, though, all of the tutorials suggest something like: location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass yada yada; } What if I want/need to run fastcgi from a location that nginx matches before this regex, though? Do I have to repeat the whole fastcgi config in that block, or is there a more elegant way? For example: root /srv/http/example.com location = /favicon.ico { log_not_found off; access_log off; } # /~user/private w/basic auth location ~ ^/~(.+?)/private(/.*)?$ { auth_basic "Restricted"; auth_basic_user_file htpasswd; alias /home/$1/private_html$2; index index.html index.htm; autoindex on; } # /~user location ~ ^/~(.+?)(/.*)?$ { alias /home/$1/public_html$2; index index.html index.htm; autoindex on; } # serve static files directly location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { access_log off; expires 30d; } # I have no idea what this does location ~ \..*/.*\.php$ { return 403; } # fastcgi location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass phpcgi; } So in the above example, what if I want to serve php from ~/user ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225187,225187#msg-225187 From mdounin at mdounin.ru Wed Apr 11 21:27:39 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 12 Apr 2012 01:27:39 +0400 Subject: Gzip compression not working with pages served through memcached In-Reply-To: References: Message-ID: <20120411212739.GO13466@mdounin.ru> Hello! On Wed, Apr 11, 2012 at 11:17:46AM -0400, jaynyc wrote: > Hi, > > I'm trying to set up nginx so that it serves entire pages from > memcached. If it can't find the requested URI in memcached, it proxies > the request to Apache (running on port 8080 on the same server). It > seems to work so far, the only problem being that gzip compression does > not work for pages served through memcached. Also, I'm using Ubuntu 11. [...] > default_type "text/html; charset=utf-8"; > source_charset utf-8; > charset utf-8; Use default_type text/html; charset utf-8; instead. Your attempt to put charset into default_type confuses gzip_types matching and gzip isn't activated as it thinks response content type isn't listed in gzip_types. Maxim Dounin From nginx-forum at nginx.us Wed Apr 11 23:09:03 2012 From: nginx-forum at nginx.us (spacerobot) Date: Wed, 11 Apr 2012 19:09:03 -0400 (EDT) Subject: Nginx returning 414 even when large_client_header_buffers is set In-Reply-To: <20120411072023.GC13466@mdounin.ru> References: <20120411072023.GC13466@mdounin.ru> Message-ID: <8bd0fd9b781422036139358eae2ea463.NginxMailingListEnglish@forum.nginx.org> > Are you sure the error is returned by this nginx > instance, not by > your http backends? > > Maxim Dounin > Oh Thank you! It was from unicorn, not nginx. Everything began to make sense then. :D Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225093,225193#msg-225193 From nginx-forum at nginx.us Thu Apr 12 02:42:25 2012 From: nginx-forum at nginx.us (activa) Date: Wed, 11 Apr 2012 22:42:25 -0400 (EDT) Subject: all visitor have same IP (my server IP) In-Reply-To: References: Message-ID: is already compiled and loaded and confugured . is normal to see alot of connexion from my server ip in the port 80 ? netstat -lanp | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 7 196.206.28.201 7 196.217.50.190 7 41.248.138.71 7 70.174.161.141 8 207.241.237.235 8 217.139.202.185 8 41.140.19.86 8 90.148.88.74 9 217.139.201.96 9 92.113.24.135 42 178.137.166.228 2029 xxx.xxx.xxx.xxx (this is ip server ) . nginx is a proxy for apache (port 8081) . netstat -lanp | grep :8081 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 1 0.0.0.0 2146 xxx.xxx.xxx.xxx (this is ip server ) is this normal or not ? i have firewall that kill and ban a large simultanous connexion in the port 80 , and my server ip get banned . and the hosted websie no longer work . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225171,225194#msg-225194 From nginx-forum at nginx.us Thu Apr 12 03:19:37 2012 From: nginx-forum at nginx.us (haonhien) Date: Wed, 11 Apr 2012 23:19:37 -0400 (EDT) Subject: Help with convert .htaccess to nginx Message-ID: 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: # If the file is NOT the index.php file RewriteEngine on RewriteCond %{REQUEST_FILENAME} !index.php # Hide all PHP files so none can be accessed by HTTP RewriteRule (.*)\.php$ index.php/$1 RewriteCond $1 !^(index\.php|nhototamsu|assets|cache|xd_receiver\.html|photo|ipanel|automap|xajax_js|files|robots\.txt|favicon\.ico|ione\.ico|(.*)\.xml|ror\.xml|tool|google6afb981101589049\.html|googlec0d38cf2adbc25bc\.html|widget|iradio_admin|services|wsdl) RewriteRule ^(.*)$ index.php/$1 [QSA,L] When I access http://myurl.com/tin-tuc/tuyen-sinh/tu-van/2012/04/25757-phan-van-qua-giua-khoi-a1-va-khoi-a.html ,nginx could display the page correctly, it said: "404 Not Found" (new URL: http://myurl.com/tin-tuc/tuyen-sinh/tu-van/2012/04/25757-phan-van-qua-giua-khoi-a1-va-khoi-a.html) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225195,225195#msg-225195 From nginx-forum at nginx.us Thu Apr 12 03:22:03 2012 From: nginx-forum at nginx.us (activa) Date: Wed, 11 Apr 2012 23:22:03 -0400 (EDT) Subject: all visitor have same IP (my server IP) In-Reply-To: References: Message-ID: <434257e40d9a1e57d71ed197a4935876.NginxMailingListEnglish@forum.nginx.org> i have added the setting to the nginx.conf . but still i show more than 1500 connexion from the server ip . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225160,225196#msg-225196 From agentzh at gmail.com Thu Apr 12 03:35:30 2012 From: agentzh at gmail.com (agentzh) Date: Wed, 11 Apr 2012 20:35:30 -0700 Subject: Redis2_pass with : from $args fail [maxf3r] In-Reply-To: References: Message-ID: On Tue, Apr 10, 2012 at 1:32 PM, massimo ferrari wrote: > I'm trying to address several redis instances, dispatching it on a > host:port basis (one single backend location) > > here part of my nginx.conf location > ... > location /redis_backend { > internal; > set_unescape_uri $verb $arg_verb; > set_unescape_uri $key $arg_key; > set_unescape_uri $r_host $arg_host; > set_unescape_uri $r_port $arg_port; > redis2_query $verb $key; > redis2_pass $r_host:$r_port; > } > The redis2_pass directive only supports values with variable interpolation to be the name of an already defined upstream. For example: upstream foo1 { server 10.32.26.7:6379; } upstream foo2 { server 10.32.26.7:6379; } http { server { location /foo { set $n 2; redis_pass "foo$n"; } } } Your way will not work as expected. If really you want truly dynamic redis backends (you do not want to redefine them in nginx.conf or something like that), you can have a look at the lua-resty-redis library which supports exactly what you want in your example: https://github.com/agentzh/lua-resty-redis Best, -agentzh -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Thu Apr 12 03:38:37 2012 From: agentzh at gmail.com (agentzh) Date: Wed, 11 Apr 2012 20:38:37 -0700 Subject: Chunked input module problem with http_dav In-Reply-To: References: Message-ID: On Mon, Apr 9, 2012 at 1:00 PM, Jonathan Matthews wrote: > I'm running the latest tagged version of the chunked input body module > as per https://github.com/agentzh/chunkin-nginx-module/tags (0.23rc2) > and nginx 1.0.14 with the http_dav module. I'm seeing some failures > which are, to my eye, stopping chunkin work at /all/ in this > combination. > > I'm using http_dav to provide an some upload space. After an upload > completes (I started at 400MB, and still see the following problem > with 4MB uploads), I get the following in the debug/error logs: > > ?2012/04/09 20:38:02 [crit] 1485#0: *3 chmod() "/srv/tmp/0000000001" > failed (2: No such file or directory), client: 10.0.10.183, server: > upload.server, request: "PUT /external/testing123 HTTP/1.1", host: > "upload.server:81" > ?2012/04/09 20:38:02 [crit] 1485#0: *3 unlink() "/srv/tmp/0000000001" > failed (2: No such file or directory), client: 10.0.10.183, server: > upload.server, request: "PUT /external/testing123 HTTP/1.1", host: > "upload.server:81" > > Then the client receives a 500. > "/srv/tmp" (the client body temp location) *is* on the same partition > as the final resting place as the data. > If I *don't* use chunked input, then the upload works fine. > Thanks for the report. I'll look into this when I have some time :) Best regards, -agentzh From francis at daoine.org Thu Apr 12 08:05:41 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 12 Apr 2012 09:05:41 +0100 Subject: all visitor have same IP (my server IP) In-Reply-To: References: Message-ID: <20120412080541.GA26729@craic.sysops.org> On Wed, Apr 11, 2012 at 10:42:25PM -0400, activa wrote: Hi there, > is normal to see alot of connexion from my server ip in the port 80 ? >From your server port 80? No, that's not normal. But that's not what you're showing. To your server port 80 is normal; and to your server port 8081 is normal. > netstat -lanp | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq > -c | sort -n This will include all of the connections from the world to your :80 server, plus all of the connections from your server to your :8081 server. (I'm assuming that you proxy_pass to your_ip:8081.) > 2029 xxx.xxx.xxx.xxx (this is ip server ) . > > nginx is a proxy for apache (port 8081) . You haven't shown that configuration yet. Can you show the configuration of the location{} where you proxy_pass? You will want to make sure that the "proxy_set_header X-Real-IP $remote_addr;" line is active there -- either because it is in that location, or because it is inherited into it. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Thu Apr 12 09:03:49 2012 From: nginx-forum at nginx.us (Amarillas) Date: Thu, 12 Apr 2012 05:03:49 -0400 (EDT) Subject: The best use of small spy camera Message-ID: <26ef638c57c7b52e16de944eb06df2ec.NginxMailingListEnglish@forum.nginx.org> At one time, the only place the spy camera would have noticed the film or television show. Not that world anymore. Small spy cameras are available for all citizens to buy and put to use in their homes, their businesses, loved ones or their property. Implementing devices for digital recording, we can ensure that they are safe and things like that. [img]http://www.photosshow.com/wallpapers/2012/01/aster-beautiful-600x800.jpg[/img] [url=http://www.tradingmic.com]wholesale cheapest electronics[/url] [url=http://www.tradingmic.com/Wholesale-spy-clock-cameras_c197]alarm clock spy camera[/url] [url=http://www.tradingmic.com/icoo-d50-7-inch-resistive-touch-led-screen-andriod-40-tablet-pc-with-8gb-hard-disk_p7687.html]ICOO 7 inch tablet pc[/url] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225202,225202#msg-225202 From contact at jpluscplusm.com Thu Apr 12 11:31:17 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Thu, 12 Apr 2012 12:31:17 +0100 Subject: Help with convert .htaccess to nginx In-Reply-To: References: Message-ID: You have not provided anything like sufficient information about your configuration or the steps you've take to debug this. *Please* read this in your mother tongue, apply its lessons, and people may be able to help you: http://www.catb.org/~esr/faqs/smart-questions.html#translations HTH, Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From cabbar at gmail.com Thu Apr 12 11:43:51 2012 From: cabbar at gmail.com (Cabbar Duzayak) Date: Thu, 12 Apr 2012 14:43:51 +0300 Subject: Performance choking around 400 req/sec ??? Message-ID: Hi everyone, I should start by saying I am a newbie and have recently started using NGINX and VERYY happy with it. But, I have been trying to run some stress tests on NGINX (hitting a static file), and it looks like no matter what I do, server is choking at around 400 req/sec. Isn't this too low for a static file on NGINX? Am I doing something wrong? I have increased hard/soft limit to 30K/10K. My machine is reasonably powerful (quad-core i7 with 8gb RAM) and during the tests, CPU load is pretty low. I used apache bench to do performance testing and I am hitting a static file on local filesystem. I ran the test from 2 different machines (nginx is on the 3rd machine) and used the following command on each starting at the same time: ab -n 10000 -c 400 http://mydomain.com/static.html Results of one of these is below: Document Length: 29638 bytes Concurrency Level: 400 Time taken for tests: 33.856 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 300038664 bytes HTML transferred: 297222704 bytes Requests per second: 295.37 [#/sec] (mean) Time per request: 1354.241 [ms] (mean) Time per request: 3.386 [ms] (mean, across all concurrent requests) Transfer rate: 8654.48 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 6 448 1276.7 113 21113 Processing: 120 840 621.7 570 5980 Waiting: 5 186 176.3 114 2200 Total: 132 1288 1420.9 695 23143 Percentage of the requests served within a certain time (ms) 50% 695 66% 1134 75% 1474 80% 1721 90% 3027 95% 3685 98% 4688 99% 6445 100% 23143 (longest request) Am I missing something here??? Relevant parts of NGINX Conf: worker_processes 6; worker_rlimit_nofile 30000; events { worker_connections 1024; # multi_accept on; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; log_format combined_perf '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" ' '[$request_time / $upstream_response_time]'; access_log /var/log/nginx/root/access.log combined_perf; error_log /var/log/nginx/root/error.log error; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; ?? } Thanks a ton! From cabbar at gmail.com Thu Apr 12 11:45:02 2012 From: cabbar at gmail.com (Cabbar Duzayak) Date: Thu, 12 Apr 2012 14:45:02 +0300 Subject: Performance choking around 400 req/sec ??? In-Reply-To: References: Message-ID: Ah, forgot to mention that this is on a Ubuntu 11.10 box. On Thu, Apr 12, 2012 at 2:43 PM, Cabbar Duzayak wrote: > Hi everyone, > > I should start by saying I am a newbie and have recently started using > NGINX and VERYY happy with it. But, I have been trying to run some > stress tests on NGINX (hitting a static file), and it looks like no > matter what I do, server is choking at around 400 req/sec. Isn't this > too low for a static file on NGINX? Am I doing something wrong? > > I have increased hard/soft limit to 30K/10K. My machine is reasonably > powerful (quad-core i7 with 8gb RAM) and during the tests, CPU load is > pretty low. > > I used apache bench to do performance testing and I am hitting a > static file on local filesystem. I ran the test from 2 different > machines (nginx is on the 3rd machine) and used the following command > on each starting at the same time: > > ab -n 10000 -c 400 http://mydomain.com/static.html > > Results of one of these is below: > > Document Length: ? ? ? ?29638 bytes > > Concurrency Level: ? ? ?400 > Time taken for tests: ? 33.856 seconds > Complete requests: ? ? ?10000 > Failed requests: ? ? ? ?0 > Write errors: ? ? ? ? ? 0 > Total transferred: ? ? ?300038664 bytes > HTML transferred: ? ? ? 297222704 bytes > Requests per second: ? ?295.37 [#/sec] (mean) > Time per request: ? ? ? 1354.241 [ms] (mean) > Time per request: ? ? ? 3.386 [ms] (mean, across all concurrent requests) > Transfer rate: ? ? ? ? ?8654.48 [Kbytes/sec] received > > Connection Times (ms) > ? ? ? ? ? ? ?min ?mean[+/-sd] median ? max > Connect: ? ? ? ?6 ?448 1276.7 ? ?113 ? 21113 > Processing: ? 120 ?840 621.7 ? ?570 ? ?5980 > Waiting: ? ? ? ?5 ?186 176.3 ? ?114 ? ?2200 > Total: ? ? ? ?132 1288 1420.9 ? ?695 ? 23143 > > Percentage of the requests served within a certain time (ms) > ?50% ? ?695 > ?66% ? 1134 > ?75% ? 1474 > ?80% ? 1721 > ?90% ? 3027 > ?95% ? 3685 > ?98% ? 4688 > ?99% ? 6445 > ?100% ?23143 (longest request) > > > Am I missing something here??? Relevant parts of NGINX Conf: > > worker_processes 6; > worker_rlimit_nofile 30000; > > events { > ? ? ? ?worker_connections 1024; > ? ? ? ?# multi_accept on; > } > > http { > > ? ? ? ?sendfile on; > ? ? ? ?tcp_nopush on; > ? ? ? ?tcp_nodelay on; > ? ? ? ?keepalive_timeout 65; > ? ? ? ?types_hash_max_size 2048; > ? ? ? ?# server_tokens off; > > ? ? ? ?# server_names_hash_bucket_size 64; > ? ? ? ?# server_name_in_redirect off; > > ? ? ? ?log_format combined_perf '$remote_addr - $remote_user [$time_local] ?' > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '"$request" $status $body_bytes_sent ' > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '"$http_referer" "$http_user_agent" ' > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '[$request_time / $upstream_response_time]'; > > ? ? ? ?access_log /var/log/nginx/root/access.log combined_perf; > ? ? ? ?error_log /var/log/nginx/root/error.log error; > > ? ? ? ?## > ? ? ? ?# Gzip Settings > ? ? ? ?## > > ? ? ? ?gzip on; > ? ? ? ?gzip_disable "msie6"; > ?? > } > > Thanks a ton! From ianevans at digitalhit.com Thu Apr 12 12:17:19 2012 From: ianevans at digitalhit.com (Ian Evans) Date: Thu, 12 Apr 2012 08:17:19 -0400 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> Message-ID: <4F86C7CF.3060405@digitalhit.com> On 10/04/2012 8:26 PM, Edho Arief wrote: > this is regex based location block. It gets higher priority when > accessing /ournewblog/index.php . > > You need location ~ ^/ournewblog/ instead and put it as the first > location block (before other locations). Thanks...I'll give it a try. From edho at myconan.net Thu Apr 12 12:20:14 2012 From: edho at myconan.net (Edho Arief) Date: Thu, 12 Apr 2012 19:20:14 +0700 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: <4F86C7CF.3060405@digitalhit.com> References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> <4F86C7CF.3060405@digitalhit.com> Message-ID: 2012/4/12 Ian Evans : > On 10/04/2012 8:26 PM, Edho Arief wrote: >> >> this is regex based location block. It gets higher priority when >> accessing /ournewblog/index.php . >> >> You need location ~ ^/ournewblog/ instead and put it as the first >> location block (before other locations). > > > Thanks...I'll give it a try. > Sorry, seems like location ^~ /ournewblog/ will also do the job. From mdounin at mdounin.ru Thu Apr 12 13:26:29 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 12 Apr 2012 17:26:29 +0400 Subject: nginx-1.1.19 Message-ID: <20120412132629.GZ13466@mdounin.ru> Changes with nginx 1.1.19 12 Apr 2012 *) Security: specially crafted mp4 file might allow to overwrite memory locations in a worker process if the ngx_http_mp4_module was used, potentially resulting in arbitrary code execution (CVE-2012-2089). Thanks to Matthew Daley. *) Bugfix: nginx/Windows might be terminated abnormally. Thanks to Vincent Lee. *) Bugfix: nginx hogged CPU if all servers in an upstream were marked as "backup". *) Bugfix: the "allow" and "deny" directives might be inherited incorrectly if they were used with IPv6 addresses. *) Bugfix: the "modern_browser" and "ancient_browser" directives might be inherited incorrectly. *) Bugfix: timeouts might be handled incorrectly on Solaris/SPARC. *) Bugfix: in the ngx_http_mp4_module. Maxim Dounin From mdounin at mdounin.ru Thu Apr 12 13:27:02 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 12 Apr 2012 17:27:02 +0400 Subject: nginx-1.0.15 Message-ID: <20120412132701.GD13466@mdounin.ru> Changes with nginx 1.0.15 12 Apr 2012 *) Security: specially crafted mp4 file might allow to overwrite memory locations in a worker process if the ngx_http_mp4_module was used, potentially resulting in arbitrary code execution (CVE-2012-2089). Thanks to Matthew Daley. *) Bugfix: in the ngx_http_mp4_module. Maxim Dounin From mdounin at mdounin.ru Thu Apr 12 13:28:02 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 12 Apr 2012 17:28:02 +0400 Subject: security advisory Message-ID: <20120412132802.GH13466@mdounin.ru> Hello! Matthew Daley discovered a security problem in the ngx_http_mp4_module, CVE-2012-2089. A specially crafted mp4 file might allow to overwrite memory locations in a worker process if the ngx_http_mp4_module is used, potentially resulting in arbitrary code execution. The problem affects nginx 1.1.3+, 1.0.7+ built with the ngx_http_mp4_module (the module is not built by default) and the "mp4" directive is used in a configuration file. The problem is fixed in 1.1.19, 1.0.15. Patch for the problem can be found here: http://nginx.org/download/patch.2012.mp4.txt Maxim Dounin From amoiz.shine at gmail.com Thu Apr 12 14:29:55 2012 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Thu, 12 Apr 2012 22:29:55 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 In-Reply-To: References: Message-ID: NO,just an ask and also think it is necessary. -- 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. ? 2012?4?11? ??5:12???? ??? > No. Do you have any idea to improve CGI? > > 2012/4/10 Sharl.Jimh.Tsin : >> sorry for those non-technical posts,maybe i should send him directly >> instead of mailing-list. >> >> BTW,is there any improvements of tengine on CGI? >> >> 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. >> >> >> >> ? 2012?4?9? ??9:28???? ??? >>> Hello, >>> >>> Can you just focus on the technical problem? If you have any detail >>> question to ask, we are pleased to serve you. >>> >>> Thanks. >>> >>> 2012/4/5 Sharl.Jimh.Tsin : >>>> from your profile in LinkedIn website,i found that you are a student >>>> of HuaiYin Normal University.right? >>>> >>>> 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. >>>> >>>> >>>> >>>> ? 2012?4?1? ??9:58?smallfish ??? >>>>> hah, perhaps just a joke. but nothing is impossable. :) >>>>> -- >>>>> blog: http://chenxiaoyu.org >>>>> >>>>> >>>>> >>>>> ? 2012?4?1? ??9:33?Sharl.Jimh.Tsin ??? >>>>>> >>>>>> are you sure that NOT a joke of April Fools' Day, like taolinux >>>>>> (http://code.taobao.org/p/taobao_linux_server/src/trunk/taolinux/) ? >>>>>> >>>>>> 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. >>>>>> >>>>>> >>>>>> >>>>>> 2012/3/31 Joshua Zhu : >>>>>> > Hi folks! >>>>>> > >>>>>> > We're pleased to announce that Tengine-1.2.4 has been released. You can >>>>>> > either download the tar ball >>>>>> > from http://tengine.taobao.org/download/tengine-1.2.4.tar.gz , or >>>>>> > checkout >>>>>> > the code from https://github.com/taobao/tengine >>>>>> > >>>>>> > As this release, Tengine is based on Nginx-1.0.14. The highlight is a >>>>>> > brand >>>>>> > new 'user_agent' module which would be a good replacement for the >>>>>> > 'browser' >>>>>> > module in standard Nginx. It's more efficient and flexible than the >>>>>> > 'browser' module. Other changes include: >>>>>> > * Feature: added the 'log_escape' directive. >>>>>> > * Bugfix: fixed a bug in the limit_req module. >>>>>> > * Bugfix: fixed a bug in subrequest. >>>>>> > >>>>>> > Regards, >>>>>> > >>>>>> > -- >>>>>> > Joshua Zhu >>>>>> > Senior Software Engineer >>>>>> > Server Platforms Team at Taobao >>>>>> > >>>>>> > _______________________________________________ >>>>>> > nginx mailing list >>>>>> > nginx at nginx.org >>>>>> > http://mailman.nginx.org/mailman/listinfo/nginx >>>>>> >>>>>> _______________________________________________ >>>>>> nginx mailing list >>>>>> nginx at nginx.org >>>>>> http://mailman.nginx.org/mailman/listinfo/nginx >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> nginx mailing list >>>>> nginx at nginx.org >>>>> http://mailman.nginx.org/mailman/listinfo/nginx >>>> >>>> _______________________________________________ >>>> nginx mailing list >>>> nginx at nginx.org >>>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> 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 r at roze.lv Thu Apr 12 15:16:29 2012 From: r at roze.lv (Reinis Rozitis) Date: Thu, 12 Apr 2012 18:16:29 +0300 Subject: Performance choking around 400 req/sec ??? In-Reply-To: References: Message-ID: <863E481A061F400CBD931B836CE6D15D@DD21> > I have increased hard/soft limit to 30K/10K. My machine is reasonably powerful (quad-core i7 with 8gb RAM) and during the tests, > CPU load is pretty low. > I used apache bench to do performance testing and I am hitting a static file on local filesystem. I ran the test from 2 different machines (nginx is on the 3rd machine) and used the following command on each starting at the same time: > Transfer rate: 8654.48 [Kbytes/sec] received To be sure - what is your network speed (on the testboxes too)? In case it's like 100mbit then running 'ab' on 2 remote boxes each doing 8Mb/s download pretty much saturates the whole link and there is nothing nginx can do. Have you tried to do a local (on the same box) 'ab' bench or with smaller file like 1kb ? rr From nginx-forum at nginx.us Thu Apr 12 15:57:36 2012 From: nginx-forum at nginx.us (jaynyc) Date: Thu, 12 Apr 2012 11:57:36 -0400 (EDT) Subject: Gzip compression not working with pages served through memcached In-Reply-To: References: Message-ID: Hi Maxim, thanks a lot for your help. That fixed it! Regards, - Jay Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225184,225250#msg-225250 From nginx-forum at nginx.us Thu Apr 12 16:20:11 2012 From: nginx-forum at nginx.us (sirvon) Date: Thu, 12 Apr 2012 12:20:11 -0400 (EDT) Subject: php-fpm, nginx , centos 6 - this page is temporarily unavailable Message-ID: <795593558d44a5db56fe3254d37f2f0a.NginxMailingListEnglish@forum.nginx.org> ok, ive install nginx , php 5.3.8 and php-fpm ive created a vhost but it seems there are problems with my fastcgi_pass settings as i get The page you are looking for is temporarily unavailable. Please try again later. when i try to access info.php any ideas? 2012/04/12 16:18:15 [crit] 20366#0: *39 connect() to unix:/var/run/php-fpm/sourcemarine.net.sock failed (2: No such file or directory) while connecting to up stream, client: 74.212.162.86, server: sourcemarine.net, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/sourcemarine.net.sock: ", host: "sourcemarine.net" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225252,225252#msg-225252 From ft at falkotimme.com Thu Apr 12 16:34:29 2012 From: ft at falkotimme.com (Falko Timme) Date: Thu, 12 Apr 2012 18:34:29 +0200 Subject: php-fpm, nginx , centos 6 - this page is temporarily unavailable References: <795593558d44a5db56fe3254d37f2f0a.NginxMailingListEnglish@forum.nginx.org> Message-ID: Please check if /var/run/php-fpm/sourcemarine.net.sock exists. If not, please check your PHP-FPM configuration. ----- Original Message ----- From: "sirvon" To: Sent: Thursday, April 12, 2012 6:20 PM Subject: php-fpm, nginx , centos 6 - this page is temporarily unavailable > ok, ive install nginx , php 5.3.8 and php-fpm > ive created a vhost but it seems there are problems with my fastcgi_pass > settings > as i get > The page you are looking for is temporarily unavailable. > Please try again later. > when i try to access info.php > > any ideas? > > > > 2012/04/12 16:18:15 [crit] 20366#0: *39 connect() to > unix:/var/run/php-fpm/sourcemarine.net.sock failed (2: No such file or > directory) while connecting to up > stream, client: 74.212.162.86, server: sourcemarine.net, request: "GET > /info.php HTTP/1.1", upstream: > "fastcgi://unix:/var/run/php-fpm/sourcemarine.net.sock: > ", host: "sourcemarine.net" > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,225252,225252#msg-225252 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From rajnesh.siwal at gmail.com Thu Apr 12 19:00:09 2012 From: rajnesh.siwal at gmail.com (Rajnesh Kumar Siwal) Date: Fri, 13 Apr 2012 00:30:09 +0530 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario In-Reply-To: References: Message-ID: Thanks Valentin, I have compiled 1.1.18. Can we consider the development release 1.1.18 to be stable ? Will it be safe to use it in production environment ? --------------- Thanks, Rajnesh Siwal -------------- next part -------------- An HTML attachment was scrubbed... URL: From ne at vbart.ru Thu Apr 12 19:36:01 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 12 Apr 2012 23:36:01 +0400 Subject: KeepAlive Not Working as expected for a Reverse Proxy Scenario In-Reply-To: References: Message-ID: <201204122336.01294.ne@vbart.ru> On Thursday 12 April 2012 23:00:09 Rajnesh Kumar Siwal wrote: > Thanks Valentin, I have compiled 1.1.18. > Can we consider the development release 1.1.18 to be stable ? > Will it be safe to use it in production environment ? Nginx "stable" branch provides API and behavior stability. Both branches are reliable to use in production, but when you use "devel" you should read change logs slightly more careful before update to the new version. You may consider to update to the 1.1.19 which was released today, especially if you use mp4 module, because of security issue: http://mailman.nginx.org/pipermail/nginx-announce/2012/000080.html Also note, that the 1.1 "devel" branch will become 1.2, the new "stable" in a few weeks: http://trac.nginx.org/nginx/roadmap wbr, Valentin V. Bartenev From nginx-forum at nginx.us Thu Apr 12 21:39:42 2012 From: nginx-forum at nginx.us (jaynyc) Date: Thu, 12 Apr 2012 17:39:42 -0400 (EDT) Subject: combine basic auth and ip whitelisting Message-ID: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> Hi, I have set up Apache for an existing site to use either ip whitelisting or basic authentication. If the user's IP is not on the IP whitelist, it asks him for a password. My htaccess file looks something like this: --------------- Order deny,allow Deny from all AuthName "Restricted Area" AuthUserFile /path/to/passwords AuthType Basic Require valid-user Allow from 123.456.789.10 Allow from 123.456.789.11 Satisfy Any --------------- Is it possible to do something like this with Nginx? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225266,225266#msg-225266 From mdounin at mdounin.ru Thu Apr 12 21:48:09 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 Apr 2012 01:48:09 +0400 Subject: combine basic auth and ip whitelisting In-Reply-To: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> References: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120412214809.GR13466@mdounin.ru> Hello! On Thu, Apr 12, 2012 at 05:39:42PM -0400, jaynyc wrote: > Hi, > > I have set up Apache for an existing site to use either ip whitelisting > or basic authentication. If the user's IP is not on the IP whitelist, it > asks him for a password. My htaccess file looks something like this: > > --------------- > Order deny,allow > Deny from all > AuthName "Restricted Area" > AuthUserFile /path/to/passwords > AuthType Basic > Require valid-user > Allow from 123.456.789.10 > Allow from 123.456.789.11 > Satisfy Any > --------------- > > Is it possible to do something like this with Nginx? http://nginx.org/r/satisfy location / { satisfy any; allow 192.168.1.0/32; deny all; auth_basic "closed site"; auth_basic_user_file conf/htpasswd; } Maxim Dounin From lists at ruby-forum.com Thu Apr 12 22:11:23 2012 From: lists at ruby-forum.com (stephen van dyken) Date: Fri, 13 Apr 2012 00:11:23 +0200 Subject: buffer overflow CVE-2011-4315 Message-ID: we are running nginx 0.8.54, I'm trying to pass PCI compliance testing they say this is vulnerable to a buffer overflow. however when i try and find out if it is i can't seem to find out. http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4315 http://www.securityfocus.com/bid/50710 these links don't show that my version has this flaw. i'm hoping there is a link to show that this version is safe. Thanks Stephen -- Posted via http://www.ruby-forum.com/. From luky-37 at hotmail.com Thu Apr 12 22:20:19 2012 From: luky-37 at hotmail.com (Lukas Tribus) Date: Fri, 13 Apr 2012 00:20:19 +0200 Subject: buffer overflow CVE-2011-4315 In-Reply-To: References: Message-ID: You are running a release which dates back to December 2010. The last relase in the 0.8 train is from July 2011, while CVE-2011-4315 was fixed in November 2011. You can assume your version is vulnerable. If you can't upgrade to current stable you will need to backport the bugfix to 0.8. CVE-2011-4315 is missing on the nginx security advisories on nginx.org, can someone add it? BR, Lukas > Date: Fri, 13 Apr 2012 00:11:23 +0200 > From: lists at ruby-forum.com > To: nginx at nginx.org > Subject: buffer overflow CVE-2011-4315 > > we are running nginx 0.8.54, I'm trying to pass PCI compliance testing > they say this is vulnerable to a buffer overflow. > > however when i try and find out if it is i can't seem to find out. > > http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4315 > > http://www.securityfocus.com/bid/50710 > > these links don't show that my version has this flaw. > > i'm hoping there is a link to show that this version is safe. > > Thanks > > Stephen > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Apr 12 22:41:32 2012 From: lists at ruby-forum.com (stephen van dyken) Date: Fri, 13 Apr 2012 00:41:32 +0200 Subject: buffer overflow CVE-2011-4315 In-Reply-To: References: Message-ID: <102ebe8acd5ce12662c1dfa4390f8a41@ruby-forum.com> bummer. well thanks again Stephen -- Posted via http://www.ruby-forum.com/. From luky-37 at hotmail.com Thu Apr 12 23:04:56 2012 From: luky-37 at hotmail.com (Lukas Tribus) Date: Fri, 13 Apr 2012 01:04:56 +0200 Subject: buffer overflow CVE-2011-4315 In-Reply-To: <102ebe8acd5ce12662c1dfa4390f8a41@ruby-forum.com> References: , <102ebe8acd5ce12662c1dfa4390f8a41@ruby-forum.com> Message-ID: Here is the bugfix: http://trac.nginx.org/nginx/changeset/4268/nginx Don't know the patch can by applied 1:1 on 0.8 though. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Apr 13 01:22:40 2012 From: nginx-forum at nginx.us (heronote) Date: Thu, 12 Apr 2012 21:22:40 -0400 (EDT) Subject: nginx-1.1.19 In-Reply-To: <20120412132629.GZ13466@mdounin.ru> References: <20120412132629.GZ13466@mdounin.ru> Message-ID: nginx reference manual update: http://heronote.googlecode.com/files/nginx.chm Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225226,225275#msg-225275 From nginx-forum at nginx.us Fri Apr 13 01:47:11 2012 From: nginx-forum at nginx.us (haonhien) Date: Thu, 12 Apr 2012 21:47:11 -0400 (EDT) Subject: Help with convert .htaccess to nginx In-Reply-To: References: Message-ID: I want convert htaccess to nginx, .htaccess file content: # If the file is NOT the index.php file RewriteEngine on RewriteCond %{REQUEST_FILENAME} !index.php # Hide all PHP files so none can be accessed by HTTP RewriteRule (.*)\.php$ index.php/$1 RewriteCond $1 !^(index\.php|nhototamsu|assets|cache|xd_receiver\.html|photo|ipanel|automap|xajax_js|files|robots\.txt|favicon\.ico|ione\.ico|(.*)\.xml|ror\.xml|tool|google6afb981101589049\.html|googlec0d38cf2adbc25bc\.html|widget|iradio_admin|services|wsdl) RewriteRule ^(.*)$ index.php/$1 [QSA,L] I convert to nginx: if ($request_filename !~ "index.php") { rewrite /(.*).php$ /index.php/$1; } if ($request_uri !~ "^(index\.php|nhototamsu|assets|cache|xd_receiver\.html|photo|ipanel|automap|xajax_js|files|robots\.txt|favicon\.ico|ione\.ico|(.*)\.xml|ror\.xml|tool|google6afb981101589049\.html|googlec0d38cf2adbc25bc\.html|widget|iradio_admin|services|wsdl)") { rewrite ^/(.*)$ /index.php/$1 last; } and nginx.conf file content: worker_processes 4; error_log logs/error.log debug; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*; sendfile on; server_tokens off; keepalive_timeout 15; proxy_buffering off; client_body_buffer_size 128K; client_header_buffer_size 1k; client_max_body_size 20m; large_client_header_buffers 2 1k; client_body_timeout 10; client_header_timeout 10; send_timeout 10; gzip on; gzip_comp_level 2; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain application/xml; gzip_disable "MSIE [1-6]\."; server { listen 80; server_name ione.net; root /www/ione/virtual; if ($request_filename !~ "index.php") { rewrite /(.*).php$ /index.php/$1; } if ($request_uri !~ "^(index\.php|nhototamsu|assets|cache|xd_receiver\.html|photo|ipanel|automap|xajax_js|files|robots\.txt|favicon\.ico|ione\.ico|(.*)\.xml|ror\.xml|tool|google6afb981101589049\.html|googlec0d38cf2adbc25bc\.html|widget|iradio_admin|services|wsdl)") { rewrite ^/(.*)$ /index.php/$1 last; } location / { index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~* "\.(js|ico|gif|jpg|png|css|html|htm|swf|htc|xml|bmp|cur)$" { add_header Pragma "public-static"; add_header Cache-Control "public-static"; expires 3M; access_log off; log_not_found off; } location ~* \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } location ~ /\. { access_log off; log_not_found off; deny all; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225195,225276#msg-225276 From ianevans at digitalhit.com Fri Apr 13 02:14:26 2012 From: ianevans at digitalhit.com (Ian M. Evans) Date: Thu, 12 Apr 2012 22:14:26 -0400 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> <4F86C7CF.3060405@digitalhit.com> Message-ID: <7f7ed71a31ba3f27c3b51890e29d46d5.squirrel@www.digitalhit.com> On Thu, April 12, 2012 8:20 am, Edho Arief wrote: > Sorry, seems like location ^~ /ournewblog/ will also do the job. Hmm...already encountered one issue: location ^~ /ournewblog/ { try_files $uri /ournewblog/index.php?q=$uri; location ~ \.php$ { fastcgi_pass 127.0.0.1:10004; } } Just started the install and it duplicates the admin subdirectory links so we get: http://www.example.com/ournewblog/wp-admin/wp-admin/setup-config.php Any ideas? From edho at myconan.net Fri Apr 13 03:38:52 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 13 Apr 2012 10:38:52 +0700 Subject: Non-root install of Wordpress in an already running nginx site In-Reply-To: <7f7ed71a31ba3f27c3b51890e29d46d5.squirrel@www.digitalhit.com> References: <55bffb6bd356c42141918488c2b8967c.squirrel@www.digitalhit.com> <2ae0445f93b65b54c15ed98cd78c6450.squirrel@www.digitalhit.com> <4F86C7CF.3060405@digitalhit.com> <7f7ed71a31ba3f27c3b51890e29d46d5.squirrel@www.digitalhit.com> Message-ID: Am 13.04.2012 09:14 schrieb "Ian M. Evans" : > > On Thu, April 12, 2012 8:20 am, Edho Arief wrote: > > Sorry, seems like location ^~ /ournewblog/ will also do the job. > > Hmm...already encountered one issue: > Try > location ^~ /ournewblog/ { try_files $uri $uri/ /ournewblog/index.php?q=$uri; > location ~ \.php$ { > fastcgi_pass 127.0.0.1:10004; > } > } > > Just started the install and it duplicates the admin subdirectory links so > we get: > > http://www.example.com/ournewblog/wp-admin/wp-admin/setup-config.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andybartaman at gmail.com Fri Apr 13 06:50:18 2012 From: andybartaman at gmail.com (Andy Bartaman) Date: Thu, 12 Apr 2012 23:50:18 -0700 Subject: Question on socket usage Message-ID: Hi, I am new to nginx. I was wondering if nginx uses one server-side socket for each connection request. That is if there are 100 http connections simultaneously active tp an nginx server would there be 100 sockets in use in nginx? Thanks, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Apr 13 07:38:01 2012 From: nginx-forum at nginx.us (mlmarius) Date: Fri, 13 Apr 2012 03:38:01 -0400 (EDT) Subject: Purge files from proxy_cache Message-ID: Hi, i've set a proxy cache for my app ( app is allso served by nginx ). My problem is that i would like to have my app control the cache a little bit so i have hooks that delete files whith keys matching certain paths when some events in the app take place. This also works ok but the problem is that during stress testing if i remove a file from the nginx cache i get a lot of php-fpm processes stampeeding to generate that file in the cache. I would like to mention that i am using proxy_cache_use_stale updating in order to prevent stampeeding when nginx needs to rebuild cached pages that have expired naturally but that won't help when i remove them from the cache myself. Question is ... how can i make certain pages expire when the application decides they need to be refreshed ? or ... how can i safely delete them and not have a php riot ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225281,225281#msg-225281 From appa at perusio.net Fri Apr 13 07:39:57 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Fri, 13 Apr 2012 09:39:57 +0200 Subject: combine basic auth and ip whitelisting In-Reply-To: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> References: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3196f0fcc9544b475d0a6e43d0992884.squirrel@damiao.org> > Hi, > > I have set up Apache for an existing site to use either ip whitelisting > or basic authentication. If the user's IP is not on the IP whitelist, it > asks him for a password. My htaccess file looks something like this: > > --------------- > Order deny,allow > Deny from all > AuthName "Restricted Area" > AuthUserFile /path/to/passwords > AuthType Basic > Require valid-user > Allow from 123.456.789.10 > Allow from 123.456.789.11 > Satisfy Any > --------------- > Is it possible to do something like this with Nginx? auth_basic "Restricted Area"; # realm auth_basic_user_file /path/to/passwords; allow 123.456.789.10; allow 123.456.789.11; deny all; satisfy any; --appa From appa at perusio.net Fri Apr 13 07:43:08 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Fri, 13 Apr 2012 09:43:08 +0200 Subject: Purge files from proxy_cache In-Reply-To: References: Message-ID: <35e6ff25bc0fbf0045214a3611765f2c.squirrel@damiao.org> > Hi, i've set a proxy cache for my app ( app is allso served by nginx ). > My problem is that i would like to have my app control the cache a > little bit so i have hooks that delete files whith keys matching certain > paths when some events in the app take place. This also works ok but the > problem is that during stress testing if i remove a file from the nginx > cache i get a lot of php-fpm processes stampeeding to generate that file > in the cache. > > I would like to mention that i am using proxy_cache_use_stale updating > in order to prevent stampeeding when nginx needs to rebuild cached pages > that have expired naturally but that won't help when i remove them from > the cache myself. > > Question is ... how can i make certain pages expire when the application > decides they need to be refreshed ? or ... how can i safely delete them > and not have a php riot ? Either use this: https://github.com/FRiCKLE/ngx_cache_purge Or just delete the file. This could be handy in that case: https://github.com/perusio/nginx-cache-purge --appa From nginx-forum at nginx.us Fri Apr 13 08:08:27 2012 From: nginx-forum at nginx.us (mlmarius) Date: Fri, 13 Apr 2012 04:08:27 -0400 (EDT) Subject: Purge files from proxy_cache In-Reply-To: <35e6ff25bc0fbf0045214a3611765f2c.squirrel@damiao.org> References: <35e6ff25bc0fbf0045214a3611765f2c.squirrel@damiao.org> Message-ID: <47e76d545139a158b1ad8e093faf8fd4.NginxMailingListEnglish@forum.nginx.org> Antonio P.P. Almeida Wrote: ------------------------------------------------------- > > Hi, i've set a proxy cache for my app ( app is > allso served by nginx ). > > My problem is that i would like to have my app > control the cache a > > little bit so i have hooks that delete files > whith keys matching certain > > paths when some events in the app take place. > This also works ok but the > > problem is that during stress testing if i > remove a file from the nginx > > cache i get a lot of php-fpm processes > stampeeding to generate that file > > in the cache. > > > > I would like to mention that i am using > proxy_cache_use_stale updating > > in order to prevent stampeeding when nginx needs > to rebuild cached pages > > that have expired naturally but that won't help > when i remove them from > > the cache myself. > > > > Question is ... how can i make certain pages > expire when the application > > decides they need to be refreshed ? or ... how > can i safely delete them > > and not have a php riot ? > > Either use this: > https://github.com/FRiCKLE/ngx_cache_purge > > Or just delete the file. This could be handy in > that case: > > https://github.com/perusio/nginx-cache-purge > > > --appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Well ... i kind of figured out how to actually delete the files from the cache by greping for certain key patterns so i am able to actually remove them. The problem is that right after i remove them nginx will try to rebuild them and at 1000 req/s a lot of php-php processes will come up to try and generate the missing cache page which will cause a drop in the reqs's ( i think requests start getting http error pages actually ). So that is my problem ... the fact that i have no control over how uncached pages are created. I would like just 1 process to generate the missing page and the others to wait for it to be available or something. I guess i'm looging for the functionality that proxy_cache_use_stale updating adds but for missing files. That will only keep me safe from updating of cached and expired pages. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225281,225285#msg-225285 From bruno.premont at restena.lu Fri Apr 13 08:11:53 2012 From: bruno.premont at restena.lu (Bruno =?UTF-8?B?UHLDqW1vbnQ=?=) Date: Fri, 13 Apr 2012 10:11:53 +0200 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20111005125209.GU1137@mdounin.ru> References: <20111004092231.10a846bd@pluto.restena.lu> <20111005110528.GT1137@mdounin.ru> <20111005135635.713333c9@pluto.restena.lu> <20111005125209.GU1137@mdounin.ru> Message-ID: <20120413101153.5e0e8639@pluto.restena.lu> Hello Maxim, On Wed, 5 Oct 2011 16:52:10 Maxim Dounin wrote: > 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. What's the state of/progress with Gregor's patch? I've been using it on top of 1.0.x since October without any issues. Is there anything preventing it from being applied? Thanks, Bruno From appa at perusio.net Fri Apr 13 08:16:47 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Fri, 13 Apr 2012 10:16:47 +0200 Subject: Purge files from proxy_cache In-Reply-To: <47e76d545139a158b1ad8e093faf8fd4.NginxMailingListEnglish@forum.nginx.org> References: <35e6ff25bc0fbf0045214a3611765f2c.squirrel@damiao.org> <47e76d545139a158b1ad8e093faf8fd4.NginxMailingListEnglish@forum.nginx.org> Message-ID: > Well ... i kind of figured out how to actually delete the files from the > cache by greping for certain key patterns so i am able to actually > remove them. The problem is that right after i remove them nginx will > try to rebuild them and at 1000 req/s a lot of php-php processes will > come up to try and generate the missing cache page which will cause a > drop in the reqs's ( i think requests start getting http error pages > actually ). So that is my problem ... the fact that i have no control > over how uncached pages are created. I would like just 1 process to > generate the missing page and the others to wait for it to be available > or something. I guess i'm looging for the functionality that > > proxy_cache_use_stale updating > > adds but for missing files. That will only keep me safe from updating of > cached and expired pages. http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_lock http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_lock --appa From nginx-forum at nginx.us Fri Apr 13 08:59:55 2012 From: nginx-forum at nginx.us (OlivierC) Date: Fri, 13 Apr 2012 04:59:55 -0400 (EDT) Subject: upstream timed out Message-ID: Hi. I'm the new admin of a website and its servers. I have a frontend nginx proxy server and an Apache backend. I sometimes have errors : 2012/04/12 17:44:33 [error] 13442#0: *74193485 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 98.87.76.65, server: www.mysite.tld, request: "POST /my/url HTTP/1.1", upstream: "http://12.23.34.45:80/my/url", host: "www.mysite.tld", referrer: "https://www.mysite.tld/another/url" 2012/04/12 17:44:33 [error] 13442#0: *74193485 no live upstreams while connecting to upstream, client: 98.87.76.65, server: www.mysite.tld, request: "POST /my/url HTTP/1.1", upstream: "http://backend/my/url", host: "www.mysite.tld", referrer: "https://www.goeland.fr/another/url" (I've juste anonymized the urls and ip addresses) Here are the configuration files : conf.d/proxy.conf : proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 32M; client_body_buffer_size 256k; client_header_buffer_size 128k; proxy_connect_timeout 30; proxy_send_timeout 30; proxy_read_timeout 30; proxy_buffer_size 32k; proxy_buffers 64 32k; proxy_busy_buffers_size 128k; conf.d/loadbalancer.conf : upstream backend { ip_hash; # web1 # server 127.0.0.1:8098 backup; # web2 server 44.33.22.11; #web3 server 11.22.33.44 down; } sites-enabled/mysite.conf : server { listen 80; listen 443 ssl; server_name www.mysite.tld www3.mysite.tld; access_log off; #/home/nginx/log/mysite.access.log; #error_log /dev/null crit; # Possible level values : debug | info | notice | warn | error | crit error_log /home/nginx/log/mysite.error.log notice; log_not_found off; #set $proto "http"; #if ( $server_port = "443" ) { #set $proto "https"; #} # serve static files directly location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|pdf|zip|tgz|gz|bz2|swf)$ { expires 10d; root /home/mysite/www; } location / { #proxy_set_header X-Forwarded-Proto $proto; proxy_pass http://backend; add_header X-Whom candidature at mysite.tld; } error_page 405 = $uri; error_page 500 502 503 504 /50x.html; location = /50x.html { root /home/mysitewww; } location = /favicon.ico { access_log off; log_not_found off; } } The problem seems to be recent and sometimes happens immediatly after clients have paid through the bank online credit card form which is integrated (we do not redirect to the bank website). It's a real problem for us since when it happens at that moment, clients think their order and paiement have not been saved and they order a second time (and also pay a second time). I don't really know what i'm looking for : can it be a network connection problem between frontend and backend servers ? Is it because of the configuration of the proxy of the server ? or... ? Thanks for any help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225289,225289#msg-225289 From ft at falkotimme.com Fri Apr 13 09:26:22 2012 From: ft at falkotimme.com (Falko Timme) Date: Fri, 13 Apr 2012 11:26:22 +0200 Subject: upstream timed out References: Message-ID: Have you tried to increase the proxy_connect_timeout, proxy_send_timeout, proxy_read_timeout values? Maybe to 60 or 180 seconds? ----- Original Message ----- From: "OlivierC" To: Sent: Friday, April 13, 2012 10:59 AM Subject: upstream timed out > Hi. > > I'm the new admin of a website and its servers. I have a frontend nginx > proxy server and an Apache backend. > I sometimes have errors : > > 2012/04/12 17:44:33 [error] 13442#0: *74193485 upstream timed out (110: > Connection timed out) while reading response header from upstream, > client: 98.87.76.65, server: www.mysite.tld, request: "POST /my/url > HTTP/1.1", upstream: "http://12.23.34.45:80/my/url", host: > "www.mysite.tld", referrer: "https://www.mysite.tld/another/url" > 2012/04/12 17:44:33 [error] 13442#0: *74193485 no live upstreams while > connecting to upstream, client: 98.87.76.65, server: www.mysite.tld, > request: "POST /my/url HTTP/1.1", upstream: "http://backend/my/url", > host: "www.mysite.tld", referrer: "https://www.goeland.fr/another/url" > > (I've juste anonymized the urls and ip addresses) > > Here are the configuration files : > > conf.d/proxy.conf : > > proxy_redirect off; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > proxy_set_header X-Forwarded-Proto $scheme; > client_max_body_size 32M; > client_body_buffer_size 256k; > client_header_buffer_size 128k; > proxy_connect_timeout 30; > proxy_send_timeout 30; > proxy_read_timeout 30; > proxy_buffer_size 32k; > proxy_buffers 64 32k; > proxy_busy_buffers_size 128k; > > > conf.d/loadbalancer.conf : > > upstream backend { > ip_hash; > # web1 > # server 127.0.0.1:8098 backup; > # web2 > server 44.33.22.11; > #web3 > server 11.22.33.44 down; > } > > > sites-enabled/mysite.conf : > > server { > listen 80; > listen 443 ssl; > server_name www.mysite.tld www3.mysite.tld; > > access_log off; #/home/nginx/log/mysite.access.log; > #error_log /dev/null crit; > > # Possible level values : debug | info | notice | warn | error | > crit > error_log /home/nginx/log/mysite.error.log notice; > log_not_found off; > > #set $proto "http"; > #if ( $server_port = "443" ) { > #set $proto "https"; > #} > > # serve static files directly > location ~* > ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|pdf|zip|tgz|gz|bz2|swf)$ { > expires 10d; > root /home/mysite/www; > } > > location / { > #proxy_set_header X-Forwarded-Proto $proto; > proxy_pass http://backend; > add_header X-Whom candidature at mysite.tld; > } > > error_page 405 = $uri; > error_page 500 502 503 504 /50x.html; > > location = /50x.html { > root /home/mysitewww; > } > > location = /favicon.ico { access_log off; log_not_found off; } > } > > > The problem seems to be recent and sometimes happens immediatly after > clients have paid through the bank online credit card form which is > integrated (we do not redirect to the bank website). It's a real problem > for us since when it happens at that moment, clients think their order > and paiement have not been saved and they order a second time (and also > pay a second time). > > I don't really know what i'm looking for : can it be a network > connection problem between frontend and backend servers ? Is it because > of the configuration of the proxy of the server ? or... ? > > Thanks for any help. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,225289,225289#msg-225289 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From andrew at nginx.com Fri Apr 13 10:15:52 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Fri, 13 Apr 2012 14:15:52 +0400 Subject: buffer overflow CVE-2011-4315 In-Reply-To: References: Message-ID: <951DD5B1-0DFA-4096-9F33-6E699707E323@nginx.com> On Apr 13, 2012, at 2:20 AM, Lukas Tribus wrote: > You are running a release which dates back to December 2010. The last relase in the 0.8 train is from July 2011, while CVE-2011-4315 was fixed in November 2011. You can assume your version is vulnerable. > > If you can't upgrade to current stable you will need to backport the bugfix to 0.8. > > > CVE-2011-4315 is missing on the nginx security advisories on nginx.org, can someone add it? Thanks for spotting it's missing, we'll add it. > BR, > > Lukas > > > > > Date: Fri, 13 Apr 2012 00:11:23 +0200 > > From: lists at ruby-forum.com > > To: nginx at nginx.org > > Subject: buffer overflow CVE-2011-4315 > > > > we are running nginx 0.8.54, I'm trying to pass PCI compliance testing > > they say this is vulnerable to a buffer overflow. > > > > however when i try and find out if it is i can't seem to find out. > > > > http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4315 > > > > http://www.securityfocus.com/bid/50710 > > > > these links don't show that my version has this flaw. > > > > i'm hoping there is a link to show that this version is safe. > > > > Thanks > > > > Stephen > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Fri Apr 13 10:32:13 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 Apr 2012 14:32:13 +0400 Subject: upstream timed out In-Reply-To: References: Message-ID: <20120413103212.GU13466@mdounin.ru> Hello! On Fri, Apr 13, 2012 at 04:59:55AM -0400, OlivierC wrote: > Hi. > > I'm the new admin of a website and its servers. I have a frontend nginx > proxy server and an Apache backend. > I sometimes have errors : > > 2012/04/12 17:44:33 [error] 13442#0: *74193485 upstream timed out (110: > Connection timed out) while reading response header from upstream, > client: 98.87.76.65, server: www.mysite.tld, request: "POST /my/url > HTTP/1.1", upstream: "http://12.23.34.45:80/my/url", host: > "www.mysite.tld", referrer: "https://www.mysite.tld/another/url" > 2012/04/12 17:44:33 [error] 13442#0: *74193485 no live upstreams while > connecting to upstream, client: 98.87.76.65, server: www.mysite.tld, > request: "POST /my/url HTTP/1.1", upstream: "http://backend/my/url", > host: "www.mysite.tld", referrer: "https://www.goeland.fr/another/url" [...] > proxy_read_timeout 30; [...] > The problem seems to be recent and sometimes happens immediatly after > clients have paid through the bank online credit card form which is > integrated (we do not redirect to the bank website). It's a real problem > for us since when it happens at that moment, clients think their order > and paiement have not been saved and they order a second time (and also > pay a second time). > > I don't really know what i'm looking for : can it be a network > connection problem between frontend and backend servers ? Is it because > of the configuration of the proxy of the server ? or... ? How long it takes for a backend server to generate response? The 30s read timeout might be just not enough. Maxim Dounin From mdounin at mdounin.ru Fri Apr 13 10:47:24 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 Apr 2012 14:47:24 +0400 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20120413101153.5e0e8639@pluto.restena.lu> References: <20111004092231.10a846bd@pluto.restena.lu> <20111005110528.GT1137@mdounin.ru> <20111005135635.713333c9@pluto.restena.lu> <20111005125209.GU1137@mdounin.ru> <20120413101153.5e0e8639@pluto.restena.lu> Message-ID: <20120413104724.GV13466@mdounin.ru> Hello! On Fri, Apr 13, 2012 at 10:11:53AM +0200, Bruno Pr?mont wrote: > Hello Maxim, > > On Wed, 5 Oct 2011 16:52:10 Maxim Dounin wrote: > > 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. > > What's the state of/progress with Gregor's patch? > > I've been using it on top of 1.0.x since October without any issues. > Is there anything preventing it from being applied? We'll work on various ipv6-related things after 1.2.0 release (it was expected to happen yesterday, but was postponed to avoid interference with security updates; next expected date is about 23 april). It will likely be committed then. Maxim Dounin From gregor at unimatrix-one.org Fri Apr 13 10:55:19 2012 From: gregor at unimatrix-one.org (Gregor =?utf-8?B?S2FsacWhbmlr?=) Date: Fri, 13 Apr 2012 12:55:19 +0200 Subject: [PATCH] Add IPv6 support to GeoIP module In-Reply-To: <20120413104724.GV13466@mdounin.ru> References: <20111004092231.10a846bd@pluto.restena.lu> <20120413101153.5e0e8639@pluto.restena.lu> <20120413104724.GV13466@mdounin.ru> Message-ID: <4213323.5cW85mn50h@francl> Hi. On Friday 13 of April 2012 14:47:24 Maxim Dounin wrote: > We'll work on various ipv6-related things after 1.2.0 release (it > was expected to happen yesterday, but was postponed to avoid > interference with security updates; next expected date is about 23 > april). It will likely be committed then. Nice to hear that. Best regards, Gregor Kali?nik -------------- 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 nginx-forum at nginx.us Fri Apr 13 11:02:45 2012 From: nginx-forum at nginx.us (alexscott) Date: Fri, 13 Apr 2012 07:02:45 -0400 (EDT) Subject: Very wierd config error.. Message-ID: Hello! I'm sorry to bother the forum with these kind of questions, but I simply can't figure out what I'm doing wrong here: When I access sub.domain.net/ I still get the 502 error instead of being served from the /somefolder/stuff folder?.... server { listen 80; server_name sub.domain.net; location = / { root /somefolder/stuff; index index.html index.htm; } location / { return 502; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225300,225300#msg-225300 From mdounin at mdounin.ru Fri Apr 13 11:10:29 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 Apr 2012 15:10:29 +0400 Subject: Very wierd config error.. In-Reply-To: References: Message-ID: <20120413111029.GY13466@mdounin.ru> Hello! On Fri, Apr 13, 2012 at 07:02:45AM -0400, alexscott wrote: > Hello! > I'm sorry to bother the forum with these kind of questions, but I simply > can't figure out what I'm doing wrong here: > > When I access sub.domain.net/ I still get the 502 error instead of being > served from the /somefolder/stuff folder?.... > > server { > listen 80; > server_name sub.domain.net; > > location = / { > root /somefolder/stuff; > index index.html index.htm; > > } > > location / { > > return 502; > > } > > } Detailed explanation is given here: http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration In short: request to "/" is internally redirected to "/index.html", and then handled in "location /". Try this instead: root /somefolder/stuff; location = / { index index.html index.htm; } location = /index.html { internal; } location = /index.htm { internal; } location / { return 502; } Maxim Dounin From igor at sysoev.ru Fri Apr 13 11:10:58 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 13 Apr 2012 15:10:58 +0400 Subject: buffer overflow CVE-2011-4315 In-Reply-To: References: <102ebe8acd5ce12662c1dfa4390f8a41@ruby-forum.com> Message-ID: <20120413111057.GA65820@nginx.com> On Fri, Apr 13, 2012 at 01:04:56AM +0200, Lukas Tribus wrote: > > Here is the bugfix: http://trac.nginx.org/nginx/changeset/4268/nginx > > Don't know the patch can by applied 1:1 on 0.8 though. The patch is suitable for 0.8. -- Igor Sysoev From nginx-forum at nginx.us Fri Apr 13 12:23:06 2012 From: nginx-forum at nginx.us (kolbyjack) Date: Fri, 13 Apr 2012 08:23:06 -0400 (EDT) Subject: Very wierd config error.. In-Reply-To: <20120413111029.GY13466@mdounin.ru> References: <20120413111029.GY13466@mdounin.ru> Message-ID: Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Fri, Apr 13, 2012 at 07:02:45AM -0400, > alexscott wrote: > > > Hello! > > I'm sorry to bother the forum with these kind of > questions, but I simply > > can't figure out what I'm doing wrong here: > > > > When I access sub.domain.net/ I still get the > 502 error instead of being > > served from the /somefolder/stuff folder?.... > > > > server { > > listen 80; > > server_name sub.domain.net; > > > > location = / { > > root /somefolder/stuff; > > index index.html index.htm; > > > > } > > > > location / { > > > > return 502; > > > > } > > > > } > > Detailed explanation is given here: > http://nginx.org/en/docs/http/request_processing.h > tml#simple_php_site_configuration > > In short: request to "/" is internally redirected > to > "/index.html", and then handled in "location /". > Try this > instead: > > root /somefolder/stuff; > > location = / { > index index.html index.htm; > } > > location = /index.html { > internal; > } > > location = /index.htm { > internal; > } > > location / { > return 502; > } > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx You can also do this without adding new locations by using try_files instead of index. root /somefolder/stuff; location = / { try_files /index.html /index.htm =404; } location / { return 502; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225300,225305#msg-225305 From webmaster at bigdinosaur.org Fri Apr 13 12:41:33 2012 From: webmaster at bigdinosaur.org (BigdinoWebmaster) Date: Fri, 13 Apr 2012 07:41:33 -0500 Subject: Naming a virtual location to avoid logging results in 404s Message-ID: <83563FCD97B24567A7A2D3BB87B2D80E@bigdinosaur.org> I'm hosting a forum using Vanilla (http://www.vanillaforums.org), and its internal statistics tracking involves no small amount of GETs and POSTs to URIs that don't correspond to actual directories underneath the web root. Since every active user on the forum generates lots of these every minute, I wanted to exclude them from being logged to keep the server logs from growing to an unreasonable size, and so I added the following three lines to my server config to stop logging of the three main ones: location /plugin/imonline { access_log off; log_not_found off; } location /dashboard/notifications/inform { access_log off; log_not_found off; } location /settings/analyticstick.json { access_log off; log_not_found off; } Prior to adding the lines, the requests to those locations would generate an HTTP 200 response and the corresponding analytic action (counting thread views, showing who is online, etc) would be recorded in the forum's database. After adding the lines, all GETs and POSTs receive 404s, like this: -- 99.41.160.47 [11/Apr/2012:17:40:16 -0500] forum.chroniclesofgeorge.com: GET /plugin/imonline HTTP/1.1 404 334 "http://forum.chroniclesofgeorge.com/" "Mozilla/5.0 (Windows NT 6.0; rv:11.0) Gecko/20100101 Firefox/11.0" 203.122.220.202 [11/Apr/2012:16:43:28 -0500] forum.chroniclesofgeorge.com: POST /dashboard/notifications/inform HTTP/1.1 404 736 "http://forum.chroniclesofgeorge.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.152 Safari/535.19" 98.111.0.215 [11/Apr/2012:16:43:25 -0500] forum.chroniclesofgeorge.com: POST /settings/analyticstick.json HTTP/1.1 404 736 "http://forum.chroniclesofgeorge.com/discussions/all" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19" -- That's one representative entry for each. I also realized that "access_log off" appears to not prevent POST requests being logged, so I'll need to read up on the logging directive to see if there's a way to stop that. I have since commented out the three lines and the analytics are being collected again, but I wanted to ask if there is a way to not log any GETs and POSTs to a named location without also generating 404s if those locations don't actually exist. Is it because of the string matching method used in the location directive? Should I have tried ~ instead? -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Fri Apr 13 15:19:39 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 Apr 2012 19:19:39 +0400 Subject: Naming a virtual location to avoid logging results in 404s In-Reply-To: <83563FCD97B24567A7A2D3BB87B2D80E@bigdinosaur.org> References: <83563FCD97B24567A7A2D3BB87B2D80E@bigdinosaur.org> Message-ID: <20120413151939.GC13466@mdounin.ru> Hello! On Fri, Apr 13, 2012 at 07:41:33AM -0500, BigdinoWebmaster wrote: > I'm hosting a forum using Vanilla > (http://www.vanillaforums.org), and its internal statistics > tracking involves no small amount of GETs and POSTs to URIs that > don't correspond to actual directories underneath the web root. > Since every active user on the forum generates lots of these > every minute, I wanted to exclude them from being logged to keep > the server logs from growing to an unreasonable size, and so I > added the following three lines to my server config to stop > logging of the three main ones: > > location /plugin/imonline { access_log off; log_not_found off; } > location /dashboard/notifications/inform { access_log off; > log_not_found off; } > location /settings/analyticstick.json { access_log off; > log_not_found off; } > > > Prior to adding the lines, the requests to those locations would > generate an HTTP 200 response and the corresponding analytic > action (counting thread views, showing who is online, etc) would > be recorded in the forum's database. After adding the lines, all > GETs and POSTs receive 404s, like this: [...] You should add correct processing to the locations you added as well as access_log off, likely something like proxy_pass or fastcgi_pass: location /plugin/imonline { access_log off; log_not_found off; proxy_pass http://your.backend.host; ... } Without this requests which match these locations are processed as static, and end up with 404 as there are no corresponding files. Maxim Dounin From citrin at citrin.ru Fri Apr 13 15:21:35 2012 From: citrin at citrin.ru (Anton Yuzhaninov) Date: Fri, 13 Apr 2012 19:21:35 +0400 Subject: Question on socket usage In-Reply-To: References: Message-ID: <4F88447F.3010404@citrin.ru> On 04/13/12 10:50, Andy Bartaman wrote: > I am new to nginx. I was wondering if nginx uses one server-side socket for each > connection request. That is if there are 100 http connections simultaneously active > tp an nginx server would there be 100 sockets in use in nginx? Yes, you are right. In case if request proxied by nginx to upstream, take in account sockets used by upstream connections too. If you wan to tune max sockets limit in OS, don't forget about sockets in TIME_WAIT state - this connections closed in nginx, but usually accounted in OS limits. -- Anton Yuzhaninov From webmaster at bigdinosaur.org Fri Apr 13 15:28:18 2012 From: webmaster at bigdinosaur.org (BigdinoWebmaster) Date: Fri, 13 Apr 2012 10:28:18 -0500 Subject: Naming a virtual location to avoid logging results in 404s In-Reply-To: <20120413151939.GC13466@mdounin.ru> References: <83563FCD97B24567A7A2D3BB87B2D80E@bigdinosaur.org> <20120413151939.GC13466@mdounin.ru> Message-ID: Maxim, thanks for the reply. There's no backend host; there is only the one server running nginx + php-fpm + the forum database. Should I just do a proxy_pass to localhost, or would that create a loop and cause bad things to happen? Alternately, should I just create empty directories and files to match the location targets, or would that cause Nginx to try to GET and POST them instead? On Friday, April 13, 2012 at 10:19 AM, Maxim Dounin wrote: > Hello! > > On Fri, Apr 13, 2012 at 07:41:33AM -0500, BigdinoWebmaster wrote: > > > I'm hosting a forum using Vanilla > > (http://www.vanillaforums.org), and its internal statistics > > tracking involves no small amount of GETs and POSTs to URIs that > > don't correspond to actual directories underneath the web root. > > Since every active user on the forum generates lots of these > > every minute, I wanted to exclude them from being logged to keep > > the server logs from growing to an unreasonable size, and so I > > added the following three lines to my server config to stop > > logging of the three main ones: > > > > location /plugin/imonline { access_log off; log_not_found off; } > > location /dashboard/notifications/inform { access_log off; > > log_not_found off; } > > location /settings/analyticstick.json { access_log off; > > log_not_found off; } > > > > > > Prior to adding the lines, the requests to those locations would > > generate an HTTP 200 response and the corresponding analytic > > action (counting thread views, showing who is online, etc) would > > be recorded in the forum's database. After adding the lines, all > > GETs and POSTs receive 404s, like this: > > > > > [...] > > You should add correct processing to the locations you added as > well as access_log off, likely something like proxy_pass or > fastcgi_pass: > > location /plugin/imonline { > access_log off; > log_not_found off; > proxy_pass http://your.backend.host; > ... > } > > Without this requests which match these locations are processed as > static, and end up with 404 as there are no corresponding files. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Fri Apr 13 15:37:01 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 Apr 2012 19:37:01 +0400 Subject: Naming a virtual location to avoid logging results in 404s In-Reply-To: References: <83563FCD97B24567A7A2D3BB87B2D80E@bigdinosaur.org> <20120413151939.GC13466@mdounin.ru> Message-ID: <20120413153700.GE13466@mdounin.ru> Hello! On Fri, Apr 13, 2012 at 10:28:18AM -0500, BigdinoWebmaster wrote: > Maxim, thanks for the reply. > > There's no backend host; there is only the one server running > nginx + php-fpm + the forum database. Should I just do a > proxy_pass to localhost, or would that create a loop and cause > bad things to happen? To pass requests to php-fpm you have to use fastcgi_pass. And you have to duplicate this fastcgi_pass for locations you've added. Maxim Dounin > > Alternately, should I just create empty directories and files to > match the location targets, or would that cause Nginx to try to > GET and POST them instead? > > > > On Friday, April 13, 2012 at 10:19 AM, Maxim Dounin wrote: > > > Hello! > > > > On Fri, Apr 13, 2012 at 07:41:33AM -0500, BigdinoWebmaster wrote: > > > > > I'm hosting a forum using Vanilla > > > (http://www.vanillaforums.org), and its internal statistics > > > tracking involves no small amount of GETs and POSTs to URIs that > > > don't correspond to actual directories underneath the web root. > > > Since every active user on the forum generates lots of these > > > every minute, I wanted to exclude them from being logged to keep > > > the server logs from growing to an unreasonable size, and so I > > > added the following three lines to my server config to stop > > > logging of the three main ones: > > > > > > location /plugin/imonline { access_log off; log_not_found off; } > > > location /dashboard/notifications/inform { access_log off; > > > log_not_found off; } > > > location /settings/analyticstick.json { access_log off; > > > log_not_found off; } > > > > > > > > > Prior to adding the lines, the requests to those locations would > > > generate an HTTP 200 response and the corresponding analytic > > > action (counting thread views, showing who is online, etc) would > > > be recorded in the forum's database. After adding the lines, all > > > GETs and POSTs receive 404s, like this: > > > > > > > > > [...] > > > > You should add correct processing to the locations you added as > > well as access_log off, likely something like proxy_pass or > > fastcgi_pass: > > > > location /plugin/imonline { > > access_log off; > > log_not_found off; > > proxy_pass http://your.backend.host; > > ... > > } > > > > Without this requests which match these locations are processed as > > static, and end up with 404 as there are no corresponding files. > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org (mailto: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 webmaster at bigdinosaur.org Fri Apr 13 15:38:40 2012 From: webmaster at bigdinosaur.org (BigdinoWebmaster) Date: Fri, 13 Apr 2012 10:38:40 -0500 Subject: Naming a virtual location to avoid logging results in 404s In-Reply-To: <20120413153700.GE13466@mdounin.ru> References: <83563FCD97B24567A7A2D3BB87B2D80E@bigdinosaur.org> <20120413151939.GC13466@mdounin.ru> <20120413153700.GE13466@mdounin.ru> Message-ID: <86A70376BAEE4378B87F7B14DD9A80FB@bigdinosaur.org> I understand now--sorry. I was thinking that because the actual analytics processing is done via javascript that a php passthrough for that location wasn't necessary, but now I see what you are saying. I will make the change this evening. Thanks very much for helping! On Friday, April 13, 2012 at 10:37 AM, Maxim Dounin wrote: > Hello! > > On Fri, Apr 13, 2012 at 10:28:18AM -0500, BigdinoWebmaster wrote: > > > Maxim, thanks for the reply. > > > > There's no backend host; there is only the one server running > > nginx + php-fpm + the forum database. Should I just do a > > proxy_pass to localhost, or would that create a loop and cause > > bad things to happen? > > > > > To pass requests to php-fpm you have to use fastcgi_pass. And you > have to duplicate this fastcgi_pass for locations you've added. > > Maxim Dounin > > > > > Alternately, should I just create empty directories and files to > > match the location targets, or would that cause Nginx to try to > > GET and POST them instead? > > > > > > > > On Friday, April 13, 2012 at 10:19 AM, Maxim Dounin wrote: > > > > > Hello! > > > > > > On Fri, Apr 13, 2012 at 07:41:33AM -0500, BigdinoWebmaster wrote: > > > > > > > I'm hosting a forum using Vanilla > > > > (http://www.vanillaforums.org), and its internal statistics > > > > tracking involves no small amount of GETs and POSTs to URIs that > > > > don't correspond to actual directories underneath the web root. > > > > Since every active user on the forum generates lots of these > > > > every minute, I wanted to exclude them from being logged to keep > > > > the server logs from growing to an unreasonable size, and so I > > > > added the following three lines to my server config to stop > > > > logging of the three main ones: > > > > > > > > location /plugin/imonline { access_log off; log_not_found off; } > > > > location /dashboard/notifications/inform { access_log off; > > > > log_not_found off; } > > > > location /settings/analyticstick.json { access_log off; > > > > log_not_found off; } > > > > > > > > > > > > Prior to adding the lines, the requests to those locations would > > > > generate an HTTP 200 response and the corresponding analytic > > > > action (counting thread views, showing who is online, etc) would > > > > be recorded in the forum's database. After adding the lines, all > > > > GETs and POSTs receive 404s, like this: > > > > > > > > > > > > > > > > [...] > > > > > > You should add correct processing to the locations you added as > > > well as access_log off, likely something like proxy_pass or > > > fastcgi_pass: > > > > > > location /plugin/imonline { > > > access_log off; > > > log_not_found off; > > > proxy_pass http://your.backend.host; > > > ... > > > } > > > > > > Without this requests which match these locations are processed as > > > static, and end up with 404 as there are no corresponding files. > > > > > > Maxim Dounin > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org (mailto:nginx at nginx.org) > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org (mailto:nginx at nginx.org) > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Apr 13 15:54:03 2012 From: nginx-forum at nginx.us (jaynyc) Date: Fri, 13 Apr 2012 11:54:03 -0400 (EDT) Subject: combine basic auth and ip whitelisting In-Reply-To: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> References: <34fae061ea03252514d8e110a331849c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0acb771a04b10b9c614831fd6046c1c1.NginxMailingListEnglish@forum.nginx.org> Hi Appa and Maxim, Thanks a lot for your help. That worked! :) Regards, - Jay Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225266,225314#msg-225314 From samuel.roze at gmail.com Fri Apr 13 19:58:14 2012 From: samuel.roze at gmail.com (Samuel ROZE) Date: Fri, 13 Apr 2012 21:58:14 +0200 Subject: Empty headers_out in log phase Message-ID: Hello, I'm writing an nginx module but I've got a problem for getting response headers. It's using an NGX_HTTP_LOG_PHASE handler and I want to have access to response headers sent to client. (with or without proxy_pass) And, in fact, the headers_out variable of request isn't really completed. When debugging module using gdb, in the log phase handler, the headers_out variable is always like that: headers_out = { headers = { last = 0x1ed5530, part = { elts = 0x1ec6250, nelts = 1, next = 0x0 }, size = 48, nalloc = 20, pool = 0x1ec6200 }, status = 304, status_line = { len = 0, data = 0x0 }, server = 0x0, date = 0x0, content_length = 0x0, content_encoding = 0x0, location = 0x0, refresh = 0x0, last_modified = 0x0, content_range = 0x0, accept_ranges = 0x0, www_authenticate = 0x0, expires = 0x0, etag = 0x0, override_charset = 0x0, content_type_len = 9, content_type = { len = 0, data = 0x1ed1248 "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 = 1334219772 }, The headers_out array is containing the only request that I added using "add_header" in location, and the "server", "date", etc... variables are empty. Do you know why there isn't any value in headers_out structure? And do you know how can I get these headers? Thanks you very much in advance! Samuel. From cabbar at gmail.com Fri Apr 13 23:34:57 2012 From: cabbar at gmail.com (Cabbar Duzayak) Date: Sat, 14 Apr 2012 02:34:57 +0300 Subject: Performance choking around 400 req/sec ??? In-Reply-To: <863E481A061F400CBD931B836CE6D15D@DD21> References: <863E481A061F400CBD931B836CE6D15D@DD21> Message-ID: Ah, that is exactly what the issue is... Server has 100 megabit/sec and it was limited by that. When I tested it with a 1 KB file, I was 5K req/sec Thank a ton! On Thu, Apr 12, 2012 at 6:16 PM, Reinis Rozitis wrote: >> I have increased hard/soft limit to 30K/10K. My machine is reasonably >> powerful (quad-core i7 with 8gb RAM) and during the tests, CPU load is > > pretty low. >> >> I used apache bench to do performance testing and I am hitting a static >> file on local filesystem. I ran the test from 2 different > > machines (nginx is on the 3rd machine) and used the following command on > each starting at the same time: > >> Transfer rate: ? ? ? ? ?8654.48 [Kbytes/sec] received > > > To be sure - what is your network speed (on the testboxes too)? > In case it's like 100mbit then running 'ab' on 2 remote boxes each doing > 8Mb/s download pretty much saturates the whole link and there is nothing > nginx can do. > > Have you tried to do a local (on the same box) 'ab' bench or with smaller > file like 1kb ? > > rr > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From kworthington at gmail.com Fri Apr 13 23:52:27 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Fri, 13 Apr 2012 19:52:27 -0400 Subject: nginx-1.0.15 In-Reply-To: <20120412132701.GD13466@mdounin.ru> References: <20120412132701.GD13466@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.0.15 For Windows http://goo.gl/Hm5j6 (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On Thu, Apr 12, 2012 at 9:27 AM, Maxim Dounin wrote: > Changes with nginx 1.0.15 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?12 Apr 2012 > > ? ?*) Security: specially crafted mp4 file might allow to overwrite memory > ? ? ? locations in a worker process if the ngx_http_mp4_module was used, > ? ? ? potentially resulting in arbitrary code execution (CVE-2012-2089). > ? ? ? Thanks to Matthew Daley. > > ? ?*) Bugfix: in the ngx_http_mp4_module. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From kworthington at gmail.com Fri Apr 13 23:52:48 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Fri, 13 Apr 2012 19:52:48 -0400 Subject: nginx-1.1.19 In-Reply-To: <20120412132629.GZ13466@mdounin.ru> References: <20120412132629.GZ13466@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.1.19 For Windows http://goo.gl/Hm5j6 (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On Thu, Apr 12, 2012 at 9:26 AM, Maxim Dounin wrote: > Changes with nginx 1.1.19 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?12 Apr 2012 > > ? ?*) Security: specially crafted mp4 file might allow to overwrite memory > ? ? ? locations in a worker process if the ngx_http_mp4_module was used, > ? ? ? potentially resulting in arbitrary code execution (CVE-2012-2089). > ? ? ? Thanks to Matthew Daley. > > ? ?*) Bugfix: nginx/Windows might be terminated abnormally. > ? ? ? Thanks to Vincent Lee. > > ? ?*) Bugfix: nginx hogged CPU if all servers in an upstream were marked as > ? ? ? "backup". > > ? ?*) Bugfix: the "allow" and "deny" directives might be inherited > ? ? ? incorrectly if they were used with IPv6 addresses. > > ? ?*) Bugfix: the "modern_browser" and "ancient_browser" directives might > ? ? ? be inherited incorrectly. > > ? ?*) Bugfix: timeouts might be handled incorrectly on Solaris/SPARC. > > ? ?*) Bugfix: in the ngx_http_mp4_module. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Sat Apr 14 11:05:01 2012 From: nginx-forum at nginx.us (yoavaner) Date: Sat, 14 Apr 2012 07:05:01 -0400 (EDT) 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: <407ca3256951e7b5e5a0eb7ed5abb839.NginxMailingListEnglish@forum.nginx.org> I was experiencing something very similar too. In my case I was using phusion-passenger. However, after looking at this thread https://code.google.com/p/phusion-passenger/issues/detail?id=569 I moved the `error_log` settings to inside `http` section and it seemed to have resolved the issue somehow... really not sure why, but would be great if the nginx guys can look into this. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216933,225324#msg-225324 From dilyan.palauzov at aegee.org Sat Apr 14 11:44:58 2012 From: dilyan.palauzov at aegee.org (=?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Sat, 14 Apr 2012 13:44:58 +0200 Subject: Virtual hosting Message-ID: <4F89633A.2010707@aegee.org> Hello, on my server I have several IP-Addresses and for some of them I want to use Nginx to server port 80. I want to host several different domains. Let's say A.org and B.org to IP-Address 1.1.1.1:80 and C.org to IP-Address 1.1.1.2:80, while 1.1.1.3:80 shall not be used by Nginx. Shall I configure Nginx something like server { listen 1.1.1.1; server_name A.org B.org; if ($host ~ "A.org") {root /A; ... break;} if ($host ~ "B.org") {root /B;... break;} } server { listen 1.1.1.2; server_name C.org; } or is there a way to configure three different server{}s? server { server_name A.org; } server { server_name B.org; } server { server_name C.org; listen 1.1.1.2; } In the former form, I cannot use directly "root /A;" in if (). In the latter form, I cannot use for A.org and B.org listen 1.1.1.1, as Nginx says it cannot bind twice IP1.1.1.1 (it can bind to it for A, but since the socket is already occupied, it cannot bind for for B.org}. Moreover, as the Nginx module documentation is available both trough wiki.nginx.org (wiki.nginx.org/HttpCoreModule) and http://www.nginx.org/en/docs/, I would like to ask which is the reference documentation (and what is the point to have the documentation on two different places -- e.g. why isn't the wiki enough). nginx version: nginx/1.0.15 TLS SNI support enabled configure arguments: --pid-path=/var/run/nginx.pid --conf-path=/etc/nginx/core.conf --error-log-path=/var/log/nginx/nginx.log --user=wwwrun --group=nogroup --with-ipv6 --without-poll_module --without-select_module --with-file-aio --with-http_ssl_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_degradation_module --with-http_stub_status_module --http-log-path=/var/log/nginx --with-pcre --prefix=/usr --with-cc-opt='-O3 -march=native -Wl,--hash-style=gnu -Wl,-O1 -flto -Wl,-z,relro' --with-ld-opt='-L/usr/lib64 -L/lib64' --without-http_ssi_module --without-http_uwsgi_module --without-http_scgi_module --without-http_upstream_ip_hash_module --without-http_split_clients_module --without-http_empty_gif_module Thanks in advance for your help ????? From contact at jpluscplusm.com Sat Apr 14 12:03:33 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sat, 14 Apr 2012 13:03:33 +0100 Subject: Virtual hosting In-Reply-To: <4F89633A.2010707@aegee.org> References: <4F89633A.2010707@aegee.org> Message-ID: 2012/4/14 ????? ???????? : > Hello, > > on my server I have several IP-Addresses and for some of them I want to use > Nginx to server port 80. ?I want to host several different domains. ?Let's > say A.org and B.org to IP-Address 1.1.1.1:80 and C.org to IP-Address > 1.1.1.2:80, while 1.1.1.3:80 shall not be used by Nginx. > > Shall I configure Nginx something like > ?server { > ? listen 1.1.1.1; > ? server_name A.org B.org; > ? if ($host ~ "A.org") {root /A; ... break;} > ? if ($host ~ "B.org") {root /B;... break;} > ?} This is a really nasty way of dealing with vhosts. I don't know offhand if it's even valid. > or is there a way to configure three different server{}s? > ?server { server_name A.org; } > ?server { server_name B.org; } > ?server { server_name C.org; listen 1.1.1.2; } > > In the former form, I cannot use directly "root /A;" in if (). *Please* read http://wiki.nginx.org/IfIsEvil. > In the latter form, I cannot use for A.org and B.org listen 1.1.1.1, as > Nginx says it cannot bind twice IP1.1.1.1 (it can bind to it for A, but > since the socket is already occupied, it cannot bind for for B.org}. The assertion that you cannot use the same IP twice is wrong, and probably the root of your misunderstanding. This *is* legitimate configuration: ----------------------------------------------------- http { server { listen 1.1.1.1:80; server_name A.org; root /srv/A.org/public; } server { listen 1.1.1.1:80; server_name B.org; root /srv/B.org/public; } server { listen 1.1.1.2:80; server_name C.org; root /srv/C.org/public; } } ----------------------------------------------------- There are more concise ways of expressing this setup, especially if you're dealing with significant numbers of domains, but this is pretty unambiguous. Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From igor at sysoev.ru Sat Apr 14 12:05:38 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Sat, 14 Apr 2012 16:05:38 +0400 Subject: Virtual hosting In-Reply-To: <4F89633A.2010707@aegee.org> References: <4F89633A.2010707@aegee.org> Message-ID: <20120414120538.GA90613@nginx.com> On Sat, Apr 14, 2012 at 01:44:58PM +0200, ????? ???????? wrote: > Hello, > > on my server I have several IP-Addresses and for some of them I want to > use Nginx to server port 80. I want to host several different domains. > Let's say A.org and B.org to IP-Address 1.1.1.1:80 and C.org to > IP-Address 1.1.1.2:80, while 1.1.1.3:80 shall not be used by Nginx. > > Shall I configure Nginx something like > server { > listen 1.1.1.1; > server_name A.org B.org; > if ($host ~ "A.org") {root /A; ... break;} > if ($host ~ "B.org") {root /B;... break;} > } > server { > listen 1.1.1.2; > server_name C.org; > } > or is there a way to configure three different server{}s? > server { server_name A.org; } > server { server_name B.org; } > server { server_name C.org; listen 1.1.1.2; } > > In the former form, I cannot use directly "root /A;" in if (). > > In the latter form, I cannot use for A.org and B.org listen 1.1.1.1, as > Nginx says it cannot bind twice IP1.1.1.1 (it can bind to it for A, but > since the socket is already occupied, it cannot bind for for B.org}. server { listen 1.1.1.1; server_name A.org; } server { listen 1.1.1.1; server_name B.org; } server { listen 1.1.1.2; server_name C.org; } > Moreover, as the Nginx module documentation is available both trough > wiki.nginx.org (wiki.nginx.org/HttpCoreModule) and > http://www.nginx.org/en/docs/, I would like to ask which is the > reference documentation (and what is the point to have the documentation > on two different places -- e.g. why isn't the wiki enough). The right place is http://www.nginx.org/en/docs/ Until this year the only English documentation was in wiki, but the wiki contains errors and inaccurancies. -- Igor Sysoev From mdounin at mdounin.ru Sat Apr 14 14:07:14 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 14 Apr 2012 18:07:14 +0400 Subject: Empty headers_out in log phase In-Reply-To: References: Message-ID: <20120414140713.GF13466@mdounin.ru> Hello! On Fri, Apr 13, 2012 at 09:58:14PM +0200, Samuel ROZE wrote: > Hello, > > I'm writing an nginx module but I've got a problem for getting > response headers. It's using an NGX_HTTP_LOG_PHASE handler and I want > to have access to response headers sent to client. (with or without > proxy_pass) > > And, in fact, the headers_out variable of request isn't really > completed. When debugging module using gdb, in the log phase handler, > the headers_out variable is always like that: > > headers_out = { > headers = { > last = 0x1ed5530, > part = { > elts = 0x1ec6250, > nelts = 1, > next = 0x0 > }, > size = 48, > nalloc = 20, > pool = 0x1ec6200 > }, > status = 304, > status_line = { > len = 0, > data = 0x0 > }, > server = 0x0, > date = 0x0, > content_length = 0x0, > content_encoding = 0x0, > location = 0x0, > refresh = 0x0, > last_modified = 0x0, > content_range = 0x0, > accept_ranges = 0x0, > www_authenticate = 0x0, > expires = 0x0, > etag = 0x0, > override_charset = 0x0, > content_type_len = 9, > content_type = { > len = 0, > data = 0x1ed1248 "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 = 1334219772 > }, > > The headers_out array is containing the only request that I added > using "add_header" in location, and the "server", "date", etc... > variables are empty. > > Do you know why there isn't any value in headers_out structure? And do > you know how can I get these headers? The "Server", "Date", "Content-Length", "Last-Modified" and other standard headers aren't normally exists in r->headers_out for nginx's own responses, they are instead constructed on the fly in ngx_http_header_filter.c. The r->headers_out structure either hold needed data (as last_modified_time for the "Last-Modified" header) or just nothing (as for the "Date" header, as it just uses current time). Maxim Dounin From adnan at rihan.fr Sun Apr 15 15:22:03 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun, 15 Apr 2012 17:22:03 +0200 Subject: Rewrite non-ssl to ssl except for given location Message-ID: Hi everybody, I'm using an internal proxy for one of my websites (just a PHP script which does a curl request for a given script). I've forced every non-ssl location to ssl with this: > rewrite ^/(.*) https://$host/$1 permanent; The thing is that my scripts doesn't need SSL as it's internal, so I want to force SSL except for a given location: > location = /includes/api.php { > } > rewrite ^/(.*) https://$host/$1 permanent; Unfortunately, this isn't enough and queries to /includes/api.php?foo=bar still sends me a 301 redirect. Am I missing something ? Thanks for your help. --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). -------------- next part -------------- An HTML attachment was scrubbed... URL: From edho at myconan.net Sun Apr 15 15:28:18 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 15 Apr 2012 22:28:18 +0700 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: Message-ID: 2012/4/15 Adnan RIHAN : > Hi everybody, > > I'm using an internal proxy for one of my websites (just a PHP script which > does a curl request for a given script). > > I've forced every non-ssl location to ssl with this: > > rewrite ^/(.*) https://$host/$1 permanent; > > > The thing is that my scripts doesn't need SSL as it's internal, so I want to > force SSL except for a given location: > > location = /includes/api.php { > } > rewrite ^/(.*) https://$host/$1 permanent; > > > Unfortunately, this isn't enough and queries to /includes/api.php?foo=bar > still sends me a 301 redirect. > Am I missing something ? location / { return 301 https://$host$request_uri; } location = /includes/api.php { ... } From adnan at rihan.fr Sun Apr 15 15:32:42 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun, 15 Apr 2012 17:32:42 +0200 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: Message-ID: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> > location / { > return 301 https://$host$request_uri; > } > location = /includes/api.php { > ... > } > > The problem is that I'm on a web hosting service which allow s customers to edit an included config file. So, "location /" is a duplicate :/ Isn't there a way to write "location [not matching] /includes/api.php {}" ? --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le dimanche 15 avril 2012 ? 17:28, Edho Arief a ?crit : > 2012/4/15 Adnan RIHAN : > > Hi everybody, > > > > I'm using an internal proxy for one of my websites (just a PHP script which > > does a curl request for a given script). > > > > I've forced every non-ssl location to ssl with this: > > > > rewrite ^/(.*) https://$host/$1 permanent; > > > > > > The thing is that my scripts doesn't need SSL as it's internal, so I want to > > force SSL except for a given location: > > > > location = /includes/api.php { > > } > > rewrite ^/(.*) https://$host/$1 permanent; > > > > > > Unfortunately, this isn't enough and queries to /includes/api.php?foo=bar > > still sends me a 301 redirect. > > Am I missing something ? > > > > > location / { > return 301 https://$host$request_uri; > } > location = /includes/api.php { > ... > } > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sun Apr 15 15:42:54 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 15 Apr 2012 16:42:54 +0100 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> Message-ID: On 15 April 2012 16:32, Adnan RIHAN wrote: > location / { > return 301 https://$host$request_uri; > } > location = /includes/api.php { > ... > } > > The problem is that I'm on a web hosting service which allow s customers to > edit an included config file. > ?So, "location /" is a duplicate :/ > > Isn't there a way to write "location [not matching] /includes/api.php {}" ? The method mentioned above *is* the canonical way to do that. It's in the docs somewhere. Anything else will be a hack of some kind, strongly influenced by your specific nginx setup. You'll need to give more complete information about the nuances of the shared hosting setup in order for someone to work out if there's a way to achieve what you want to. > --- > Cordialement, Adnan RIHAN. > Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info, h?bergeur You have the wrong signature separator here. It's not "---" (dash-dash-dash), it's "-- " (dash-dash-space). Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From edho at myconan.net Sun Apr 15 15:43:46 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 15 Apr 2012 22:43:46 +0700 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> Message-ID: 2012/4/15 Adnan RIHAN : > location / { > return 301 https://$host$request_uri; > } > location = /includes/api.php { > ... > } > > The problem is that I'm on a web hosting service which allow s customers to > edit an included config file. > ?So, "location /" is a duplicate :/ > This is valid: location / { location / { } } From adnan at rihan.fr Sun Apr 15 16:16:19 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun, 15 Apr 2012 18:16:19 +0200 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> Message-ID: @Jonathan: okok Here is the known but can't be touched vhost file: > ################################################################# > ########### Vhost configuration of example.com > ################################################################# > server { > access_log off; > error_log logs/vhost-error_log warn; > listen 80; > server_name example.com www.example.com; > location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ { > expires 24h; > root /home/example/public_html; > error_page 404 = @apache; > access_log /usr/local/apache/domlogs/example.com; > log_not_found off; > } > location ~ /\.ht { > deny all; > } > > location / { > log_not_found off; > > client_max_body_size 2000m; > client_body_buffer_size 512k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 32k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > > proxy_redirect http://www.example.com:8888 http://www.example.com; > proxy_redirect http://example.com:8888 http://example.com; > proxy_pass http://87.98.132.48:8888/; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > location @apache { > internal; > > client_max_body_size 2000m; > client_body_buffer_size 512k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 32k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > > proxy_redirect http://example.com:8888 http://example.com; > proxy_pass http://87.98.132.48:8888; > 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/cpnginx/custom/example.com"; > } The only file I can modify is this one: /etc/cpnginx/custom/example.com For forcing SSL, here is what I wrote in the custom file: > root at shadow [/etc/cpnginx/custom]# cat example.com > rewrite ^/(.*) https://$host/$1 permanent; I've also changed my signature ;) -- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le dimanche 15 avril 2012 ? 17:42, Jonathan Matthews a ?crit : > On 15 April 2012 16:32, Adnan RIHAN wrote: > > location / { > > return 301 https://$host$request_uri; > > } > > location = /includes/api.php { > > ... > > } > > > > The problem is that I'm on a web hosting service which allow s customers to > > edit an included config file. > > So, "location /" is a duplicate :/ > > > > Isn't there a way to write "location [not matching] /includes/api.php {}" ? > > The method mentioned above *is* the canonical way to do that. It's in > the docs somewhere. > > Anything else will be a hack of some kind, strongly influenced by your > specific nginx setup. You'll need to give more complete information > about the nuances of the shared hosting setup in order for someone to > work out if there's a way to achieve what you want to. > > > --- > > Cordialement, Adnan RIHAN. > > Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info, h?bergeur > > > > > You have the wrong signature separator here. It's not "---" > (dash-dash-dash), it's "-- " (dash-dash-space). > > Jonathan > -- > Jonathan Matthews > Oxford, London, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sun Apr 15 16:50:53 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 15 Apr 2012 17:50:53 +0100 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> Message-ID: On 15 April 2012 17:16, Adnan RIHAN wrote: > @Jonathan: okok > > Here is the known but can't be touched vhost file: > > ################################################################# > ########### Vhost configuration of ?example.com > ################################################################# > server { > access_log off; > error_log ?logs/vhost-error_log warn; > listen ? ?80; > server_name ?example.com www.example.com; > location ~* > ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ > { > expires 24h; > root /home/example/public_html; > error_page ?404 = @apache; > access_log /usr/local/apache/domlogs/example.com; > log_not_found ?off; > } > location ~ /\.ht { > ? ? ? ? ? deny all; > } > > location / { > log_not_found ?off; > > ? client_max_body_size ? ?2000m; > ? client_body_buffer_size 512k; > ? proxy_send_timeout ? 90; > ? proxy_read_timeout ? 90; > ? proxy_buffer_size ? ?32k; > ? proxy_buffers ? ? 16 32k; > ? proxy_busy_buffers_size 64k; > ? proxy_temp_file_write_size 64k; > ? proxy_connect_timeout 30s; > > ? ? ? ? proxy_redirect ?http://www.example.com:8888 > http://www.example.com; > ? ? ? ? proxy_redirect ?http://example.com:8888 ? http://example.com; > ? ? ? ? proxy_pass ? http://87.98.132.48:8888/; > ? ? ? ? proxy_set_header ? Host ? $host; > ? ? ? ? proxy_set_header ? X-Real-IP ?$remote_addr; > ? ? ? ? proxy_set_header ? X-Forwarded-For $proxy_add_x_forwarded_for; > ? ? ? ? } > location @apache { > internal; > > ? client_max_body_size ? ?2000m; > ? client_body_buffer_size 512k; > ? proxy_send_timeout ? 90; > ? proxy_read_timeout ? 90; > ? proxy_buffer_size ? ?32k; > ? proxy_buffers ? ? 16 32k; > ? proxy_busy_buffers_size 64k; > ? proxy_temp_file_write_size 64k; > ? proxy_connect_timeout 30s; > > ? ? ? ? proxy_redirect ?http://example.com:8888 ? http://example.com; > ? ? ? ? proxy_pass ? http://87.98.132.48:8888; > ? ? ? ? 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/cpnginx/custom/example.com"; > } > > The only file I can modify is this one:?/etc/cpnginx/custom/example.com I don't understand how this could ever work. The only entry point you've shown to the @apache location is if the URI's path ends in ".(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)" That doesn't include ".php", so I don't see how control of "/includes/api.php" ever hits the file you can amend. Assuming there's something I'm missing here and .php does in fact reach that file, here's how you might achieve what you want. It uses PCRE negative lookaheads, which I don't know definitely work inside nginx. rewrite ^/(?!includes/api\.php) https://$http_host$uri?$args; For what it's worth, I personally wouldn't use a host that enforced these restrictions on my configuration, like OVH appear to be doing here. It's *extremely* unpleasant. HTH, Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From adnan at rihan.fr Sun Apr 15 16:57:11 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun, 15 Apr 2012 18:57:11 +0200 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> Message-ID: <22D04174D3ED4139ABBD80B2BBD30405@gmail.com> Actually, I'm the CEO of that host. The thing is that we're using CPanel, and a module called CPNginx. I've send some features requests like moving the include and/or changing some positions. I've also asked them to add a "custom field" in the customer's panel to allow customers to edit their config (which will only be the include file). Currently, I'm editing by hands included files, and I can't change the way cpnginx rebuild vhosts because it's scripts are ioncubed T_T So, I'm hacking as I can. ----- I don't get what you're "missing". PHP Files are never matched because there is no location block including them. I've put my rewrite outside any blocks actually. Thank your for your help, I'll check this soon. -- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le dimanche 15 avril 2012 ? 18:50, Jonathan Matthews a ?crit : > On 15 April 2012 17:16, Adnan RIHAN wrote: > > @Jonathan: okok > > > > Here is the known but can't be touched vhost file: > > > > ################################################################# > > ########### Vhost configuration of example.com (http://example.com) > > ################################################################# > > server { > > access_log off; > > error_log logs/vhost-error_log warn; > > listen 80; > > server_name example.com www.example.com (http://www.example.com); > > location ~* > > ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ > > { > > expires 24h; > > root /home/example/public_html; > > error_page 404 = @apache; > > access_log /usr/local/apache/domlogs/example.com (http://example.com); > > log_not_found off; > > } > > location ~ /\.ht { > > deny all; > > } > > > > location / { > > log_not_found off; > > > > client_max_body_size 2000m; > > client_body_buffer_size 512k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 32k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > > > proxy_redirect http://www.example.com:8888 > > http://www.example.com; > > proxy_redirect http://example.com:8888 http://example.com; > > proxy_pass http://87.98.132.48:8888/; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > location @apache { > > internal; > > > > client_max_body_size 2000m; > > client_body_buffer_size 512k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 32k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > > > proxy_redirect http://example.com:8888 http://example.com; > > proxy_pass http://87.98.132.48:8888; > > 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/cpnginx/custom/example.com (http://example.com)"; > > } > > > > The only file I can modify is this one: /etc/cpnginx/custom/example.com (http://example.com) > > I don't understand how this could ever work. The only entry point > you've shown to the @apache location is if the URI's path ends in > ".(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)" > > That doesn't include ".php", so I don't see how control of > "/includes/api.php" ever hits the file you can amend. > > Assuming there's something I'm missing here and .php does in fact > reach that file, here's how you might achieve what you want. It uses > PCRE negative lookaheads, which I don't know definitely work inside > nginx. > > rewrite ^/(?!includes/api\.php) https://$http_host$uri?$args; > > For what it's worth, I personally wouldn't use a host that enforced > these restrictions on my configuration, like OVH appear to be doing > here. It's *extremely* unpleasant. > > HTH, > Jonathan > -- > Jonathan Matthews > Oxford, London, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adnan at rihan.fr Sun Apr 15 17:16:04 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun, 15 Apr 2012 19:16:04 +0200 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> Message-ID: <78B3CA16246A478F8AF2D4D1176379C8@gmail.com> By the way, rewrite ^/(?!includes/api\.php) https://$http_host$uri?$args; Is working weeeell, thank you :) -- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le dimanche 15 avril 2012 ? 18:50, Jonathan Matthews a ?crit : > On 15 April 2012 17:16, Adnan RIHAN wrote: > > @Jonathan: okok > > > > Here is the known but can't be touched vhost file: > > > > ################################################################# > > ########### Vhost configuration of example.com (http://example.com) > > ################################################################# > > server { > > access_log off; > > error_log logs/vhost-error_log warn; > > listen 80; > > server_name example.com www.example.com (http://www.example.com); > > location ~* > > ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ > > { > > expires 24h; > > root /home/example/public_html; > > error_page 404 = @apache; > > access_log /usr/local/apache/domlogs/example.com (http://example.com); > > log_not_found off; > > } > > location ~ /\.ht { > > deny all; > > } > > > > location / { > > log_not_found off; > > > > client_max_body_size 2000m; > > client_body_buffer_size 512k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 32k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > > > proxy_redirect http://www.example.com:8888 > > http://www.example.com; > > proxy_redirect http://example.com:8888 http://example.com; > > proxy_pass http://87.98.132.48:8888/; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > location @apache { > > internal; > > > > client_max_body_size 2000m; > > client_body_buffer_size 512k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 32k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > > > proxy_redirect http://example.com:8888 http://example.com; > > proxy_pass http://87.98.132.48:8888; > > 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/cpnginx/custom/example.com (http://example.com)"; > > } > > > > The only file I can modify is this one: /etc/cpnginx/custom/example.com (http://example.com) > > I don't understand how this could ever work. The only entry point > you've shown to the @apache location is if the URI's path ends in > ".(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)" > > That doesn't include ".php", so I don't see how control of > "/includes/api.php" ever hits the file you can amend. > > Assuming there's something I'm missing here and .php does in fact > reach that file, here's how you might achieve what you want. It uses > PCRE negative lookaheads, which I don't know definitely work inside > nginx. > > rewrite ^/(?!includes/api\.php) https://$http_host$uri?$args; > > For what it's worth, I personally wouldn't use a host that enforced > these restrictions on my configuration, like OVH appear to be doing > here. It's *extremely* unpleasant. > > HTH, > Jonathan > -- > Jonathan Matthews > Oxford, London, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sun Apr 15 17:20:09 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 15 Apr 2012 18:20:09 +0100 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: <22D04174D3ED4139ABBD80B2BBD30405@gmail.com> References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> <22D04174D3ED4139ABBD80B2BBD30405@gmail.com> Message-ID: On 15 April 2012 17:57, Adnan RIHAN wrote: [snip] > I don't get what you're "missing". PHP Files are never matched because there > is no location block including them. > I've put my rewrite outside any blocks actually. Ah; your indenting fooled me into thinking your include was the last line of the @apache location. Now that I've noticed it's /outside/ any location, I can see how it works. The negative lookahead should work fine here :-) Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From adnan at rihan.fr Sun Apr 15 17:22:50 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun, 15 Apr 2012 19:22:50 +0200 Subject: Rewrite non-ssl to ssl except for given location In-Reply-To: References: <45625DD6CC8B4612A27C9274CB1826AE@gmail.com> <22D04174D3ED4139ABBD80B2BBD30405@gmail.com> Message-ID: That's what I answered, it's working and thank you. And sorry for being a host which enforce strange configs, but I'm currently trying to do better, and it's not easy (as the dev of the softwares I'm using are a bit short-minded...). Have a nice day ! -- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le dimanche 15 avril 2012 ? 19:20, Jonathan Matthews a ?crit : > On 15 April 2012 17:57, Adnan RIHAN wrote: > [snip] > > I don't get what you're "missing". PHP Files are never matched because there > > is no location block including them. > > I've put my rewrite outside any blocks actually. > > > > > Ah; your indenting fooled me into thinking your include was the last > line of the @apache location. Now that I've noticed it's /outside/ any > location, I can see how it works. The negative lookahead should work > fine here :-) > > Jonathan > -- > Jonathan Matthews > Oxford, London, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Sun Apr 15 20:18:27 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 15 Apr 2012 20:18:27 +0000 Subject: How make nginx write cache files in 770 permissions instead of 700? Message-ID: Hello all, I included a special user into the nginx group with the purpose of giving privilege to be able to delete or read nginx cache files. The problem is nginx writes these in 700 mode. What is the simplest way I can achieve what I want? Perhaps forcing nginx to write cache files in 770 ? Regards, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Sun Apr 15 22:13:04 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Mon, 16 Apr 2012 00:13:04 +0200 Subject: How make nginx write cache files in 770 permissions instead of 700? In-Reply-To: References: Message-ID: <87sjg43aq7.wl%appa@perusio.net> On 15 Abr 2012 22h18 CEST, tdgh2323 at hotmail.com wrote: > > Hello all, > > I included a special user into the nginx group with the purpose of > giving privilege to be able to delete or read nginx cache files. The > problem is nginx writes these in 700 mode. What is the simplest way > I can achieve what I want? Perhaps forcing nginx to write cache > files in 770 ? Isn't it simpler and potentially safer to use a setuid wrapper? I like super: http://www.ucolick.org/~will/RUE/super/super.1.html You can create a wrapper command that grants the right to delete the cache files to a specific user. --- appa From nginx-forum at nginx.us Mon Apr 16 03:34:48 2012 From: nginx-forum at nginx.us (bpiraeus) Date: Sun, 15 Apr 2012 23:34:48 -0400 (EDT) Subject: SSL negotiation failures causing 408 error to be returned Message-ID: <3f7ca0ac8ba89cce43fad095d7821c7a.NginxMailingListEnglish@forum.nginx.org> While debugging for a client, we found that we're seeing significant numbers of 408s being generated for SSL connections. It seems to be MOSTLY Chrome on a Windows 7 base with some MSIE 9.0 (also on Win 7) as user agents go, and at this point I'm completely stumped. We've tried disabling session cache, upping timeout values, enabling/disabling keepalives, nothing seems to stem the steady flow of these. Below is a sample debug log (I've redacted specific pieces for business reasons). What I see a lot of is 6 simultaneous connections being setup, 2 being used, and then 4 timing out 60s later. Invariably, if I enable full debug, I see 'client timed out (60: Operation timed out) while SSL handshaking' which makes no sense. If I turn on logging for session IDs, I can clearly see the clients being sent 408s are being assigned session IDs which says to me they're completing the SSL negotiation and then just.. sitting idle. 2012/04/14 14:51:41 [debug] 99433#0: *3313 accept: fd:100 2012/04/14 14:51:41 [debug] 99433#0: *3313 post event 0000000801A026F0 2012/04/14 14:51:41 [debug] 99433#0: *3313 delete posted event 0000000801A026F0 2012/04/14 14:51:41 [debug] 99433#0: *3313 malloc: 0000000801EEF000:1256 2012/04/14 14:51:41 [debug] 99433#0: *3313 posix_memalign: 0000000801EE8300:256 @16 2012/04/14 14:51:41 [debug] 99433#0: *3313 malloc: 0000000800DE5000:4096 2012/04/14 14:51:41 [debug] 99433#0: *3313 posix_memalign: 0000000800DFE000:4096 @16 2012/04/14 14:51:41 [debug] 99433#0: *3313 http check ssl handshake 2012/04/14 14:51:41 [debug] 99433#0: *3313 https ssl handshake: 0x16 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL server name: "" 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL_do_handshake: -1 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL_get_error: 2 2012/04/14 14:51:41 [debug] 99433#0: *3313 kevent set event: 100: ft:-1 fl:0025 2012/04/14 14:51:41 [debug] 99433#0: *3313 event timer add: 100: 60000:1334440361120 2012/04/14 14:51:41 [debug] 99433#0: *3313 post event 0000000801A026F0 2012/04/14 14:51:41 [debug] 99433#0: *3313 delete posted event 0000000801A026F0 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL handshake handler: 0 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL_do_handshake: 1 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL: TLSv1, cipher: "RC4-SHA SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=SHA1" 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL reused session 2012/04/14 14:51:41 [debug] 99433#0: *3313 http process request line 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL_read: -1 2012/04/14 14:51:41 [debug] 99433#0: *3313 SSL_get_error: 2 2012/04/14 14:52:41 [debug] 99433#0: *3313 event timer del: 100: 1334440361120 2012/04/14 14:52:41 [debug] 99433#0: *3313 http process request line 2012/04/14 14:52:41 [info] 99433#0: *3313 client timed out (60: Operation timed out) while SSL handshaking, client: , server: 2012/04/14 14:52:41 [debug] 99433#0: *3313 http request count:1 blk:0 2012/04/14 14:52:41 [debug] 99433#0: *3313 http close request 2012/04/14 14:52:41 [debug] 99433#0: *3313 http log handler 2012/04/14 14:52:41 [debug] 99433#0: *3313 free: 0000000800DFE000, unused: 2426 2012/04/14 14:52:41 [debug] 99433#0: *3313 close http connection: 100 2012/04/14 14:52:41 [debug] 99433#0: *3313 SSL_shutdown: 1 2012/04/14 14:52:41 [debug] 99433#0: *3313 reusable connection: 0 2012/04/14 14:52:41 [debug] 99433#0: *3313 free: 0000000800DE5000 2012/04/14 14:52:41 [debug] 99433#0: *3313 free: 0000000801EEF000 2012/04/14 14:52:41 [debug] 99433#0: *3313 free: 0000000801EE8200, unused: 8 2012/04/14 14:52:41 [debug] 99433#0: *3313 free: 0000000801EE8300, unused: 72 The following 5 UAs are by far the most common Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.152 Safari/535.19 Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19 Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) This appears to implicate Windows in some way, but I've yet to figure it out and am, quite frankly, stumped. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225349,225349#msg-225349 From nginx-forum at nginx.us Mon Apr 16 03:38:29 2012 From: nginx-forum at nginx.us (bpiraeus) Date: Sun, 15 Apr 2012 23:38:29 -0400 (EDT) Subject: SSL negotiation failures causing 408 error to be returned In-Reply-To: <3f7ca0ac8ba89cce43fad095d7821c7a.NginxMailingListEnglish@forum.nginx.org> References: <3f7ca0ac8ba89cce43fad095d7821c7a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <989062e0f76afb1d746dee0e6170ab3c.NginxMailingListEnglish@forum.nginx.org> I should note, I've also tried various revisions of nginx, the debug was taken using 1.1.19 w/ the following configure options --with-http_ssl_module --with-http_stub_status_module --with-ipv6 --with-pcre --with-debug --with-openssl=/usr/local/src/openssl-1.0.1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225349,225350#msg-225350 From list at oxdrove.co.uk Mon Apr 16 08:37:27 2012 From: list at oxdrove.co.uk (James Lee) Date: Mon, 16 Apr 2012 09:37:27 +0100 Subject: truncated output with gzip, large files and slow rate Message-ID: Hello, nginx is truncating output with the following: + gzip on + compressed size greater than 100k (approx) + client downloads at a slow rate *** Steps to reproduce *** nginx.conf: events { } http { types { text/plain txt; } gzip on; gzip_types text/plain; server { listen 80 default_server; server_name _; root /path/to/root; } } Create a test file that is larger than 100k compressed: $ head -1000 /dev/random > /path/to/root/test.txt Request exhibiting failure: $ curl -H "Accept-Encoding: gzip" --limit-rate 50k localhost/test.txt | gzcat | cksum % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 180k 0 180k 0 0 2966 0 --:--:-- 0:01:02 --:--:-- 0 curl: (18) transfer closed with outstanding read data remaining gzcat: stdin: unexpected end of file 649550918 184260 and with wget: $ wget --header "Accept-Encoding: gzip" --limit-rate=50k -O /dev/stdout localhost/test.txt | gzcat | cksum --2012-04-15 11:27:04-- http://localhost/test.txt Resolving localhost (localhost)... 127.0.0.1, ::1 Connecting to localhost (localhost)|127.0.0.1|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/plain] Saving to: `/dev/stdout' [ <=> ] 184,330 --.-K/s in 61s 2012-04-15 11:28:06 (2.96 KB/s) - `/dev/stdout' saved [184330] gzcat: stdin: unexpected end of file 649550918 184260 Some variants showing success (correct size and cksum) by avoiding one of compression or limit-rate: $ curl -H "Accept-Encoding: gzip" localhost/test.txt | gzcat | cksum % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 235k 0 235k 0 0 5970k 0 --:--:-- --:--:-- --:--:-- 6370k 2871747365 241269 $ curl --limit-rate 50k localhost/test.txt | cksum % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 235k 100 235k 0 0 47700 0 0:00:05 0:00:05 --:--:-- 55650 2871747365 241269 There are also failures with major web browsers including Firefox 11.0, MSIE 9.0 and Safari. No error is reported by nginx. The http return code and logged code is 200. The only clue in the server is the sent size reported is smaller than the expected compressed size. *** Other information *** nginx 1.1.19 Solaris 10 u10 James. From nginx-forum at nginx.us Mon Apr 16 08:43:46 2012 From: nginx-forum at nginx.us (lockev3.0) Date: Mon, 16 Apr 2012 04:43:46 -0400 (EDT) Subject: Default_server catch all block not working In-Reply-To: References: Message-ID: <5c1276b46f9cd1e19931715fee0069ad.NginxMailingListEnglish@forum.nginx.org> Well, probably I'm, still novice at Nginx but, that default server block is meant to fit when no other block server (server_name) fits. So my current problem is that 444 behaviour is arising all thru my nginx server, not just that default_server block/vhost .....not quit sure If I explained my self better now ? or even understood you right .... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221572,225354#msg-225354 From hagaizzz at yahoo.com Mon Apr 16 08:53:39 2012 From: hagaizzz at yahoo.com (hagai avrahami) Date: Mon, 16 Apr 2012 01:53:39 -0700 (PDT) Subject: ngx_http_send_special_response Message-ID: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> Hi I am appreciate any help I can get on the following issues. I am writing my own module. 1. I can see in function ngx_http_send_special_response ??? that it calculates the content length of the error page even if the request signed as header only (r->header_only = 1) ??? and set the content length header with value, after sending the header it does not send the body ( because? r->header_only = 1) ??? so the response arrive with content length different than 0 but without body ??? Is it a BUG? 2.In the module I am trying to redirect the request with status code 302 (NGX_HTTP_MOVED_TEMPORARILY) ?? Trying to user->headers_out.location for the Alternate URL failed, I looked in the code and saw the Location must start with "/" - why? ?? In the end I add it to r->headers_out.headers ?? using header = ngx_list_push(&r->headers_out.headers); ?? Is it the write way to do it? 3. Can you explain please the different between ??? a. r->headers_out.content_length_n ??? b. r->headers_out.content_length 4. Can you explain the usage of the hash field in ngx_table_elt_t Thanks Hagai Avrahami -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Apr 16 10:17:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 14:17:41 +0400 Subject: truncated output with gzip, large files and slow rate In-Reply-To: References: Message-ID: <20120416101741.GH13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 09:37:27AM +0100, James Lee wrote: > Hello, > > nginx is truncating output with the following: > + gzip on > + compressed size greater than 100k (approx) > + client downloads at a slow rate > > > *** Steps to reproduce *** > > nginx.conf: > > events { > } > http { > types { > text/plain txt; > } > gzip on; > gzip_types text/plain; > server { > listen 80 default_server; > server_name _; > root /path/to/root; > } > } > > > Create a test file that is larger than 100k compressed: > > $ head -1000 /dev/random > /path/to/root/test.txt > > > Request exhibiting failure: > > $ curl -H "Accept-Encoding: gzip" --limit-rate 50k > localhost/test.txt | gzcat | cksum > % Total % Received % Xferd Average Speed Time Time > Time Current > Dload Upload Total Spent > Left Speed > 100 180k 0 180k 0 0 2966 0 --:--:-- 0:01:02 > --:--:-- 0 > curl: (18) transfer closed with outstanding read data remaining > > gzcat: stdin: unexpected end of file > 649550918 184260 > > > and with wget: > > $ wget --header "Accept-Encoding: gzip" --limit-rate=50k -O > /dev/stdout localhost/test.txt | gzcat | cksum > > --2012-04-15 11:27:04-- http://localhost/test.txt > Resolving localhost (localhost)... 127.0.0.1, ::1 > Connecting to localhost (localhost)|127.0.0.1|:80... connected. > HTTP request sent, awaiting response... 200 OK > Length: unspecified [text/plain] > Saving to: `/dev/stdout' > > [ <=> ] 184,330 --.-K/s in 61s > > 2012-04-15 11:28:06 (2.96 KB/s) - `/dev/stdout' saved [184330] > > > gzcat: stdin: unexpected end of file > 649550918 184260 > > > > > Some variants showing success (correct size and cksum) by avoiding > one of compression or limit-rate: > > $ curl -H "Accept-Encoding: gzip" localhost/test.txt | gzcat | cksum > % Total % Received % Xferd Average Speed Time Time > Time Current > Dload Upload Total Spent > Left Speed > 100 235k 0 235k 0 0 5970k 0 --:--:-- --:--:-- > --:--:-- 6370k > 2871747365 241269 > > > $ curl --limit-rate 50k localhost/test.txt | cksum > % Total % Received % Xferd Average Speed Time Time > Time Current > Dload Upload Total Spent > Left Speed > 100 235k 100 235k 0 0 47700 0 0:00:05 0:00:05 > --:--:-- 55650 > 2871747365 241269 > > > > There are also failures with major web browsers including Firefox > 11.0, MSIE 9.0 and Safari. > > No error is reported by nginx. The http return code and logged code > is 200. The only clue in the server is the sent size reported is > smaller than the expected compressed size. > > > > *** Other information *** > > nginx 1.1.19 > Solaris 10 u10 Could you please provide debug log and nginx -V output? See http://wiki.nginx.org/Debugging for details. Maxim Dounin From mdounin at mdounin.ru Mon Apr 16 10:37:45 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 14:37:45 +0400 Subject: ngx_http_send_special_response In-Reply-To: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> References: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> Message-ID: <20120416103744.GI13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 01:53:39AM -0700, hagai avrahami wrote: > > > Hi > > I am appreciate any help I can get on the following issues. > > I am writing my own module. > > 1. I can see in function ngx_http_send_special_response > ??? that it calculates the content length of the error page even if the request signed as header only (r->header_only = 1) > ??? and set the content length header with value, after sending the header it does not send the body ( because? r->header_only = 1) > ??? so the response arrive with content length different than 0 but without body > > ??? Is it a BUG? No. The r->header_only flag should is set when body isn't expected per protocol (HEAD requests, 304 responses). Having Content-Length present in such responses is ok. > 2.In the module I am trying to redirect the request with status code 302 (NGX_HTTP_MOVED_TEMPORARILY) > ?? Trying to user->headers_out.location for the Alternate URL failed, I looked in the code and saw the Location must start with "/" - why? You have to set it correctly, i.e. add to r->headers_out.headers and link to r->headers_out.location. If it starts with "/" it works even if set incorrectly due to adding of a server_name, that's probably what confused you. > ?? In the end I add it to r->headers_out.headers > ?? using header = ngx_list_push(&r->headers_out.headers); > ?? Is it the write way to do it? > > 3. Can you explain please the different between > ??? a. r->headers_out.content_length_n > ??? b. r->headers_out.content_length The content_length_n is a numeric length, this what you normaly should set when generating response in nginx. The content_length is a pointer to a headers array element, it might be present if there is string representation of a Content-Length header available for some reason (e.g. from a backend). > 4. Can you explain the usage of the hash field in ngx_table_elt_t Normally the hash field is used for fast lookups in hash structures. In case of r->headers_out it's usually just set to 1 indicate the header is valid (or reset to 0 to indicate the header should not be sent as it was superseeded by some other header). Maxim Dounin From mdounin at mdounin.ru Mon Apr 16 10:59:30 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 14:59:30 +0400 Subject: SSL negotiation failures causing 408 error to be returned In-Reply-To: <3f7ca0ac8ba89cce43fad095d7821c7a.NginxMailingListEnglish@forum.nginx.org> References: <3f7ca0ac8ba89cce43fad095d7821c7a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120416105930.GJ13466@mdounin.ru> Hello! On Sun, Apr 15, 2012 at 11:34:48PM -0400, bpiraeus wrote: > While debugging for a client, we found that we're seeing significant > numbers of 408s being generated for SSL connections. It seems to be > MOSTLY Chrome on a Windows 7 base with some MSIE 9.0 (also on Win 7) as > user agents go, and at this point I'm completely stumped. We've tried > disabling session cache, upping timeout values, enabling/disabling > keepalives, nothing seems to stem the steady flow of these. Below is a > sample debug log (I've redacted specific pieces for business reasons). > What I see a lot of is 6 simultaneous connections being setup, 2 being > used, and then 4 timing out 60s later. Invariably, if I enable full > debug, I see 'client timed out (60: Operation timed out) while SSL > handshaking' which makes no sense. If I turn on logging for session IDs, > I can clearly see the clients being sent 408s are being assigned session > IDs which says to me they're completing the SSL negotiation and then > just.. sitting idle. This is because Chrome opens many connections to a server from very start, trying to reduce latence in case of these connections will be useful. If they aren't - they are just kept idle and either closed by Chrome (in this case you'll likely see 400 in logs) or timed out (in this case you'll see 408). [...] > 2012/04/14 14:52:41 [debug] 99433#0: *3313 http process request line > 2012/04/14 14:52:41 [info] 99433#0: *3313 client timed out (60: > Operation timed out) while SSL handshaking, client: , > server: The "while SSL handshaking" part of the message is a bit misleading. Probably something like this will make things a bit better: --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -612,6 +612,8 @@ ngx_http_ssl_handshake_handler(ngx_conne c->ssl->no_wait_shutdown = 1; + c->log->action = "reading client request line"; + c->read->handler = ngx_http_process_request_line; /* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler; Maxim Dounin From hagaizzz at yahoo.com Mon Apr 16 11:29:18 2012 From: hagaizzz at yahoo.com (hagai avrahami) Date: Mon, 16 Apr 2012 04:29:18 -0700 (PDT) Subject: ngx_http_send_special_response In-Reply-To: <20120416103744.GI13466@mdounin.ru> References: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> <20120416103744.GI13466@mdounin.ru> Message-ID: <1334575758.9686.YahooMailNeo@web125504.mail.ne1.yahoo.com> WOW thanks for the quick and elaborate response So what is the right way to send response with status code 302 on GET request but with content length 0 and no body (I want to redirect the request to other Server) Thanks Hagai >________________________________ > From: Maxim Dounin >To: nginx at nginx.org >Sent: Monday, April 16, 2012 12:37 PM >Subject: Re: ngx_http_send_special_response > >Hello! > >On Mon, Apr 16, 2012 at 01:53:39AM -0700, hagai avrahami wrote: > >> >> >> Hi >> >> I am appreciate any help I can get on the following issues. >> >> I am writing my own module. >> >> 1. I can see in function ngx_http_send_special_response >> ??? that it calculates the content length of the error page even if the request signed as header only (r->header_only = 1) >> ??? and set the content length header with value, after sending the header it does not send the body ( because? r->header_only = 1) >> ??? so the response arrive with content length different than 0 but without body >> >> ??? Is it a BUG? > >No.? The r->header_only flag should is set when body isn't >expected per protocol (HEAD requests, 304 responses).? Having >Content-Length present in such responses is ok. > >> 2.In the module I am trying to redirect the request with status code 302 (NGX_HTTP_MOVED_TEMPORARILY) >> ?? Trying to user->headers_out.location for the Alternate URL failed, I looked in the code and saw the Location must start with "/" - why? > >You have to set it correctly, i.e. add to r->headers_out.headers >and link to r->headers_out.location.? If it starts with "/" it >works even if set incorrectly due to adding of a server_name, >that's probably what confused you. > >> ?? In the end I add it to r->headers_out.headers >> ?? using header = ngx_list_push(&r->headers_out.headers); >> ?? Is it the write way to do it? >> >> 3. Can you explain please the different between >> ??? a. r->headers_out.content_length_n >> ??? b. r->headers_out.content_length > >The content_length_n is a numeric length, this what you normaly >should set when generating response in nginx.? The content_length >is a pointer to a headers array element, it might be present if >there is string representation of a Content-Length header >available for some reason (e.g. from a backend). > >> 4. Can you explain the usage of the hash field in ngx_table_elt_t > >Normally the hash field is used for fast lookups in hash >structures.? In case of r->headers_out it's usually just set to 1 >indicate the header is valid (or reset to 0 to indicate the >header should not be sent as it was superseeded by some other >header). > >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 list at oxdrove.co.uk Mon Apr 16 13:27:08 2012 From: list at oxdrove.co.uk (James Lee) Date: Mon, 16 Apr 2012 14:27:08 +0100 Subject: truncated output with gzip, large files and slow rate In-Reply-To: <20120416101741.GH13466@mdounin.ru> References: <20120416101741.GH13466@mdounin.ru> Message-ID: On Mon, 16 Apr 2012 11:17:41 +0100, Maxim Dounin wrote: > Could you please provide debug log and nginx -V output? debug.log.bz2 as attachment. $ nginx -V nginx version: nginx/1.1.19 TLS SNI support enabled configure arguments: --prefix=/opt/prefix --prefix=/var/opt/prefix/nginx --http-client-body-temp-path=/var/opt/prefix/nginx/client --http-fastcgi-temp-path=/var/opt/prefix/nginx/fastcgi --http-scgi-temp-path=/var/opt/prefix/nginx/scgi --http-proxy-temp-path=/var/opt/prefix/nginx/proxy --conf-path=/etc/opt/prefix/nginx/nginx.conf --error-log-path=/var/opt/prefix/nginx/logs/error.log --http-log-path=/var/opt/prefix/nginx/logs/access.log --pid-path=/var/opt/prefix/nginx/nginx.pid --lock-path=/var/opt/prefix/nginx/nginx.lock --user=webservd --group=webservd --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_stub_status_module --with-debug James. -------------- next part -------------- A non-text attachment was scrubbed... Name: debug.log.bz2 Type: application/bzip2 Size: 10955 bytes Desc: not available URL: From mdounin at mdounin.ru Mon Apr 16 13:38:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 17:38:23 +0400 Subject: ngx_http_send_special_response In-Reply-To: <1334575758.9686.YahooMailNeo@web125504.mail.ne1.yahoo.com> References: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> <20120416103744.GI13466@mdounin.ru> <1334575758.9686.YahooMailNeo@web125504.mail.ne1.yahoo.com> Message-ID: <20120416133823.GK13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 04:29:18AM -0700, hagai avrahami wrote: > WOW thanks for the quick and elaborate response > > So what is the right way to send response with status code 302 on GET request but > with content length 0 and no body (I want to redirect the request to other Server) Easiest solution is to just write return 302 $where; in config. :) >From the code point of view (assuming content handler context), something like this should work: ngx_table_elt_t *h; ngx_http_clear_location(r); h = ngx_list_push(&r->headers_out.headers); if (h == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } h->hash = 1; ngx_str_set(&h->key, "Location"); h->value.data = ... h->value.len = ... r->headers_out.location = h; return NGX_HTTP_MOVED_TEMPORARILY; Maxim Dounin > > Thanks > > Hagai > > > > > >________________________________ > > From: Maxim Dounin > >To: nginx at nginx.org > >Sent: Monday, April 16, 2012 12:37 PM > >Subject: Re: ngx_http_send_special_response > > > >Hello! > > > >On Mon, Apr 16, 2012 at 01:53:39AM -0700, hagai avrahami wrote: > > > >> > >> > >> Hi > >> > >> I am appreciate any help I can get on the following issues. > >> > >> I am writing my own module. > >> > >> 1. I can see in function ngx_http_send_special_response > >> ??? that it calculates the content length of the error page even if the request signed as header only (r->header_only = 1) > >> ??? and set the content length header with value, after sending the header it does not send the body ( because? r->header_only = 1) > >> ??? so the response arrive with content length different than 0 but without body > >> > >> ??? Is it a BUG? > > > >No.? The r->header_only flag should is set when body isn't > >expected per protocol (HEAD requests, 304 responses).? Having > >Content-Length present in such responses is ok. > > > >> 2.In the module I am trying to redirect the request with status code 302 (NGX_HTTP_MOVED_TEMPORARILY) > >> ?? Trying to user->headers_out.location for the Alternate URL failed, I looked in the code and saw the Location must start with "/" - why? > > > >You have to set it correctly, i.e. add to r->headers_out.headers > >and link to r->headers_out.location.? If it starts with "/" it > >works even if set incorrectly due to adding of a server_name, > >that's probably what confused you. > > > >> ?? In the end I add it to r->headers_out.headers > >> ?? using header = ngx_list_push(&r->headers_out.headers); > >> ?? Is it the write way to do it? > >> > >> 3. Can you explain please the different between > >> ??? a. r->headers_out.content_length_n > >> ??? b. r->headers_out.content_length > > > >The content_length_n is a numeric length, this what you normaly > >should set when generating response in nginx.? The content_length > >is a pointer to a headers array element, it might be present if > >there is string representation of a Content-Length header > >available for some reason (e.g. from a backend). > > > >> 4. Can you explain the usage of the hash field in ngx_table_elt_t > > > >Normally the hash field is used for fast lookups in hash > >structures.? In case of r->headers_out it's usually just set to 1 > >indicate the header is valid (or reset to 0 to indicate the > >header should not be sent as it was superseeded by some other > >header). > > > >Maxim Dounin > > > >_______________________________________________ > >nginx mailing list > >nginx at nginx.org > >http://mailman.nginx.org/mailman/listinfo/nginx > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Mon Apr 16 14:43:03 2012 From: nginx-forum at nginx.us (bpiraeus) Date: Mon, 16 Apr 2012 10:43:03 -0400 (EDT) Subject: SSL negotiation failures causing 408 error to be returned In-Reply-To: <20120416105930.GJ13466@mdounin.ru> References: <20120416105930.GJ13466@mdounin.ru> Message-ID: <23c6bb3114f978f9e223193522fab9f7.NginxMailingListEnglish@forum.nginx.org> The problem with that diagnosis, is that in this case, it's actually causing failures on the client side. The client in question has a flash game which pulls some amount of data over https, when these sessions time out and hand out a 408, it causes the game itself to barf up a lung. Additionally after pulling 12 hours of logs and doing UA matching, while Chrome on Win7 base seems to be the major player, we find these as well: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; yie9) Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0; yie9) Mozilla/5.0 (Windows NT 6.0; rv:11.0) Gecko/20100101 Firefox/11.0 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; CPNTDF; .NET4.0C) Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; WinNT-PAI 26.09.2009; .NET4.0C) Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; NP06) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SlimBrowser) Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; MS-RTC EA 2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; BRI/2) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0) Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0 Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/4.1.3 Safari/533.19.4 Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; yie9) Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0 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 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) The interesting bit is that the significant amount of these (when we strip out Chrome) are MSIE on a Win7 base, which makes me inclined to suspect something funny with Win 7, but there's at least 2 instances of OS X in there, and 2 instances (FF 10.0.02 and FF 11) on NT 5.1 (XP base) If we throw out the OS X and XP ones as outliers due to something else (people monkeying with settings, who knows), that leaves us with a pretty clear indication that -something- in Win 7 has got some kind of naughty behavior with SSL, but I'll be damned if I can come up with anything. I spent half of last night trawling google for Win 7+SSL issues and just didn't find anything of relevance. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225349,225368#msg-225368 From nginx-forum at nginx.us Mon Apr 16 15:14:13 2012 From: nginx-forum at nginx.us (bpiraeus) Date: Mon, 16 Apr 2012 11:14:13 -0400 (EDT) Subject: SSL negotiation failures causing 408 error to be returned In-Reply-To: <20120416105930.GJ13466@mdounin.ru> References: <20120416105930.GJ13466@mdounin.ru> Message-ID: <63f68a99756125f01db7f1c33d06bd0e.NginxMailingListEnglish@forum.nginx.org> I stumbled across this this morning after talking with some co-workers about what we're seeing http://code.google.com/p/chromium/issues/detail?id=85229 I'm wondering if someone @ MS decided IE9 would benefit from the same speculative pre-connect sockets. If we strip out anything that's not IE9/Chrome we're left with a pretty small subset of 'other browsers' which I'm leaning towards considering outliers just by virtue of being < .5% of the overall error count. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225349,225369#msg-225369 From hagaizzz at yahoo.com Mon Apr 16 15:14:25 2012 From: hagaizzz at yahoo.com (hagai avrahami) Date: Mon, 16 Apr 2012 08:14:25 -0700 (PDT) Subject: ngx_http_send_special_response In-Reply-To: <20120416133823.GK13466@mdounin.ru> References: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> <20120416103744.GI13466@mdounin.ru> <1334575758.9686.YahooMailNeo@web125504.mail.ne1.yahoo.com> <20120416133823.GK13466@mdounin.ru> Message-ID: <1334589265.45104.YahooMailNeo@web125504.mail.ne1.yahoo.com> Hi Thanks The redirect response is from content handler context. Using the code you added cause Nginx to send back the Error Page (302) with Content-Length and Content-Type ("test/html") (And I am trying avoid that) without Body That's why I assumed using r->header_only = 1? will solve my problem but as you explained it is used for other cases. please see that in ngx_http_send_special_response when this flag set to 1 the Header is set with this fields but no body in response (I think this is not a good result) if adding in the beginning of the function (ngx_http_send_special_response) the following code it solves the problem: ? if (r->header_only == 1) ? { ?????? ngx_http_clear_accept_ranges(r); ?????? ngx_http_clear_last_modified(r); ??????? rc = ngx_http_send_header(r); ??????? return rc; ?? } Is there any other way I can avoid content length and content-type in 302 response Thanks Hagai >________________________________ > From: Maxim Dounin >To: nginx at nginx.org >Sent: Monday, April 16, 2012 3:38 PM >Subject: Re: ngx_http_send_special_response > >Hello! > >On Mon, Apr 16, 2012 at 04:29:18AM -0700, hagai avrahami wrote: > >> WOW thanks for the quick and elaborate response >> >> So what is the right way to send response with status code 302 on GET request but >> with content length 0 and no body (I want to redirect the request to other Server) > >Easiest solution is to just write > >? ? return 302 $where; > >in config. :) > >From the code point of view (assuming content handler context), >something like this should work: > >? ? ngx_table_elt_t? *h; > >? ? ngx_http_clear_location(r); > >? ? h = ngx_list_push(&r->headers_out.headers); >? ? if (h == NULL) { >? ? ? ? return NGX_HTTP_INTERNAL_SERVER_ERROR; >? ? } > >? ? h->hash = 1; >? ? ngx_str_set(&h->key, "Location"); > >? ? h->value.data = ... >? ? h->value.len = ... > >? ? r->headers_out.location = h; > >? ? return NGX_HTTP_MOVED_TEMPORARILY; > >Maxim Dounin > > >> >> Thanks >> >> Hagai >> >> >> >> >> >________________________________ >> > From: Maxim Dounin >> >To: nginx at nginx.org >> >Sent: Monday, April 16, 2012 12:37 PM >> >Subject: Re: ngx_http_send_special_response >> > >> >Hello! >> > >> >On Mon, Apr 16, 2012 at 01:53:39AM -0700, hagai avrahami wrote: >> > >> >> >> >> >> >> Hi >> >> >> >> I am appreciate any help I can get on the following issues. >> >> >> >> I am writing my own module. >> >> >> >> 1. I can see in function ngx_http_send_special_response >> >> ??? that it calculates the content length of the error page even if the request signed as header only (r->header_only = 1) >> >> ??? and set the content length header with value, after sending the header it does not send the body ( because? r->header_only = 1) >> >> ??? so the response arrive with content length different than 0 but without body >> >> >> >> ??? Is it a BUG? >> > >> >No.? The r->header_only flag should is set when body isn't >> >expected per protocol (HEAD requests, 304 responses).? Having >> >Content-Length present in such responses is ok. >> > >> >> 2.In the module I am trying to redirect the request with status code 302 (NGX_HTTP_MOVED_TEMPORARILY) >> >> ?? Trying to user->headers_out.location for the Alternate URL failed, I looked in the code and saw the Location must start with "/" - why? >> > >> >You have to set it correctly, i.e. add to r->headers_out.headers >> >and link to r->headers_out.location.? If it starts with "/" it >> >works even if set incorrectly due to adding of a server_name, >> >that's probably what confused you. >> > >> >> ?? In the end I add it to r->headers_out.headers >> >> ?? using header = ngx_list_push(&r->headers_out.headers); >> >> ?? Is it the write way to do it? >> >> >> >> 3. Can you explain please the different between >> >> ??? a. r->headers_out.content_length_n >> >> ??? b. r->headers_out.content_length >> > >> >The content_length_n is a numeric length, this what you normaly >> >should set when generating response in nginx.? The content_length >> >is a pointer to a headers array element, it might be present if >> >there is string representation of a Content-Length header >> >available for some reason (e.g. from a backend). >> > >> >> 4. Can you explain the usage of the hash field in ngx_table_elt_t >> > >> >Normally the hash field is used for fast lookups in hash >> >structures.? In case of r->headers_out it's usually just set to 1 >> >indicate the header is valid (or reset to 0 to indicate the >> >header should not be sent as it was superseeded by some other >> >header). >> > >> >Maxim Dounin >> > >> >_______________________________________________ >> >nginx mailing list >> >nginx at nginx.org >> >http://mailman.nginx.org/mailman/listinfo/nginx >> > >> > > >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > >_______________________________________________ >nginx mailing list >nginx at nginx.org >http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Apr 16 15:25:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 19:25:03 +0400 Subject: SSL negotiation failures causing 408 error to be returned In-Reply-To: <23c6bb3114f978f9e223193522fab9f7.NginxMailingListEnglish@forum.nginx.org> References: <20120416105930.GJ13466@mdounin.ru> <23c6bb3114f978f9e223193522fab9f7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120416152503.GM13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 10:43:03AM -0400, bpiraeus wrote: > The problem with that diagnosis, is that in this case, it's actually > causing failures on the client side. The client in question has a flash > game which pulls some amount of data over https, when these sessions > time out and hand out a 408, it causes the game itself to barf up a > lung. Additionally after pulling 12 hours of logs and doing UA matching, > while Chrome on Win7 base seems to be the major player, we find these as > well: Similar errors might as well be a result of e.g. network connectivity problems. It's hard to say anything without detailed inspection of a failure on the client side. [...] > The interesting bit is that the significant amount of these (when we > strip out Chrome) are MSIE on a Win7 base, which makes me inclined to > suspect something funny with Win 7, but there's at least 2 instances of > OS X in there, and 2 instances (FF 10.0.02 and FF 11) on NT 5.1 (XP > base) There is at least several Vista user-agents in your list (Windows NT 6.0), and I would rather suggest to compare the distribution to your site's OS/UA stats before concluding anything. And you need to trace real client failures, not 408 errors in general. Maxim Dounin From mdounin at mdounin.ru Mon Apr 16 15:57:16 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 19:57:16 +0400 Subject: ngx_http_send_special_response In-Reply-To: <1334589265.45104.YahooMailNeo@web125504.mail.ne1.yahoo.com> References: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> <20120416103744.GI13466@mdounin.ru> <1334575758.9686.YahooMailNeo@web125504.mail.ne1.yahoo.com> <20120416133823.GK13466@mdounin.ru> <1334589265.45104.YahooMailNeo@web125504.mail.ne1.yahoo.com> Message-ID: <20120416155716.GN13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 08:14:25AM -0700, hagai avrahami wrote: > Hi > Thanks > > The redirect response is from content handler context. > > Using the code you added > > cause Nginx to send back the Error Page (302) with > Content-Length and Content-Type ("test/html") (And I am trying > avoid that) without Body Ah, sorry, I missed you want to send 302 with an empty body, not just 302. Then instead of return NGX_HTTP_MOVED_TEMPORARY; you have to send actual response youself, like this: r->headers_out.status = NGX_HTTP_MOVED_TEMPORARY; r->headers_out.content_length_n = 0; rc = ngx_http_send_header(r); if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { return rc; } return ngx_http_send_special(r, NGX_HTTP_LAST); Maxim Dounin From hagaizzz at yahoo.com Mon Apr 16 16:28:01 2012 From: hagaizzz at yahoo.com (hagai avrahami) Date: Mon, 16 Apr 2012 09:28:01 -0700 (PDT) Subject: ngx_http_send_special_response In-Reply-To: <20120416155716.GN13466@mdounin.ru> References: <1334566419.86321.YahooMailNeo@web125506.mail.ne1.yahoo.com> <20120416103744.GI13466@mdounin.ru> <1334575758.9686.YahooMailNeo@web125504.mail.ne1.yahoo.com> <20120416133823.GK13466@mdounin.ru> <1334589265.45104.YahooMailNeo@web125504.mail.ne1.yahoo.com> <20120416155716.GN13466@mdounin.ru> Message-ID: <1334593681.18904.YahooMailNeo@web125504.mail.ne1.yahoo.com> Thanks! >________________________________ > From: Maxim Dounin >To: nginx at nginx.org >Sent: Monday, April 16, 2012 6:57 PM >Subject: Re: ngx_http_send_special_response > >Hello! > >On Mon, Apr 16, 2012 at 08:14:25AM -0700, hagai avrahami wrote: > >> Hi >> Thanks >> >> The redirect response is from content handler context. >> >> Using the code you added >> >> cause Nginx to send back the Error Page (302) with >> Content-Length and Content-Type ("test/html") (And I am trying >> avoid that) without Body > >Ah, sorry, I missed you want to send 302 with an empty body, not >just 302.? Then instead of > >? ? return NGX_HTTP_MOVED_TEMPORARY; > >you have to send actual response youself, like this: > >? ? r->headers_out.status = NGX_HTTP_MOVED_TEMPORARY; >? ? r->headers_out.content_length_n = 0; > >? ? rc = ngx_http_send_header(r); > >? ? if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { >? ? ? ? return rc; >? ? } > >? ? return ngx_http_send_special(r, NGX_HTTP_LAST); > >Maxim Dounin > >_______________________________________________ >nginx mailing list >nginx at nginx.org >http://mailman.nginx.org/mailman/listinfo/nginx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Apr 16 17:24:17 2012 From: nginx-forum at nginx.us (bpiraeus) Date: Mon, 16 Apr 2012 13:24:17 -0400 (EDT) Subject: SSL negotiation failures causing 408 error to be returned In-Reply-To: <20120416152503.GM13466@mdounin.ru> References: <20120416152503.GM13466@mdounin.ru> Message-ID: <42f0f0380cd3c7c65a4ed4707cea73b9.NginxMailingListEnglish@forum.nginx.org> Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > Similar errors might as well be a result of e.g. > network connectivity > problems. It's hard to say anything without > detailed inspection > of a failure on the client side. > We've been able to replicate once in a VM running Win 7 w/ Chrome. > There is at least several Vista user-agents in > your list (Windows > NT 6.0), and I would rather suggest to compare the > distribution to > your site's OS/UA stats before concluding > anything. And you need > to trace real client failures, not 408 errors in > general. We've done numerous packet traces, at this point we're fairly well stumped and are leaning towards it being some strange interaction with SSL+Flash. The 408s, while not specifically problem, may indirectly contribute to some behavioral issue that we're still trying to track down. I would be hard pressed to put this on Nginx, I was, ultimately, hoping someone had perhaps seen this behvior previously and had some insight into the issue. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225349,225375#msg-225375 From mdounin at mdounin.ru Mon Apr 16 17:56:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 Apr 2012 21:56:03 +0400 Subject: truncated output with gzip, large files and slow rate In-Reply-To: References: <20120416101741.GH13466@mdounin.ru> Message-ID: <20120416175603.GQ13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 02:27:08PM +0100, James Lee wrote: > On Mon, 16 Apr 2012 11:17:41 +0100, Maxim Dounin > wrote: > > >Could you please provide debug log and nginx -V output? > > debug.log.bz2 as attachment. Thanks, the problem looks clear. Could you please test if the following patch fixes things for you? # HG changeset patch # User Maxim Dounin # Date 1334597965 -14400 # Node ID f58e907f57e1136223c178ea81a18e52a136ec60 # Parent 56f926e54f3430f1f9ecc9ef154262de10c33005 Fixed loop in ngx_writev_chain() and ngx_solaris_sendfilev_chain(). diff --git a/src/os/unix/ngx_solaris_sendfilev_chain.c b/src/os/unix/ngx_solaris_sendfilev_chain.c --- a/src/os/unix/ngx_solaris_sendfilev_chain.c +++ b/src/os/unix/ngx_solaris_sendfilev_chain.c @@ -74,7 +74,6 @@ ngx_solaris_sendfilev_chain(ngx_connecti send = 0; - complete = 0; vec.elts = sfvs; vec.size = sizeof(sendfilevec_t); @@ -87,6 +86,7 @@ ngx_solaris_sendfilev_chain(ngx_connecti fprev = 0; sfv = NULL; eintr = 0; + complete = 0; sent = 0; prev_send = send; diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c --- a/src/os/unix/ngx_writev_chain.c +++ b/src/os/unix/ngx_writev_chain.c @@ -54,7 +54,6 @@ ngx_writev_chain(ngx_connection_t *c, ng } send = 0; - complete = 0; vec.elts = iovs; vec.size = sizeof(struct iovec); @@ -65,6 +64,7 @@ ngx_writev_chain(ngx_connection_t *c, ng prev = NULL; iov = NULL; eintr = 0; + complete = 0; prev_send = send; vec.nelts = 0; Maxim Dounin From list at oxdrove.co.uk Mon Apr 16 18:22:16 2012 From: list at oxdrove.co.uk (James Lee) Date: Mon, 16 Apr 2012 19:22:16 +0100 Subject: truncated output with gzip, large files and slow rate In-Reply-To: <20120416175603.GQ13466@mdounin.ru> References: <20120416101741.GH13466@mdounin.ru> <20120416175603.GQ13466@mdounin.ru> Message-ID: On Mon, 16 Apr 2012 18:56:03 +0100, Maxim Dounin wrote: Hello, > Thanks, the problem looks clear. Could you please test if the > following patch fixes things for you? Glad it looked clear to you! Quick test shows this fixes the problem. Thank you for the fix, I'll check tomorrow on a working installation and hopefully users will get full files at busy times. James. From lists at ruby-forum.com Mon Apr 16 18:27:36 2012 From: lists at ruby-forum.com (maria m.) Date: Mon, 16 Apr 2012 20:27:36 +0200 Subject: File Not Found logging in w/ nginx+phpMyAdmin in URL subdir In-Reply-To: <2ade13bb167050f3e7310e42f175013c@ruby-forum.com> References: <2ade13bb167050f3e7310e42f175013c@ruby-forum.com> Message-ID: server { listen 80; server_name support.example.com; access_log /var/log/nginx/support.example.com.access.log; error_log /var/log/nginx/support.example.com.error.log; # this root dir below is to the thebuggenie htdocs folder root /home/user/public_html/support.example.com/thebuggenie; client_max_body_size 40M; large_client_header_buffers 4 8k; index index.php index.html; location ^~ /files { } #location ~ \..*/.*\.php$ { return 403; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /(?.*){ set $suburi $1; try_files $uri $uri/ /index.php?url=$suburi&$args; } -- Posted via http://www.ruby-forum.com/. From eltlims at yahoo.com.br Mon Apr 16 19:34:30 2012 From: eltlims at yahoo.com.br (Elton Lima) Date: Mon, 16 Apr 2012 12:34:30 -0700 (PDT) Subject: File Not Found logging in w/ nginx+phpMyAdmin in URL subdir In-Reply-To: References: <2ade13bb167050f3e7310e42f175013c@ruby-forum.com> Message-ID: <1334604870.68092.YahooMailNeo@web39304.mail.mud.yahoo.com> Hi, server { ? ? ? ? listen ?80; ? ? ? ? server_name ?localhost; ? ? ? ? #access_log ?/var/log/nginx/access.log ?main; ? ? ? ? location / { ? ? ? ? ? ? root ? /var/www/nginx; ? ? ? ? ? ? index ?index.php index.html index.htm; ? ? ? ? } ? ? ? ?? location /phpmyadmin { ? ? ? ? ? ? ? ?root /usr/share/; ? ? ? ? ? ? ? ?index index.php index.html index.htm; ? ? ? ? ? ? ? ?location ~ ^/phpmyadmin/(.+\.php)$ { ? ? ? ? ? ? ? ? ? ? ? ?try_files $uri =404; ? ? ? ? ? ? ? ? ? ? ? ?root /usr/share/; ? ? ? ? ? ? ? ? ? ? ? ?fastcgi_pass 127.0.0.1:9000; ? ? ? ? ? ? ? ? ? ? ? ?fastcgi_index index.php; ? ? ? ? ? ? ? ? ? ? ? ?fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; ? ? ? ? ? ? ? ? ? ? ? ?include /etc/nginx/fastcgi_params; ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ?location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { ? ? ? ? ? ? ? ? ? ? ? ?root /usr/share/; ? ? ? ? ? ? ? ?} ? ? ? ? } ? ? ? ? location /phpMyAdmin { ? ? ? ? ? ? ? ?rewrite ^/* /phpmyadmin last; ? ? ? ? } } ? Elton Lima ------------------------------------------------------ Analista de Suporte Linux E-mail: eltonlim at gmail.com // eltlims at yahoo.com.br Site: http://blog.eltonlima.com.br ________________________________ De: maria m. Para: nginx at nginx.org Enviadas: Segunda-feira, 16 de Abril de 2012 15:27 Assunto: Re: File Not Found logging in w/ nginx+phpMyAdmin in URL subdir server { listen 80; server_name support.example.com; access_log /var/log/nginx/support.example.com.access.log; error_log /var/log/nginx/support.example.com.error.log; # this root dir below is to the thebuggenie htdocs folder root /home/user/public_html/support.example.com/thebuggenie; client_max_body_size 40M; large_client_header_buffers 4 8k; index index.php index.html; location ^~ /files { } #location ~ \..*/.*\.php$ { return 403; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /(?.*){ set $suburi $1; try_files $uri $uri/ /index.php?url=$suburi&$args; } -- Posted via http://www.ruby-forum.com/. _______________________________________________ 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 Apr 16 21:15:17 2012 From: nginx-forum at nginx.us (michael_teter) Date: Mon, 16 Apr 2012 17:15:17 -0400 (EDT) Subject: Display configuration at runtime? Message-ID: Howdy. I'm working on setting up a maintenance page, and I can't figure out where Nginx is looking for the maintenance.html that I have specified. I've tried placing the file in a lot of different locations, but I still get the generic "503 Service Temporarily Unavailable" page. My question is, is there a way I can get Nginx to display it's configuration at run-time, so perhaps I can determine where it is looking for the file? Thanks in advance, Michael Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225392,225392#msg-225392 From jim at ohlste.in Mon Apr 16 21:38:38 2012 From: jim at ohlste.in (Jim Ohlstein) Date: Mon, 16 Apr 2012 17:38:38 -0400 Subject: Display configuration at runtime? In-Reply-To: References: Message-ID: Jim Ohlstein On Apr 16, 2012 5:15 PM, "michael_teter" wrote: > > Howdy. > > I'm working on setting up a maintenance page, and I can't figure out > where Nginx is looking for the maintenance.html that I have specified. > I've tried placing the file in a lot of different locations, but I still > get the generic "503 Service Temporarily Unavailable" page. What does the error log show? If you use something like: location / { root /some/path; try_files maintenance.html $uri $uri/; ...; } then nginx will look for maintenance.html in the root directory and serve it if it's present. So to put our sites into maintenance mode, we simply copy our maintenance.html into the root directory. No need to reload nginx. When we're ready to go back up, the file is removed. > > My question is, is there a way I can get Nginx to display it's > configuration at run-time, so perhaps I can determine where it is > looking for the file? > > Thanks in advance, > Michael > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225392,225392#msg-225392 > Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashishs.dev at gmail.com Mon Apr 16 21:51:53 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Mon, 16 Apr 2012 14:51:53 -0700 Subject: Help with chaining of sub-requests Message-ID: Hi, I have 3 existing http backend web-services S1, S2 and S3. I am trying to use nginx for a use-case where i need to first get a "key" from service S1, use this key along with some input data, to query S2, and based on S2's response, query S3. My question is, would sub-request chaining be the best method to go about this? I can use the upstream method to connect to S1. Am i doing something wrong, if I then fire a sub-request (request to S2) from within the content handler (process header) method registered for this upstream?. How do i then initiate the sub-request to S3 ? Any pointers or example that i might be able to follow, for something like the above? Thanks, Ashish From nginx-forum at nginx.us Mon Apr 16 22:02:45 2012 From: nginx-forum at nginx.us (michael_teter) Date: Mon, 16 Apr 2012 18:02:45 -0400 (EDT) Subject: Display configuration at runtime? In-Reply-To: References: Message-ID: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> Thanks for the quick response. My error log shows nothing, but my access log does show the visit. Here's the relevant part of my config: server { listen 80; server_name www.ourname.com; rewrite ^(.*) https://$server_name$1 permanent; } server { listen 443; server_name www.ourname.com; #try_files $uri /maintenance.html @passenger; root /home/michael/ourname/public; # MT added 20120416 error_page 503 /maintenance.html; if (-f $document_root/../tmp/stop.txt) { set $maintenance 1; } if ($maintenance) { return 503; } passenger_enabled on; #rails_env development; rails_env production; location @passenger { passenger_enabled on; root /home/michael/ourname/public; } ssl on; ssl_certificate /home/michael/ssl_keys/ourname.com_ssl.crt; ssl_certificate_key /home/michael/ssl_keys/Cert1.key; #return 403; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225392,225395#msg-225395 From nginx-forum at nginx.us Mon Apr 16 22:05:23 2012 From: nginx-forum at nginx.us (michael_teter) Date: Mon, 16 Apr 2012 18:05:23 -0400 (EDT) Subject: Display configuration at runtime? In-Reply-To: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> References: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <36998251f3b4903876fa160e7d7d20c0.NginxMailingListEnglish@forum.nginx.org> I should note that on this line: error_page 503 /maintenance.html; I have tried a variety of paths. /maintenance.html $document_root/maintenance.html /some/other/path/maintenance.html etc. I don't understand how Nginx can see the stop.txt that I use to put it in maint mode, but it can't see (or ignores) $document_root/maintenance.html (when I had that set as the error_page) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225392,225396#msg-225396 From ne at vbart.ru Mon Apr 16 22:18:06 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 17 Apr 2012 02:18:06 +0400 Subject: Display configuration at runtime? In-Reply-To: References: Message-ID: <201204170218.06363.ne@vbart.ru> On Tuesday 17 April 2012 01:15:17 michael_teter wrote: [...] > > My question is, is there a way I can get Nginx to display it's > configuration at run-time, so perhaps I can determine where it is > looking for the file? > Debug log will help: http://nginx.org/en/docs/debugging_log.html wbr, Valentin V. Bartenev From jim at ohlste.in Mon Apr 16 22:25:44 2012 From: jim at ohlste.in (Jim Ohlstein) Date: Mon, 16 Apr 2012 18:25:44 -0400 Subject: Display configuration at runtime? In-Reply-To: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> References: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Apr 16, 2012 6:03 PM, "michael_teter" wrote: > > Thanks for the quick response. My error log shows nothing, but my > access log does show the visit. Use higher level error logging. See http://nginx.org/en/docs/ngx_core_module.html#error_log. > > Here's the relevant part of my config: > > > server { > listen 80; > server_name www.ourname.com; > rewrite ^(.*) https://$server_name$1 permanent; > } > server { > listen 443; > server_name www.ourname.com; > #try_files $uri /maintenance.html @passenger; Why are you not using this line? It's the perfect use case for "try_files". Note that I believe that you should remove the leading "/" from "/maintenance.html". > root /home/michael/ourname/public; > > # MT added 20120416 > error_page 503 /maintenance.html; > if (-f $document_root/../tmp/stop.txt) { > set $maintenance 1; > } > > if ($maintenance) { > return 503; > } This is a lot more work than using the above "try_files". See also http://wiki.nginx.org/IfIsEvil. > > passenger_enabled on; > #rails_env development; > rails_env production; > location @passenger { > passenger_enabled on; > root /home/michael/ourname/public; > } > > ssl on; > ssl_certificate /home/michael/ssl_keys/ourname.com_ssl.crt; > ssl_certificate_key /home/michael/ssl_keys/Cert1.key; > #return 403; > } > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225392,225395#msg-225395 > > Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Mon Apr 16 23:05:57 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 17 Apr 2012 00:05:57 +0100 Subject: Display configuration at runtime? In-Reply-To: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> References: <34ad57c9bed43d3baf79a901d69b3d7b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120416230557.GB26729@craic.sysops.org> On Mon, Apr 16, 2012 at 06:02:45PM -0400, michael_teter wrote: Hi there, > My error log shows nothing, but my > access log does show the visit. The error log doesn't seem immediately useful in this case; but with the debug log you can work out what is happening. The short answer is "internal redirect", or "subrequest". > Here's the relevant part of my config: > error_page 503 /maintenance.html; > if (-f $document_root/../tmp/stop.txt) { > set $maintenance 1; > } > > if ($maintenance) { > return 503; > } For any request, if the file exists then return 503, which does an internal redirect to /maintenance.html. This subrequest goes through the same process, and since the file still exists, you would end up in a loop. With the following config, you can break out of the loop: error_page 503 /maintenance.html; if ($uri = "/maintenance.html") { break; } if (-f $document_root/../tmp/stop.txt) { return 503; } Although I confess I don't know if there is a "best" way to implement a 503 response to all requests in nginx based on the existence of a flag file. f -- Francis Daly francis at daoine.org From agentzh at gmail.com Tue Apr 17 05:47:27 2012 From: agentzh at gmail.com (agentzh) Date: Tue, 17 Apr 2012 13:47:27 +0800 Subject: Slides for My Nginx Talk at Percona Live MySQL Conference 2012 In-Reply-To: References: Message-ID: Hi, folks! Last week chaoslawful and I gave a talk at Percona Live MySQL Conference 2012: ?http://www.percona.com/live/mysql-conference-2012/sessions/scripting-mysql-lua-and-libdrizzle-inside-nginx This was my first English presentation and I was glad that it went well :) Here's the AJAX-based slides for my part: ? ?http://agentzh.org/misc/slides/libdrizzle-lua-nginx/#2 You can use the arrow keys on your keyboard to switch pages. The slides contain a lot of benchmark results comparing various solutions like nginx + php-fpm + php-mysql, ngx_drizzle + ngx_rds_json, ngx_drizzle + ngx_lua, and nodejs + node-mysql + node-generic-pool. There's also a PDF version for these slides: ? ?http://agentzh.org/misc/slides/libdrizzle-lua-nginx.pdf Enjoy! -agentzh From agentzh at gmail.com Tue Apr 17 07:19:56 2012 From: agentzh at gmail.com (agentzh) Date: Tue, 17 Apr 2012 15:19:56 +0800 Subject: Help with chaining of sub-requests In-Reply-To: References: Message-ID: On Tue, Apr 17, 2012 at 5:51 AM, Ashish S wrote: > > I have 3 existing http backend web-services ?S1, S2 and S3. ?I am > trying to use nginx for a use-case where ?i need to first get a "key" > from service S1, use this key along with some input data, to query S2, > and based on S2's response, query S3. ? ?My question is, would > sub-request chaining be the best method to go about this? ?I can use > the upstream method to connect to S1. ? Am i doing something wrong, if > I then fire a sub-request (request to S2) from within the content > handler (process header) method registered for this upstream?. ?How do > i then initiate the sub-request to S3 ? > > Any pointers or example that i might be able to follow, for something > like the above? > Regarding chained subrequest implementation, see ngx_echo module's echo_subrequest directive for an example: ?? http://wiki.nginx.org/HttpEchoModule#echo_subrequest Also ngx_lua's ngx.location.capture() and ngx.location.capture_multi() worth a look too: ??? http://wiki.nginx.org/HttpLuaModule#ngx.location.capture ??? http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi Regarding non-subrequest upstream communication, ngx_lua supports the cosocket API which implements something similar to (but more general than) ngx_http_upstream: ??? http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp Hope these helps, -agentzh From ashishs.dev at gmail.com Tue Apr 17 07:46:58 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Tue, 17 Apr 2012 00:46:58 -0700 Subject: Help with chaining of sub-requests In-Reply-To: References: Message-ID: Thank you for the pointers, agentzh! --Ashish On Tue, Apr 17, 2012 at 12:19 AM, agentzh wrote: > On Tue, Apr 17, 2012 at 5:51 AM, Ashish S wrote: >> >> I have 3 existing http backend web-services ?S1, S2 and S3. ?I am >> trying to use nginx for a use-case where ?i need to first get a "key" >> from service S1, use this key along with some input data, to query S2, >> and based on S2's response, query S3. ? ?My question is, would >> sub-request chaining be the best method to go about this? ?I can use >> the upstream method to connect to S1. ? Am i doing something wrong, if >> I then fire a sub-request (request to S2) from within the content >> handler (process header) method registered for this upstream?. ?How do >> i then initiate the sub-request to S3 ? >> >> Any pointers or example that i might be able to follow, for something >> like the above? >> > > Regarding chained subrequest implementation, see ngx_echo module's > echo_subrequest directive for an example: > > ?? http://wiki.nginx.org/HttpEchoModule#echo_subrequest > > Also ngx_lua's ngx.location.capture() and ngx.location.capture_multi() > worth a look too: > > ??? http://wiki.nginx.org/HttpLuaModule#ngx.location.capture > ??? http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi > > Regarding non-subrequest upstream communication, ngx_lua supports the > cosocket API which implements something similar to (but more general > than) ngx_http_upstream: > > ??? http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp > > Hope these helps, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Apr 17 09:09:54 2012 From: nginx-forum at nginx.us (bigplum) Date: Tue, 17 Apr 2012 05:09:54 -0400 (EDT) Subject: Why the benchmark results are different? Message-ID: Hi, I install the newest nginx, and run 3 benchmark tools: ab/http_load/weighttp. I get three rps results 9129.48/2594.08 /1107. So which tool give the right result? # ab2 -n 10000 -c 1000 http://10.6.2.213/ 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 10.6.2.213 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests Server Software: nginx/1.1.19 Server Hostname: 10.6.2.213 Server Port: 80 Document Path: / Document Length: 151 bytes Concurrency Level: 1000 Time taken for tests: 1.095 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 3620000 bytes HTML transferred: 1510000 bytes Requests per second: 9129.48 [#/sec] (mean) Time per request: 109.535 [ms] (mean) Time per request: 0.110 [ms] (mean, across all concurrent requests) Transfer rate: 3227.41 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 9 11.4 2 34 Processing: 2 26 30.3 16 638 Waiting: 1 24 29.3 16 638 Total: 3 35 36.9 16 641 Percentage of the requests served within a certain time (ms) 50% 16 66% 31 75% 53 80% 56 90% 67 95% 109 98% 164 99% 178 100% 641 (longest request) # ./http_load -parallel 1000 -fetches 10000 ./htl.url 10000 fetches, 1000 max parallel, 1.51e+06 bytes, in 3.85493 seconds 151 mean bytes/connection 2594.08 fetches/sec, 391706 bytes/sec msecs/connect: 211.437 mean, 3001.19 max, 0.102 min msecs/first-response: 38.354 mean, 1456.25 max, 0.189 min HTTP response codes: code 200 -- 10000 # weighttp -n 10000 -t 10 -c 1000 http://10.6.2.213 weighttp - a lightweight and simple webserver benchmarking tool starting benchmark... spawning thread #1: 100 concurrent requests, 1000 total requests spawning thread #2: 100 concurrent requests, 1000 total requests spawning thread #3: 100 concurrent requests, 1000 total requests spawning thread #4: 100 concurrent requests, 1000 total requests spawning thread #5: 100 concurrent requests, 1000 total requests spawning thread #6: 100 concurrent requests, 1000 total requests spawning thread #7: 100 concurrent requests, 1000 total requests spawning thread #8: 100 concurrent requests, 1000 total requests spawning thread #9: 100 concurrent requests, 1000 total requests progress: 10% done spawning thread #10: 100 concurrent requests, 1000 total requests progress: 20% done progress: 30% done progress: 40% done progress: 50% done progress: 60% done progress: 70% done progress: 80% done progress: 90% done progress: 100% done finished in 9 sec, 26 millisec and 801 microsec, 1107 req/s, 391 kbyte/s requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx traffic: 3620000 bytes total, 2110000 bytes http, 1510000 bytes data Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225415,225415#msg-225415 From igor at sysoev.ru Tue Apr 17 09:18:29 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 17 Apr 2012 13:18:29 +0400 Subject: Why the benchmark results are different? In-Reply-To: References: Message-ID: <20120417091829.GA95437@nginx.com> On Tue, Apr 17, 2012 at 05:09:54AM -0400, bigplum wrote: > I install the newest nginx, and run 3 benchmark tools: > ab/http_load/weighttp. I get > three rps results 9129.48/2594.08 /1107. So which tool give the right > result? I believe you benchmarked these tools themselves. It seems the tools overhead is larger than nginx's overhead. -- Igor Sysoev From nginx-forum at nginx.us Tue Apr 17 10:44:48 2012 From: nginx-forum at nginx.us (leontinus) Date: Tue, 17 Apr 2012 06:44:48 -0400 (EDT) Subject: some of my user cannot access my website Message-ID: Hi guys, I need your help to help me identify a problem. I'm running an online marketplace here in Indonesia. Right now I have 1 mod perl server using apache and 1 nginx server as proxy. But some of my users complain they cannot access my website, http://www.tokopedia.com. And I found out a fact that if they use mikrotik HttpProxy, they cannot access my website, but they can access other website. If they use firefox, they found err message : Content Encoding Error If they use google chrome, they found err message : ERR_INVALID_CHUNKED_ENCODING Can you help me with this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225421,225421#msg-225421 From nginx-forum at nginx.us Tue Apr 17 10:51:54 2012 From: nginx-forum at nginx.us (leontinus) Date: Tue, 17 Apr 2012 06:51:54 -0400 (EDT) Subject: some of my user cannot access my website In-Reply-To: References: Message-ID: <953e03108e130f68986766f1c2dc6351.NginxMailingListEnglish@forum.nginx.org> by the way here i put my website proxy configuration #-- notice info error_log /data/share/project/www-conf/logs/nginx.err.proxy.log; pid /data/share/project/www-conf/logs/nginx.proxy.pid; user ngproxy tokopedia; worker_processes 4; events { worker_connections 1024; } http { include /share/project/www-conf/nginx/tkpmodperl1/mime.types; include /share/project/www-conf/nginx/deny.conf; default_type text/plain; sendfile on; keepalive_timeout 5; set_real_ip_from 192.168.1.0/24; real_ip_header X-Forwarded-For; gzip on; #gzip off; gzip_types text/plain text/css application/x-javascript; gzip_comp_level 9; gzip_proxied any; #gzip_vary off; #charset ISO-8859-1; charset UTF-8; source_charset UTF-8; #------------------- server { server_name tokopedia; listen 80; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server www.tokopedia.com; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header Accept-Encoding ""; proxy_buffering on; proxy_buffers 8 64k; if ($http_user_agent ~* big.brother|crawl ){return 403;} if ($http_user_agent = "" ){return 403;} location /___pstatus { stub_status on; access_log off; } location /img/ { proxy_pass http://xxx.xxx.xxx.xxx/img/; } location ~* ^/(.*)\.(js|css)$ { proxy_pass http://xxx.xxx.xxx.xxx/$1.$2; } location / { proxy_pass http://xxx.xxx.xxx.xxx:888/; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225421,225422#msg-225422 From svoop at delirium.ch Tue Apr 17 11:24:07 2012 From: svoop at delirium.ch (Sven Schwyn) Date: Tue, 17 Apr 2012 13:24:07 +0200 Subject: Legitimate access with certificate auth or basic auth Message-ID: <80A15EAE-1997-4A5B-ADEA-AA281787DCA4@delirium.ch> Hi Is there a way to legitimate access to a location (in my case an entire vhost) with certificate auth and - if no certificate is sent - a fallback to basic auth? On Apache (from where I'm currently migrating) this is done with "FakeBasicAuth" as follows: SSLVerifyClient require SSLVerifyDepth 3 SSLCADNRequestFile /path/to/certs.pem SSLOptions +FakeBasicAuth Allow from all AuthName 'MySite' AuthType Basic AuthUserFile /path/to/htpasswd Require valid-user Thanks for your hints! From Pekka.Panula at sofor.fi Tue Apr 17 11:43:27 2012 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Tue, 17 Apr 2012 14:43:27 +0300 Subject: I am getting wrong response from nginx Message-ID: Hi I am wondering how does nginx returns wrong content, atleast it seems so. I am terminating https addresses to nginx thru my firewall, what does nat public ips to nginx to ports 901 and 902 in this case, where nginx is configured to wait https connections. So when end user hits eg address: https://a.host.com/, firewall does nat and sends it to nginx private ip port 901, and https://b.host.com/ goes to nginx private ip port 902. Some config lines: http { proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; client_max_body_size 50M; # DNS resolver resolver 213.250.93.67; # nginx oma http proxy cache proxy_cache_path /usr/share/nginx/cache levels=1:2 keys_zone=one:10m max_size=1G; proxy_temp_path /usr/share/nginx/tmp; proxy_cache_key "$scheme$host$request_uri$args"; proxy_cache_use_stale updating error timeout invalid_header http_500 http_502 http_503 http_504; # ---- cache times ---- proxy_cache_valid 200 302 5m; proxy_cache_valid 301 1h; proxy_cache_valid any 1m; proxy_cache one; proxy_cache_bypass $http_pragma $http_authorization $cookie_DomAuthSessId $args; proxy_no_cache $http_pragma $http_authorization $cookie_DomAuthSessId $args; include mime.types; default_type application/octet-stream; gzip_http_version 1.1; gzip_vary on; gzip_min_length 1100; gzip_buffers 16 8k; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_proxied any; gzip_types text/css text/plain application/atom+xml application/x-javascript application/xml text/javascript application/xml+rss; gzip on; server_tokens off; client_header_timeout 3m; send_timeout 3m; client_header_buffer_size 8k; large_client_header_buffers 4 8k; output_buffers 1 32k; postpone_output 1460; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 75 20; server_names_hash_bucket_size 256; # this seems to be required for some vh log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; 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; proxy_connect_timeout 120; proxy_send_timeout 120; proxy_read_timeout 120; proxy_set_header Accept-Encoding ""; proxy_pass_header Set-Cookie; # ---- geoip ----- # geo $country { default no; include conf.d/geo.data; } # catchall server { listen 80 default; server_name _; access_log /var/log/nginx/default-access.log main; server_name_in_redirect off; location / { index index.html; root /var/www/default/htdocs; } } include /etc/nginx/virtual-hosts/*; } then here is config file for a.host.com, file: /etc/nginx/virtual-hosts/a.host.com server { listen 81.x.y.x:901; ssl on; ssl_certificate /etc/nginx/ssl/a.crt; ssl_certificate_key /etc/nginx/ssl/a.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; # HTTP Strict Transport Security add_header Strict-Transport-Security max-age=500; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; server_name a.host.com atest.host.com; access_log /logfiles/a.host.com/a.host.com-access_log combined; default_type text/html; root /usr/share/nginx/huolto; location / { proxy_cache off; proxy_cache_valid 200 302 0; proxy_cache_valid 301 0; proxy_cache_valid any 0; proxy_set_header ClientProtocol HTTPS; proxy_set_header Accept-Encoding ""; proxy_pass http://1.1.1.131; # Huoltoikkuna (manuaalinen) include /etc/nginx/maintenance.conf; } } then file: /etc/nginx/virtual-hosts/b.host.com server { listen 81.x.y.x:902; ssl on; ssl_certificate /etc/nginx/ssl/b.crt; ssl_certificate_key /etc/nginx/ssl/b.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; proxy_cache_use_stale off; # HTTP Strict Transport Security add_header Strict-Transport-Security max-age=500; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; server_name b.host.com btest.host.com; access_log /logfiles/b.host.com/b.host.com-access_log combined; default_type text/html; root /usr/share/nginx/huolto; location / { proxy_cache off; proxy_cache_valid 200 302 0; proxy_cache_valid 301 0; proxy_cache_valid any 0; proxy_set_header ClientProtocol HTTPS; proxy_set_header Accept-Encoding ""; proxy_pass http://1.1.1.131; } } I have also a wildcard ssl cert, file /etc/nginx/virtual-hosts/wildcard.host.com: ssl_certificate /etc/nginx/ssl/wildcard.crt; ssl_certificate_key /etc/nginx/ssl/wildcard.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:20m; server { listen 443 default ssl; ssl on; server_name my.default.hostname; access_log /logfiles/my.default.hostname/my.default.hostname-access_log combined; # HTTP Strict Transport Security add_header Strict-Transport-Security max-age=500; location / { proxy_cache off; proxy_cache_valid 200 302 0; proxy_cache_valid 301 0; proxy_cache_valid any 0; proxy_pass http://1.2.3.4; # Huoltoikkuna (manuaalinen) include /etc/nginx/maintenance.conf; } } Now when i do go to address https://b.host.com/, i am getting response from a.host.com. I am pretty if correct Host header goes to 1.1.1.131 server, it should return different content, i have tested it manually using curl, eg: " curl --verbose --header 'Host: b.host.com' http://1.1.1.131" from nginx machine, i will get correct content, but not thru nginx. So i am assuming that somehow i am getting wrong content from a.host.com or does nginx somehow leave Host header off? Notice that i have same proxy_pass in both a.host.com and in b.host.com, they resides on same ip and same port (named virtual hosts). What i am debugged, i can see it goes to b.host.com config block, atleast nginx writes to /logfiles/b.host.com/b.host.com-access_log when i do test it. 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 mdounin at mdounin.ru Tue Apr 17 12:17:57 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 17 Apr 2012 16:17:57 +0400 Subject: I am getting wrong response from nginx In-Reply-To: References: Message-ID: <20120417121756.GX13466@mdounin.ru> Hello! On Tue, Apr 17, 2012 at 02:43:27PM +0300, Pekka.Panula at sofor.fi wrote: > I am wondering how does nginx returns wrong content, atleast it seems so. > I am terminating https addresses to nginx thru my firewall, what does nat > public ips to nginx to ports 901 and 902 in this case, where nginx is > configured to wait https connections. > > So when end user hits eg address: https://a.host.com/, firewall does nat > and sends it to nginx private ip port 901, and https://b.host.com/ goes to > nginx private ip port 902. [...] > server { > listen 81.x.y.x:901; [...] > server_name a.host.com atest.host.com; [...] > location / { > proxy_cache off; > proxy_cache_valid 200 302 0; > proxy_cache_valid 301 0; > proxy_cache_valid any 0; > proxy_set_header ClientProtocol HTTPS; > proxy_set_header Accept-Encoding ""; > proxy_pass http://1.1.1.131; This will result in a request with "Host: 1.1.1.131" to a backend server, see http://nginx.org/r/proxy_set_header. [...] > server { > listen 81.x.y.x:902; [...] > server_name b.host.com btest.host.com; [...] > location / { > proxy_cache off; > proxy_cache_valid 200 302 0; > proxy_cache_valid 301 0; > proxy_cache_valid any 0; > proxy_set_header ClientProtocol HTTPS; > proxy_set_header Accept-Encoding ""; > proxy_pass http://1.1.1.131; Same here. [...] > Now when i do go to address https://b.host.com/, i am getting response > from a.host.com. > > I am pretty if correct Host header goes to 1.1.1.131 server, it should > return different content, i have tested it manually using curl, eg: > " curl --verbose --header 'Host: b.host.com' http://1.1.1.131" from nginx > machine, i will get correct content, but not thru nginx. > So i am assuming that somehow i am getting wrong content from a.host.com > or does nginx somehow leave Host header off? By default nginx uses the name you wrote in a proxy_pass directive for the Host header. You probably want to use proxy_set_header Host $host; or something similar in the locations above. [...] Maxim Dounin From Pekka.Panula at sofor.fi Tue Apr 17 12:29:26 2012 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Tue, 17 Apr 2012 15:29:26 +0300 Subject: I am getting wrong response from nginx In-Reply-To: <20120417121756.GX13466@mdounin.ru> References: <20120417121756.GX13466@mdounin.ru> Message-ID: > By default nginx uses the name you wrote in a proxy_pass directive > for the Host header. You probably want to use > > proxy_set_header Host $host; > > or something similar in the locations above. > > [...] > > Maxim Dounin Hi, look again, i do have a proxy_set_header line in my http block. It should inherit it to server blocks, afaik? 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 mdounin at mdounin.ru Tue Apr 17 12:41:08 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 17 Apr 2012 16:41:08 +0400 Subject: some of my user cannot access my website In-Reply-To: References: Message-ID: <20120417124108.GY13466@mdounin.ru> Hello! On Tue, Apr 17, 2012 at 06:44:48AM -0400, leontinus wrote: > Hi guys, I need your help to help me identify a problem. I'm running an > online marketplace here in Indonesia. Right now I have 1 mod perl server > using apache and 1 nginx server as proxy. But some of my users complain > they cannot access my website, http://www.tokopedia.com. And I found out > a fact that if they use mikrotik HttpProxy, they cannot access my > website, but they can access other website. > > If they use firefox, they found err message : Content Encoding Error > If they use google chrome, they found err message : > ERR_INVALID_CHUNKED_ENCODING > > Can you help me with this? The messages suggest there is something wrong with the proxy in question, most likely it fails to handle chunked encoding properly. You may try to disable use of chunked transfer encoding with chunked_transfer_encoding off; to see if it helps. Note though that it will also make keepalive connections impossible if Content-Length isn't known. You may also try to disabling keepalive connections completely with keepalive_timeout 0; See here for details: http://nginx.org/r/chunked_transfer_encoding http://nginx.org/r/keepalive_timeout Maxim Dounin From mdounin at mdounin.ru Tue Apr 17 12:43:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 17 Apr 2012 16:43:03 +0400 Subject: I am getting wrong response from nginx In-Reply-To: References: <20120417121756.GX13466@mdounin.ru> Message-ID: <20120417124303.GZ13466@mdounin.ru> Hello! On Tue, Apr 17, 2012 at 03:29:26PM +0300, Pekka.Panula at sofor.fi wrote: > > By default nginx uses the name you wrote in a proxy_pass directive > > for the Host header. You probably want to use > > > > proxy_set_header Host $host; > > > > or something similar in the locations above. > > > > [...] > > > > Maxim Dounin > > > Hi, look again, i do have a proxy_set_header line in my http block. It > should inherit it to server blocks, afaik? No. Quote from http://nginx.org/r/proxy_set_header: These directives are inherited from the previous level if and only if there are no proxy_set_header directives defined on the current level. Maxim Dounin From Pekka.Panula at sofor.fi Tue Apr 17 12:50:41 2012 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Tue, 17 Apr 2012 15:50:41 +0300 Subject: I am getting wrong response from nginx In-Reply-To: <20120417124303.GZ13466@mdounin.ru> References: <20120417121756.GX13466@mdounin.ru> <20120417124303.GZ13466@mdounin.ru> Message-ID: > > Hi, look again, i do have a proxy_set_header line in my http block. It > > should inherit it to server blocks, afaik? > > No. > > Quote from http://nginx.org/r/proxy_set_header: > > These directives are inherited from the previous level if and only > if there are no proxy_set_header directives defined on the current > level. > > Maxim Dounin Hi, that was my problem! Thx man, you saved my day. Now my configuration does do what it suppose todo. 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 nginx-forum at nginx.us Tue Apr 17 13:44:13 2012 From: nginx-forum at nginx.us (mscheel) Date: Tue, 17 Apr 2012 09:44:13 -0400 (EDT) Subject: worker process exited on signal 11 Message-ID: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> Dear all, error logs show this error (worker process exited on signal 11). The error appears after ~1 hour, then with the half of the worker processes. No problems with 1.0-versions of nginx. Problem existed in 1.1.18 already. I'm using a custom rpm build with the following additional modules: --add-module=/root/rpm/SOURCES/agentzh-headers-more-nginx-module-3580526 \ --add-module=/root/rpm/SOURCES/FRiCKLE-ngx_cache_purge-e34bd2c \ --add-module=/root/rpm/SOURCES/substitutions4nginx-read-only \ Here is the backtrace, any ideas? Thank you. 2012/04/17 10:16:36 [alert] 20802#0: worker process 20808 exited on signal 11 (core dumped) 2012/04/17 10:16:45 [alert] 20802#0: worker process 20805 exited on signal 11 (core dumped) 2012/04/17 10:17:33 [alert] 20802#0: worker process 23616 exited on signal 11 (core dumped) 2012/04/17 10:18:14 [alert] 20802#0: worker process 20806 exited on signal 11 (core dumped) 2012/04/17 10:22:41 [alert] 20802#0: worker process 23892 exited on signal 11 (core dumped) dmesg: nginx[20808]: segfault at 0000000000000020 rip 000000000042a47b rsp 00007fff79073f80 error 4 nginx[20805]: segfault at 0000000000000020 rip 000000000042a47b rsp 00007fff79073f80 error 4 nginx[23616]: segfault at 0000000000000020 rip 000000000042a47b rsp 00007fff79073ff0 error 4 nginx[20806]: segfault at 0000000000000020 rip 000000000042a47b rsp 00007fff79073f80 error 4 nginx[23892]: segfault at 0000000000000008 rip 000000000042cbe8 rsp 00007fff79073f20 error 6 gdb /usr/sbin/nginx /var/local/dumps/core GNU gdb 6.6 Copyright (C) 2006 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 "x86_64-suse-linux"... Using host libthread_db library "/lib64/libthread_db.so.1". Reading symbols from /lib64/libpthread.so.0...done. Loaded symbols for /lib64/libpthread.so.0 Reading symbols from /lib64/libcrypt.so.1...done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /usr/lib64/libpcre.so.0...done. Loaded symbols for /usr/lib64/libpcre.so.0 Reading symbols from /usr/lib64/libssl.so.0.9.8...done. Loaded symbols for /usr/lib64/libssl.so.0.9.8 Reading symbols from /usr/lib64/libcrypto.so.0.9.8...done. Loaded symbols for /usr/lib64/libcrypto.so.0.9.8 Reading symbols from /lib64/libdl.so.2...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libz.so.1...done. Loaded symbols for /lib64/libz.so.1 Reading symbols from /usr/lib64/libGeoIP.so.1...done. Loaded symbols for /usr/lib64/libGeoIP.so.1 Reading symbols from /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so...done. Loaded symbols for /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so Reading symbols from /lib64/libm.so.6...done. Loaded symbols for /lib64/libm.so.6 Reading symbols from /lib64/libc.so.6...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/nginx/nginx.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/nginx/nginx.so Core was generated by `nginx: worker pr'. Program terminated with signal 11, Segmentation fault. #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 195 src/os/unix/ngx_readv_chain.c: No such file or directory. in src/os/unix/ngx_readv_chain.c (gdb) bt #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 #1 0x000000000042b133 in ngx_event_pipe (p=0x747170, do_write=) at src/event/ngx_event_pipe.c:271 #2 0x000000000045410e in ngx_http_upstream_process_upstream (r=0x69ef00, u=0x746db8) at src/http/ngx_http_upstream.c:2641 #3 0x0000000000454269 in ngx_http_upstream_handler (ev=0x2b50cc7d9218) at src/http/ngx_http_upstream.c:935 #4 0x0000000000428f64 in ngx_event_process_posted (cycle=0x5f6490, posted=0x5d14a0) at src/event/ngx_event_posted.c:40 #5 0x000000000042fc36 in ngx_worker_process_cycle (cycle=0x5f6490, data=) at src/os/unix/ngx_process_cycle.c:806 #6 0x000000000042e14d in ngx_spawn_process (cycle=0x5f6490, proc=0x42fb70 , data=0x0, name=0x49e05e "worker process", respawn=5) at src/os/unix/ngx_process.c:198 #7 0x0000000000430c76 in ngx_master_process_cycle (cycle=0x5f6490) at src/os/unix/ngx_process_cycle.c:622 #8 0x000000000041235d in main (argc=1, argv=) at src/core/nginx.c:410 (gdb) backtrace full #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 prev = (u_char *) 0x0 n = size = 0 err = vec = {elts = 0x7fff79073f20, nelts = 0, size = 16, nalloc = 16, pool = 0x5f57a0} rev = iov = (struct iovec *) 0x0 iovs = {{iov_base = 0x40000, iov_len = 140735223906344}, {iov_base = 0x69ef00, iov_len = 47624914552144}, {iov_base = 0x6024c0, iov_len = 262144}, {iov_base = 0x1, iov_len = 4566241}, { iov_base = 0x40000, iov_len = 6942464}, {iov_base = 0x2b508a1d4550, iov_len = 0}, {iov_base = 0x0, iov_len = 47624930312022}, {iov_base = 0x69b6e0, iov_len = 6942464}, { iov_base = 0x2b508a1d4550, iov_len = 6300864}, {iov_base = 0x40000, iov_len = 1}, {iov_base = 0x602460, iov_len = 4367464}, {iov_base = 0x1, iov_len = 2}, {iov_base = 0x0, iov_len = 47624930399933}, {iov_base = 0x40000, iov_len = 4309842}, {iov_base = 0x2b50cc80e2e8, iov_len = 4370439}, {iov_base = 0x2b, iov_len = 2}} #1 0x000000000042b133 in ngx_event_pipe (p=0x747170, do_write=) at src/event/ngx_event_pipe.c:271 rc = rev = wev = #2 0x000000000045410e in ngx_http_upstream_process_upstream (r=0x69ef00, u=0x746db8) at src/http/ngx_http_upstream.c:2641 c = (ngx_connection_t *) 0x2b508a1d43d0 #3 0x0000000000454269 in ngx_http_upstream_handler (ev=0x2b50cc7d9218) at src/http/ngx_http_upstream.c:935 c = (ngx_connection_t *) 0x2b508a1d4550 r = (ngx_http_request_t *) 0x69ef00 u = (ngx_http_upstream_t *) 0x746db8 #4 0x0000000000428f64 in ngx_event_process_posted (cycle=0x5f6490, posted=0x5d14a0) at src/event/ngx_event_posted.c:40 ev = (ngx_event_t *) 0x2b50cc7d9218 #5 0x000000000042fc36 in ngx_worker_process_cycle (cycle=0x5f6490, data=) at src/os/unix/ngx_process_cycle.c:806 i = 0 c = #6 0x000000000042e14d in ngx_spawn_process (cycle=0x5f6490, proc=0x42fb70 , data=0x0, name=0x49e05e "worker process", respawn=5) at src/os/unix/ngx_process.c:198 on = 1 pid = 0 s = 5 #7 0x0000000000430c76 in ngx_master_process_cycle (cycle=0x5f6490) at src/os/unix/ngx_process_cycle.c:622 title = p = size = 9 i = n = 432 sigio = 0 set = {__val = {0 }} itv = {it_interval = {tv_sec = 0, tv_usec = 6251688}, it_value = {tv_sec = 0, tv_usec = 47624916165168}} live = 1 delay = 0 ccf = (ngx_core_conf_t *) 0x5f74f0 #8 0x000000000041235d in main (argc=1, argv=) at src/core/nginx.c:410 i = log = (ngx_log_t *) 0x5ce6e0 cycle = (ngx_cycle_t *) 0x5f6490 init_cycle = {conf_ctx = 0x0, pool = 0x5f5440, log = 0x5ce6e0, new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0, data = 0x0, action = 0x0}, files = 0x0, free_connections = 0x0, free_connection_n = 0, reusable_connections_queue = {prev = 0x0, next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, pathes = { elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = { last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0, write_events = 0x0, old_cycle = 0x0, conf_file = {len = 21, data = 0x4998b3 "/etc/nginx/nginx.conf"}, conf_param = {len = 0, data = 0x0}, conf_prefix = {len = 11, data = 0x4998b3 "/etc/nginx/nginx.conf"}, prefix = {len = 6, data = 0x4998ac "/usr//"}, lock_file = {len = 0, data = 0x0}, hostname = {len = 0, data = 0x0}} ccf = (ngx_core_conf_t *) 0x5f74f0 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225420#msg-225420 From nginx-forum at nginx.us Tue Apr 17 14:20:10 2012 From: nginx-forum at nginx.us (mscheel) Date: Tue, 17 Apr 2012 10:20:10 -0400 (EDT) Subject: worker process exited on signal 11 In-Reply-To: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> References: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <35b528922bf87b99900a8ada6b165ca8.NginxMailingListEnglish@forum.nginx.org> sorry, forgot uname -a: Linux hostname 2.6.16.60-0.42.10-smp #1 SMP Tue Apr 27 05:11:27 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux nginx -V nginx version: nginx/1.1.19 built by gcc 4.1.2 20070115 (SUSE Linux) TLS SNI support disabled configure arguments: --add-module=/root/rpm/SOURCES/agentzh-headers-more-nginx-module-3580526 --add-module=/root/rpm/SOURCES/FRiCKLE-ngx_cache_purge-e34bd2c --add-module=/root/rpm/SOURCES/substitutions4nginx-read-only --with-debug --prefix=/usr/ --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/run/nginx.lock --http-client-body-temp-path=/var/lib/nginx/tmp/ --http-proxy-temp-path=/var/lib/nginx/proxy/ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi/ --http-uwsgi-temp-path=/var/lib/nginx/uwsgi/ --http-scgi-temp-path=/var/lib/nginx/scgi/ --user=wwwrun --group=www --with-rtsig_module --with-select_module --with-poll_module --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-perl=/usr/bin/perl --with-mail --with-mail_ssl_module --with-pcre --with-md5=/usr --with-sha1=/usr --with-cc-opt='-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector' Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225433#msg-225433 From a_davy at bellsouth.net Tue Apr 17 15:56:54 2012 From: a_davy at bellsouth.net (Allan Davy) Date: Tue, 17 Apr 2012 10:56:54 -0500 Subject: Compiling nginx with zlib-1.2.6 error Message-ID: Hello, I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11 platform and received the following error. gmake . . . cd ../zlib-1.2.6 \ && gmake distclean \ && CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="gcc" \ ./configure \ && gmake libz.a gmake[2]: Entering directory `/home/produser/Downloads/zlib-1.2.6' make -f Makefile.in distclean make: Fatal error in reader: Makefile.in, line 57: Unexpected end of line seen Current working directory /home/produser/Downloads/zlib-1.2.6 gmake[2]: *** [distclean] Error 1 gmake[2]: Leaving directory `/home/produser/Downloads/zlib-1.2.6' gmake[1]: *** [../zlib-1.2.6/libz.a] Error 2 gmake[1]: Leaving directory `/home/produser/Downloads/nginx-1.0.15' gmake: *** [build] Error 2 Pleae advise what I should do. There were many many bug fixes and enhancements to zlib 1.2.6 over the 1.2.5 and would like to know if its going to work or not. Tank you, Allan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sb at waeme.net Tue Apr 17 16:21:15 2012 From: sb at waeme.net (Sergey Budnevitch) Date: Tue, 17 Apr 2012 20:21:15 +0400 Subject: Compiling nginx with zlib-1.2.6 error In-Reply-To: References: Message-ID: <6FA4E717-2E18-4C73-AA9E-73E2F55538C8@waeme.net> On 17.04.2012, at 19:56, Allan Davy wrote: > Hello, > I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11 platform and received the following error. I doubt you will be able to build static library on solaris 10 or 11. Try to build or install new dynamic zlib 1.2.6 and run nginx with LD_PRELOAD hack: LD_PRELOAD=/path/to/new/libz.so nginx > > gmake > . > . > . > cd ../zlib-1.2.6 \ > && gmake distclean \ > && CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="gcc" \ > ./configure \ > && gmake libz.a > gmake[2]: Entering directory `/home/produser/Downloads/zlib-1.2.6' > make -f Makefile.in distclean > make: Fatal error in reader: Makefile.in, line 57: Unexpected end of line seen > Current working directory /home/produser/Downloads/zlib-1.2.6 > gmake[2]: *** [distclean] Error 1 > gmake[2]: Leaving directory `/home/produser/Downloads/zlib-1.2.6' > gmake[1]: *** [../zlib-1.2.6/libz.a] Error 2 > gmake[1]: Leaving directory `/home/produser/Downloads/nginx-1.0.15' > gmake: *** [build] Error 2 > > Pleae advise what I should do. There were many many bug fixes and enhancements to zlib 1.2.6 over the 1.2.5 and would like to know if its going to work or not. > > Tank you, > Allan > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Tue Apr 17 16:48:24 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 17 Apr 2012 20:48:24 +0400 Subject: Compiling nginx with zlib-1.2.6 error In-Reply-To: References: Message-ID: <20120417164824.GB13466@mdounin.ru> Hello! On Tue, Apr 17, 2012 at 10:56:54AM -0500, Allan Davy wrote: > Hello, > I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11 platform and received the following error. > > gmake > . > . > . > cd ../zlib-1.2.6 \ > && gmake distclean \ > && CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="gcc" \ > ./configure \ > && gmake libz.a > gmake[2]: Entering directory `/home/produser/Downloads/zlib-1.2.6' > make -f Makefile.in distclean > make: Fatal error in reader: Makefile.in, line 57: Unexpected end of line seen > Current working directory /home/produser/Downloads/zlib-1.2.6 > gmake[2]: *** [distclean] Error 1 > gmake[2]: Leaving directory `/home/produser/Downloads/zlib-1.2.6' > gmake[1]: *** [../zlib-1.2.6/libz.a] Error 2 > gmake[1]: Leaving directory `/home/produser/Downloads/nginx-1.0.15' > gmake: *** [build] Error 2 > > Pleae advise what I should do. There were many many bug fixes > and enhancements to zlib 1.2.6 over the 1.2.5 and would like to > know if its going to work or not. As usual, "many bug fixes" means "old bugs fixed, new bugs added". The zlib-1.2.6's Makefile.in now can't be parsed by Solaris's make, but shipped Makefile calls "make" as a hardcoded command for distclean target. You may try the following patch (against zlib-1.2.6) to see if it helps (and report the problem to zlib folks): --- Makefile.orig Tue Apr 17 20:39:34 2012 +++ Makefile Tue Apr 17 20:39:48 2012 @@ -2,4 +2,4 @@ - at echo "Please use ./configure first. Thank you." distclean: - make -f Makefile.in distclean + ${MAKE} -f Makefile.in distclean If you want to just compile nginx, the fix should be as trivial as running ./configure in zlib's directory once. Maxim Dounin From mdounin at mdounin.ru Tue Apr 17 16:56:46 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 17 Apr 2012 20:56:46 +0400 Subject: Compiling nginx with zlib-1.2.6 error In-Reply-To: <6FA4E717-2E18-4C73-AA9E-73E2F55538C8@waeme.net> References: <6FA4E717-2E18-4C73-AA9E-73E2F55538C8@waeme.net> Message-ID: <20120417165645.GC13466@mdounin.ru> Hello! On Tue, Apr 17, 2012 at 08:21:15PM +0400, Sergey Budnevitch wrote: > > On 17.04.2012, at 19:56, Allan Davy wrote: > > > Hello, > > I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11 platform and received the following error. > > I doubt you will be able to build static library on solaris 10 or 11. > Try to build or install new dynamic zlib 1.2.6 and run nginx with LD_PRELOAD hack: > LD_PRELOAD=/path/to/new/libz.so nginx It builds fine with zlib 1.2.5. The problem is in zlib 1.2.6 Makefile / Makefile.in, see my reply. Maxim Dounin > > > > > gmake > > . > > . > > . > > cd ../zlib-1.2.6 \ > > && gmake distclean \ > > && CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="gcc" \ > > ./configure \ > > && gmake libz.a > > gmake[2]: Entering directory `/home/produser/Downloads/zlib-1.2.6' > > make -f Makefile.in distclean > > make: Fatal error in reader: Makefile.in, line 57: Unexpected end of line seen > > Current working directory /home/produser/Downloads/zlib-1.2.6 > > gmake[2]: *** [distclean] Error 1 > > gmake[2]: Leaving directory `/home/produser/Downloads/zlib-1.2.6' > > gmake[1]: *** [../zlib-1.2.6/libz.a] Error 2 > > gmake[1]: Leaving directory `/home/produser/Downloads/nginx-1.0.15' > > gmake: *** [build] Error 2 > > > > Pleae advise what I should do. There were many many bug fixes and enhancements to zlib 1.2.6 over the 1.2.5 and would like to know if its going to work or not. > > > > Tank you, > > Allan > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Tue Apr 17 17:20:52 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 17 Apr 2012 21:20:52 +0400 Subject: worker process exited on signal 11 In-Reply-To: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> References: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120417172052.GE13466@mdounin.ru> Hello! On Tue, Apr 17, 2012 at 09:44:13AM -0400, mscheel wrote: > Dear all, > > error logs show this error (worker process exited on signal 11). The > error appears after ~1 hour, then with the half of the worker processes. > No problems with 1.0-versions of nginx. Problem existed in 1.1.18 > already. > > I'm using a custom rpm build with the following additional modules: > --add-module=/root/rpm/SOURCES/agentzh-headers-more-nginx-module-3580526 > \ > --add-module=/root/rpm/SOURCES/FRiCKLE-ngx_cache_purge-e34bd2c \ > --add-module=/root/rpm/SOURCES/substitutions4nginx-read-only \ Are you able to reproduce this without 3rd party modules? [...] > (gdb) bt > #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, > chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 Please provide gdb output of the following commands: fr 0 p chain p *chain > #1 0x000000000042b133 in ngx_event_pipe (p=0x747170, do_write= optimized out>) at src/event/ngx_event_pipe.c:271 fr 1 p *p > #2 0x000000000045410e in ngx_http_upstream_process_upstream > (r=0x69ef00, u=0x746db8) at src/http/ngx_http_upstream.c:2641 fr 2 p *r p *u [...] It might be also helpful to see full configuration used. Maxim Dounin From nginx-forum at nginx.us Tue Apr 17 17:40:05 2012 From: nginx-forum at nginx.us (leontinus) Date: Tue, 17 Apr 2012 13:40:05 -0400 (EDT) Subject: some of my user cannot access my website In-Reply-To: <20120417124108.GY13466@mdounin.ru> References: <20120417124108.GY13466@mdounin.ru> Message-ID: Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Tue, Apr 17, 2012 at 06:44:48AM -0400, > leontinus wrote: > > > Hi guys, I need your help to help me identify a > problem. I'm running an > > online marketplace here in Indonesia. Right now > I have 1 mod perl server > > using apache and 1 nginx server as proxy. But > some of my users complain > > they cannot access my website, > http://www.tokopedia.com. And I found out > > a fact that if they use mikrotik HttpProxy, they > cannot access my > > website, but they can access other website. > > > > If they use firefox, they found err message : > Content Encoding Error > > If they use google chrome, they found err > message : > > ERR_INVALID_CHUNKED_ENCODING > > > > Can you help me with this? > > The messages suggest there is something wrong with > the proxy in > question, most likely it fails to handle chunked > encoding > properly. You may try to disable use of chunked > transfer encoding > with > > chunked_transfer_encoding off; > > to see if it helps. Note though that it will also > make keepalive > connections impossible if Content-Length isn't > known. You may > also try to disabling keepalive connections > completely with > > keepalive_timeout 0; > > See here for details: > > http://nginx.org/r/chunked_transfer_encoding > http://nginx.org/r/keepalive_timeout > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hi Maxim Dounin, Thank you for these tips, I will try it and see if it help my user. I will update again soon I get the result. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225421,225441#msg-225441 From siefke_listen at web.de Tue Apr 17 22:17:49 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Wed, 18 Apr 2012 00:17:49 +0200 Subject: HTML as PHP Message-ID: <20120418001749.8d31e902.siefke_listen@web.de> Hello, i want html files use as php file. So i have write the follow config: /etc/nginx/nginx.conf server { listen 80; server_name silviosiefke_de; access_log /var/www/silviosiefke_de/log/access_log main; error_log /var/www/silviosiefke_de/log/error_log info; location / { root /var/www/silviosiefke_de/htdocs; index index.html index.htm index.php; } #location /article-(\d+)\.html$ { #try_files $uri $uri/ /blogdetail.html?id=$1; #} # pass the PHP scripts to FastCGI location ~ \.(php|htm|html)$ { #location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/silviosiefke_de/htdocs$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~ /\.ht { deny all; } } When i make restart nginx and go on the side i read only Access denied. In the log i have: access.log 192.168.0.22 - - [18/Apr/2012:00:15:54 +0200] "GET /blog/manage.html HTTP/1.1" 403 25 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de-de) AppleWebKit/535+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Midori/0.4" "-" No entrys in the error.log. Has someone an idea? Regards Silvio From cliff at develix.com Tue Apr 17 22:56:34 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 17 Apr 2012 15:56:34 -0700 Subject: HTML as PHP In-Reply-To: <20120418001749.8d31e902.siefke_listen@web.de> References: <20120418001749.8d31e902.siefke_listen@web.de> Message-ID: <1334703394.2486.10.camel@portable-evil> On Wed, 2012-04-18 at 00:17 +0200, Silvio Siefke wrote: > location ~ /\.ht { > deny all; > } This also matches .html files. Try making your regex more explicit. Cliff From siefke_listen at web.de Tue Apr 17 23:02:23 2012 From: siefke_listen at web.de (siefke_listen at web.de) Date: Wed, 18 Apr 2012 01:02:23 +0200 Subject: HTML as PHP In-Reply-To: <1334703394.2486.10.camel@portable-evil> References: <20120418001749.8d31e902.siefke_listen@web.de> <1334703394.2486.10.camel@portable-evil> Message-ID: <20120418010223.d8bc2cd0.siefke_listen@web.de> Hello, On Tue, 17 Apr 2012 15:56:34 -0700 Cliff Wells wrote: > On Wed, 2012-04-18 at 00:17 +0200, Silvio Siefke wrote: > > > location ~ /\.ht { > > deny all; > > } > > This also matches .html files. Try making your regex more explicit. ok i have delete the part, but the error is the same. Access Denied. And in the logs the same message, 403. Regards Silvio From cliff at develix.com Tue Apr 17 23:10:55 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 17 Apr 2012 16:10:55 -0700 Subject: HTML as PHP In-Reply-To: <1334703394.2486.10.camel@portable-evil> References: <20120418001749.8d31e902.siefke_listen@web.de> <1334703394.2486.10.camel@portable-evil> Message-ID: <1334704255.2486.18.camel@portable-evil> On Tue, 2012-04-17 at 15:56 -0700, Cliff Wells wrote: > On Wed, 2012-04-18 at 00:17 +0200, Silvio Siefke wrote: > > > location ~ /\.ht { > > deny all; > > } > > This also matches .html files. Try making your regex more explicit. My mistake, it doesn't. Check these: 1) file/directory permissions are correct 2) is the php app is setting the status to 403? Regards, Cliff From cliff at develix.com Tue Apr 17 23:12:33 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 17 Apr 2012 16:12:33 -0700 Subject: HTML as PHP In-Reply-To: <20120418010223.d8bc2cd0.siefke_listen@web.de> References: <20120418001749.8d31e902.siefke_listen@web.de> <1334703394.2486.10.camel@portable-evil> <20120418010223.d8bc2cd0.siefke_listen@web.de> Message-ID: <1334704353.2486.19.camel@portable-evil> On Wed, 2012-04-18 at 01:02 +0200, siefke_listen at web.de wrote: > ok i have delete the part, but the error is the same. Access Denied. > And in the logs the same message, 403. Can you also check the main nginx error log? Usually /var/log/nginx/error.log. Cliff From siefke_listen at web.de Tue Apr 17 23:19:46 2012 From: siefke_listen at web.de (siefke_listen at web.de) Date: Wed, 18 Apr 2012 01:19:46 +0200 Subject: HTML as PHP In-Reply-To: <1334704353.2486.19.camel@portable-evil> References: <20120418001749.8d31e902.siefke_listen@web.de> <1334703394.2486.10.camel@portable-evil> <20120418010223.d8bc2cd0.siefke_listen@web.de> <1334704353.2486.19.camel@portable-evil> Message-ID: <20120418011946.3328e5fb.siefke_listen@web.de> On Tue, 17 Apr 2012 16:12:33 -0700 Cliff Wells wrote: > Can you also check the main nginx error log? > Usually /var/log/nginx/error.log. Thats stand in the main error.log 2012/04/18 01:00:08 [info] 6802#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:85 2012/04/18 01:00:08 [notice] 6330#0: signal 15 (SIGTERM) received, exiting 2012/04/18 01:00:08 [notice] 6332#0: exiting 2012/04/18 01:00:08 [notice] 6332#0: exit 2012/04/18 01:00:08 [notice] 6330#0: signal 17 (SIGCHLD) received 2012/04/18 01:00:08 [notice] 6330#0: worker process 6332 exited with code 0 2012/04/18 01:00:08 [notice] 6330#0: exit 2012/04/18 01:00:08 [notice] 6817#0: using the "epoll" event method 2012/04/18 01:00:08 [notice] 6817#0: nginx/1.0.15 2012/04/18 01:00:08 [notice] 6817#0: OS: Linux 3.2.14 2012/04/18 01:00:08 [notice] 6817#0: getrlimit(RLIMIT_NOFILE): 1024:4096 2012/04/18 01:00:08 [notice] 6818#0: start worker processes 2012/04/18 01:00:08 [notice] 6818#0: start worker process 6820 2012/04/18 01:12:29 [notice] 6818#0: signal 15 (SIGTERM) received, exiting 2012/04/18 01:12:29 [notice] 6820#0: exiting 2012/04/18 01:12:29 [notice] 6820#0: exit 2012/04/18 01:12:29 [notice] 6818#0: signal 17 (SIGCHLD) received 2012/04/18 01:12:29 [notice] 6818#0: worker process 6820 exited with code 0 2012/04/18 01:12:29 [notice] 6818#0: exit 2012/04/18 01:12:32 [info] 7036#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:85 2012/04/18 01:12:32 [notice] 7040#0: using the "epoll" event method 2012/04/18 01:12:32 [notice] 7040#0: nginx/1.0.15 2012/04/18 01:12:32 [notice] 7040#0: OS: Linux 3.2.14 2012/04/18 01:12:32 [notice] 7040#0: getrlimit(RLIMIT_NOFILE): 1024:4096 2012/04/18 01:12:32 [notice] 7041#0: start worker processes 2012/04/18 01:12:32 [notice] 7041#0: start worker process 7043 2012/04/18 01:12:57 [info] 7058#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:85 2012/04/18 01:12:57 [notice] 7041#0: signal 15 (SIGTERM) received, exiting 2012/04/18 01:12:57 [notice] 7043#0: exiting 2012/04/18 01:12:57 [notice] 7043#0: exit 2012/04/18 01:12:57 [notice] 7041#0: signal 17 (SIGCHLD) received 2012/04/18 01:12:57 [notice] 7041#0: worker process 7043 exited with code 0 2012/04/18 01:12:57 [notice] 7041#0: exit 2012/04/18 01:12:58 [notice] 7073#0: using the "epoll" event method 2012/04/18 01:12:58 [notice] 7073#0: nginx/1.0.15 2012/04/18 01:12:58 [notice] 7073#0: OS: Linux 3.2.14 2012/04/18 01:12:58 [notice] 7073#0: getrlimit(RLIMIT_NOFILE): 1024:4096 2012/04/18 01:12:58 [notice] 7074#0: start worker processes 2012/04/18 01:12:58 [notice] 7074#0: start worker process 7076 From siefke_listen at web.de Tue Apr 17 23:26:52 2012 From: siefke_listen at web.de (siefke_listen at web.de) Date: Wed, 18 Apr 2012 01:26:52 +0200 Subject: HTML as PHP In-Reply-To: <1334704255.2486.18.camel@portable-evil> References: <20120418001749.8d31e902.siefke_listen@web.de> <1334703394.2486.10.camel@portable-evil> <1334704255.2486.18.camel@portable-evil> Message-ID: <20120418012652.45339807.siefke_listen@web.de> On Tue, 17 Apr 2012 16:10:55 -0700 Cliff Wells wrote: > 1) file/directory permissions are correct gentoo-desk htdocs # ls -l insgesamt 40 drwxr-xr-x 2 siefke siefke 4096 18. Apr 00:08 blog -rw-r--r-- 1 siefke siefke 1406 18. M?r 2011 favicon.ico drwxr-xr-x 2 siefke siefke 4096 16. Apr 20:02 howto drwxr-xr-x 4 siefke siefke 4096 16. Apr 13:38 img drwxr-xr-x 2 siefke siefke 4096 18. Apr 00:08 inc -rw-r--r-- 1 siefke siefke 1137 17. Apr 22:45 index.html -rw-r--r-- 1 siefke siefke 17 14. Apr 00:09 info.php -rw-r--r-- 1 siefke siefke 43 16. Apr 20:28 robots.txt -rw-r--r-- 1 siefke siefke 508 16. Apr 20:28 sitemap.xml > 2) is the php app is setting the status to 403? The mistake come in blog directory, ok i try in root without any php inside html, but it come too Access denied. The complete nginx.conf -> http://nopaste.info/d7665fafff.html The php-php.conf -> http://nopaste.info/717a0a166f.html Thank u for ur Help. Regards Silvio From nginx-forum at nginx.us Wed Apr 18 00:08:36 2012 From: nginx-forum at nginx.us (ragivan) Date: Tue, 17 Apr 2012 20:08:36 -0400 (EDT) Subject: MP4 pseudostreaming - seek delay In-Reply-To: <20120305070815.GA28715@nginx.com> References: <20120305070815.GA28715@nginx.com> Message-ID: So how does YouTube manage to get 2 hour videos to start playing instantly (1 second).. with nginx it takes me 10 seconds for a 2 hour video to start playing. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225451#msg-225451 From jdorfman at netdna.com Wed Apr 18 00:29:52 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Tue, 17 Apr 2012 17:29:52 -0700 Subject: MP4 pseudostreaming - seek delay In-Reply-To: References: <20120305070815.GA28715@nginx.com> Message-ID: For video Youtube uses lighttp, not nginx - http://highscalability.com/youtube-architecture Regards, Justin Dorfman NetDNA ? The Science of Acceleration? Email / gtalk: jdorfman at netdna.com P: 1.323.301.1400 x 272 Skype: netdna-justind Twitter: @jdorfman www.NetDNA.com | www.MaxCDN.com @NetDNA | @MaxCDN On Tue, Apr 17, 2012 at 5:08 PM, ragivan wrote: > So how does YouTube manage to get 2 hour videos to start playing > instantly (1 second).. with nginx it takes me 10 seconds for a 2 hour > video to start playing. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,223375,225451#msg-225451 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Apr 18 01:23:13 2012 From: nginx-forum at nginx.us (ragivan) Date: Tue, 17 Apr 2012 21:23:13 -0400 (EDT) Subject: MP4 pseudostreaming - seek delay In-Reply-To: References: Message-ID: That was back in 2008, they didn't have 2 hour long videos. But what I was talking about what regarding the technology, lighttpd and nginx both do pseudo streaming. The moov atom is about 5 MB so it takes about 10 seconds to download that before playing the video. Is there some technique to start playing the video after partial download of the moov atom? Or is it possible to cache the moov atom into memory for faster retrieval? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225453#msg-225453 From nginx-forum at nginx.us Wed Apr 18 03:31:24 2012 From: nginx-forum at nginx.us (activa) Date: Tue, 17 Apr 2012 23:31:24 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: <0c5d7c297e71276447c3ffd6b4705ef6.NginxMailingListEnglish@forum.nginx.org> is this available in stable version 1.0.15 ? disable_symlinks if_not_owner; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225454#msg-225454 From edho at myconan.net Wed Apr 18 03:37:43 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 18 Apr 2012 10:37:43 +0700 Subject: nginx + FollowSymLinks owner verification In-Reply-To: <0c5d7c297e71276447c3ffd6b4705ef6.NginxMailingListEnglish@forum.nginx.org> References: <0c5d7c297e71276447c3ffd6b4705ef6.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2012/4/18 activa : > is this available in stable version 1.0.15 ? > > disable_symlinks if_not_owner; > Nope, it's new in 1.1.x (since 1.1.16) From nginx-forum at nginx.us Wed Apr 18 04:39:38 2012 From: nginx-forum at nginx.us (justin) Date: Wed, 18 Apr 2012 00:39:38 -0400 (EDT) Subject: Nginx Benchmark Serving Static Image Timeouts Message-ID: <20d30f3c6faa2eaad43656025b0b0cc4.NginxMailingListEnglish@forum.nginx.org> Hello, I am benchmarking nginx, serving a static image (png file which is 6kb) with http://blitz.io. I am sending 250 requests a second for 60 seconds. When I run the benchmark approximately 15% of the requests are taking longer than 2 seconds, which is completely unacceptable. Nginx should be able to fly at this, even though its a lot of requests. At first I thought that I must be maxing out the network interface, but I looked and only pushing 10-12mbps. Any ideas what could be causing this? Here is the performance directives that I have modified in nginx: worker_processes 4; events { worker_connections 2048; } sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 30; gzip on; gzip_proxied any; gzip_comp_level 3; gzip_disable "MSIE [1-6].(?!.*SV1)"; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; client_max_body_size 16M; location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 30d; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225456,225456#msg-225456 From nginx-forum at nginx.us Wed Apr 18 05:06:25 2012 From: nginx-forum at nginx.us (mscheel) Date: Wed, 18 Apr 2012 01:06:25 -0400 (EDT) Subject: worker process exited on signal 11 In-Reply-To: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> References: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> Message-ID: <02299bd23d1683f18815cac8d2f70f37.NginxMailingListEnglish@forum.nginx.org> Hello Maxim, it appears only on two productive servers. Compiling without these modules is not possible at the moment but i've tried several times with each module deactivated (and without any of these three). Full config is huge. I'm using a php-fpm backend with keepalive on and one upstream server with nginx and php-fpm. http { include mime.types; include gzip.conf; default_type application/octet-stream; keepalive_timeout 240; keepalive_requests 2000; open_file_cache max=10000 inactive=3m; open_file_cache_valid 3m; open_file_cache_min_uses 2; open_file_cache_errors off; index wartung.html index.php index.html index.htm; recursive_error_pages on; large_client_header_buffers 8 256k; client_max_body_size 1024m; client_body_buffer_size 128K; client_header_buffer_size 10k; client_header_timeout 120; client_body_timeout 120; fastcgi_read_timeout 240; set_real_ip_from x.x.x.0/24; real_ip_header X-Forwarded-For; #nginx 1.0 #limit_zone spiders $binary_remote_addr 10m; #nginx 1.1 limit_conn_zone $binary_remote_addr zone=spiders:10m; limit_req_zone $binary_remote_addr zone=spider_req:10m rate=5r/s; limit_conn_log_level info; upstream be_server_nginx { server IP:80; keepalive 300; } } ... location @be_nginx { proxy_pass http://be_server_nginx; proxy_set_header Connection ""; proxy_http_version 1.1; include /etc/nginx/proxy.conf; output of gdb: (gdb) fr 0 #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 195 in src/os/unix/ngx_readv_chain.c (gdb) p chain $1 = (ngx_chain_t *) 0x602348 (gdb) p *chain $2 = {buf = 0x602460, next = 0x752628} (gdb) fr 1 #1 0x000000000042b133 in ngx_event_pipe (p=0x747170, do_write=) at src/event/ngx_event_pipe.c:271 271 src/event/ngx_event_pipe.c: No such file or directory. in src/event/ngx_event_pipe.c (gdb) p *p $3 = {upstream = 0x2b508a1d43d0, downstream = 0x2b508a1d4550, free_raw_bufs = 0x0, in = 0x6024d0, last_in = 0x7523a0, out = 0x0, free = 0x602450, busy = 0x0, input_filter = 0x47bc30 , input_ctx = 0x69ef00, output_filter = 0x43ca40 , output_ctx = 0x69ef00, read = 0, cacheable = 0, 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, allocated = 2, bufs = {num = 10, size = 262144}, tag = 0x5c8480, busy_size = 262144, read_length = 378731, length = 1, max_temp_file_size = 0, temp_file_write_size = 524288, read_timeout = 180000, send_timeout = 60000, send_lowat = 0, pool = 0x69b6e0, log = 0x6c5380, preread_bufs = 0x0, preread_size = 129547, buf_to_file = 0x0, temp_file = 0x602358, num = 6} (gdb) fr 2 #2 0x000000000045410e in ngx_http_upstream_process_upstream (r=0x69ef00, u=0x746db8) at src/http/ngx_http_upstream.c:2641 2641 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 = 0x2b508a1d4550, ctx = 0x69baf0, main_conf = 0x5f7910, srv_conf = 0x617f48, loc_conf = 0x640e00, read_event_handler = 0x454510 , write_event_handler = 0x454b50 , cache = 0x0, upstream = 0x746db8, upstream_states = 0x747890, pool = 0x69b6e0, header_in = 0x6c5450, headers_in = {headers = {last = 0x69ef70, part = {elts = 0x69c008, nelts = 11, next = 0x0}, size = 48, nalloc = 20, pool = 0x69b6e0}, host = 0x69c0f8, connection = 0x0, if_modified_since = 0x0, if_unmodified_since = 0x0, user_agent = 0x69c098, referer = 0x69c038, content_length = 0x0, content_type = 0x0, range = 0x0, if_range = 0x0, transfer_encoding = 0x0, expect = 0x0, accept_encoding = 0x69c0c8, via = 0x69c188, authorization = 0x0, keep_alive = 0x0, x_forwarded_for = 0x69c1b8, x_real_ip = 0x0, depth = 0x0, destination = 0x0, overwrite = 0x0, date = 0x0, user = {len = 0, data = 0x0}, passwd = {len = 0, data = 0x0}, cookies = { elts = 0x69c3c8, nelts = 1, size = 8, nalloc = 2, pool = 0x69b6e0}, server = {len = 22, data = 0x74eadb "domain.com"}, content_length_n = -1, keep_alive_n = -1, connection_type = 2, msie = 1, msie6 = 0, opera = 0, gecko = 0, chrome = 0, safari = 0, konqueror = 0}, headers_out = {headers = {last = 0x69f0c8, part = {elts = 0x69b730, nelts = 5, next = 0x0}, size = 48, nalloc = 20, pool = 0x69b6e0}, status = 200, status_line = {len = 6, data = 0x4a2662 "200 OK"}, server = 0x69b790, date = 0x0, content_length = 0x0, content_encoding = 0x69b7f0, 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 = 24, data = 0x747a0d "text/html; charset=utf-8"}, charset = {len = 5, data = 0x747a20 "utf-8"}, content_type_lowcase = 0x602078 "text/html", content_type_hash = 101824002410317, cache_control = {elts = 0x6016c8, nelts = 1, size = 8, nalloc = 2, pool = 0x69b6e0}, content_length_n = -1, date_time = 0, last_modified_time = -1}, request_body = 0x747270, lingering_time = 0, start_sec = 1334650957, start_msec = 91, method = 2, http_version = 1001, request_line = {len = 50, data = 0x74e8c0 "GET /nc/pdf-generation.html?pageID=776404 HTTP/1.1\r\nAccept"}, uri = {len = 10, data = 0x746d62 "/index.php"}, args = {len = 13, data = 0x746a8f "pageID=776404"}, exten = { len = 3, data = 0x746d69 "php"}, unparsed_uri = {len = 37, data = 0x74e8c4 "/nc/pdf-generation.html?pageID=776404 HTTP/1.1\r\nAccept"}, method_name = {len = 3, data = 0x74e8c0 "GET /nc/pdf-generation.html?pageID=776404 HTTP/1.1\r\nAccept"}, http_protocol = {len = 8, data = 0x74e8ea "HTTP/1.1\r\nAccept"}, out = 0x7523b8, main = 0x69ef00, parent = 0x0, postponed = 0x0, post_subrequest = 0x0, posted_requests = 0x0, virtual_names = 0x744098, phase_handler = 13, content_handler = 0x47b940 , access_code = 0, variables = 0x69bc98, ncaptures = 0, captures = 0x69c580, captures_data = 0x746a84 "/index.php?pageID=776404", limit_rate = 0, header_size = 339, request_length = 785, err_status = 0, http_connection = 0x6c53d8, log_handler = 0x442e60 , cleanup = 0x7478f0, subrequests = 201, 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 = 1, gzip_ok = 1, gzip_vary = 1, proxy = 0, bypass_cache = 0, no_cache = 0, limit_conn_set = 1, limit_req_set = 1, 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 = 1, filter_need_in_memory = 1, filter_need_temporary = 0, allow_ranges = 0, stat_reading = 0, stat_writing = 1, state = 0, header_hash = 6740241951503570450, lowcase_index = 13, lowcase_header = "cache-controlsitiont", '\0' , header_name_start = 0x2b50cc8430b3 "^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????????^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^"..., header_name_end = 0x2b50cc8430a8 "??u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????????^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??????"..., header_start = 0x2b50cc8430aa "u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????????^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u"..., header_end = 0x2b50cc8430b3 "^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????????^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^"..., uri_start = 0x74e8c4 "/nc/pdf-generation.html?pageID=776404 HTTP/1.1\r\nAccept", uri_end = 0x74e8e9 " HTTP/1.1\r\nAccept", uri_ext = 0x74e8d7 "html?pageID=776404 HTTP/1.1\r\nAccept", args_start = 0x74e8dc "pageID=776404 HTTP/1.1\r\nAccept", request_start = 0x74e8c0 "GET /nc/pdf-generation.html?pageID=776404 HTTP/1.1\r\nAccept", request_end = 0x74e8f2 "\r\nAccept", method_end = 0x74e8c2 "T /nc/pdf-generation.html?pageID=776404 HTTP/1.1\r\nAccept", 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 = 0x454090 , write_event_handler = 0x452980 , peer = {connection = 0x2b508a1d43d0, sockaddr = 0x617ea8, socklen = 110, name = 0x68a6b0, tries = 1, get = 0x487370 , free = 0x4875b0 , data = 0x747908, set_session = 0x486e80 , save_session = 0x486e90 , local = 0x0, rcvbuf = 0, log = 0x6c5380, cached = 1, log_error = 1}, pipe = 0x747170, request_bufs = 0x747880, output = {buf = 0x0, in = 0x0, free = 0x0, busy = 0x0, sendfile = 0, directio = 0, unaligned = 0, need_in_memory = 0, need_in_temp = 0, alignment = 512, pool = 0x69b6e0, allocated = 0, bufs = {num = 1, size = 131072}, tag = 0x5c8480, output_filter = 0x414db0 , filter_ctx = 0x746eb0}, writer = {out = 0x0, last = 0x746eb0, connection = 0x2b508a1d43d0, pool = 0x69b6e0, limit = 0}, conf = 0x6416a8, headers_in = {headers = {last = 0x746ee8, part = { elts = 0x601520, nelts = 4, next = 0x0}, size = 48, nalloc = 8, pool = 0x69b6e0}, status_n = 200, status_line = {len = 6, data = 0x4a2662 "200 OK"}, status = 0x0, date = 0x0, server = 0x0, connection = 0x0, expires = 0x0, etag = 0x0, x_accel_expires = 0x0, x_accel_redirect = 0x0, x_accel_limit_rate = 0x0, content_type = 0x601580, content_length = 0x601520, last_modified = 0x0, location = 0x0, accept_ranges = 0x0, www_authenticate = 0x0, transfer_encoding = 0x0, content_encoding = 0x0, content_length_n = 355230, cache_control = { elts = 0x747a38, nelts = 1, size = 8, nalloc = 2, pool = 0x69b6e0}, connection_close = 0, chunked = 0}, resolved = 0x0, buffer = { pos = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., last = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., file_pos = 0, file_last = 0, start = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., end = 0x2b50cc883010 "", tag = 0x5c8480, 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 = 2}, length = 355230, out_bufs = 0x0, busy_bufs = 0x0, free_bufs = 0x0, input_filter_init = 0x47af80 , input_filter = 0, input_filter_ctx = 0x0, create_key = 0x47c100 , create_request = 0x47c3a0 , reinit_request = 0x47af50 , process_header = 0x47cf20 , abort_request = 0x47b560 , finalize_request = 0x47b530 , rewrite_redirect = 0, rewrite_cookie = 0, timeout = 0, state = 0x7478b8, method = {len = 0, data = 0x0}, schema = {len = 10, data = 0x4a8c69 "fastcgi://"}, uri = {len = 0, data = 0x0}, cleanup = 0x7478f0, store = 0, cacheable = 0, accel = 0, ssl = 0, cache_status = 0, buffering = 1, keepalive = 0, request_sent = 1, header_sent = 1} Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225457#msg-225457 From 191919 at gmail.com Wed Apr 18 06:07:00 2012 From: 191919 at gmail.com (191919) Date: Wed, 18 Apr 2012 14:07:00 +0800 Subject: MP4 pseudostreaming - seek delay In-Reply-To: References: Message-ID: <1ABA1FA6E6BE4F14B6F82D97B29B6C5D@gmail.com> You can split the big movie file into small pieces, thus you have smaller index for each small movie file. In the player, when current part is about to end, load next part, when current part is over, play the next part. So the movie is played seamlessly, you save network traffics, and your users feel better. You need to modify your movie player, but it is not a very hard work. Be caution: you must split your movie file at offsets of key-frame. -- 191919 Le mercredi, avril 18, 2012 ? 9:23 AM, ragivan a ?crit : > That was back in 2008, they didn't have 2 hour long videos. But what I > was talking about what regarding the technology, lighttpd and nginx both > do pseudo streaming. The moov atom is about 5 MB so it takes about 10 > seconds to download that before playing the video. Is there some > technique to start playing the video after partial download of the moov > atom? Or is it possible to cache the moov atom into memory for faster > retrieval? > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225453#msg-225453 > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed Apr 18 06:29:22 2012 From: nginx-forum at nginx.us (ragivan) Date: Wed, 18 Apr 2012 02:29:22 -0400 (EDT) Subject: MP4 pseudostreaming - seek delay In-Reply-To: <1ABA1FA6E6BE4F14B6F82D97B29B6C5D@gmail.com> References: <1ABA1FA6E6BE4F14B6F82D97B29B6C5D@gmail.com> Message-ID: <470a16e554fd989a5f1301211d1e6d91.NginxMailingListEnglish@forum.nginx.org> Do you know a tool for doing this? Something that will work on a unix system. Also, what if the user wants to jump to the end of the movie? I suppose that won't be possible as the user must click to the end of each segment until reaching the last segment. 191919 Wrote: ------------------------------------------------------- > You can split the big movie file into small > pieces, thus you have smaller index for each small > movie file. > > In the player, when current part is about to end, > load next part, when current part is over, play > the next part. So the movie is played seamlessly, > you save network traffics, and your users feel > better. You need to modify your movie player, but > it is not a very hard work. > > Be caution: you must split your movie file at > offsets of key-frame. > > -- > 191919 > > > Le mercredi, avril 18, 2012 ? 9:23 AM, ragivan a > ?crit : > > > That was back in 2008, they didn't have 2 hour > long videos. But what I > > was talking about what regarding the technology, > lighttpd and nginx both > > do pseudo streaming. The moov atom is about 5 MB > so it takes about 10 > > seconds to download that before playing the > video. Is there some > > technique to start playing the video after > partial download of the moov > > atom? Or is it possible to cache the moov atom > into memory for faster > > retrieval? > > > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,223375,225453#ms > g-225453 > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org (mailto:nginx at nginx.org) > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225459#msg-225459 From igor at sysoev.ru Wed Apr 18 06:38:12 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 18 Apr 2012 10:38:12 +0400 Subject: MP4 pseudostreaming - seek delay In-Reply-To: References: Message-ID: <20120418063812.GA25571@nginx.com> On Tue, Apr 17, 2012 at 09:23:13PM -0400, ragivan wrote: > That was back in 2008, they didn't have 2 hour long videos. But what I > was talking about what regarding the technology, lighttpd and nginx both > do pseudo streaming. The moov atom is about 5 MB so it takes about 10 > seconds to download that before playing the video. Is there some > technique to start playing the video after partial download of the moov > atom? Or is it possible to cache the moov atom into memory for faster > retrieval? I've just tried to watch 3 YouTube movies in Firefox 11 with Flash installed and discovered using LiveHTTPHeaders that these movies are in FLV format. Using this format player is smart enough to request just a file offset but not movie time and it does not need movie metadata such as MOOV atom. It need just a small static 13-bytes FLV header: http://nginx.org/en/docs/http/ngx_http_flv_module.html -- Igor Sysoev From nginx-forum at nginx.us Wed Apr 18 07:40:22 2012 From: nginx-forum at nginx.us (dagr) Date: Wed, 18 Apr 2012 03:40:22 -0400 (EDT) Subject: MP4 pseudostreaming - seek delay In-Reply-To: <20120418063812.GA25571@nginx.com> References: <20120418063812.GA25571@nginx.com> Message-ID: If you try to download youtube movie (any movie which i tried so far) with Download Master - then if you download 720p or higher, you ll get MP4 file , not FLV. Download Master emulates flash player to retrieve video , so it looks like flash player in resolutions 720p 1080p plays mp4 (not flv) too (may be i wrong). AFAIK youtube stores video under 720p as flv and >=720p as mp4 and another batch of mp4 files for ipads which are encoded with main profile, not high. By the way, i was not able to find on youtube 720p MP4 files longer than 20 mins ( moov data is not huge), so their smooth playing doesnt look very strange. Anyway - ipads CAN seek smoothly mp4 files without all this shit with moov data. And Adobe flash player - doesnt - very strange. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225461#msg-225461 From 191919 at gmail.com Wed Apr 18 08:27:42 2012 From: 191919 at gmail.com (191919) Date: Wed, 18 Apr 2012 16:27:42 +0800 Subject: MP4 pseudostreaming - seek delay In-Reply-To: <470a16e554fd989a5f1301211d1e6d91.NginxMailingListEnglish@forum.nginx.org> References: <1ABA1FA6E6BE4F14B6F82D97B29B6C5D@gmail.com> <470a16e554fd989a5f1301211d1e6d91.NginxMailingListEnglish@forum.nginx.org> Message-ID: <467B949137834116A8EE2B666E00D3FD@gmail.com> I wrote such a tool which generates mp4 file-series, it is simple if you are familiar with libgpac. You have to keep an array which maps time to file indexes, when a user wants to seek to a specific position, just convert the timestamp (e.g. 01:15:14) to file index (movie_2314_segment_519.mp4) then request it from the server. You can also use FLVs which contain H264 and AAC if Flash Player is your only client. -- 191919 Le mercredi, avril 18, 2012 ? 2:29 PM, ragivan a ?crit : > Do you know a tool for doing this? Something that will work on a unix > system. Also, what if the user wants to jump to the end of the movie? I > suppose that won't be possible as the user must click to the end of each > segment until reaching the last segment. > > 191919 Wrote: > ------------------------------------------------------- > > You can split the big movie file into small > > pieces, thus you have smaller index for each small > > movie file. > > > > In the player, when current part is about to end, > > load next part, when current part is over, play > > the next part. So the movie is played seamlessly, > > you save network traffics, and your users feel > > better. You need to modify your movie player, but > > it is not a very hard work. > > > > Be caution: you must split your movie file at > > offsets of key-frame. > > > > -- > > 191919 > > > > > > Le mercredi, avril 18, 2012 ? 9:23 AM, ragivan a > > ?crit : > > > > > That was back in 2008, they didn't have 2 hour > > long videos. But what I > > > was talking about what regarding the technology, > > > > > > lighttpd and nginx both > > > do pseudo streaming. The moov atom is about 5 MB > > > > > > so it takes about 10 > > > seconds to download that before playing the > > > > > > video. Is there some > > > technique to start playing the video after > > > > > > partial download of the moov > > > atom? Or is it possible to cache the moov atom > > > > > > into memory for faster > > > retrieval? > > > > > > Posted at Nginx Forum: > > > > http://forum.nginx.org/read.php?2,223375,225453#ms > > g-225453 > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org (mailto:nginx at nginx.org) > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org (mailto:nginx at nginx.org) > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225459#msg-225459 > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx From luky-37 at hotmail.com Wed Apr 18 09:00:53 2012 From: luky-37 at hotmail.com (Lukas Tribus) Date: Wed, 18 Apr 2012 11:00:53 +0200 Subject: MP4 pseudostreaming - seek delay In-Reply-To: References: <20120418063812.GA25571@nginx.com>, Message-ID: > Anyway - ipads CAN seek smoothly mp4 files without all this shit with> moov data. Ipads don't use flash with pseudostreaming, but html5/native apps,which probably use HTTP Range requests instead. If you embed MP4 content with html5 and play it in chrome or safari(they have html5 with h264 support), you will probably see similarperformance. From nginx-forum at nginx.us Wed Apr 18 10:09:51 2012 From: nginx-forum at nginx.us (VRider) Date: Wed, 18 Apr 2012 06:09:51 -0400 (EDT) Subject: nginx serving old files from cache Message-ID: <59ab839ec58397d3a8ea72be3ad90408.NginxMailingListEnglish@forum.nginx.org> I have nginx set as reverse proxy for Apache and for serving static files. Everything works great, except in the last few weeks I noticed that sometimes nginx returns page from cache which is 3-4 hours old. I checked the timestamp of the cache file, and it is old. This is part of the config file related to caching in nginx.conf: proxy_cache off; proxy_buffering on; proxy_buffer_size 8k; proxy_buffers 100 8k; proxy_cache_path /var/www/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m; proxy_temp_path /var/www/cache/tmp; proxy_cache_key "$host$request_uri"; proxy_ignore_headers "Expires" "Cache-Control" "X-Accel-Expires"; and this is for particulat vhost: proxy_cache my-cache; proxy_cache_valid 200 404 1m; # <----- should be valid for just one minute! proxy_ignore_headers Expires; proxy_ignore_headers Cache-Control; proxy_ignore_headers X-Accel-Expires; proxy_ignore_headers Set-Cookie; proxy_hide_header Set-Cookie; Any ideas? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225467,225467#msg-225467 From mdounin at mdounin.ru Wed Apr 18 11:03:28 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 18 Apr 2012 15:03:28 +0400 Subject: worker process exited on signal 11 In-Reply-To: <02299bd23d1683f18815cac8d2f70f37.NginxMailingListEnglish@forum.nginx.org> References: <2bd9c9c86f68a802bb9544d26ad045bb.NginxMailingListEnglish@forum.nginx.org> <02299bd23d1683f18815cac8d2f70f37.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120418110327.GG13466@mdounin.ru> Hello! On Wed, Apr 18, 2012 at 01:06:25AM -0400, mscheel wrote: > Hello Maxim, > > it appears only on two productive servers. Compiling without these > modules is not possible at the moment but i've tried several times with > each module deactivated (and without any of these three). > > Full config is huge. I'm using a php-fpm backend with keepalive on and > one upstream server with nginx and php-fpm. [...] > upstream be_server_nginx { > server IP:80; > keepalive 300; > } > } > > ... > > location @be_nginx { > proxy_pass http://be_server_nginx; > proxy_set_header Connection ""; proxy_http_version 1.1; > include /etc/nginx/proxy.conf; This part of the config shows proxy_pass, while gdb prints provided say the request used fastcgi_pass. Could you please: 1. Check processing flow of the "/nc/pdf-generation.html?pageID=776404" uri and provide relevant parts of the config. According to gdb it's transformed to "/index.php?pageID=776404". 2. Check if the problem is reproduceable with the uri in question. 3. Check if the problem persists with the upstream keepalive turned off. It would be also cool to obtain debug log if possible, it should be ok to grab one from a particular location with fastcgi_pass. And see below from more gdb commands I would like to see output from. > output of gdb: > > (gdb) fr 0 > #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, > chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 > 195 in src/os/unix/ngx_readv_chain.c > > (gdb) p chain > $1 = (ngx_chain_t *) 0x602348 > > (gdb) p *chain > $2 = {buf = 0x602460, next = 0x752628} fr 0 p *chain->buf p *chain->next p *chain->next->buf p *chain->next->next p *chain->next->next->buf (repeat last two prints with one more "->next" added till it fails) > (gdb) fr 1 > #1 0x000000000042b133 in ngx_event_pipe (p=0x747170, do_write= optimized out>) at src/event/ngx_event_pipe.c:271 > 271 src/event/ngx_event_pipe.c: No such file or directory. > in src/event/ngx_event_pipe.c > > (gdb) p *p > $3 = {upstream = 0x2b508a1d43d0, downstream = 0x2b508a1d4550, > free_raw_bufs = 0x0, in = 0x6024d0, last_in = 0x7523a0, out = 0x0, free > = 0x602450, busy = 0x0, fr 1 p *p->in p *p->in->buf p *p->in->next p *p->in->next->buf (same here, repeat with "->next" added till it fails) p *p->free p *p->free->buf p *p->free->next p *p->free->next->buf (same here) [...] Maxim Dounin From nginx-forum at nginx.us Wed Apr 18 11:13:02 2012 From: nginx-forum at nginx.us (mscheel) Date: Wed, 18 Apr 2012 07:13:02 -0400 (EDT) Subject: worker process exited on signal 11 In-Reply-To: <20120418110327.GG13466@mdounin.ru> References: <20120418110327.GG13466@mdounin.ru> Message-ID: Hello Maxim, thanks alot for your help. I'll try to reproduce it. (gdb) fr 0 #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 195 src/os/unix/ngx_readv_chain.c: No such file or directory. in src/os/unix/ngx_readv_chain.c (gdb) p *chain->buf $6 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, end = 0x0, tag = 0x5c8480, 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 = 0} (gdb) p *chain->next $7 = {buf = 0x7523d8, next = 0x752638} (gdb) p *chain->next->buf $8 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, end = 0x0, tag = 0x5c8480, 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 = 0} (gdb) p *chain->next->next $9 = {buf = 0x746ff8, next = 0x0} (gdb) p *chain->next->next->buf $10 = { pos = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., last = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., file_pos = 0, file_last = 0, start = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., end = 0x2b50cc883010 "", tag = 0x5c8480, 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 = 2} (gdb) p *chain->next->next->next Cannot access memory at address 0x0 (gdb) p *chain->next->next->next->buf Cannot access memory at address 0x0 ____________________________________________ (gdb) fr 1 #1 0x000000000042b133 in ngx_event_pipe (p=0x747170, do_write=) at src/event/ngx_event_pipe.c:271 271 src/event/ngx_event_pipe.c: No such file or directory. in src/event/ngx_event_pipe.c (gdb) p *p->in $11 = {buf = 0x7524d8, next = 0x7523a8} (gdb) p *p->in->buf $12 = {pos = 0x2b50cc908010 "?:??>G?\223?", last = 0x2b50cc918008 "\001\006", file_pos = 0, file_last = 0, start = 0x2b50cc908010 "?:??>G?\223?", end = 0x2b50cc948010 "", tag = 0x5c8480, file = 0x0, shadow = 0x752528, 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 = 4} (gdb) p *p->in->next $13 = {buf = 0x752528, next = 0x752398} (gdb) p *p->in->next->buf $14 = {pos = 0x2b50cc918010 "t?|=\036o?G_?\227\027???U)?", last = 0x2b50cc91be90 "", file_pos = 0, file_last = 0, start = 0x2b50cc908010 "?:??>G?\223?", end = 0x2b50cc948010 "", tag = 0x5c8480, file = 0x0, shadow = 0x752478, temporary = 1, memory = 0, mmap = 0, recycled = 1, in_file = 0, flush = 0, sync = 0, last_buf = 0, last_in_chain = 0, last_shadow = 1, temp_file = 0, num = 4} (gdb) p *p->in->next->next $15 = {buf = 0x7525d8, next = 0x0} (gdb) p *p->in->next->next->buf $16 = { pos = 0x2b50cc949010 "g??d?z\211?\017\027??\026\225h^3?\217?}\221&NG\230N\033??.\207?\222?=R\215??\037\224|??N\224?\206?\205)J\003%dY\2348\235?5[UnJ+??6&?p?z.K\203?ZG?YJv?\025?bZM?\227,\016?\236'YrKFoqhN\223\022`L\213z{?i,\226?\b\t)\033\217?\225V?\005*??W?^>?U??$??", last = 0x2b50cc9518f0 "", file_pos = 0, file_last = 0, start = 0x2b50cc949010 "g??d?z\211?\017\027??\026\225h^3?\217?}\221&NG\230N\033??.\207?\222?=R\215??\037\224|??N\224?\206?\205)J\003%dY\2348\235?5[UnJ+??6&?p?z.K\203?ZG?YJv?\025?bZM?\227,\016?\236'YrKFoqhN\223\022`L\213z{?i,\226?\b\t)\033\217?\225V?\005*??W?^>?U??$??", end = 0x2b50cc989010 "", tag = 0x5c8480, file = 0x0, shadow = 0x752578, temporary = 1, memory = 0, mmap = 0, recycled = 1, in_file = 0, flush = 0, sync = 0, last_buf = 0, last_in_chain = 0, last_shadow = 1, temp_file = 0, num = 5} (gdb) p *p->in->next->next->next Cannot access memory at address 0x0 _______________________________________________ (gdb) p *p->free $17 = {buf = 0x752428, next = 0x752290} (gdb) p *p->free->buf $18 = { pos = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., last = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., file_pos = 0, file_last = 0, start = 0x2b50cc843010 "?u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^???????u?~??{???^??"..., end = 0x2b50cc883010 "", tag = 0x5c8480, 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 = 2} (gdb) p *p->free->next $19 = {buf = 0x7523d8, next = 0x6024b0} (gdb) p *p->free->next->buf $20 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, end = 0x0, tag = 0x5c8480, 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 = 0} (gdb) $21 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, end = 0x0, tag = 0x5c8480, 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 = 0} (gdb) p *p->free->next->next $22 = {buf = 0x602460, next = 0x6024c0} (gdb) p *p->free->next->next->buf $23 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, end = 0x0, tag = 0x5c8480, 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 = 0} (gdb) p *p->free->next->next->next $24 = {buf = 0x7510f0, next = 0x0} (gdb) p *p->free->next->next->next->buf $25 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, end = 0x0, tag = 0x5c8480, 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 = 0} (gdb) p *p->free->next->next->next->next Cannot access memory at address 0x0 (gdb) p *p->free->next->next->next->next->buf Cannot access memory at address 0x0 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225474#msg-225474 From nginx-forum at nginx.us Wed Apr 18 11:28:46 2012 From: nginx-forum at nginx.us (mscheel) Date: Wed, 18 Apr 2012 07:28:46 -0400 (EDT) Subject: worker process exited on signal 11 In-Reply-To: References: <20120418110327.GG13466@mdounin.ru> Message-ID: <59a2b34633388aa6230a49eb0380adc3.NginxMailingListEnglish@forum.nginx.org> Interesting, i'm unable to reproduce it with the uri. The uri generates a pdf file (when it does not exist on the fs). I've deleted it on the fs and it's created fine by our php application. I've also made some tests with keepalive off, no change. Maybe there is something missing in SLES 10 which is required by 1.1? A manual configure and make (without install) with my nginx -V runs without errors. My fastcgi_params: set $php_root /docroot; root $php_root; try_files $uri $uri/ @404; fastcgi_pass php-fpm_backend; fastcgi_keep_conn on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $php_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 REMOTE_ADDR $HTTP_X_FORWARDED_FOR; 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_param HOST_LSG $http_host; fastcgi_param HTTP_REFERER $http_referer; fastcgi_param HTTPS $https_ms; fastcgi_pass_header HTTP_HOST; fastcgi_pass_header SERVER_NAME; fastcgi_pass_header HOST; fastcgi_pass_header SERVER_NAME; fastcgi_pass_header X-REAL-IP; fastcgi_pass_header X-FORWARDED-PROTO; fastcgi_pass_header X-FORWARDED-FOR; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225475#msg-225475 From nginx-forum at nginx.us Wed Apr 18 13:26:06 2012 From: nginx-forum at nginx.us (dagr) Date: Wed, 18 Apr 2012 09:26:06 -0400 (EDT) Subject: MP4 pseudostreaming - seek delay In-Reply-To: References: Message-ID: > Ipads don't use flash with pseudostreaming, but html5/native apps i know, i actually dont understand why flash player cant do the same Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,225476#msg-225476 From brian at akins.org Wed Apr 18 14:02:08 2012 From: brian at akins.org (Brian Akins) Date: Wed, 18 Apr 2012 10:02:08 -0400 Subject: nginx serving old files from cache In-Reply-To: <59ab839ec58397d3a8ea72be3ad90408.NginxMailingListEnglish@forum.nginx.org> References: <59ab839ec58397d3a8ea72be3ad90408.NginxMailingListEnglish@forum.nginx.org> Message-ID: <70228B38-8E8E-4D98-9D0B-7D6A42809963@akins.org> Do you have proxy_cache_use_stale set? Has any nginx process segfaulted? From mdounin at mdounin.ru Wed Apr 18 14:22:13 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 18 Apr 2012 18:22:13 +0400 Subject: worker process exited on signal 11 In-Reply-To: References: <20120418110327.GG13466@mdounin.ru> Message-ID: <20120418142213.GI13466@mdounin.ru> Hello! On Wed, Apr 18, 2012 at 07:13:02AM -0400, mscheel wrote: > Hello Maxim, thanks alot for your help. I'll try to reproduce it. > > (gdb) fr 0 > #0 0x000000000042cbe8 in ngx_readv_chain (c=0x2b508a1d43d0, > chain=0x602348) at src/os/unix/ngx_readv_chain.c:195 > 195 src/os/unix/ngx_readv_chain.c: No such file or directory. > in src/os/unix/ngx_readv_chain.c > > (gdb) p *chain->buf > $6 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, > end = 0x0, tag = 0x5c8480, 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 = 0} > > (gdb) p *chain->next > $7 = {buf = 0x7523d8, next = 0x752638} > > (gdb) p *chain->next->buf > $8 = {pos = 0x0, last = 0x0, file_pos = 0, file_last = 0, start = 0x0, > end = 0x0, tag = 0x5c8480, 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 = 0} > > (gdb) p *chain->next->next > $9 = {buf = 0x746ff8, next = 0x0} [...] Ok, thanks. The buffer chain looks completely screwed up, and I suspect the culprit is substitutions4nginx module you use. Quick look over it's sources suggests it at least changes the last_shadow flag of the buffers it gets, and this may cause undefined behaviour. Additionally, the response in question has Content-Type set to "text/html" (though it looks like the actual response is pdf), which is handled by substitutions4nginx by default. Could you please try to reproduce the problem without the module in question? Maxim Dounin From nginx-forum at nginx.us Wed Apr 18 14:50:43 2012 From: nginx-forum at nginx.us (VRider) Date: Wed, 18 Apr 2012 10:50:43 -0400 (EDT) Subject: nginx serving old files from cache In-Reply-To: <70228B38-8E8E-4D98-9D0B-7D6A42809963@akins.org> References: <70228B38-8E8E-4D98-9D0B-7D6A42809963@akins.org> Message-ID: <0cae86110bc8dbefacc2eb981091d4ef.NginxMailingListEnglish@forum.nginx.org> No segfaults and proxy_cache_use_stale wasn't specified, so by default it was off. D Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225467,225482#msg-225482 From nginx-forum at nginx.us Wed Apr 18 14:53:55 2012 From: nginx-forum at nginx.us (rob) Date: Wed, 18 Apr 2012 10:53:55 -0400 (EDT) Subject: How to optimize these config / rewrite rules Message-ID: <966202bd319a1ca94d70368f6b70dbae.NginxMailingListEnglish@forum.nginx.org> Hi there, I'm running nginx and xenforo but need to rewrite some old legacy URL's (left over from vbulletin + vbseo).. Here is just a very small selection of my config which I want to optimise as fully as possible:- [code] #Forum 26 main location = /category-name-73/forum-name-26/ { rewrite ^ /forums/forum-name.26/ permanent; } #Forum 26 location /category-name-73/forum-name-26/ { #forum paging rewrite ^/category-name-73/forum-name-26/index([\d]+).html /forums/forum-name.26/page-$1 permanent; #thread paging (modified version of kier's redirect script) rewrite [^/]+/([\d]+)-.+-([\d]+).html /showthread.php?t=$1&page=$2 last; #thread rewrite [^/]+/([\d]+)-.+.html /threads/redirectme.$1/ permanent; }[/code] If only I can optimise the above then I can transfer the same principle to the rest of my (huge) config file. I've been told that its possible to optimise the above so that a visit to /category-name-73/forum-name-26/ or any path below it will run just one regex instead of potentially 4 as per the above code... So, optimising the above... does anyone have any clue how to do this? Thank you for any help offered, Rob Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225483,225483#msg-225483 From nginx-forum at nginx.us Wed Apr 18 14:54:54 2012 From: nginx-forum at nginx.us (rob) Date: Wed, 18 Apr 2012 10:54:54 -0400 (EDT) Subject: How to optimize these config / rewrite rules In-Reply-To: <966202bd319a1ca94d70368f6b70dbae.NginxMailingListEnglish@forum.nginx.org> References: <966202bd319a1ca94d70368f6b70dbae.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6cbee914ac9b02e540c1574c3fac6e48.NginxMailingListEnglish@forum.nginx.org> bah... please ignore the [code][/code] tags above - assumed this forum software used bbcode. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225483,225484#msg-225484 From nginx-forum at nginx.us Wed Apr 18 15:12:11 2012 From: nginx-forum at nginx.us (mscheel) Date: Wed, 18 Apr 2012 11:12:11 -0400 (EDT) Subject: worker process exited on signal 11 In-Reply-To: <20120418142213.GI13466@mdounin.ru> References: <20120418142213.GI13466@mdounin.ru> Message-ID: Thanks. Do you think it's necessary to create a new rpm without this module or will it be sufficient to turn it off in the configs? I'll disable the config now. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225485#msg-225485 From contact at jpluscplusm.com Wed Apr 18 15:37:59 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 18 Apr 2012 16:37:59 +0100 Subject: How to optimize these config / rewrite rules In-Reply-To: <966202bd319a1ca94d70368f6b70dbae.NginxMailingListEnglish@forum.nginx.org> References: <966202bd319a1ca94d70368f6b70dbae.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 18 April 2012 15:53, rob wrote: [snip] > So, optimising the above... does anyone have any clue how to do this? Optimising for what? Runtime speed? Runtime memory use? Administrative efficiency? Administrative clarity? Future flexibility? J -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From nginx-forum at nginx.us Wed Apr 18 15:48:53 2012 From: nginx-forum at nginx.us (rob) Date: Wed, 18 Apr 2012 11:48:53 -0400 (EDT) Subject: How to optimize these config / rewrite rules In-Reply-To: References: Message-ID: <48d8dd62b58cce70ee93fcbb5015b268.NginxMailingListEnglish@forum.nginx.org> As I said Jonathan, I've been told that the above rules can be optimised so that hitting any url in the path I mentioned would run just one rex rule instead of a minimum of 3 currently. I have been told that by an nginx expert but what I have not been told is how to achieve it. I suspect it will be by nesting location {} constructs (is thsat possible) or by having more selective location {} constructs. I want to start with as optimised a set of rewrite rules as possible. Does this help any? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225483,225487#msg-225487 From contact at jpluscplusm.com Wed Apr 18 16:51:30 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 18 Apr 2012 17:51:30 +0100 Subject: How to optimize these config / rewrite rules In-Reply-To: <48d8dd62b58cce70ee93fcbb5015b268.NginxMailingListEnglish@forum.nginx.org> References: <48d8dd62b58cce70ee93fcbb5015b268.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 18 April 2012 16:48, rob wrote: > As I said Jonathan, ?I've been told that the above rules can be > optimised so that hitting any url in the path I mentioned would run just > one rex rule instead of a minimum of 3 currently. ?I have been told that > by an nginx expert but what I have not been told is how to achieve it. I > suspect it will be by nesting location {} constructs (is thsat possible) > or by having more selective location {} constructs. > > I want to start with as optimised a set of rewrite rules as possible. > > Does this help any? I still don't think you've defined the optimisation you're looking for. Just to say "optimised" isn't specific enough IMHO. You optimise /for/ a characteristic, almost always at the expense of other characteristics. It looks to me like you're trying to optimise for as few lines as possible in your config file, at the expense of config file *clarity* and runtime performance. Also, just because you can technically combine multiple regular expressions into a single one doesn't mean that the result will be any faster than the multiple, simpler, regex route. I can't personally be bothered to work out the complex regex that would be required here for rewrites as it's *really* not something I'd do with my nginx configs. I want to understand them later and not worry if every minor change might have some huge unintended impact - which is where I think you'll end up if you carry on down this route. However there are a few points I can give you, looking at what you've got. 1) Locations can be nested. This is valid: location /foo { location /foo/bar { ... } } AFAICT, the intended use of this construct is to have non-regex outer locations, preventing the evaluation of inner regex locations until they're necessary e.g. location /foo/ { location ~ ^/foo/(bar|baz) { ... } location ~ ^/foo/image(s)?/ { ... } } 2) If you're using brackets solely for alternation (i.e. one thing OR the other, e.g. "(bar|baz)", above) then consider using (?:bar|baz) instead, as this stops the regex engine from capturing the match for later use, which might save you valuable microseconds ;-) 3) Regex *locations* are, as per http://wiki.nginx.org/HttpCoreModule#location, evaluated in order, stopping after the first match. This probably isn't the case with rewrites, which are cumulative I believe. 4) Here's how I'd structure what you're doing if my aim was to make it forum-name agnostic. YMMV, 'cos it actually depends on the format names of the forums. You may need to tweak it. I wouldn't personally do this unless I *really* needed to make it name-agnostic. It sacrifices readability for brevity. ---------------------- location ~ ^/category-name-73/(?[^/]+)/$ { rewrite ^ /forums/$forum/ permanent; } location ~ ^/category-name-73/([^/]+)/index(?[\d]+).html { rewrite /forums/$forum/page-$number permanent; } # Now /you/ redo these as locations; to do so requires a bit more detail about the URI structures than you've posted :-) #rewrite [^/]+/([\d]+)-.+-([\d]+).html /showthread.php?t=$1&page=$2 last; #rewrite [^/]+/([\d]+)-.+.html /threads/redirectme.$1/ permanent; ---------------------- HTH, Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From nginx-forum at nginx.us Wed Apr 18 17:14:11 2012 From: nginx-forum at nginx.us (rob) Date: Wed, 18 Apr 2012 13:14:11 -0400 (EDT) Subject: How to optimize these config / rewrite rules In-Reply-To: References: Message-ID: <06b6f3c7cb4ed0c2eb8a9e003d01fc32.NginxMailingListEnglish@forum.nginx.org> Hi Jonathan, That was exactly the advice I needed. I will spend some time rewriting what I think to be a better way based on your advice and post back here with more clearly defined rules using location a bit more. Thanks :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225483,225492#msg-225492 From mdounin at mdounin.ru Wed Apr 18 17:27:53 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 18 Apr 2012 21:27:53 +0400 Subject: worker process exited on signal 11 In-Reply-To: References: <20120418142213.GI13466@mdounin.ru> Message-ID: <20120418172753.GK13466@mdounin.ru> Hello! On Wed, Apr 18, 2012 at 11:12:11AM -0400, mscheel wrote: > Thanks. Do you think it's necessary to create a new rpm without this > module or will it be sufficient to turn it off in the configs? > I'll disable the config now. It should be sufficient to disable it in config (that is, remove/comment out all "subs_filter" directives). Maxim Dounin From ashishs.dev at gmail.com Thu Apr 19 01:29:23 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Wed, 18 Apr 2012 18:29:23 -0700 Subject: nginx upstream for broadcasting update messages ? Message-ID: Hi, I have 2 memcache boxes behind nginx. For reads, the upstream module lets me round-robin between the backend memcache boxes. I want the updates to go to all 2 memcache boxes. My question is, what is the best way to broadcast the updates to the backend? Is there a reference implementation of some module which does similar stuff (broadcast)? Thanks Ashish From nginx-forum at nginx.us Thu Apr 19 05:28:22 2012 From: nginx-forum at nginx.us (mscheel) Date: Thu, 19 Apr 2012 01:28:22 -0400 (EDT) Subject: worker process exited on signal 11 In-Reply-To: <20120418172753.GK13466@mdounin.ru> References: <20120418172753.GK13466@mdounin.ru> Message-ID: Hello Maxim, until now no signal 11 occured without substitutions4nginx. It's interesting that such errors do not occur in 1.0. I'll contact the developer of this module, maybe he can help or fix it. We're parsing the content with regexp to rewrite links to another domain, mainly for external CDN domains. Thank you very much for your help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225420,225498#msg-225498 From sammyraul1 at gmail.com Thu Apr 19 08:39:22 2012 From: sammyraul1 at gmail.com (Sammy Raul) Date: Thu, 19 Apr 2012 17:39:22 +0900 Subject: Registering Nginx callback in external library Message-ID: Hi All, Here's what I wanted to do: 1) I wanted to write a Nginx location handler for example "/mylocation" which when invoked should call another program to get the response. 2) The other external program provides a client library where we can register callbacks. 3) The external program will call the callback when the data is available. I wanted to know if I am using an external library and one of the external API is asking for registering callback, how i can achieve this in Nginx. I cannot give any function from my handler, as that is called internally by the nginx Core. Please guide me how I can register a callback inside Nginx which will be called by the external program. Thanks, Raul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Apr 19 09:06:46 2012 From: nginx-forum at nginx.us (springbok) Date: Thu, 19 Apr 2012 05:06:46 -0400 (EDT) Subject: nginx segfault Message-ID: <3c174a88bff7f85c8d642a4c8641c161.NginxMailingListEnglish@forum.nginx.org> I tried to upgrade my passenger+nginx install to passenger 3.0.11 on our staging server to match our production server, I've also upgraded to ruby 1.9.3. Previously I had successfully run passenger 3.0.3 with ruby 1.9.2. After installing the new passenger gem 9.0.11, I install as usual using passenger-install-nginx-module. Everything seems to build without any problems but when I try and do: /opt/nginx/sbin/nginx -V I get "Segmentation fault", when I look in the log file I have: Apr 19 19:00:28 jbdev1 kernel: nginx[32336]: segfault at 705740 ip 0000000000705740 sp 00007fff4673f478 error 15 in nginx[6f5000+11000] I've tried building with the latest version of passenger 9.0.12 but I get the same problem. I've installed passenger+nginx many times on many server without this problem. I'm running this particular build on suse linux Linux jbdev1 2.6.27.19-5-default #1 SMP 2009-02-28 04:40:21 +0100 x86_64 x86_64 x86_64 GNU/Linux SUSE Linux Enterprise Server 11 (x86_64) gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) Any help appreciated. Etienne. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225501,225501#msg-225501 From kjetil at pswin.com Thu Apr 19 09:13:19 2012 From: kjetil at pswin.com (=?iso-8859-1?Q?Kjetil_M=E6land?=) Date: Thu, 19 Apr 2012 11:13:19 +0200 Subject: Different Client certificate CA's in each server{} element? Message-ID: <6C7F78F11731F14291BB7356B7A8AD101535DE@pro-srv4.provide.no> Can we set up Nginx to handle Client verification from different CA's in each Server element? Or do we need one NginX instance pr. CA? Thanks Kjetil -------------- next part -------------- An HTML attachment was scrubbed... URL: From edho at myconan.net Thu Apr 19 09:15:16 2012 From: edho at myconan.net (Edho Arief) Date: Thu, 19 Apr 2012 16:15:16 +0700 Subject: Different Client certificate CA's in each server{} element? In-Reply-To: <6C7F78F11731F14291BB7356B7A8AD101535DE@pro-srv4.provide.no> References: <6C7F78F11731F14291BB7356B7A8AD101535DE@pro-srv4.provide.no> Message-ID: 2012/4/19 Kjetil M?land : > > > Can we set up Nginx to handle Client verification from different CA?s in > each Server element? > Yes. From nginx-forum at nginx.us Thu Apr 19 10:23:30 2012 From: nginx-forum at nginx.us (wangbin579) Date: Thu, 19 Apr 2012 06:23:30 -0400 (EDT) Subject: Why the benchmark results are different? In-Reply-To: References: Message-ID: If you have online data,you can use tcpcopy to test your system. https://github.com/wangbin579/tcpcopy or http://code.google.com/p/tcpcopy/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225415,225505#msg-225505 From nginx-forum at nginx.us Thu Apr 19 11:51:38 2012 From: nginx-forum at nginx.us (keeef) Date: Thu, 19 Apr 2012 07:51:38 -0400 (EDT) Subject: Proxy_Pass & proxy_set_header problem Message-ID: <78487d49512f812f81b51a2c3a204a39.NginxMailingListEnglish@forum.nginx.org> I am trying to get a CMS (Liferay), a desktop application (Liferay Sync) and WebDav to all work behind a Nginx reverse proxy and can't quite get all 3 working although they all use the same domain. The following code works BUT the only problem is that webpages that are returned contain links to http://10.x.x.205:8080 If I put in a "proxy_set_header Host $host" then the webpage links are correct and WebDav works but "Liferay Sync" stops working. server { listen 80; server_name liferay.mydomain.com; location / { # proxy_set_header Host $host; proxy_pass http://10.x.x.205:8080; } } I think this is a HTTP header issue as I have tried passing all the headers that I can find with "proxy_pass_header" and but I can't see why the LiferaySync app isn't working. Can anyone help ? Cheers Keith Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225506,225506#msg-225506 From gpakosz at yahoo.fr Thu Apr 19 12:23:40 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Thu, 19 Apr 2012 14:23:40 +0200 Subject: php-fpm backend, sigsegv and limit_conn Message-ID: Hello, I'm facing the situation where worker process crashes in the php-fpm backend with SIGSEGV: [alert] 5712#0: worker process 5713 exited on signal 11 In such a case, what happens to the connection? is it dangling? Crashes in the backend are random, and I have the impression that when too many crashes happen in a row, connection stay open and eventually I'm hitting limit_conn. What do you think? Regards, Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Apr 19 12:31:48 2012 From: nginx-forum at nginx.us (utahemre) Date: Thu, 19 Apr 2012 08:31:48 -0400 (EDT) Subject: Caching images with memcached Message-ID: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> Hi everyone, I want to cache png images with memcached and serve with nginx. I configured nginx and i could write images to memcached. When i try to read this images from cache with memcached client i can. But when i try to read this images from nginx, broken images comes. For example : I put byte array to memcached with 115832 bytes but when i try to read get 114940 bytes. Anyone has idea? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225508,225508#msg-225508 From mdounin at mdounin.ru Thu Apr 19 12:36:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 Apr 2012 16:36:41 +0400 Subject: Default_server catch all block not working In-Reply-To: <5c1276b46f9cd1e19931715fee0069ad.NginxMailingListEnglish@forum.nginx.org> References: <5c1276b46f9cd1e19931715fee0069ad.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120419123641.GO13466@mdounin.ru> Hello! On Mon, Apr 16, 2012 at 04:43:46AM -0400, lockev3.0 wrote: > Well, probably I'm, still novice at Nginx but, that default server block > is meant to fit when no other block server (server_name) fits. So my > current problem is that 444 behaviour is arising all thru my nginx > server, not just that default_server block/vhost > .....not quit sure If I explained my self better now ? or even > understood you right .... I belive Jonathan Matthews is right and the problem is as follows: your load balancer sees invalid response from your nginx server (as "return 444" just drops the connection) and starts to think it's not working (and starts to return errors to clients without even asking nginx). There are two possible solutions: 1) Don't use "return 444" but return some correct response. In any case "return 444" doesn't help at all as long as your nginx is behind load balancer (as your balancer will return response anyway). 2) Tune your balancer to ignore such connection closes (not sure this is possible). Maxim Dounin From am at simoon.de Thu Apr 19 12:44:46 2012 From: am at simoon.de (Alexander Meis) Date: Thu, 19 Apr 2012 14:44:46 +0200 Subject: Caching images with memcached In-Reply-To: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> References: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F9008BE.2040108@simoon.de> Hi, i want to do the same setup, could you give me your configuration so that i can see how it works? thanks alex From nginx-forum at nginx.us Thu Apr 19 12:51:26 2012 From: nginx-forum at nginx.us (utahemre) Date: Thu, 19 Apr 2012 08:51:26 -0400 (EDT) Subject: Caching images with memcached In-Reply-To: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> References: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8e032c486e9817f59541ff54c7b18e3d.NginxMailingListEnglish@forum.nginx.org> I did the configuration that is explained in this site; http://f.souza.cc/2010/12/killer-java-applications-server-with-nginx-and-memcached/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225508,225512#msg-225512 From mdounin at mdounin.ru Thu Apr 19 13:35:18 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 Apr 2012 17:35:18 +0400 Subject: php-fpm backend, sigsegv and limit_conn In-Reply-To: References: Message-ID: <20120419133518.GU13466@mdounin.ru> Hello! On Thu, Apr 19, 2012 at 02:23:40PM +0200, Gr?gory Pakosz wrote: > I'm facing the situation where worker process crashes in the php-fpm > backend with SIGSEGV: [alert] 5712#0: worker process 5713 exited on signal > 11 You mean nginx worker process crash, right? > In such a case, what happens to the connection? is it dangling? > Crashes in the backend are random, and I have the impression that when too > many crashes happen in a row, connection stay open and eventually I'm > hitting limit_conn. The limit_conn numbers are kept in a shared memory and will not be decremented on nginx worker process crash, leading to a limit hits eventually. To clear the numbers you may do an online upgrade, see http://nginx.org/en/docs/control.html#upgrade. Or, better, you may want to debug crashes, see here for basic instructions: http://wiki.nginx.org/Debugging Note well that crashes might lead to much more severe consequences, e.g. if the crash happens during shared memory update it may be left in an inconsistent state, leading to unpredictable behaviour (usually more crashes). Maxim Dounin From mdounin at mdounin.ru Thu Apr 19 13:40:39 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 Apr 2012 17:40:39 +0400 Subject: Caching images with memcached In-Reply-To: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> References: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120419134039.GV13466@mdounin.ru> Hello! On Thu, Apr 19, 2012 at 08:31:48AM -0400, utahemre wrote: > Hi everyone, > > I want to cache png images with memcached and serve with nginx. > > I configured nginx and i could write images to memcached. When i try to > read this images from cache with memcached client i can. > > But when i try to read this images from nginx, broken images comes. > > For example : I put byte array to memcached with 115832 bytes but when i > try to read get 114940 bytes. > > Anyone has idea? Usually it happens due to compressed content being put into memcached by a memcached client. Maxim Dounin From gpakosz at yahoo.fr Thu Apr 19 13:45:11 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Thu, 19 Apr 2012 15:45:11 +0200 Subject: php-fpm backend, sigsegv and limit_conn In-Reply-To: <20120419133518.GU13466@mdounin.ru> References: <20120419133518.GU13466@mdounin.ru> Message-ID: On Thu, Apr 19, 2012 at 3:35 PM, Maxim Dounin wrote: > > You mean nginx worker process crash, right? > > errors get logged into /var/log/nginx/error.log: 2012/04/19 15:34:41 [alert] 5712#0: worker process 9234 exited on signal 11 2012/04/19 15:34:48 [alert] 5712#0: worker process 9252 exited on signal 11 2012/04/19 15:34:57 [alert] 5712#0: worker process 9253 exited on signal 11 2012/04/19 15:35:06 [alert] 5712#0: worker process 9272 exited on signal 11 2012/04/19 15:36:11 [alert] 5712#0: worker process 9277 exited on signal 11 debian squeeze nginx-full 1.1.19-1~bpo60+1 from squeeze-backports php5-fpm 5.3.10-1~dotdeb.1 from dotdeb The context: I'm experimenting with Piwik's new log analytics import script. It's a Python script that parses server logs and does POST requests to a Piwik instance. I wouldn't say it's hammering much as it's able to post only around 10 log lines per second. It's those POST requests that randomly cause the SIGSEGV errors that got logged into /var/log/nginx/error.log. After many worker process crashes, I eventually hit a connection limit I set with limit_conn (of 10 simultaneous connections per IP). I could disable limit_conn as a workaround until I find out the root cause of those crashes. About the crashes themselves, I really don't know what's going on so far. PHP-FPM logs remain empty (or I wasn't able to enable them correctly). Piwik's wiki states it's impossible Piwik itself is the root cause for SIGSEGV; instead they say bugs in PHP itself, MySQL or accelerators like APC are to blame. (note I disabled APC without much luck). > The limit_conn numbers are kept in a shared memory and will not be > decremented on nginx worker process crash, leading to a limit > hits eventually. To clear the numbers you may do an online > upgrade, see http://nginx.org/en/docs/control.html#upgrade. > > Or, better, you may want to debug crashes, see here for basic > instructions: > > http://wiki.nginx.org/Debugging > > Note well that crashes might lead to much more severe > consequences, e.g. if the crash happens during shared memory > update it may be left in an inconsistent state, leading to > unpredictable behaviour (usually more crashes). > > I'll try to give it a go. thank you for the reply Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Apr 19 14:46:46 2012 From: nginx-forum at nginx.us (dignus) Date: Thu, 19 Apr 2012 10:46:46 -0400 (EDT) Subject: RHEL 6, nginx and parse fails Message-ID: <9e3f559fb44adbae0fa8b2e838bb7a4b.NginxMailingListEnglish@forum.nginx.org> Hi all, Today I updated 2 of my RHEL 6 boxes to the latest version of all installed packages including Nginx from the nginx repository. Since then both reload & configtest won't work, the error I'm seeing is this: nginx object version 0.8.54 does not match bootstrap parameter 1.0.14 at /usr/lib64/perl5/XSLoader.pm line 94. Compilation failed in require. BEGIN failed--compilation aborted. 2012/04/19 16:23:01 [alert] 11485#0: perl_parse() failed: 2 Any idea what's happening here? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225519,225519#msg-225519 From nginx-forum at nginx.us Thu Apr 19 14:56:21 2012 From: nginx-forum at nginx.us (utahemre) Date: Thu, 19 Apr 2012 10:56:21 -0400 (EDT) Subject: Caching images with memcached In-Reply-To: <8e032c486e9817f59541ff54c7b18e3d.NginxMailingListEnglish@forum.nginx.org> References: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> <8e032c486e9817f59541ff54c7b18e3d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3774f3a7520338ec3cff2bedd966f269.NginxMailingListEnglish@forum.nginx.org> I focused same topic that you are said about. I am using spymemcached client to write the cache and nginx read wrong data. After your reply i tried to write with whalin memcached client and tried to read both spymemcached and nginx. Neither nginx nor spymemcached can read data from cache. Does nginx have any configuration that i configure which memcached client nginx use? Or anyone know which memcached client can run with nginx properly? Emre Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225508,225520#msg-225520 From mdounin at mdounin.ru Thu Apr 19 16:02:20 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 Apr 2012 20:02:20 +0400 Subject: Caching images with memcached In-Reply-To: <3774f3a7520338ec3cff2bedd966f269.NginxMailingListEnglish@forum.nginx.org> References: <893dbafae654ff3729e104451be26658.NginxMailingListEnglish@forum.nginx.org> <8e032c486e9817f59541ff54c7b18e3d.NginxMailingListEnglish@forum.nginx.org> <3774f3a7520338ec3cff2bedd966f269.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120419160220.GY13466@mdounin.ru> Hello! On Thu, Apr 19, 2012 at 10:56:21AM -0400, utahemre wrote: > I focused same topic that you are said about. > > I am using spymemcached client to write the cache and nginx read wrong > data. > > After your reply i tried to write with whalin memcached client and tried > to read both spymemcached and nginx. Neither nginx nor spymemcached can > read data from cache. > > Does nginx have any configuration that i configure which memcached > client nginx use? Or anyone know which memcached client can run with > nginx properly? More or less any memcached client can work properly with nginx, you just need to figure out how to write raw data into memcached from your client, i.e. without compression, serialization and so on. In case of Perl clients it's more or less default behaviour for all modules I know (Cache::Memcached, Cache::Memcached::Fast) as long as you write scalars to memcached. No idea about Java. Maxim Dounin From zzz at zzz.org.ua Thu Apr 19 16:11:55 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Thu, 19 Apr 2012 19:11:55 +0300 Subject: RHEL 6, nginx and parse fails In-Reply-To: <9e3f559fb44adbae0fa8b2e838bb7a4b.NginxMailingListEnglish@forum.nginx.org> References: <9e3f559fb44adbae0fa8b2e838bb7a4b.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Apr 19, 2012 at 5:46 PM, dignus wrote: > Hi all, > > Today I updated 2 of my RHEL 6 boxes to the latest version of all > installed packages including Nginx from the nginx repository. > > Since then both reload & configtest won't work, the error I'm seeing is > this: > > nginx object version 0.8.54 does not match bootstrap parameter 1.0.14 at > /usr/lib64/perl5/XSLoader.pm line 94. > Compilation failed in require. > BEGIN failed--compilation aborted. > 2012/04/19 16:23:01 [alert] 11485#0: perl_parse() failed: 2 > > Any idea what's happening here? Seems like you are trying to load older nginx.so with newer nginx.pm. From nginx-forum at nginx.us Thu Apr 19 17:18:14 2012 From: nginx-forum at nginx.us (sirvon) Date: Thu, 19 Apr 2012 13:18:14 -0400 (EDT) Subject: can't access sub directories Message-ID: <84dea16a0832a02f92cd60e3b8e63ff4.NginxMailingListEnglish@forum.nginx.org> with my current config, i can access the root directory but i cant access any directory below it... here's my vhost config: http://pastebin.com/50pyYDtS here's my nginx config: http://pastebin.com/n1HXxVmu thanks for any assistance Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225528,225528#msg-225528 From tdgh2323 at hotmail.com Thu Apr 19 19:10:45 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Thu, 19 Apr 2012 19:10:45 +0000 Subject: Cache hit statistics? Message-ID: Does nginx have a cache hit ratio statistic... Ive been searching .. or perhaps a way to differentiate in the logs wchi was served from cache and which was not. Thanks -Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Thu Apr 19 19:18:38 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Thu, 19 Apr 2012 19:18:38 +0000 Subject: How to umask nginx to make it write files in 770 (cache/logs) Message-ID: Hello, Iam thinking of setting a umask in nginx... so that it writes files (logs ans cache) in 770 . Anybody know how to do this, or done it? I need this because my environment needs access to all files produced by nginx and some are 700 . Regards, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Thu Apr 19 19:31:19 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 19 Apr 2012 20:31:19 +0100 Subject: can't access sub directories In-Reply-To: <84dea16a0832a02f92cd60e3b8e63ff4.NginxMailingListEnglish@forum.nginx.org> References: <84dea16a0832a02f92cd60e3b8e63ff4.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120419193119.GC26729@craic.sysops.org> On Thu, Apr 19, 2012 at 01:18:14PM -0400, sirvon wrote: Hi there, > with my current config, i can access the root directory > but i cant access any directory below it... With that configuration, I'd expect that any non-php request to a url that starts http://sourcemarine.net/ would be served directly from the filesystem below /usr/share/nginx/html/sourcemarine.net I'm not able to work out how you want php requests to be handled. After "fastcgi_pass", the configuration becomes unclear. By which I mean "probably broken". So, when you say "cant access any directory below it": can you nominate one specific url, and say what you actually get when you fetch it, and say what you expect to get when you fetch it? I suspect that the output of something like curl -i http://sourcemarine.net/one/two will be useful. If the problem is with the php configuration, then can you describe how you would like the request to be handled? As in, if I access http://sourcemarine.net/one/two.php/three, which php file do you want "the system" to read and process? f -- Francis Daly francis at daoine.org From ashishs.dev at gmail.com Thu Apr 19 20:17:09 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Thu, 19 Apr 2012 13:17:09 -0700 Subject: nginx upstream for broadcasting update messages ? In-Reply-To: References: Message-ID: Hi, Anyone with experience with a similar use-case? Any recommendations here? Thanks, Ashish On Wed, Apr 18, 2012 at 6:29 PM, Ashish S wrote: > Hi, > > I have 2 memcache boxes behind nginx. ?For reads, the upstream module > lets me round-robin between the backend memcache boxes. I want the > updates to go to all 2 memcache boxes. My question is, what is the > best way to broadcast the updates to the backend? ?Is there a > reference implementation of some module which does similar stuff > (broadcast)? > > Thanks > Ashish From siefke_listen at web.de Thu Apr 19 23:53:50 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Fri, 20 Apr 2012 01:53:50 +0200 Subject: Rewrite Message-ID: <20120420015350.c2347e7e.siefke_listen@web.de> Hello, i want use rewrite to use article-"id".php to the post.php?id=1 for example. I has written the follow in the server section: location /article-(\d+)\.php$ { try_files $uri $uri/ /post.php?id=$1; } But it want not run. When i give http://example.com/blog/article-1.php, nginx not change to http://example.com/blog/post.php?id=1 192.168.0.20 - - [20/Apr/2012:01:52:16 +0200] "GET /blog/article-1.php HTTP/1.1" 404 27 "http://silviosiefke_de/blog/pdo-read.php" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" "-" Has someone idea whereis the mistake? Thanks for help. Regards Silvio From edho at myconan.net Thu Apr 19 23:56:51 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 20 Apr 2012 06:56:51 +0700 Subject: Rewrite In-Reply-To: <20120420015350.c2347e7e.siefke_listen@web.de> References: <20120420015350.c2347e7e.siefke_listen@web.de> Message-ID: 2012/4/20 Silvio Siefke : > Hello, > > i want use rewrite to use article-"id".php to the post.php?id=1 for example. > I has written the follow in the server section: > > location /article-(\d+)\.php$ { > try_files $uri $uri/ /post.php?id=$1; > } > > But it want not run. When i give http://example.com/blog/article-1.php, > nginx not change to http://example.com/blog/post.php?id=1 > 1. you forgot to put ~ for regex match 2. the one you want is rewrite/return, not try_files something like this may work: location ~ ^/article-(\d+)\.php$ { rewrite ^ /post.php?id=$1 last; } From nginx-forum at nginx.us Fri Apr 20 00:01:21 2012 From: nginx-forum at nginx.us (squimmy) Date: Thu, 19 Apr 2012 20:01:21 -0400 (EDT) Subject: Really bizarre problem with Sabredav Message-ID: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> Hi everyone, I've been desperately trying to get SabreDav working with Nginx for the last 3 days almost to no avail. Well, with some success actually. By following the instructions here: http://blog.carlkoepke.com/index.php/2011/12/09/nginx-can-do-web-dav-with-a-little-help-from-a-friend/ I can set it up so I can login. I can create folders too. I can't upload files though...well, I can't upload files with file extensions actually, and it's this I find really real really bizarre. If I try and upload blah.blah Transmit returns 405 Not Allowed and in the error logs in Nginx I get something like "access forbidden by rule" but if I then upload blah without the extension it works?!?! So i'm mostly getting lots of 405 Not Allowed's :( I'm pretty sure this is an Nginx issue not a Sabredav issue. Help would be really, really, really appreciated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225539,225539#msg-225539 From sammyraul1 at gmail.com Fri Apr 20 00:11:21 2012 From: sammyraul1 at gmail.com (sammy_raul) Date: Thu, 19 Apr 2012 17:11:21 -0700 (PDT) Subject: Registering Nginx callback in external library In-Reply-To: References: Message-ID: <1334880681719-7482648.post@n2.nabble.com> Anything on this guys. Raul -- View this message in context: http://nginx.2469901.n2.nabble.com/Registering-Nginx-callback-in-external-library-tp7479794p7482648.html Sent from the nginx mailing list archive at Nabble.com. From nginx-forum at nginx.us Fri Apr 20 00:20:33 2012 From: nginx-forum at nginx.us (springbok) Date: Thu, 19 Apr 2012 20:20:33 -0400 (EDT) Subject: nginx segfault In-Reply-To: <3c174a88bff7f85c8d642a4c8641c161.NginxMailingListEnglish@forum.nginx.org> References: <3c174a88bff7f85c8d642a4c8641c161.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5a2d5f819003c964154382e2ffea7199.NginxMailingListEnglish@forum.nginx.org> Ran gdb with a backtrace and got the following, is there an incompatible library or something? Program received signal SIGSEGV, Segmentation fault. 0x00000000006d2660 in strcmp@@GLIBC_2.2.5 () (gdb) bt full #0 0x00000000006d2660 in strcmp@@GLIBC_2.2.5 () No symbol table info available. #1 0x00007ffff7dea4a7 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2 No symbol table info available. #2 0x00007fff00000001 in ?? () No symbol table info available. #3 0x0000000000000000 in ?? () No symbol table info available. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225501,225541#msg-225541 From siefke_listen at web.de Fri Apr 20 00:43:17 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Fri, 20 Apr 2012 02:43:17 +0200 Subject: Rewrite In-Reply-To: References: <20120420015350.c2347e7e.siefke_listen@web.de> Message-ID: <20120420024317.5fa88fb8.siefke_listen@web.de> On Fri, 20 Apr 2012 06:56:51 +0700 Edho Arief wrote: > 1. you forgot to put ~ for regex match > 2. the one you want is rewrite/return, not try_files Thanks for help. So i have from this list, with the html files it run. But nginx want not use html inside php so i must change the rule. > something like this may work: > > location ~ ^/article-(\d+)\.php$ { > rewrite ^ /post.php?id=$1 last; > } Is the same, i become "File not found". 192.168.0.20 - - [20/Apr/2012:02:40:32 +0200] "GET /blog/article-1.php HTTP/1.1" 404 27 "http://silviosiefke_de/blog/index.php" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" "-" Regards Silvio gentoo-desk db # nginx -V nginx version: nginx/1.0.15 TLS SNI support enabled configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-http_addition_module --with-http_dav_module --with-http_realip_module --with-http_stub_status_module --with-http_sub_module --with-http_xslt_module --with-http_realip_module --with-pcre --add-module=/var/tmp/portage/www-servers/nginx-1.0.15/work/agentzh-headers-more-nginx-module-137855d --add-module=/var/tmp/portage/www-servers/nginx-1.0.15/work/nginx_http_push_module-0.692 --add-module=/var/tmp/portage/www-servers/nginx-1.0.15/work/nginx_upload_module-2.2.0 --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx From edho at myconan.net Fri Apr 20 00:44:57 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 20 Apr 2012 07:44:57 +0700 Subject: Rewrite In-Reply-To: <20120420024317.5fa88fb8.siefke_listen@web.de> References: <20120420015350.c2347e7e.siefke_listen@web.de> <20120420024317.5fa88fb8.siefke_listen@web.de> Message-ID: 2012/4/20 Silvio Siefke : > On Fri, 20 Apr 2012 06:56:51 +0700 > Edho Arief wrote: > >> 1. you forgot to put ~ for regex match >> 2. the one you want is rewrite/return, not try_files > > Thanks for help. So i have from this list, with the html files it run. > But nginx want not use html inside php so i must change the rule. > >> something like this may work: >> >> location ~ ^/article-(\d+)\.php$ { >> ? rewrite ^ /post.php?id=$1 last; >> } > > Is the same, i become "File not found". > Put the block before all other locations. From siefke_listen at web.de Fri Apr 20 01:23:15 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Fri, 20 Apr 2012 03:23:15 +0200 Subject: Rewrite In-Reply-To: References: <20120420015350.c2347e7e.siefke_listen@web.de> Message-ID: <20120420032315.4b69f02d.siefke_listen@web.de> Hello, On Fri, 20 Apr 2012 06:56:51 +0700 Edho Arief wrote: > 1. you forgot to put ~ for regex match > 2. the one you want is rewrite/return, not try_files > > something like this may work: > > location ~ ^/article-(\d+)\.php$ { > rewrite ^ /post.php?id=$1 last; > } Ok i have it do, but the result is same, File not found. The config complete: http://nopaste.info/af7861f553.html Regards Silvio From agentzh at gmail.com Fri Apr 20 07:21:34 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 20 Apr 2012 15:21:34 +0800 Subject: Registering Nginx callback in external library In-Reply-To: References: Message-ID: On Thu, Apr 19, 2012 at 4:39 PM, Sammy Raul wrote: > Here's what I wanted to do: > > 1) I wanted to write a Nginx location handler for example "/mylocation" > which when invoked should call another program to get the response. > > 2) The other external program provides a client library where we can > register callbacks. > > 3) The external program will call the callback when the data is available. > > > > I wanted to know if I am using an external library and one of the external > API is asking for registering callback, how i can achieve this in Nginx. > Take a look at the ngx_drizzle module which integrates the external client library libdrizzle into the Nginx core and generates outputs for an nginx location: http://wiki.nginx.org/HttpDrizzleModule Also take a look at the ngx_postgres module which integrates external client library libpq into the Nginx core: https://github.com/FRiCKLE/ngx_postgres Hope this helps, -agentzh From jdmls at yahoo.com Fri Apr 20 11:55:42 2012 From: jdmls at yahoo.com (John Doe) Date: Fri, 20 Apr 2012 04:55:42 -0700 (PDT) Subject: How to umask nginx to make it write files in 770 (cache/logs) In-Reply-To: References: Message-ID: <1334922942.14473.YahooMailNeo@web114703.mail.gq1.yahoo.com> From: Micheal Wolfskill >Iam thinking of setting a umask in nginx... so that it writes files (logs ans cache) in 770 . Anybody know how to do this, or done it? >I need this because my environment needs access to all files produced by nginx and some are 700 . Never tried but maybe set the umask at the beginning of the init.d script (but that would apply to all files creation)... Or a quick/dirty way to do it would be to chmod 770 the log files every x hour or once a day from a cron job... JD From sparshgupta at gmail.com Fri Apr 20 11:57:40 2012 From: sparshgupta at gmail.com (Sparsh Gupta) Date: Fri, 20 Apr 2012 17:27:40 +0530 Subject: Permission Denied Error Message-ID: I am seeing some error like below in my nginx error log: 2012/04/20 11:51:52 [crit] 21437#0: *2548 open() "/var/cache/nginx/fastcgi_temp/5/00/0000000005" failed (13: Permission denied) while reading upstream, client: 139.112.144.210, server: example.com, request: "GET /index.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "example.com", referrer: "http://example.com/" I have: user www-data; in my nginx.conf and the owners of the /var/cache/nginx/fastcgi_temp/5/00 are 'nginx:nginx' How can I fix this? Thanks Sparsh Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Fri Apr 20 13:06:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 Apr 2012 17:06:23 +0400 Subject: Permission Denied Error In-Reply-To: References: Message-ID: <20120420130623.GH13466@mdounin.ru> Hello! On Fri, Apr 20, 2012 at 05:27:40PM +0530, Sparsh Gupta wrote: > I am seeing some error like below in my nginx error log: > > 2012/04/20 11:51:52 [crit] 21437#0: *2548 open() > "/var/cache/nginx/fastcgi_temp/5/00/0000000005" failed (13: Permission > denied) while reading upstream, client: 139.112.144.210, server: example.com, > request: "GET /index.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", > host: "example.com", referrer: "http://example.com/" > > I have: user www-data; in my nginx.conf and > the owners of the /var/cache/nginx/fastcgi_temp/5/00 are 'nginx:nginx' > > How can I fix this? With chown(1), see "man chown" for details. Maxim Dounin From mdounin at mdounin.ru Fri Apr 20 13:14:53 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 Apr 2012 17:14:53 +0400 Subject: Cache hit statistics? In-Reply-To: References: Message-ID: <20120420131453.GI13466@mdounin.ru> Hello! On Thu, Apr 19, 2012 at 07:10:45PM +0000, Micheal Wolfskill wrote: > Does nginx have a cache hit ratio statistic... Ive been > searching .. or perhaps a way to differentiate in the logs wchi > was served from cache and which was not. Thanks The $upstream_cache_status variable is what you are looking for. It's not yet described in docs, but here is a wiki entry: http://wiki.nginx.org/HttpUpstreamModule#.24upstream_cache_status Maxim Dounin From sparshgupta at gmail.com Fri Apr 20 18:57:40 2012 From: sparshgupta at gmail.com (Sparsh Gupta) Date: Sat, 21 Apr 2012 00:27:40 +0530 Subject: Permission Denied Error In-Reply-To: <20120420130623.GH13466@mdounin.ru> References: <20120420130623.GH13466@mdounin.ru> Message-ID: My concern was that when I have user www-data; mentioned in my config file, why is nginx creating files for fastcgi_temp with user nginx and group nginx I understand thats the default user:group while compiling was nginx:nginx but shouldn't they be overridden by the option provided in nginx runtime configuration file? Sparsh Gupta On 20 April 2012 18:36, Maxim Dounin wrote: > Hello! > > On Fri, Apr 20, 2012 at 05:27:40PM +0530, Sparsh Gupta wrote: > > > I am seeing some error like below in my nginx error log: > > > > 2012/04/20 11:51:52 [crit] 21437#0: *2548 open() > > "/var/cache/nginx/fastcgi_temp/5/00/0000000005" failed (13: Permission > > denied) while reading upstream, client: 139.112.144.210, server: > example.com, > > request: "GET /index.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000 > ", > > host: "example.com", referrer: "http://example.com/" > > > > I have: user www-data; in my nginx.conf and > > the owners of the /var/cache/nginx/fastcgi_temp/5/00 are 'nginx:nginx' > > > > How can I fix this? > > With chown(1), see "man chown" for details. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Apr 20 19:38:59 2012 From: nginx-forum at nginx.us (catball123) Date: Fri, 20 Apr 2012 15:38:59 -0400 (EDT) Subject: nginx Unicode character bug in all win version Message-ID: <0396d00e61b458ca0acd3ff485cf5abb.NginxMailingListEnglish@forum.nginx.org> test in 0.7.69-1.1.9 / OS:WINXP SP2 CHINA mkdir chinese Charset DIR like ????? you can see error C:\?????\nginx.exe 2012/04/21 03:32:00 [emerg] 2060#3468: CreateFile() "C:\?????\nginx-1.1.19/conf/nginx.conf" failed (1113: No mapping for the Unicode character exists in the target multi-byte code page) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225564,225564#msg-225564 From cliff at develix.com Fri Apr 20 20:05:40 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 20 Apr 2012 13:05:40 -0700 Subject: Really bizarre problem with Sabredav In-Reply-To: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> References: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1334952340.28719.7.camel@portable-evil> On Thu, 2012-04-19 at 20:01 -0400, squimmy wrote: > Hi everyone, > > I've been desperately trying to get SabreDav working with Nginx for the > last 3 days almost to no avail. Well, with some success actually. By > following the instructions here: > http://blog.carlkoepke.com/index.php/2011/12/09/nginx-can-do-web-dav-with-a-little-help-from-a-friend/ > > I can set it up so I can login. I can create folders too. I can't upload > files though...well, I can't upload files with file extensions actually, > and it's this I find really real really bizarre. If I try and upload > blah.blah Transmit returns 405 Not Allowed and in the error logs in > Nginx I get something like "access forbidden by rule" but if I then > upload blah without the extension it works?!?! So i'm mostly getting > lots of 405 Not Allowed's :( Without seeing any config or knowing which extensions you refer to, I'm going to guess that you have a location that matches those extensions (any chance they are .php?), and that location is handling the PUT (hence, 405 method not allowed) rather than your DAV location. Regards, Cliff > I'm pretty sure this is an Nginx issue not a Sabredav issue. > > Help would be really, really, really appreciated. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225539,225539#msg-225539 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From cliff at develix.com Fri Apr 20 20:14:10 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 20 Apr 2012 13:14:10 -0700 Subject: Really bizarre problem with Sabredav In-Reply-To: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> References: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1334952850.28719.8.camel@portable-evil> You might try this instead: https://github.com/arut/nginx-dav-ext-module Cliff On Thu, 2012-04-19 at 20:01 -0400, squimmy wrote: > Hi everyone, > > I've been desperately trying to get SabreDav working with Nginx for the > last 3 days almost to no avail. Well, with some success actually. By > following the instructions here: > http://blog.carlkoepke.com/index.php/2011/12/09/nginx-can-do-web-dav-with-a-little-help-from-a-friend/ > > I can set it up so I can login. I can create folders too. I can't upload > files though...well, I can't upload files with file extensions actually, > and it's this I find really real really bizarre. If I try and upload > blah.blah Transmit returns 405 Not Allowed and in the error logs in > Nginx I get something like "access forbidden by rule" but if I then > upload blah without the extension it works?!?! So i'm mostly getting > lots of 405 Not Allowed's :( > > I'm pretty sure this is an Nginx issue not a Sabredav issue. > > Help would be really, really, really appreciated. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225539,225539#msg-225539 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Fri Apr 20 20:16:46 2012 From: nginx-forum at nginx.us (haad) Date: Fri, 20 Apr 2012 16:16:46 -0400 (EDT) Subject: srcache + mogilefs module Message-ID: <2077f3d358a87c93dcf94d8db97d653c.NginxMailingListEnglish@forum.nginx.org> Hi, I'm currently in a process of setting mogilefs + memcached + nginx environment. My idea is to have nginx as a frontend server which will be used to access files stored on a mogile filesystem. This is working perfectly. To add some caching I would like to add support for memcached to nginx itself. That way it will be able to cache some images for itself and do not ask mogilefs for them. My problem is that it seems that even if I put files to memcache manually and it srcache will find it (see log below), my file is still served from mogilefs and not from memcached. upstream mogilefs_trackers { server 192.168.206.3:6001; #server 192.168.206.2:6001; } upstream memcached_servers { server 192.168.206.3:11211; } server { listen 80; server_name ws01x.test.reality.sk; root /var/www/html; # # Check if we can find anything on a memcache server if not fetch it from a mogilefs. # location = /memc { internal; memc_connect_timeout 100ms; memc_send_timeout 100ms; memc_read_timeout 100ms; set $memc_key $query_string; set $memc_exptime 300; memc_pass memcached_servers; } location /share/ { set $key $uri; srcache_fetch GET /memc $key; srcache_store PUT /memc $key; srcache_store_statuses 200 301 302; srcache_response_cache_control off; mogilefs_tracker mogilefs_trackers; mogilefs_domain test; #mogilefs_class testclass; mogilefs_methods GET; mogilefs_noverify on; mogilefs_pass { proxy_pass $mogilefs_path; proxy_hide_header Content-Type; proxy_buffering off; } if ($request_uri ~* \.(ico|css|js)$) { expires 72h; break; } } } ------ LOG 2012/04/20 21:28:21 [debug] 7385#0: *501 http request line: "GET /share/file.html HTTP/1.0" 2012/04/20 21:28:21 [debug] 7385#0: *501 http uri: "/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http args: "" 2012/04/20 21:28:21 [debug] 7385#0: *501 http exten: "html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http process request header line 2012/04/20 21:28:21 [debug] 7385#0: *501 http header: "User-Agent: Wget/1.11.4 Red Hat modified" 2012/04/20 21:28:21 [debug] 7385#0: *501 http header: "Accept: */*" 2012/04/20 21:28:21 [debug] 7385#0: *501 http header: "Host: 192.168.200.64" 2012/04/20 21:28:21 [debug] 7385#0: *501 http header: "Connection: Keep-Alive" 2012/04/20 21:28:21 [debug] 7385#0: *501 http header done 2012/04/20 21:28:21 [debug] 7385#0: *501 event timer del: 3: 1334950161661 2012/04/20 21:28:21 [debug] 7385#0: *501 rewrite phase: 0 2012/04/20 21:28:21 [debug] 7385#0: *501 test location: "/memc" 2012/04/20 21:28:21 [debug] 7385#0: *501 test location: "/prehliadac" 2012/04/20 21:28:21 [debug] 7385#0: *501 test location: "/share/" 2012/04/20 21:28:21 [debug] 7385#0: *501 using configuration "/share/" 2012/04/20 21:28:21 [debug] 7385#0: *501 http cl:-1 max:1048576 2012/04/20 21:28:21 [debug] 7385#0: *501 rewrite phase: 2 2012/04/20 21:28:21 [debug] 7385#0: *501 http script complex value 2012/04/20 21:28:21 [debug] 7385#0: *501 http script var: "/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http script set $key 2012/04/20 21:28:21 [debug] 7385#0: *501 http script var 2012/04/20 21:28:21 [debug] 7385#0: *501 http script var: "/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http script regex: "\.(ico|css|js)$" 2012/04/20 21:28:21 [notice] 7385#0: *501 "\.(ico|css|js)$" does not match "/share/file.html", client: 192.168.200.64, server: ws01x.test.reality.sk, request: "GET /share/file.html HTTP/1.0", host: "192.168.200.64" 2012/04/20 21:28:21 [debug] 7385#0: *501 http script if 2012/04/20 21:28:21 [debug] 7385#0: *501 http script if: false 2012/04/20 21:28:21 [debug] 7385#0: *501 post rewrite phase: 3 2012/04/20 21:28:21 [debug] 7385#0: *501 generic phase: 4 2012/04/20 21:28:21 [debug] 7385#0: *501 generic phase: 5 2012/04/20 21:28:21 [debug] 7385#0: *501 access phase: 6 2012/04/20 21:28:21 [debug] 7385#0: *501 access phase: 7 2012/04/20 21:28:21 [debug] 7385#0: *501 access phase: 8 2012/04/20 21:28:21 [debug] 7385#0: *501 access phase: 9 2012/04/20 21:28:21 [debug] 7385#0: *501 http script var: "/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 posix_memalign: 0000000000EA31C0:4096 @16 2012/04/20 21:28:21 [debug] 7385#0: *501 http subrequest "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http posted request: "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 rewrite phase: 0 2012/04/20 21:28:21 [debug] 7385#0: *501 test location: "/memc" 2012/04/20 21:28:21 [debug] 7385#0: *501 using configuration "=/memc" 2012/04/20 21:28:21 [debug] 7385#0: *501 http cl:-1 max:1048576 2012/04/20 21:28:21 [debug] 7385#0: *501 rewrite phase: 2 2012/04/20 21:28:21 [debug] 7385#0: *501 http script complex value 2012/04/20 21:28:21 [debug] 7385#0: *501 http script var: "/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http script set $memc_key 2012/04/20 21:28:21 [debug] 7385#0: *501 http script value: "300" 2012/04/20 21:28:21 [debug] 7385#0: *501 http script set $memc_exptime 2012/04/20 21:28:21 [debug] 7385#0: *501 post rewrite phase: 3 2012/04/20 21:28:21 [debug] 7385#0: *501 generic phase: 4 2012/04/20 21:28:21 [debug] 7385#0: *501 generic phase: 5 2012/04/20 21:28:21 [debug] 7385#0: *501 http init upstream, client timer: 0 2012/04/20 21:28:21 [debug] 7385#0: *501 epoll add event: fd:3 op:3 ev:80000005 2012/04/20 21:28:21 [debug] 7385#0: *501 http memcached request: "/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http cleanup add: 0000000000EA4110 2012/04/20 21:28:21 [debug] 7385#0: *501 get rr peer, try: 1 2012/04/20 21:28:21 [debug] 7385#0: *501 socket 4 2012/04/20 21:28:21 [debug] 7385#0: *501 epoll add connection: fd:4 ev:80000005 2012/04/20 21:28:21 [debug] 7385#0: *501 connect to 192.168.206.3:11211, fd:4 #502 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream connect: -2 2012/04/20 21:28:21 [debug] 7385#0: *501 event timer add: 4: 100:1334950101761 2012/04/20 21:28:21 [debug] 7385#0: *501 http finalize request: -4, "/memc?/share/file.html" a:1, c:3 2012/04/20 21:28:21 [debug] 7385#0: *501 http request count:3 blk:0 2012/04/20 21:28:21 [debug] 7385#0: *501 http run request: "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream check client, write event:1, "/memc" 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream recv(): -1 (11: Resource temporarily unavailable) 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream request: "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream send request handler 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream send request 2012/04/20 21:28:21 [debug] 7385#0: *501 chain writer buf fl:0 s:22 2012/04/20 21:28:21 [debug] 7385#0: *501 chain writer in: 0000000000EA4148 2012/04/20 21:28:21 [debug] 7385#0: *501 writev: 22 2012/04/20 21:28:21 [debug] 7385#0: *501 chain writer out: 0000000000000000 2012/04/20 21:28:21 [debug] 7385#0: *501 event timer del: 4: 1334950101761 2012/04/20 21:28:21 [debug] 7385#0: *501 event timer add: 4: 100:1334950101763 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream request: "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream process header 2012/04/20 21:28:21 [debug] 7385#0: *501 malloc: 0000000000E989F0:4096 2012/04/20 21:28:21 [debug] 7385#0: *501 posix_memalign: 0000000000E99A00:4096 @16 2012/04/20 21:28:21 [debug] 7385#0: *501 recv: fd:4 46 of 4096 2012/04/20 21:28:21 [debug] 7385#0: *501 memcached: "VALUE /share/file.html 0 10" <---- WE got it 2012/04/20 21:28:21 [debug] 7385#0: *501 srcache_fetch: subrequest returned status 200 2012/04/20 21:28:21 [debug] 7385#0: *501 srcache_fetch decides to send the response in cache 2012/04/20 21:28:21 [debug] 7385#0: *501 tcp_nodelay 2012/04/20 21:28:21 [debug] 7385#0: *501 memcached filter bytes:17 size:17 length:17 rest:7 2012/04/20 21:28:21 [debug] 7385#0: *501 http upstream process non buffered downstream 2012/04/20 21:28:21 [debug] 7385#0: *501 http output filter "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http copy filter: "/memc?/share/file.html" 2012/04/20 21:28:21 [error] 7385#0: *501 srcache_fetch: cache sent invalid status line while sending to client, client: 192.168.200.64, server: ws01x.test.reality.sk, request: "GET /share/file.html HTTP/1.0", subrequest: "/memc", upstream: "memcached://192.168.206.3:11211", host: "192.168.200.64" 2012/04/20 21:28:21 [debug] 7385#0: *501 http copy filter: 0 "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 finalize http upstream request: 0 2012/04/20 21:28:21 [debug] 7385#0: *501 finalize http memcached request 2012/04/20 21:28:21 [debug] 7385#0: *501 free rr peer 1 0 2012/04/20 21:28:21 [debug] 7385#0: *501 close http upstream connection: 4 2012/04/20 21:28:21 [debug] 7385#0: *501 event timer del: 4: 1334950101763 2012/04/20 21:28:21 [debug] 7385#0: *501 reusable connection: 0 2012/04/20 21:28:21 [debug] 7385#0: *501 http output filter "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http copy filter: "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http copy filter: 0 "/memc?/share/file.html" 2012/04/20 21:28:21 [debug] 7385#0: *501 http finalize request: 0, "/memc?/share/file.html" a:1, c:2 2012/04/20 21:28:21 [debug] 7385#0: *501 http wake parent request: "/share/file.html?" 2012/04/20 21:28:21 [debug] 7385#0: *501 http posted request: "/share/file.html?" 2012/04/20 21:28:21 [debug] 7385#0: *501 access phase: 9 2012/04/20 21:28:21 [debug] 7385#0: *501 post access phase: 10 2012/04/20 21:28:21 [debug] 7385#0: *501 http set discard body 2012/04/20 21:28:21 [debug] 7385#0: *501 http init upstream, client timer: 0 2012/04/20 21:28:21 [debug] 7385#0: *501 mogilefs request: "get_paths key=file.html&domain=test&noverify=1" >From this log I can see why is file can't serverd from memcached, server status 200. Are srcache and mogilefs module somehow incompatible ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225568,225568#msg-225568 From adrian at navarro.at Sat Apr 21 00:18:27 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Sat, 21 Apr 2012 02:18:27 +0200 Subject: MP4 module and X-Accel-Redirect Message-ID: Hello I currently have a setup involving nginx-extras (1.1.19) and PHP, making heavy use of the X-Accel-Redirect heades to serve files with previous authentication. This also enables range requests and so on, which work flawlessly. Sadly, I can't seem to make this approach work with the MP4 streaming module. It works as expected with a standalone mp4 file and the ?start= parameter works just fine. But passing a request like this: /request?token=xxx&start=60 Does not work and yields the entire file instead. My config approach is the following: location ~ \.php$ { internal; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_index index.php; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } location ~ \.mp4$ { mp4; } location /files/ { rewrite_by_lua ' .....misc script to track connections..... '; internal; mp4; alias /home/service/files/; } location /priority { mp4; rewrite ^ /request.php last; } I cannot try any more or different combinations for the mp4 directive, I've tried to put it everywhere and just in a few places, and still, can't manage to get anything. Some time Google shows some message similar to this but dead in the wind without answer. Thank you for your time. From gpakosz at yahoo.fr Sat Apr 21 00:47:23 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Sat, 21 Apr 2012 02:47:23 +0200 Subject: error_page, try_files, internal redirect ends up in SIGSEGV Message-ID: Hello, I'm facing a SIGSEGV when trying to setup a custom error page using the following (shortened for the sake of debugging) configuration. /etc/nginx/sites-available/example.com: server { ? listen 80; ? server_name example.com; ? access_log /var/log/nginx/example.com_access.log; ? error_log /var/log/nginx/example.com_error.log debug; ? root /var/www; ? error_page 404 @404; ? location @404 { ? ? try_files /404.html =404; ? } ? location / { ? ? try_files $uri $uri/ /index.php; ? } ? location ~ \.php$ { ? ? try_files $uri =404; #? ? include php.conf; #? ? fastcgi_pass unix:/var/run/php5-fpm/www.sock; ? } } The intent is to test whether $uri exists as a file, then a directory, then if it doesn't exist defer to index.php if present. When index.php doesn't exist, use the custom 404 page. /var/www content: /var/www/index.html /var/www/404.html There is no /var/www/index.php and I'm expecting my custom 404.html page to be served. Here is a debug log when accessing http://example.com/foo.txt 2012/04/21 02:38:41 [debug] 18030#0: *71 event timer del: 35: 3528919376 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 0 2012/04/21 02:38:41 [debug] 18030#0: *71 rewrite phase: 1 2012/04/21 02:38:41 [debug] 18030#0: *71 test location: "/" 2012/04/21 02:38:41 [debug] 18030#0: *71 test location: ~ "\.php$" 2012/04/21 02:38:41 [debug] 18030#0: *71 using configuration "/" 2012/04/21 02:38:41 [debug] 18030#0: *71 http cl:-1 max:524288 2012/04/21 02:38:41 [debug] 18030#0: *71 rewrite phase: 3 2012/04/21 02:38:41 [debug] 18030#0: *71 post rewrite phase: 4 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 5 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 6 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 7 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 8 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 9 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 10 2012/04/21 02:38:41 [debug] 18030#0: *71 post access phase: 11 2012/04/21 02:38:41 [debug] 18030#0: *71 try files phase: 12 2012/04/21 02:38:41 [debug] 18030#0: *71 http script var: "/foo.txt" 2012/04/21 02:38:41 [debug] 18030#0: *71 trying to use file: "/foo.txt" "/var/www/foo.txt" 2012/04/21 02:38:41 [debug] 18030#0: *71 add cleanup: 09D15FA8 2012/04/21 02:38:41 [debug] 18030#0: *71 malloc: 09C2E528:88 2012/04/21 02:38:41 [debug] 18030#0: *71 malloc: 09C2E5B0:55 2012/04/21 02:38:41 [debug] 18030#0: *71 cached open file: /var/www/foo.txt, fd:-1, c:0, e:2, u:1 2012/04/21 02:38:41 [debug] 18030#0: *71 http script var: "/foo.txt" 2012/04/21 02:38:41 [debug] 18030#0: *71 trying to use dir: "/foo.txt" "/var/www/foo.txt" 2012/04/21 02:38:41 [debug] 18030#0: *71 add cleanup: 09D15FC4 2012/04/21 02:38:41 [debug] 18030#0: *71 cached open file: /var/www/foo.txt, fd:-1, c:0, e:2, u:2 2012/04/21 02:38:41 [debug] 18030#0: *71 trying to use file: "/index.php" "/var/www/index.php" 2012/04/21 02:38:41 [debug] 18030#0: *71 internal redirect: "/index.php?" 2012/04/21 02:38:41 [debug] 18030#0: *71 rewrite phase: 1 2012/04/21 02:38:41 [debug] 18030#0: *71 test location: "/" 2012/04/21 02:38:41 [debug] 18030#0: *71 test location: ~ "\.php$" 2012/04/21 02:38:41 [debug] 18030#0: *71 using configuration "\.php$" 2012/04/21 02:38:41 [debug] 18030#0: *71 http cl:-1 max:524288 2012/04/21 02:38:41 [debug] 18030#0: *71 rewrite phase: 3 2012/04/21 02:38:41 [debug] 18030#0: *71 post rewrite phase: 4 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 5 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 6 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 7 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 8 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 9 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 10 2012/04/21 02:38:41 [debug] 18030#0: *71 post access phase: 11 2012/04/21 02:38:41 [debug] 18030#0: *71 try files phase: 12 2012/04/21 02:38:41 [debug] 18030#0: *71 http script var: "/index.php" 2012/04/21 02:38:41 [debug] 18030#0: *71 trying to use file: "/index.php" "/var/www/index.php" 2012/04/21 02:38:41 [debug] 18030#0: *71 add cleanup: 09D1602C 2012/04/21 02:38:41 [debug] 18030#0: *71 malloc: 09C2E5F0:88 2012/04/21 02:38:41 [debug] 18030#0: *71 malloc: 09C2E650:57 2012/04/21 02:38:41 [debug] 18030#0: *71 cached open file: /var/www/index.php, fd:-1, c:0, e:2, u:1 2012/04/21 02:38:41 [debug] 18030#0: *71 trying to use file: "=404" "/var/www=404" 2012/04/21 02:38:41 [debug] 18030#0: *71 http finalize request: 404, "/index.php?" a:1, c:2 2012/04/21 02:38:41 [debug] 18030#0: *71 http special response: 404, "/index.php?" 2012/04/21 02:38:41 [debug] 18030#0: *71 test location: "@404" 2012/04/21 02:38:41 [debug] 18030#0: *71 using location: @404 "/index.php?" 2012/04/21 02:38:41 [debug] 18030#0: *71 rewrite phase: 3 2012/04/21 02:38:41 [debug] 18030#0: *71 post rewrite phase: 4 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 5 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 6 2012/04/21 02:38:41 [debug] 18030#0: *71 generic phase: 7 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 8 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 9 2012/04/21 02:38:41 [debug] 18030#0: *71 access phase: 10 2012/04/21 02:38:41 [debug] 18030#0: *71 post access phase: 11 2012/04/21 02:38:41 [debug] 18030#0: *71 try files phase: 12 At which point nginx crashes, /var/log/nginx/error.log: 2012/04/21 02:38:41 [alert] 17786#0: worker process 18030 exited on signal 11 # nginx -V nginx version: nginx/1.1.19 TLS SNI support enabled 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=/tmp/buildd/nginx-1.1.19/debian/modules/nginx-auth-pam --add-module=/tmp/buildd/nginx-1.1.19/debian/modules/nginx-echo --add-module=/tmp/buildd/nginx-1.1.19/debian/modules/nginx-upstream-fair --add-module=/tmp/buildd/nginx-1.1.19/debian/modules/nginx-dav-ext-module I'm using nginx 1.1.19-1~bpo60+1 package from Debian squeeze backports. Any idea please? Is there anything else I can report? Gregory From tdgh2323 at hotmail.com Sat Apr 21 02:09:30 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sat, 21 Apr 2012 02:09:30 +0000 Subject: How to umask nginx to make it write files in 770 (cache/logs) In-Reply-To: <1334922942.14473.YahooMailNeo@web114703.mail.gq1.yahoo.com> References: , <1334922942.14473.YahooMailNeo@web114703.mail.gq1.yahoo.com> Message-ID: I tried this in the init script: su - nginx -c "umask 002"; umask 002; None of them work... new cache files/dir still get 700 permissions... What could i be doing wrong=? > Date: Fri, 20 Apr 2012 04:55:42 -0700 > From: jdmls at yahoo.com > Subject: Re: How to umask nginx to make it write files in 770 (cache/logs) > To: nginx at nginx.org > > From: Micheal Wolfskill > > >Iam thinking of setting a umask in nginx... so that it writes files (logs ans cache) in 770 . Anybody know how to do this, or done it? > >I need this because my environment needs access to all files produced by nginx and some are 700 . > > > Never tried but maybe set the umask at the beginning of the init.d script (but that would apply to all files creation)... > Or a quick/dirty way to do it would be to chmod 770 the log files every x hour or once a day from a cron job... > > > JD > > _______________________________________________ > 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 Apr 21 02:22:25 2012 From: nginx-forum at nginx.us (nikita.tovstoles) Date: Fri, 20 Apr 2012 22:22:25 -0400 (EDT) Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: <98bff3fa433b3aa20090e187f022c094.NginxMailingListEnglish@forum.nginx.org> Hello, I was seeing the same issue: when upstream node is down, healthcheck correctly flags it as down yet subsequent requests are still routed to that node (even though others are healthy). Tried this patch with 1.0.13 and .15 - no relief: https://github.com/liseen/healthcheck_nginx_upstreams/blob/master/healthcheck.patch Is the above supposed to work when ip_hash directive is used? Thank you, -nikita My config: upstream admin-cluster { ip_hash; # clientIP-based session affinity healthcheck_enabled; healthcheck_send "GET /running HTTP/1.0" "Host: www.mydomain.com" "User-Agent: FooBar/1.0 nginx" "Connection: close"; healthcheck_delay 2000; healthcheck_failcount 2; healthcheck_timeout 2000; server admin1.staging.mydomain.com:8080 max_fails=1 fail_timeout=5; #max sec to connect to upstream host } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215656,225577#msg-225577 From tdgh2323 at hotmail.com Sat Apr 21 02:38:53 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sat, 21 Apr 2012 02:38:53 +0000 Subject: Change upstream server on the fly? (by command, instead of config editting) Message-ID: Hello all, Is there anyway I can change the upstream server of server{} on the fly... meaning without having to edit the config and reloading it? Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From ru at nginx.com Sat Apr 21 03:28:30 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Sat, 21 Apr 2012 07:28:30 +0400 Subject: error_page, try_files, internal redirect ends up in SIGSEGV In-Reply-To: References: Message-ID: <20120421032830.GA92227@lo0.su> On Sat, Apr 21, 2012 at 02:47:23AM +0200, Gr?gory Pakosz wrote: > I'm facing a SIGSEGV when trying to setup a custom error page using > the following (shortened for the sake of debugging) configuration. It's been fixed already: http://trac.nginx.org/nginx/changeset/4601/nginx From agentzh at gmail.com Sat Apr 21 04:45:17 2012 From: agentzh at gmail.com (agentzh) Date: Sat, 21 Apr 2012 12:45:17 +0800 Subject: srcache + mogilefs module In-Reply-To: <2077f3d358a87c93dcf94d8db97d653c.NginxMailingListEnglish@forum.nginx.org> References: <2077f3d358a87c93dcf94d8db97d653c.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Sat, Apr 21, 2012 at 4:16 AM, haad wrote: > My problem is that it seems that even if I put files to memcache > manually and it srcache will find it (see log below), my file is still > served from mogilefs and not from memcached. > What does the data you put into memcached look like? The ngx_srcache module requires the value to be the *whole* response, that is, including the status line and all those response headers. Basically, you should rely on ngx_srcache's srcache_store to store the responses automatically for you, rather than inserting values into memcached yourself. > 2012/04/20 21:28:21 [debug] 7385#0: *501 memcached: "VALUE > /share/file.html 0 10" <---- WE got it Yes, ngx_srcache got the value from memcached here. > 2012/04/20 21:28:21 [error] 7385#0: *501 srcache_fetch: cache sent > invalid status line while sending to client, client: 192.168.200.64, > server: ws01x.test.reality.sk, request: "GET /share/file.html HTTP/1.0", > subrequest: "/memc", upstream: "memcached://192.168.206.3:11211", host: > "192.168.200.64" But here, ngx_srcache then found the value is invalid in that it does not have a valid HTTP status line at the beginning, so it immediately abandoned the cached value, and treated it as a cache miss. > > From this log I can see why is file can't serverd from memcached, server > status 200. Maybe I should make the debug log more verbose a bit here ;) > Are srcache and mogilefs module somehow incompatible ? > ngx_srcache is designed to be backend independent ;) If it's not, then there must be a bug somewhere ;) In your case here, it seems to be the bad format of the data that you manually inserted into memcached. Best regards, -agentzh From nginx-forum at nginx.us Sat Apr 21 06:11:27 2012 From: nginx-forum at nginx.us (xxx) Date: Sat, 21 Apr 2012 02:11:27 -0400 (EDT) Subject: Rewrite in Ngnix Message-ID: Hi, How convert to httacces from apache to nginx My file htaccess is: #Options FollowSymLinks RewriteEngine on RewriteRule ^vardata/(.*).php$ [R=404,L] RewriteRule ^([a-zA-Z0-9_-]+).html$ index.php?op=$1 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2&id=$3 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2&id=$3&qs=$4 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2&id=$3&qs=$4&ne=$5 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2&id=$3&qs=$4&ne=$5&nr=$6 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2&id=$3&qs=$4&ne=$5&nr=$6&ha=$7 RewriteRule ^([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+).html$ index.php?op=$1&do=$2&id=$3&qs=$4&ne=$5&nr=$6&ha=$7&hs=$8 [L] HELP Me! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225583,225583#msg-225583 From gpakosz at yahoo.fr Sat Apr 21 07:55:09 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Sat, 21 Apr 2012 09:55:09 +0200 Subject: error_page, try_files, internal redirect ends up in SIGSEGV In-Reply-To: <20120421032830.GA92227@lo0.su> References: <20120421032830.GA92227@lo0.su> Message-ID: On Sat, Apr 21, 2012 at 5:28 AM, Ruslan Ermilov wrote: > On Sat, Apr 21, 2012 at 02:47:23AM +0200, Gr?gory Pakosz wrote: >> I'm facing a SIGSEGV when trying to setup a custom error page using >> the following (shortened for the sake of debugging) configuration. > > It's been fixed already: > http://trac.nginx.org/nginx/changeset/4601/nginx > Hi there! Thank you for the answer. At least I managed to conduct my first nginx debug session :) Looking forward nginx 1.2.0 then. Regards, Gregory From nginx-forum at nginx.us Sat Apr 21 11:49:28 2012 From: nginx-forum at nginx.us (squimmy) Date: Sat, 21 Apr 2012 07:49:28 -0400 (EDT) Subject: Really bizarre problem with Sabredav In-Reply-To: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> References: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> Message-ID: <63e97d7a0e5dc0cbf0f3488738ebe6f3.NginxMailingListEnglish@forum.nginx.org> Hi, Yeh, I did think about using nginx modules, but that would require recompiling nginx unless i'm mistaken? I'm also hoping to integrate this with Owncloud, and that uses SabreDav, so getting that working is my preferred option. These are my Nginx conf files: Nginx.conf: http://pastebin.com/fNPkw4fq Virtual.conf: http://pastebin.com/N4PZXrBm Are there any other conf files that are involved? I'm very new to Nginx! Thank you for your help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225539,225589#msg-225589 From contact at jpluscplusm.com Sat Apr 21 13:01:12 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sat, 21 Apr 2012 14:01:12 +0100 Subject: Rewrite in Ngnix In-Reply-To: References: Message-ID: On 21 April 2012 07:11, xxx wrote: > Hi, > How convert to httacces from apache to nginx > HELP Me! Step 1: Read and understand the documentation at http://nginx.org/r/rewrite Step 2: Understand what your existing rewrite rules are doing Step 3: Rewrite your rewrite rules Let us know how you get on and also -- if you get stuck -- what you've tried, what's worked, and what hasn't worked. Cheers, Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From cliff at develix.com Sat Apr 21 20:22:29 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 21 Apr 2012 13:22:29 -0700 Subject: Really bizarre problem with Sabredav In-Reply-To: <63e97d7a0e5dc0cbf0f3488738ebe6f3.NginxMailingListEnglish@forum.nginx.org> References: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> <63e97d7a0e5dc0cbf0f3488738ebe6f3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1335039749.2543.12.camel@portable-evil> On Sat, 2012-04-21 at 07:49 -0400, squimmy wrote: > Hi, > > Yeh, I did think about using nginx modules, but that would require > recompiling nginx unless i'm mistaken? I'm also hoping to integrate this > with Owncloud, and that uses SabreDav, so getting that working is my > preferred option. > > These are my Nginx conf files: > Nginx.conf: http://pastebin.com/fNPkw4fq > > Virtual.conf: http://pastebin.com/N4PZXrBm Here's what I suspect is happening: You have location /dav, where I expect is where you want SabreDav to handle requests. After that you do: include /usr/local/nginx/conf/php.conf; include /include /usr/local/nginx/conf/staticfiles.conf; I suspect these contain regex locations that are matching your problematic extensions. The reason for this is that these regex locations will take precedence over your /dav location, so when you do a DAV request such as "PUT /dav/image.jpg", you are really doing the PUT to a regex location such as "~ \.(jpg|png|gif)$" in staticfiles.conf or "~ \.php$" in php.conf. The way Nginx processes requests is outlined here: http://nginx.org/en/docs/http/request_processing.html The end result of all of this is you will need to *not* include your php.conf and staticfiles.conf as top-level locations. Instead you will need to include them inside other non-regex locations. Alternatively, you could setup a subdomain such as dav.domain.com and do all your DAV requests via that (this is probably the most foolproof). Regards, Cliff From nginx-forum at nginx.us Sat Apr 21 20:51:04 2012 From: nginx-forum at nginx.us (nikita.tovstoles) Date: Sat, 21 Apr 2012 16:51:04 -0400 (EDT) Subject: HttpHealthcheckModule server not marked down In-Reply-To: References: Message-ID: I confirmed that this is an issue only when ip_hash is used - without it healthcheck fail causes upstream to stop routing requests to failing node. Could use a bit of help understanding: - is this by design (i.e ip_hash support never implemented) or a bug? I am happy to create an enhancement/fix but, as a c-newbie, would appreciate a bit of guidance on where specifically to look in nginx or https://github.com/liseen/healthcheck_nginx_upstreams/blob/master/ngx_http_healthcheck_module.c thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215656,225595#msg-225595 From nginx-forum at nginx.us Sat Apr 21 21:49:23 2012 From: nginx-forum at nginx.us (haad) Date: Sat, 21 Apr 2012 17:49:23 -0400 (EDT) Subject: srcache + mogilefs module In-Reply-To: References: Message-ID: agentzh Wrote: ------------------------------------------------------- > On Sat, Apr 21, 2012 at 4:16 AM, haad > wrote: > > My problem is that it seems that even if I put > files to memcache > > manually and it srcache will find it (see log > below), my file is still > > served from mogilefs and not from memcached. > > > > What does the data you put into memcached look > like? The ngx_srcache > module requires the value to be the *whole* > response, that is, > including the status line and all those response > headers. It was simple string, so yes this was the problem. > > Basically, you should rely on ngx_srcache's > srcache_store to store the > responses automatically for you, rather than > inserting values into > memcached yourself. But from attached log or this new [1] dump it seems tat srcache_store is never called. I was not aware of this, it should be added to documentation :). [1] https://gist.github.com/2439805 > > > 2012/04/20 21:28:21 [debug] 7385#0: *501 > memcached: "VALUE > > /share/file.html 0 10" <---- WE got it > > Yes, ngx_srcache got the value from memcached > here. > > > 2012/04/20 21:28:21 [error] 7385#0: *501 > srcache_fetch: cache sent > > invalid status line while sending to client, > client: 192.168.200.64, > > server: ws01x.test.reality.sk, request: "GET > /share/file.html HTTP/1.0", > > subrequest: "/memc", upstream: > "memcached://192.168.206.3:11211", host: > > "192.168.200.64" > > But here, ngx_srcache then found the value is > invalid in that it does > not have a valid HTTP status line at the > beginning, so it immediately > abandoned the cached value, and treated it as a > cache miss. > > > > > From this log I can see why is file can't > serverd from memcached, server > > status 200. > > Maybe I should make the debug log more verbose a > bit here ;) > > > Are srcache and mogilefs module somehow > incompatible ? > > > > ngx_srcache is designed to be backend independent > ;) If it's not, then > there must be a bug somewhere ;) > > In your case here, it seems to be the bad format > of the data that you > manually inserted into memcached. I will try to add proper entry and try again, right now I would like to know why srcache_store do not work as expected. Here is config location = /memc { internal; memc_connect_timeout 100ms; memc_send_timeout 100ms; memc_read_timeout 100ms; set $memc_key $query_string; set $memc_exptime 300; memc_pass memcached_servers; } location /share/ { set $key $uri; srcache_fetch GET /memc $key; srcache_store PUT /memc $key; srcache_store_statuses 200 301 302; srcache_response_cache_control off; [snip] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225568,225597#msg-225597 From cliff at develix.com Sat Apr 21 22:28:27 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 21 Apr 2012 15:28:27 -0700 Subject: Permission Denied Error In-Reply-To: References: <20120420130623.GH13466@mdounin.ru> Message-ID: <1335047307.2121.1.camel@portable-evil> On Sat, 2012-04-21 at 00:27 +0530, Sparsh Gupta wrote: > My concern was that when I have user www-data; mentioned in my config > file, why is nginx creating files for fastcgi_temp with user nginx and > group nginx Probably they were created before you changed the nginx config file settings. Cliff From francis at daoine.org Sat Apr 21 22:30:18 2012 From: francis at daoine.org (Francis Daly) Date: Sat, 21 Apr 2012 23:30:18 +0100 Subject: Really bizarre problem with Sabredav In-Reply-To: <1335039749.2543.12.camel@portable-evil> References: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> <63e97d7a0e5dc0cbf0f3488738ebe6f3.NginxMailingListEnglish@forum.nginx.org> <1335039749.2543.12.camel@portable-evil> Message-ID: <20120421223018.GE26729@craic.sysops.org> On Sat, Apr 21, 2012 at 01:22:29PM -0700, Cliff Wells wrote: > On Sat, 2012-04-21 at 07:49 -0400, squimmy wrote: Hi there, > Here's what I suspect is happening: > > You have location /dav, where I expect is where you want SabreDav to > handle requests. > The way Nginx processes requests is outlined here: > > http://nginx.org/en/docs/http/request_processing.html Possibly changing the line location /dav/ to location ^~ /dav/ will cause things to Just Work. But it does depend on what exactly SabreDAV does, and what else is in your included config files. If it does work fully, it might be worth sending that information to the SabreDAV people in case they want to include a "here is how to configure your web server to use our application" note in their documentation (assuming that that doesn't already exist). Good luck with it, f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Sat Apr 21 22:32:54 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 22 Apr 2012 02:32:54 +0400 Subject: Permission Denied Error In-Reply-To: References: <20120420130623.GH13466@mdounin.ru> Message-ID: <20120421223254.GL13466@mdounin.ru> Hello! On Sat, Apr 21, 2012 at 12:27:40AM +0530, Sparsh Gupta wrote: > My concern was that when I have user www-data; mentioned in my config file, > why is nginx creating files for fastcgi_temp with user nginx and group nginx > > I understand thats the default user:group while compiling was nginx:nginx > but shouldn't they be overridden by the option provided in nginx runtime > configuration file? They are overriden. But if you change user/group set in config you have to fix permissions on already created subdirs (or just remove them, nginx will re-create them with correct permissions). Maxim Dounin > > Sparsh Gupta > > > On 20 April 2012 18:36, Maxim Dounin wrote: > > > Hello! > > > > On Fri, Apr 20, 2012 at 05:27:40PM +0530, Sparsh Gupta wrote: > > > > > I am seeing some error like below in my nginx error log: > > > > > > 2012/04/20 11:51:52 [crit] 21437#0: *2548 open() > > > "/var/cache/nginx/fastcgi_temp/5/00/0000000005" failed (13: Permission > > > denied) while reading upstream, client: 139.112.144.210, server: > > example.com, > > > request: "GET /index.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000 > > ", > > > host: "example.com", referrer: "http://example.com/" > > > > > > I have: user www-data; in my nginx.conf and > > > the owners of the /var/cache/nginx/fastcgi_temp/5/00 are 'nginx:nginx' > > > > > > How can I fix this? > > > > With chown(1), see "man chown" for details. > > > > 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 adrian at navarro.at Sun Apr 22 02:03:26 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Sun, 22 Apr 2012 04:03:26 +0200 Subject: MP4 module and X-Accel-Redirect In-Reply-To: References: Message-ID: I have finally resorted to a mixed approach: - I generate symbolic links (ln -s) from the concealed 'internal' location to a folder in the public root, only for the files I need - That folder has a location {} directive, containing the mp4; parameter to enable streaming support - This location has an access_by_lua directive, which passes, using ngx.location.capture, a copy of the request to a local API (written in PHP) and validates the access - Also rate limiting That way I can mimic the usual approach where PHP does all these checks, in a much more complicated way? But still, it works. On Sat, Apr 21, 2012 at 2:18 AM, Adri?n Navarro wrote: > Hello > > I currently have a setup involving nginx-extras (1.1.19) and PHP, > making heavy use of the X-Accel-Redirect heades to serve files with > previous authentication. This also enables range requests and so on, > which work flawlessly. > > Sadly, I can't seem to make this approach work with the MP4 streaming > module. It works as expected with a standalone mp4 file and the > ?start= parameter works just fine. But passing a request like this: > > /request?token=xxx&start=60 > > Does not work and yields the entire file instead. > > My config approach is the following: > > ? ? ? ?location ~ \.php$ { > ? ? ? ? ? ? ? ?internal; > > ? ? ? ? ? ? ? ?fastcgi_send_timeout 300; > ? ? ? ? ? ? ? ?fastcgi_read_timeout 300; > > ? ? ? ? ? ? ? ?fastcgi_index index.php; > > ? ? ? ? ? ? ? ?include fastcgi_params; > > ? ? ? ? ? ? ? ?fastcgi_pass 127.0.0.1:9000; > ? ? ? ?} > > ? ? ? ?location ~ \.mp4$ { > ? ? ? ? ? ? ? ?mp4; > ? ? ? ?} > > ? ? ? ?location /files/ { > ? ? ? ? ? ? ? ?rewrite_by_lua ' > .....misc script to track connections..... > ? ? ? ? ? ? ? ? ? ? ? ?'; > ? ? ? ? ? ? ? ?internal; > ? ? ? ? ? ? ? ?mp4; > ? ? ? ? ? ? ? ?alias /home/service/files/; > ? ? ? ?} > > ? ? ? ?location /priority { > ? ? ? ? ? ? ? ?mp4; > ? ? ? ? ? ? ? ?rewrite ^ /request.php last; > ? ? ? ?} > > > I cannot try any more or different combinations for the mp4 directive, > I've tried to put it everywhere and just in a few places, and still, > can't manage to get anything. Some time Google shows some message > similar to this but dead in the wind without answer. > > Thank you for your time. -- Adri?n Navarro / (+34) 608 831 094 From reallfqq-nginx at yahoo.fr Sun Apr 22 02:11:14 2012 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 21 Apr 2012 22:11:14 -0400 Subject: Nginx rewrite to PHP Message-ID: Hi, I'm using Nginx linked to PHP using fastcgi proxy (to the FPM module of PHP core btw). I am trying to use some rewrite rules, which apparently work since I get redirected (HTTP answer 200), but the content is not passed through the PHP handler... I am returned the file for downloading which content is the raw PHP code! I am using a configuration like the following: location / { rewrite ^/dunno/([^\.^/]+)$ /index.php?q=$1 break; return 404; } location ~ \.php$ { // PHP handling there } What am I doing wrong? --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From edho at myconan.net Sun Apr 22 02:17:34 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 22 Apr 2012 09:17:34 +0700 Subject: Nginx rewrite to PHP In-Reply-To: References: Message-ID: 2012/4/22 B.R. : > Hi, > > I'm using Nginx linked to PHP using fastcgi proxy (to the FPM module of PHP > core btw). > > I am trying to use some rewrite rules, which apparently work since I get > redirected (HTTP answer 200), but the content is not passed through the PHP > handler... > I am returned the file for downloading which content is the raw PHP code! > > I am using a configuration like the following: > > location / { > ?rewrite ^/dunno/([^\.^/]+)$ /index.php?q=$1 break; > ?return 404; > } > break means the file is handled by current location block (location / { }). The one you want is last. reference: http://nginx.org/r/rewrite From reallfqq-nginx at yahoo.fr Sun Apr 22 02:23:00 2012 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 21 Apr 2012 22:23:00 -0400 Subject: Nginx rewrite to PHP In-Reply-To: References: Message-ID: Thanks Edho, I also use the official reference first-hand ;o) >From the example given on the Wiki page of the Rewrite module you quoted, they replace 'last' by 'break' when rewrite rules put inside a location block... Isn't it a problem to put 'last' flags inside the location block? What is the 10-cycles-then-500-error referring to? --- *B. R.* On Sat, Apr 21, 2012 at 22:17, Edho Arief wrote: > 2012/4/22 B.R. : > > Hi, > > > > I'm using Nginx linked to PHP using fastcgi proxy (to the FPM module of > PHP > > core btw). > > > > I am trying to use some rewrite rules, which apparently work since I get > > redirected (HTTP answer 200), but the content is not passed through the > PHP > > handler... > > I am returned the file for downloading which content is the raw PHP code! > > > > I am using a configuration like the following: > > > > location / { > > rewrite ^/dunno/([^\.^/]+)$ /index.php?q=$1 break; > > return 404; > > } > > > > break means the file is handled by current location block (location / > { }). The one > you want is last. > > reference: http://nginx.org/r/rewrite > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From edho at myconan.net Sun Apr 22 02:32:32 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 22 Apr 2012 09:32:32 +0700 Subject: Nginx rewrite to PHP In-Reply-To: References: Message-ID: 2012/4/22 B.R. : > Thanks Edho, > > I also use the official reference first-hand ;o) > From the example given on the Wiki page of the Rewrite module you quoted, > they replace 'last' by 'break' when rewrite rules put inside a location > block... > > Isn't it a problem to put 'last' flags inside the location block? What is > the 10-cycles-then-500-error referring to? The 500 error is cause by the rewrite: it rewrites /download/ (clean url) to /download/ (actual file). If it use last flag, the /download/ location block will be searched again (and in fact it may return 403 instead of 500 if the rewritten url doesn't match the rewrite rule anymore - it'll return 500 only on certain cases). The one you want is for it to be handled by different location block (\.php$) - hence last flag. From reallfqq-nginx at yahoo.fr Sun Apr 22 02:38:31 2012 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 21 Apr 2012 22:38:31 -0400 Subject: Nginx rewrite to PHP In-Reply-To: References: Message-ID: Well, I didn't take the required time to understand these examples... Those are definitely hopefully not to be seen in real config files! ;o) Thank you for having taken time to explain all that to me. I just made the change and my requests end up at the right places. Thanks again! --- *B. R.* On Sat, Apr 21, 2012 at 22:32, Edho Arief wrote: > 2012/4/22 B.R. : > > Thanks Edho, > > > > I also use the official reference first-hand ;o) > > From the example given on the Wiki page of the Rewrite module you quoted, > > they replace 'last' by 'break' when rewrite rules put inside a location > > block... > > > > Isn't it a problem to put 'last' flags inside the location block? What is > > the 10-cycles-then-500-error referring to? > > The 500 error is cause by the rewrite: it rewrites /download/ (clean > url) to /download/ (actual file). If it use last flag, the /download/ > location block will be searched again (and in fact it may return 403 > instead of 500 if the rewritten url doesn't match the rewrite rule > anymore - it'll return 500 only on certain cases). > > The one you want is for it to be handled by different location block > (\.php$) - hence last flag. > > _______________________________________________ > 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 Sun Apr 22 03:31:53 2012 From: agentzh at gmail.com (agentzh) Date: Sun, 22 Apr 2012 11:31:53 +0800 Subject: srcache + mogilefs module In-Reply-To: References: Message-ID: On Sun, Apr 22, 2012 at 5:49 AM, haad wrote: >> Basically, you should rely on ngx_srcache's >> srcache_store to store the >> responses automatically for you, rather than >> inserting values into >> memcached yourself. > > But from attached log or this new [1] dump it seems tat srcache_store is > never called. > I was not aware of this, it should be added to documentation :). > According to your debug log, the ngx_mogilefs module left your location /share/ and did an internal redirect to an automatically-generated location named /mogstored_spare_34991976/ or so (maybe created by the mogilefs_pass directive): [debug] 7200#0: *1058 internal redirect: "/mogstored_spare_34991976/?" And you didn't configure ngx_srcache at all in this anonymous location and hence no srcache_store love here. AFAIK, the ngx_eval module also does something similar here (i.e., creating nested locations automatically). > [1] https://gist.github.com/2439805 > Just search for "internal redirect" in your debug log above. Also, you should be careful when using the "if" directive in location blocks because it also created a nested anonymous location. See the discussion here: http://agentzh.blogspot.com/2011/03/how-nginx-location-if-works.html Best regards, -agentzh From nginx-forum at nginx.us Sun Apr 22 04:04:18 2012 From: nginx-forum at nginx.us (ronin) Date: Sun, 22 Apr 2012 00:04:18 -0400 (EDT) Subject: File status about Message-ID: <2c3c5394dd5b509a1a4a2328ebff1cc5.NginxMailingListEnglish@forum.nginx.org> Web site is the Python, going to some type of the file will be forwarded to the static files directory, the static directory should not return to 404, but there is a problem, the trouble you help me see Web site configuration files: location ~* \.(php|php*|git*|htm|html|txt)$ { root /web/www/static; } curl -I http://www.a.com/a.php curl -I http://www.a.com/i.html The result that come out: curl: (52) Empty reply from server why not 404? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225612,225612#msg-225612 From nginx-forum at nginx.us Sun Apr 22 06:14:43 2012 From: nginx-forum at nginx.us (haad) Date: Sun, 22 Apr 2012 02:14:43 -0400 (EDT) Subject: srcache + mogilefs module In-Reply-To: References: Message-ID: <1ec69cd580ce8aedec369f4f05934c4e.NginxMailingListEnglish@forum.nginx.org> agentzh Wrote: ------------------------------------------------------- > On Sun, Apr 22, 2012 at 5:49 AM, haad > wrote: > >> Basically, you should rely on ngx_srcache's > >> srcache_store to store the > >> responses automatically for you, rather than > >> inserting values into > >> memcached yourself. > > > > But from attached log or this new [1] dump it > seems tat srcache_store is > > never called. > > I was not aware of this, it should be added to > documentation :). > > > > According to your debug log, the ngx_mogilefs > module left your > location /share/ and did an internal redirect to > an > automatically-generated location named > /mogstored_spare_34991976/ or > so (maybe created by the mogilefs_pass directive): > > [debug] 7200#0: *1058 internal redirect: > "/mogstored_spare_34991976/?" > > And you didn't configure ngx_srcache at all in > this anonymous location > and hence no srcache_store love here. So if I configure location with /mogstored and sets srcache_store there it should be working ? location ~ /mogstored_ { srcache_store PUT /memc } > AFAIK, the ngx_eval module also does something > similar here (i.e., > creating nested locations automatically). I'm not sure what you mean by this :) are you suggesting that I should use it ? > > > [1] https://gist.github.com/2439805 > > > > Just search for "internal redirect" in your debug > log above. > > Also, you should be careful when using the "if" > directive in location > blocks because it also created a nested anonymous > location. See the > discussion here: > > http://agentzh.blogspot.com/2011/03/how-nginx-loca > tion-if-works.html > > Best regards, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225568,225614#msg-225614 From tektonic_s at yahoo.com Sun Apr 22 08:27:38 2012 From: tektonic_s at yahoo.com (Tektonic Tektonic) Date: Sun, 22 Apr 2012 16:27:38 +0800 (SGT) Subject: Rewrite Rules Message-ID: <1335083258.34924.YahooMailNeo@web193102.mail.sg3.yahoo.com> Hello, New to this list so pardon me if I am asking a very common question (I am sure it's a common one though). It is about Rewrite Rules. We have a Magento website which use to respond slowly while working with Apache, so we decided to switch to Nginx and can see the difference already. However, the problem is the Apache Rewrite Rules which are causing all the links to redirect to "404 Not Found". I have already tried more than a few solutions from Google but none worked. Attached is the Rewrite Rules section of my .htaccess. Please check and suggest me a solution. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rewrite rules.txt URL: From nginx-forum at nginx.us Sun Apr 22 08:51:32 2012 From: nginx-forum at nginx.us (xxx) Date: Sun, 22 Apr 2012 04:51:32 -0400 (EDT) Subject: Rewrite in Ngnix In-Reply-To: References: Message-ID: Please help me, i can not run my nginx because i haven't good rewrite rules Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225583,225616#msg-225616 From contact at jpluscplusm.com Sun Apr 22 09:39:34 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 22 Apr 2012 10:39:34 +0100 Subject: Rewrite in Ngnix In-Reply-To: References: Message-ID: No. You must try translating your Apache rewrite rules to start with. Show us what you try, and where you get stuck - then someone may be willing to help you understand what you've got wrong. No-one here should just do the whole thing for you if you're too lazy even to try for yourself. Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From zzz at zzz.org.ua Sun Apr 22 15:49:16 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Sun, 22 Apr 2012 18:49:16 +0300 Subject: websockets, nginx-perl Message-ID: Just a couple of examples on websockets in nginx-perl: https://github.com/zzzcpan/nginx-perl/tree/master/eg/websockets/lib/Websockets Draw.pm - multiplayer drawing thingy Echo.pm - echo server Demo (works only in chrome and firefox 11): zzz.org.ua:55555/echo/ zzz.org.ua:55555/draw/ From lists at ruby-forum.com Sun Apr 22 16:48:06 2012 From: lists at ruby-forum.com (Jakub) Date: Sun, 22 Apr 2012 18:48:06 +0200 Subject: NGINX and wrong memcached output Message-ID: <89b67bf90e128310fea0429f089719aa@ruby-forum.com> Hi, At first let me tell my application was developped under PHP with Symfony2, but I guess my problem is about nginx and memcached and not about PHP. As I can see here is good community about nginx and I will be glad for any help. I have problem with nginx and memcached responses such as text/html or application/json. My idea is: -First request on nginx server (reverse proxy memcached server) -Try if I have memcached response (memcached run on same server as nginx) -If not go to application server -Application server makes response -Stores response in to memcached -And for next same request nginx hit response from memcached and return to client. But the problem is, when the application server stores response to memcached (data in memcached are stored good and corectly) and NGINX hit the request in memcached, but return totaly wrong hashed content. For example: First request, ngingx didnt find response in memcached, pass to application server, and here is response ... good and correct JSON. ------- Headers HTTP/1.0 200 OK Date: Sun, 22 Apr 2012 16:13:58 GMT Server: Apache/2.2.16 (Debian) X-Powered-By: PHP/5.3.3-7+squeeze8 cache-control: no-cache x-debug-token: 4f942e4dee10b Content-Length: 476 Connection: close Content-Type: application/json -------- Content [{"id":10,"title":"Cinema","url":"cinema","articles":null},{"id":2,"title":"Computers","url":"computer","articles":null},{"id":8,"title":"Foto","url":"foto","articles":null},{"id":12,"title":"Literature","url":"literature","articles":null},{"id":4,"title":"Music","url":"music","articles":null},{"id":18,"title":"Society","url":"society","articles":null},{"id":16,"title":"Sport","url":"sport","articles":null},{"id":6,"title":"Travelling","url":"travelling","articles":null}] But for the second request, when NGINX find response in memcached, NGINX serves totaly wrong. -------- Headers Connection:keep-alive Content-Length:164 Content-Type:application/json Date:Sun, 22 Apr 2012 16:17:15 GMT Server:nginx/0.7.67 -------- Content x?u?1?0??rs+"?Up?I???)??$A??n?59?????5o ?zU??0??=u?Z? ??E?c?%?O5??????`??N???}??3??a?????y+)`?????M8?H.?vJ???g???e?y?n??}?"?4???Df??????_? ? With text/html I have exactly the same problem. Do you have anybody any idea plese? Here is my nginx configuration: # nginx virtual host from sites-available server { listen 80; server_name dp-xskrha.local; access_log /var/log/nginx/dp-xskrha/access.log; error_log /var/log/nginx/dp-xskrha/error.log; # Static content, images, css, js location ~* ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ { proxy_redirect off; proxy_pass http://app.dp-xskrha.local:80; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_cache dp-xskrha-static; roxy_cache_valid 200 10m; } # Model api json location /model-api { default_type application/json; set $memcached_key $uri; memcached_pass 127.0.0.1:11211; error_page 404 =200 @fallback; } # Dynamic content, all rest uri location / { default_type text/html; charset utf-8; set $memcached_key $uri; memcached_pass 127.0.0.1:11211; error_page 404 =200 @fallback; } # Memcached fallback for proxy pass location @fallback { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; proxy_pass http://app.dp-xskrha.local:80; } } #nginx.conf user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; # proxy settings proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=dp-xskrha-static:10m inactive=24h max_size=1g; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } Thank you very much, for Your response :) Jacob -- Posted via http://www.ruby-forum.com/. From serga at seznam.cz Sun Apr 22 17:02:33 2012 From: serga at seznam.cz (=?windows-1252?Q?Jakub_=8Akrha?=) Date: Sun, 22 Apr 2012 19:02:33 +0200 Subject: Nginx and memcached response Message-ID: <4F9439A9.3090306@seznam.cz> An HTML attachment was scrubbed... URL: From bpaquet at octo.com Sun Apr 22 17:17:29 2012 From: bpaquet at octo.com (Bertrand Paquet) Date: Sun, 22 Apr 2012 19:17:29 +0200 Subject: Nginx and memcached response In-Reply-To: <4F9439A9.3090306@seznam.cz> References: <4F9439A9.3090306@seznam.cz> Message-ID: Hi, Does your application server fill memcached correctly ? May be a binary / encoding problem when connecting to memcached. Or the content is stored gzipped ? Regards Bertrand On Sun, Apr 22, 2012 at 19:02, Jakub ?krha wrote: > ** > Hi, > > I have problem with nginx and memcached responses such as text/html or > application/json and I will be glad for any help. Thanks. > > My idea is: > -First request on nginx server (reverse proxy memcached server) > -Try if I have memcached response (memcached run on same server as > nginx) > -If not pass request to application server > -Application server makes response > -Stores response in to memcached > -And for next same request nginx hit response from memcached and return > to client. > > But the problem is, when the application server stores response to > memcached (data in memcached are stored good and corectly) and NGINX hit > the request in memcached, but return totaly wrong hashed content. > > For example: > First request, ngingx didnt find response in memcached, pass to > application server, and here is response ... good and correct JSON. > ------- Headers > HTTP/1.0 200 OK > Date: Sun, 22 Apr 2012 16:13:58 GMT > Server: Apache/2.2.16 (Debian) > X-Powered-By: PHP/5.3.3-7+squeeze8 > cache-control: no-cache > x-debug-token: 4f942e4dee10b > Content-Length: 476 > Connection: close > Content-Type: application/json > -------- Content > > [{"id":10,"title":"Cinema","url":"cinema","articles":null},{"id":2,"title":"Computers","url":"computer","articles":null},{"id":8,"title":"Foto","url":"foto","articles":null},{"id":12,"title":"Literature","url":"literature","articles":null},{"id":4,"title":"Music","url":"music","articles":null},{"id":18,"title":"Society","url":"society","articles":null},{"id":16,"title":"Sport","url":"sport","articles":null},{"id":6,"title":"Travelling","url":"travelling","articles":null}] > > But for the second request, when NGINX find response in memcached, NGINX > serves response totaly wrong. > -------- Headers > Connection:keep-alive > Content-Length:164 > Content-Type:application/json > Date:Sun, 22 Apr 2012 16:17:15 GMT > Server:nginx/0.7.67 > -------- Content > x?u?1?0??rs+"?Up?I???)??$A??n?59?????5o ?zU 0? =u?Z? > ??E?c?%?O5??????`??N???}??3??a?????y+)`?????M8?H.?vJ???g???e?y?n??} > "?4???Df??????_? > ? > > With text/html I have exactly the same problem. Do you have anybody any > idea plese? Here is my nginx configuration: > > # nginx virtual host from sites-available linked to sites-enabled > server { > listen 80; > server_name dp-xskrha.local; > access_log /var/log/nginx/dp-xskrha/access.log; > error_log /var/log/nginx/dp-xskrha/error.log; > > # Static content, images, css, js > location ~* > ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ > > { > proxy_redirect off; > proxy_pass http://app.dp-xskrha.local:80; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > proxy_cache dp-xskrha-static; > roxy_cache_valid 200 10m; > } > > # Model api json > location /model-api { > default_type application/json; > set $memcached_key $uri; > memcached_pass 127.0.0.1:11211; > error_page 404 =200 @fallback; > } > > # Dynamic content, all rest uri > location / { > default_type text/html; > charset utf-8; > set $memcached_key $uri; > memcached_pass 127.0.0.1:11211; > error_page 404 =200 @fallback; > } > > # Memcached fallback for proxy pass > location @fallback { > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > proxy_redirect off; > proxy_pass http://app.dp-xskrha.local:80; > } > } > > > #nginx.conf > user www-data; > worker_processes 1; > > error_log /var/log/nginx/error.log; > pid /var/run/nginx.pid; > > events { > worker_connections 1024; > multi_accept on; > } > > http { > include /etc/nginx/mime.types; > > access_log /var/log/nginx/access.log; > > sendfile on; > tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 65; > tcp_nodelay on; > > gzip on; > gzip_disable "MSIE [1-6]\.(?!.*SV1)"; > > # proxy settings > proxy_cache_path /data/nginx/cache levels=1:2 > keys_zone=dp-xskrha-static:10m > inactive=24h max_size=1g; > > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; > } > > Thank you very much, for Your response :) > > Jacob > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serga at seznam.cz Sun Apr 22 17:39:41 2012 From: serga at seznam.cz (=?windows-1252?Q?Jakub_=8Akrha?=) Date: Sun, 22 Apr 2012 19:39:41 +0200 Subject: Nginx and memcached response In-Reply-To: References: Message-ID: <4F94425D.5050607@seznam.cz> On 22.4.2012 19:17, nginx-request at nginx.org wrote: > ------------------------------ > > Message: 2 > Date: Sun, 22 Apr 2012 18:48:06 +0200 > From: Jakub > To: nginx at nginx.org > Subject: NGINX and wrong memcached output > Message-ID:<89b67bf90e128310fea0429f089719aa at ruby-forum.com> > Content-Type: text/plain; charset=UTF-8 > > Hi, > > At first let me tell my application was developped under PHP with > Symfony2, but I guess my problem is about nginx and memcached and not > about PHP. As I can see here is good community about nginx and I will be > glad for any help. > > I have problem with nginx and memcached responses such as text/html or > application/json. My idea is: > -First request on nginx server (reverse proxy memcached server) > -Try if I have memcached response (memcached run on same server as > nginx) > -If not go to application server > -Application server makes response > -Stores response in to memcached > -And for next same request nginx hit response from memcached and return > to client. > > But the problem is, when the application server stores response to > memcached (data in memcached are stored good and corectly) and NGINX hit > the request in memcached, but return totaly wrong hashed content. > > For example: > First request, ngingx didnt find response in memcached, pass to > application server, and here is response ... good and correct JSON. > ------- Headers > HTTP/1.0 200 OK > Date: Sun, 22 Apr 2012 16:13:58 GMT > Server: Apache/2.2.16 (Debian) > X-Powered-By: PHP/5.3.3-7+squeeze8 > cache-control: no-cache > x-debug-token: 4f942e4dee10b > Content-Length: 476 > Connection: close > Content-Type: application/json > -------- Content > [{"id":10,"title":"Cinema","url":"cinema","articles":null},{"id":2,"title":"Computers","url":"computer","articles":null},{"id":8,"title":"Foto","url":"foto","articles":null},{"id":12,"title":"Literature","url":"literature","articles":null},{"id":4,"title":"Music","url":"music","articles":null},{"id":18,"title":"Society","url":"society","articles":null},{"id":16,"title":"Sport","url":"sport","articles":null},{"id":6,"title":"Travelling","url":"travelling","articles":null}] > > But for the second request, when NGINX find response in memcached, NGINX > serves totaly wrong. > -------- Headers > Connection:keep-alive > Content-Length:164 > Content-Type:application/json > Date:Sun, 22 Apr 2012 16:17:15 GMT > Server:nginx/0.7.67 > -------- Content > x?u?1?0??rs+"?Up?I???)??$A??n?59?????5o ?zU??0??=u?Z? > ??E?c?%?O5??????`??N???}??3??a?????y+)`?????M8?H.?vJ???g???e?y?n??}?"?4???Df??????_? > ? > > With text/html I have exactly the same problem. Do you have anybody any > idea plese? Here is my nginx configuration: > > # nginx virtual host from sites-available > server { > listen 80; > server_name dp-xskrha.local; > access_log /var/log/nginx/dp-xskrha/access.log; > error_log /var/log/nginx/dp-xskrha/error.log; > > # Static content, images, css, js > location ~* > ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ > { > proxy_redirect off; > proxy_pass http://app.dp-xskrha.local:80; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > proxy_cache dp-xskrha-static; > roxy_cache_valid 200 10m; > } > > # Model api json > location /model-api { > default_type application/json; > set $memcached_key $uri; > memcached_pass 127.0.0.1:11211; > error_page 404 =200 @fallback; > } > > # Dynamic content, all rest uri > location / { > default_type text/html; > charset utf-8; > set $memcached_key $uri; > memcached_pass 127.0.0.1:11211; > error_page 404 =200 @fallback; > } > > # Memcached fallback for proxy pass > location @fallback { > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > proxy_redirect off; > proxy_pass http://app.dp-xskrha.local:80; > } > } > > > #nginx.conf > user www-data; > worker_processes 1; > > error_log /var/log/nginx/error.log; > pid /var/run/nginx.pid; > > events { > worker_connections 1024; > multi_accept on; > } > > http { > include /etc/nginx/mime.types; > > access_log /var/log/nginx/access.log; > > sendfile on; > tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 65; > tcp_nodelay on; > > gzip on; > gzip_disable "MSIE [1-6]\.(?!.*SV1)"; > > # proxy settings > proxy_cache_path /data/nginx/cache levels=1:2 > keys_zone=dp-xskrha-static:10m > inactive=24h max_size=1g; > > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; > } > > Thank you very much, for Your response :) > > Jacob > Date: Sun, 22 Apr 2012 19:17:29 +0200 From: Bertrand Paquet To:nginx at nginx.org Subject: Re: Nginx and memcached response Message-ID: Content-Type: text/plain; charset="utf-8" Hi, Does your application server fill memcached correctly ? May be a binary / encoding problem when connecting to memcached. Or the content is stored gzipped ? Regards Bertrand Hi, yes the server fill memcached correctly. For example, if I store on simple JSON value, it stores correctly. Or when I store plain text, there is not any problem. Just if store to memcached some content with headers. Maybe there is problem with headers. I will try some other memcached client than the the application server is using. But I am not sure if the problem is in store process. I think there is a problem with nginx read proces. Thank you very much Jacob From mdounin at mdounin.ru Sun Apr 22 20:49:48 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 23 Apr 2012 00:49:48 +0400 Subject: NGINX and wrong memcached output In-Reply-To: <89b67bf90e128310fea0429f089719aa@ruby-forum.com> References: <89b67bf90e128310fea0429f089719aa@ruby-forum.com> Message-ID: <20120422204948.GO13466@mdounin.ru> Hello! On Sun, Apr 22, 2012 at 06:48:06PM +0200, Jakub wrote: > Hi, > > At first let me tell my application was developped under PHP with > Symfony2, but I guess my problem is about nginx and memcached and not > about PHP. As I can see here is good community about nginx and I will be > glad for any help. > > I have problem with nginx and memcached responses such as text/html or > application/json. My idea is: > -First request on nginx server (reverse proxy memcached server) > -Try if I have memcached response (memcached run on same server as > nginx) > -If not go to application server > -Application server makes response > -Stores response in to memcached > -And for next same request nginx hit response from memcached and return > to client. > > But the problem is, when the application server stores response to > memcached (data in memcached are stored good and corectly) and NGINX hit > the request in memcached, but return totaly wrong hashed content. > > For example: > First request, ngingx didnt find response in memcached, pass to > application server, and here is response ... good and correct JSON. > ------- Headers > HTTP/1.0 200 OK > Date: Sun, 22 Apr 2012 16:13:58 GMT > Server: Apache/2.2.16 (Debian) > X-Powered-By: PHP/5.3.3-7+squeeze8 > cache-control: no-cache > x-debug-token: 4f942e4dee10b > Content-Length: 476 > Connection: close > Content-Type: application/json > -------- Content > [{"id":10,"title":"Cinema","url":"cinema","articles":null},{"id":2,"title":"Computers","url":"computer","articles":null},{"id":8,"title":"Foto","url":"foto","articles":null},{"id":12,"title":"Literature","url":"literature","articles":null},{"id":4,"title":"Music","url":"music","articles":null},{"id":18,"title":"Society","url":"society","articles":null},{"id":16,"title":"Sport","url":"sport","articles":null},{"id":6,"title":"Travelling","url":"travelling","articles":null}] > > But for the second request, when NGINX find response in memcached, NGINX > serves totaly wrong. > -------- Headers > Connection:keep-alive > Content-Length:164 > Content-Type:application/json > Date:Sun, 22 Apr 2012 16:17:15 GMT > Server:nginx/0.7.67 > -------- Content > x?u?1?0??rs+"?Up?I???)??$A??n?59?????5o ?zU??0??=u?Z? > ??E?c?%?O5??????`??N???}??3??a?????y+)`?????M8?H.?vJ???g???e?y?n??}?"?4???Df??????_? > ? > > With text/html I have exactly the same problem. Do you have anybody any > idea plese? Here is my nginx configuration: Content stored in memcached is compressed, and nginx just returns what you have in memcached. You have to read docs on your memcached client to instruct it to don't do any compression/serialization and store raw data instead. Maxim Dounin From tdgh2323 at hotmail.com Sun Apr 22 20:59:51 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 22 Apr 2012 20:59:51 +0000 Subject: Way to list current requestsw being served? Message-ID: Hello. Aside from the status page of nginx... is there any way i cant print the current REQUESTS it is attending .. like apaches status module it lists the URIs being served. Thanks --Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Sun Apr 22 21:09:07 2012 From: tdgh2323 at hotmail.com (Sam Ashmann) Date: Sun, 22 Apr 2012 21:09:07 +0000 Subject: How to block non local refferers to an object? Message-ID: Hello Community, Could anybody please give me an example (or point me to such) on best way to block non local referrers to my image files (jpg, jpeg, gif) Thanks.. Regards, Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Sun Apr 22 21:22:22 2012 From: tdgh2323 at hotmail.com (Sam Ashmann) Date: Sun, 22 Apr 2012 21:22:22 +0000 Subject: stub_status and other data to be displayed. Message-ID: Hello all, I made a debug html that displays some debugging information (additional nginx variables)... but Id also prefer to print along with the output produced by stub_status . Is there anyway to do this? Something like this doesnt appear to work: location /static-test { default_type text/html; stub_status on; return 200 "test" } it either prints my test, or if I comment it .. it prints the status of nginx. Regards, Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Sun Apr 22 21:26:12 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sun, 22 Apr 2012 23:26:12 +0200 Subject: How to block non local refferers to an object? In-Reply-To: References: Message-ID: <87ehrfxxu3.wl%appa@perusio.net> On 22 Abr 2012 23h09 CEST, tdgh2323 at hotmail.com wrote: > > Hello Community, > > Could anybody please give me an example (or point me to such) on > best way to block non local referrers to my image files (jpg, jpeg, > gif) > > Thanks.. location ~* \.(?:gif|jpe?g|png)$ { valid_referers none blocked *.example.* *.google.* my.site.com; if ($invalid_referer) { return 200 "No image hotlinking allowed!\n"; } } Cf. http://nginx.org/en/docs/http/ngx_http_referer_module.html --- appa From tdgh2323 at hotmail.com Sun Apr 22 21:49:12 2012 From: tdgh2323 at hotmail.com (Joseph Cabezas) Date: Sun, 22 Apr 2012 21:49:12 +0000 Subject: How to log only if $upstream_cache_status is not equal to "HIT" Message-ID: Hello, Iam trying to find out if there is a way I can have an access logs only for the objects that did not produce a HIT from the cache (recorded in the nginx $upstream_cache_status var) Is this possible? Thanks and regards, Joseph -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Apr 22 22:02:11 2012 From: lists at ruby-forum.com (Jakub) Date: Mon, 23 Apr 2012 00:02:11 +0200 Subject: NGINX and wrong memcached output In-Reply-To: <89b67bf90e128310fea0429f089719aa@ruby-forum.com> References: <89b67bf90e128310fea0429f089719aa@ruby-forum.com> Message-ID: Hi Maxim, yes, you are right. That was the problem. I have just solved it and my app works correctly now. Thank you very much, for you response. And NGINX is strong tool :) Regards, Jacob -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Mon Apr 23 02:25:16 2012 From: nginx-forum at nginx.us (JCR) Date: Sun, 22 Apr 2012 22:25:16 -0400 (EDT) Subject: upload module fails in some cases Message-ID: <0b5caab894de6a90d1d03139c7133095.NginxMailingListEnglish@forum.nginx.org> Hello, I and using nginx 1.0.15 with the third-party module nginx_upload_module-2.2.0/ When I am using an html form all works perfectly and I can see the uploaded files and the post values as expected. But, when I send the HTTP Post request from a Poco application, it does not work. (pocoproject.org) I am pasting below the code of that C++ Poco app. I don't think that you need to be an expert at Poco to understand it. 114 std::ostringstream content; 115 content << "------WebKitFormBoundaryq2BIJhJChD7qIY1W\r\n"; 116 content << "Content-Disposition: form-data; name=\"submit\"\r\n\r\n" 117 "Upload\r\n" 118 "------WebKitFormBoundaryq2BIJhJChD7qIY1W\r\n"; 119 content << "Content-Disposition: form-data; name=\"file\"; filename=\"test.txt\"\r\n\r\n" 120 "Content-Type: text/plain\r\n" 121 "This is a test.\r\n" 122 "------WebKitFormBoundaryq2BIJhJChD7qIY1W--"; 123 124 std::ostringstream os; 125 os << "POST /upload HTTP/1.0\r\n" 126 "Host: ip:31000\r\n" 127 "User-Agent: AAA\r\n" 128 "Accept: text/plain,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" 129 "Accept-Language: en-us,ko;q=0.9,ja;q=0.7,cs;q=0.6,th;q=0.4,zh;q=0.3,en;q=0.1\r\n" 130 "Accept-Encoding: gzip,deflate\r\n" 131 "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" 132 "Referer: ip\r\n" 133 "Content-Type: multipart/form-data; boundary=------WebKitFormBoundaryq2BIJhJChD7qIY1W\r\n"; 134 135 os << "Content-Length: " << strlen(content.str().c_str()) << "\r\n\r\n"; 136 os << content.str(); 137 138 Poco::Net::SocketAddress sa("ip", 31000); 139 Poco::Net::StreamSocket socket(sa); 140 Poco::Net::SocketStream str(socket); 141 str << os.str(); 142 str.flush(); 143 Poco::StreamCopier::copyStream(str, std::cout); 144 return; I am getting this from the server HTTP/1.1 200 OK Server: nginx/1.0.15 Date: Mon, 23 Apr 2012 02:00:45 GMT Content-Type: text/html Connection: close X-Powered-By: PHP/5.1.6 Content-Length: 98
POST
Array ( [] => )
FILES
Array ( )



Drilling into nginx_upload_module-2.2.0/ngx_http_upload_module.c It seems that the problem is inside the function static ngx_int_t upload_process_buf(ngx_http_upload_ctx_t *upload_ctx, u_char *start, u_char *end) and more precisely, it appears that from the html from the scope below is entered while from the poco app it is never entered 3509 if(upload_ctx->boundary_pos == upload_ctx->boundary.data + upload_ctx->boundary.len) 3510 { 3512 upload_ctx->state = upload_state_after_boundary; 3513 upload_ctx->boundary_start = upload_ctx->boundary.data; 3514 upload_ctx->boundary_pos = upload_ctx->boundary_start; 3515 } maybe my header is wrong... I am running out of ideas to make this work I am pasting below the config file: 1 #user nobody; 2 worker_processes 1; 3 #error_log logs/error.log; 4 error_log logs/debug.log debug; 5 #error_log logs/error.log info; 6 #pid logs/nginx.pid; 7 events { 8 worker_connections 1024; 9 } 10 http { 11 12 proxy_buffering on; 13 proxy_buffer_size 8k; 14 proxy_buffers 2048 8k; 15 16 include mime.types; 17 default_type application/octet-stream; 18 log_format main '$request_body $remote_addr - $remote_user [$time_local] "$request" ' 19 '$status $body_bytes_sent "$http_referer" ' 20 '"$http_user_agent" "$http_x_forwarded_for"'; 21 access_log logs/access.log main; 22 sendfile on; 23 server_names_hash_max_size 1024; 24 server_names_hash_bucket_size 128; 25 client_body_temp_path /usr/local/nginx/uploads; 26 keepalive_timeout 65; 27 28 chunkin on; 29 30 server { 31 client_max_body_size 100m; 32 listen ip:31000; 33 34 #location /upload.php { 35 #location ~ \.php$ { 36 37 error_page 411 = @my_error; 38 location @my_error { 39 chunkin_resume; 40 } 41 location /upload{ 42 43 chunkin_resume; 44 45 # Pass altered request body to this location 46 upload_pass @uploadfiles; 47 upload_store /usr/local/nginx/uploads; 48 #upload_store_access user:r; 49 # Set specified fields in request body 50 upload_set_form_field $upload_field_name.name "$upload_file_name"; 51 upload_set_form_field $upload_field_name.content_type "$upload_content_type"; 52 upload_set_form_field $upload_field_name.path "$upload_tmp_path"; 53 # Inform backend about hash and size of a file 54 #upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5"; 55 upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size"; 56 upload_pass_form_field "^username$|^password$"; 57 #upload_pass_form_field ".*"; 58 upload_cleanup 400 404 499 500-505; 59 upload_pass_args on; 60 upload_max_part_header_len 100m; 61 upload_max_output_body_len 0; 62 } 63 location ~ \.php$ { 64 proxy_pass http://127.0.0.1:80; 65 } 66 location = /favicon.ico { 67 access_log off; 68 log_not_found off; 69 } 70 location /hello{ 71 hello; 72 } 73 location @uploadfiles{ 74 rewrite ^ /upload.php last; 75 #proxy_pass http://127.0.0.1:80; 76 } 77 location = /boom{ 78 } 79 #location / { 80 # root html; 81 # index index.html index.htm; 82 #} 83 error_page 500 502 503 504 /50x.html; 84 #location = /50x.html { 85 # root html; 86 #} 87 } 88 } Note that if I disable the module '--add-module=/root/nginx/agentzh-chunkin-nginx-module-ddc0dd5", the issue remains Thanks in advance for any idea Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225636,225636#msg-225636 From agentzh at gmail.com Mon Apr 23 03:41:17 2012 From: agentzh at gmail.com (agentzh) Date: Mon, 23 Apr 2012 11:41:17 +0800 Subject: srcache + mogilefs module In-Reply-To: <1ec69cd580ce8aedec369f4f05934c4e.NginxMailingListEnglish@forum.nginx.org> References: <1ec69cd580ce8aedec369f4f05934c4e.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Sun, Apr 22, 2012 at 2:14 PM, haad wrote: > > So if I configure location with /mogstored and sets srcache_store there > it should be working ? > > location ~ /mogstored_ { > ? srcache_store PUT /memc > } > No, the /mogstored_spare_34991976/ location is automatically generated by ngx_mogilefs. I'm not sure if it helps by putting your srcache_store configuration into the "anonymous" location block under the mogilefs_pass directive, i.e., mogilefs_pass { proxy_pass $mogilefs_path; proxy_hide_header Content-Type; proxy_buffering off; srcache_store PUT /memc; } But you can try it out anyway. >> AFAIK, the ngx_eval module also does something >> similar here (i.e., >> creating nested locations automatically). > > I'm not sure what you mean by this :) are you suggesting that > I should use it ? > No. I was just talking about the similarity in their implementations. Regards, -agentzh From sammyraul1 at gmail.com Mon Apr 23 04:26:37 2012 From: sammyraul1 at gmail.com (sammy_raul) Date: Sun, 22 Apr 2012 21:26:37 -0700 (PDT) Subject: Registering Nginx callback in external library In-Reply-To: References: Message-ID: <1335155197546-7490644.post@n2.nabble.com> Hi, Thanks for your pointers, but one thing I still not understood from the links you have provided is that how I can register a callback in my handler which will be called by the external library. In the links you have provided the read write event handler is called when any read write happens on the DB. But my case it's the external program who will call the Nginx callback. So I am not sure how I can pass a callback from Nginx to external library API. Please tell me what I can do in this scenario. Thanks, Raul. -- View this message in context: http://nginx.2469901.n2.nabble.com/Registering-Nginx-callback-in-external-library-tp7479794p7490644.html Sent from the nginx mailing list archive at Nabble.com. From mdounin at mdounin.ru Mon Apr 23 06:47:22 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 23 Apr 2012 10:47:22 +0400 Subject: upload module fails in some cases In-Reply-To: <0b5caab894de6a90d1d03139c7133095.NginxMailingListEnglish@forum.nginx.org> References: <0b5caab894de6a90d1d03139c7133095.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120423064722.GP13466@mdounin.ru> Hello! On Sun, Apr 22, 2012 at 10:25:16PM -0400, JCR wrote: > Hello, > > I and using nginx 1.0.15 with the third-party module > nginx_upload_module-2.2.0/ > > When I am using an html form all works perfectly and I can see the > uploaded files and the post values as expected. > > But, when I send the HTTP Post request from a Poco application, it does > not work. (pocoproject.org) > > I am pasting below the code of that C++ Poco app. I don't think that you > need to be an expert at Poco to understand it. > > > 114 std::ostringstream content; > 115 content << "------WebKitFormBoundaryq2BIJhJChD7qIY1W\r\n"; > 116 content << "Content-Disposition: form-data; > name=\"submit\"\r\n\r\n" > 117 "Upload\r\n" > 118 "------WebKitFormBoundaryq2BIJhJChD7qIY1W\r\n"; > 119 content << "Content-Disposition: form-data; name=\"file\"; > filename=\"test.txt\"\r\n\r\n" > 120 "Content-Type: text/plain\r\n" > 121 "This is a test.\r\n" > 122 "------WebKitFormBoundaryq2BIJhJChD7qIY1W--"; 4 dashes in the boundary here (following the '"--" boundary' syntax as per RFC 2046). > 123 > 124 std::ostringstream os; > 125 os << "POST /upload HTTP/1.0\r\n" > 126 "Host: ip:31000\r\n" > 127 "User-Agent: AAA\r\n" > 128 "Accept: > text/plain,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" > 129 "Accept-Language: > en-us,ko;q=0.9,ja;q=0.7,cs;q=0.6,th;q=0.4,zh;q=0.3,en;q=0.1\r\n" > 130 "Accept-Encoding: gzip,deflate\r\n" > 131 "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" > 132 "Referer: ip\r\n" > 133 "Content-Type: multipart/form-data; > boundary=------WebKitFormBoundaryq2BIJhJChD7qIY1W\r\n"; And 6 dashes here. This is unlikely to work. Maxim Dounin From nginx-forum at nginx.us Mon Apr 23 07:04:43 2012 From: nginx-forum at nginx.us (George) Date: Mon, 23 Apr 2012 03:04:43 -0400 (EDT) Subject: ngx_http_upstream_keepalive error ? Message-ID: <19824ba021aa753bb4551c1972773e82.NginxMailingListEnglish@forum.nginx.org> Hi first time trying to compile Nginx with ngx_http_upstream_keepalive module support and seems I am getting an error at make stage while compiling with Nginx v1.1.19 ? configure line: ./configure --sbin-path=/usr/local/sbin --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module --with-http_addition_module --with-http_secure_link_module --with-http_flv_module --with-http_realip_module --add-module=../ngx-fancyindex-ngx-fancyindex --add-module=../ngx_cache_purge-1.4 --add-module=../nginx-accesskey-2.0.3 --add-module=../agentzh-memc-nginx-module-4007350 --add-module=../agentzh-srcache-nginx-module-fa2da58 --add-module=../ngx_http_upstream_keepalive-d9ac9ad67f45 --with-openssl=../openssl-1.0.0e --with-openssl-opt="enable-tlsext" the error at make stage objs/addon/ngx-fancyindex-ngx-fancyindex/ngx_http_fancyindex_module.o \ objs/addon/ngx_cache_purge-1.4/ngx_cache_purge_module.o \ objs/addon/nginx-accesskey-2.0.3/ngx_http_accesskey_module.o \ objs/addon/src/ngx_http_memc_module.o \ objs/addon/src/ngx_http_memc_request.o \ objs/addon/src/ngx_http_memc_response.o \ objs/addon/src/ngx_http_memc_util.o \ objs/addon/src/ngx_http_memc_handler.o \ objs/addon/src/ngx_http_srcache_filter_module.o \ objs/addon/src/ngx_http_srcache_util.o \ objs/addon/src/ngx_http_srcache_var.o \ objs/addon/src/ngx_http_srcache_store.o \ objs/addon/src/ngx_http_srcache_fetch.o \ objs/addon/src/ngx_http_srcache_headers.o \ objs/addon/ngx_http_upstream_keepalive-d9ac9ad67f45/ngx_http_upstream_keepalive_module.o \ objs/ngx_modules.o \ -lpthread -lcrypt -lpcre ../openssl-1.0.0e/.openssl/lib/libssl.a ../openssl-1.0.0e/.openssl/lib/libcrypto.a -ldl -lz objs/addon/ngx_http_upstream_keepalive-d9ac9ad67f45/ngx_http_upstream_keepalive_module.o:(.data+0x0): multiple definition of `ngx_http_upstream_keepalive_module' objs/src/http/modules/ngx_http_upstream_keepalive_module.o:(.data+0x0): first defined here collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/setup/nginx-1.1.19' make: *** [build] Error 2 any ideas ? thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225641,225641#msg-225641 From mdounin at mdounin.ru Mon Apr 23 07:29:12 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 23 Apr 2012 11:29:12 +0400 Subject: ngx_http_upstream_keepalive error ? In-Reply-To: <19824ba021aa753bb4551c1972773e82.NginxMailingListEnglish@forum.nginx.org> References: <19824ba021aa753bb4551c1972773e82.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120423072912.GQ13466@mdounin.ru> Hello! On Mon, Apr 23, 2012 at 03:04:43AM -0400, George wrote: > Hi first time trying to compile Nginx with ngx_http_upstream_keepalive > module support and seems I am getting an error at make stage while > compiling with Nginx v1.1.19 ? > > configure line: > > ./configure --sbin-path=/usr/local/sbin > --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module > --with-http_gzip_static_module --with-http_stub_status_module > --with-http_sub_module --with-http_addition_module > --with-http_secure_link_module --with-http_flv_module > --with-http_realip_module --add-module=../ngx-fancyindex-ngx-fancyindex > --add-module=../ngx_cache_purge-1.4 > --add-module=../nginx-accesskey-2.0.3 > --add-module=../agentzh-memc-nginx-module-4007350 > --add-module=../agentzh-srcache-nginx-module-fa2da58 > --add-module=../ngx_http_upstream_keepalive-d9ac9ad67f45 You don't need separate upstream keepalive module, it's already included into nginx since 1.1.4 and compiled in by default. Maxim Dounin From f.bonnet at esiee.fr Mon Apr 23 07:50:26 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Mon, 23 Apr 2012 09:50:26 +0200 Subject: Per user webdav access to their home directories ? Message-ID: <4F9509C2.3000503@esiee.fr> Hello I would like to know if the following is possible with NGINX : Setup a PERSONAL webdav access to our users, that is giving access to their unix home directories thru a secure webdav. If I understand well the main problem is the httpd process has to switch to the user's identity after authentication ( LDAP ) to let him have RW access to his workspace. Is it possible with the nginx beast ? If yes, links to documentation would be welcome ! Thank you From nginx-forum at nginx.us Mon Apr 23 08:20:50 2012 From: nginx-forum at nginx.us (thodu) Date: Mon, 23 Apr 2012 04:20:50 -0400 (EDT) Subject: Multiplexing a a large number of front-end connections among a few back-end connections Message-ID: <507a4011dbd3d10af5ee0d974557b4b6.NginxMailingListEnglish@forum.nginx.org> Hello, I have a scenario where an NGINX instance is holding persistent HTTP connections from 50,000 clients. Sporadic requests from these clients have to be multiplexed over a few socket connections to back-end servers over a different binary protocol. Is it possible to write a module to do this. i.e., incorporate the non-HTTP upstream sockets in NGINX's main event loop? And proxy the requests and responses via an id I supply between the HTTP client and the non-HTTP back-end? The few back-end connections are multiplexed, bi-directional and support out-of-band messaging. I have tried googling for this and am unable to figure out a way to do this. Regards, Amit Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225644,225644#msg-225644 From nginx-forum at nginx.us Mon Apr 23 08:28:30 2012 From: nginx-forum at nginx.us (George) Date: Mon, 23 Apr 2012 04:28:30 -0400 (EDT) Subject: ngx_http_upstream_keepalive error ? In-Reply-To: <20120423072912.GQ13466@mdounin.ru> References: <20120423072912.GQ13466@mdounin.ru> Message-ID: <502874f03133cacf6f5db0833e386d66.NginxMailingListEnglish@forum.nginx.org> doh ... no wonder why it complained of multiple definitions lol thanks :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225641,225645#msg-225645 From nginx-forum at nginx.us Mon Apr 23 10:58:20 2012 From: nginx-forum at nginx.us (haad) Date: Mon, 23 Apr 2012 06:58:20 -0400 (EDT) Subject: srcache + mogilefs module In-Reply-To: References: Message-ID: <86b852479f8fc758a4e22349d08bf5b3.NginxMailingListEnglish@forum.nginx.org> agentzh Wrote: ------------------------------------------------------- > On Sun, Apr 22, 2012 at 2:14 PM, haad > wrote: > > > > So if I configure location with /mogstored and > sets srcache_store there > > it should be working ? > > > > location ~ /mogstored_ { > > ? srcache_store PUT /memc > > } > > > > No, the /mogstored_spare_34991976/ location is > automatically generated > by ngx_mogilefs. I'm not sure if it helps by > putting your > srcache_store configuration into the "anonymous" > location block under > the mogilefs_pass directive, i.e., > > mogilefs_pass { > proxy_pass $mogilefs_path; > proxy_hide_header Content-Type; > proxy_buffering off; > srcache_store PUT /memc; > } > > But you can try it out anyway. This works ! thanks a lot for your time/help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225568,225651#msg-225651 From francis at daoine.org Mon Apr 23 11:30:30 2012 From: francis at daoine.org (Francis Daly) Date: Mon, 23 Apr 2012 12:30:30 +0100 Subject: Per user webdav access to their home directories ? In-Reply-To: <4F9509C2.3000503@esiee.fr> References: <4F9509C2.3000503@esiee.fr> Message-ID: <20120423113030.GF26729@craic.sysops.org> On Mon, Apr 23, 2012 at 09:50:26AM +0200, Frank Bonnet wrote: Hi there, > Setup a PERSONAL webdav access to our users, that is giving > access to their unix home directories thru a secure webdav. > > If I understand well the main problem is the httpd process > has to switch to the user's identity after authentication ( LDAP ) > to let him have RW access to his workspace. Untested; but I would suggest running one webdav instance per user, under that userid. Then run one "public" web server, which checks identity and does a proxy_pass or something similar to the correct webdav instance. That way the httpd process doesn't have to care about switching identities; it just acts as a client to another service which has the right identity already. (Depending on how you choose to deploy the webdav server, it may be pure-nginx, or it may include something like a separate fastcgi server. The userid of whatever process is accessing the files will need to be correct.) > Is it possible with the nginx beast ? > If yes, links to documentation would be welcome ! You can "listen" on a unix:path, and you can "proxy_pass" to that path, choosing which one to used based on a variable set based on the authenticated user. So after you have webdav access as a single user working, you just repeat that setup. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Mon Apr 23 12:47:10 2012 From: nginx-forum at nginx.us (JCR) Date: Mon, 23 Apr 2012 08:47:10 -0400 (EDT) Subject: upload module fails in some cases In-Reply-To: <0b5caab894de6a90d1d03139c7133095.NginxMailingListEnglish@forum.nginx.org> References: <0b5caab894de6a90d1d03139c7133095.NginxMailingListEnglish@forum.nginx.org> Message-ID: <72715773c61d643eab99d8a3a7d1bb2b.NginxMailingListEnglish@forum.nginx.org> Hello Maxim Thanks a lot! I went back to RFC 2046 and understood clearly my mistake Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225636,225657#msg-225657 From mdounin at mdounin.ru Mon Apr 23 13:46:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 23 Apr 2012 17:46:03 +0400 Subject: nginx-1.2.0 Message-ID: <20120423134602.GB31671@mdounin.ru> Changes with nginx 1.2.0 23 Apr 2012 *) Bugfix: a segmentation fault might occur in a worker process if the "try_files" directive was used; the bug had appeared in 1.1.19. *) Bugfix: response might be truncated if there were more than IOV_MAX buffers used. *) Bugfix: in the "crop" parameter of the "image_filter" directive. Thanks to Maxim Bublis. Maxim Dounin From nginx-forum at nginx.us Mon Apr 23 13:52:04 2012 From: nginx-forum at nginx.us (JCR) Date: Mon, 23 Apr 2012 09:52:04 -0400 (EDT) Subject: extend the upload module Message-ID: <1406912274840e20d2a520f16cbd437a.NginxMailingListEnglish@forum.nginx.org> Hello I am using the /nginx_upload_module-2.2.0 with nginx 1.0.15 with great success I would like to extend it in two ways: (1) Each HTTP POST request to the module contains a username and a password field and I would like to make some checks on those values as early as possible and possibly reject the request even before the file is uploaded. (2) I would like to save the file in a directory which depends on the file name and using the original file name instead of the current 10-digit 000... filename I have studied the code a little bit but I am still unclear as to where exactly I should look to implement (1) and (2) thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225666,225666#msg-225666 From lists at wildgooses.com Mon Apr 23 13:52:18 2012 From: lists at wildgooses.com (Ed W) Date: Mon, 23 Apr 2012 14:52:18 +0100 Subject: Per user webdav access to their home directories ? In-Reply-To: <4F9509C2.3000503@esiee.fr> References: <4F9509C2.3000503@esiee.fr> Message-ID: <4F955E92.9010605@wildgooses.com> On 23/04/2012 08:50, Frank Bonnet wrote: > > Hello > > I would like to know if the following is possible with NGINX : > > Setup a PERSONAL webdav access to our users, that is giving > access to their unix home directories thru a secure webdav. > > If I understand well the main problem is the httpd process > has to switch to the user's identity after authentication ( LDAP ) > to let him have RW access to his workspace. > > Is it possible with the nginx beast ? > If yes, links to documentation would be welcome ! > > Thank you Another option seems to be to run a webdav client via some kind of CGI. There is a PHP library which gets plenty of recommendations. I'm going to be investigating the Mojolicious webdav library because it looks easy to extend and integrate into my environment (depends if you have the capability to do some development). There is also a promising looking Perl DAV implementation I also came across a dav implementation testing tool. Don't have the name at my fingertips, but it seems like a rather good idea to run it against your proposed implementation to at least baseline the kinds of issues you can look forward to later. If you want to use nginx then I think it works ok if you collect together the various patches and apply permissions via nginx permission levels. Not tried though as I decided the authentication wasn't likely to be flexible enough for my needs (probably the fastest option though?) Good luck Ed W From zhuzhaoyuan at gmail.com Mon Apr 23 14:00:32 2012 From: zhuzhaoyuan at gmail.com (Joshua Zhu) Date: Mon, 23 Apr 2012 22:00:32 +0800 Subject: nginx-1.2.0 In-Reply-To: <20120423134602.GB31671@mdounin.ru> References: <20120423134602.GB31671@mdounin.ru> Message-ID: Congratulations! Thanks for the great work. -- Joshua Zhu Senior Software Engineer Server Platforms Team at Taobao -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.bonnet at esiee.fr Mon Apr 23 14:31:45 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Mon, 23 Apr 2012 16:31:45 +0200 Subject: Per user webdav access to their home directories ? In-Reply-To: <4F955E92.9010605@wildgooses.com> References: <4F9509C2.3000503@esiee.fr> <4F955E92.9010605@wildgooses.com> Message-ID: <4F9567D1.3090805@esiee.fr> On 04/23/2012 03:52 PM, Ed W wrote: > On 23/04/2012 08:50, Frank Bonnet wrote: >> >> Hello >> >> I would like to know if the following is possible with NGINX : >> >> Setup a PERSONAL webdav access to our users, that is giving >> access to their unix home directories thru a secure webdav. >> >> If I understand well the main problem is the httpd process >> has to switch to the user's identity after authentication ( LDAP ) >> to let him have RW access to his workspace. >> >> Is it possible with the nginx beast ? >> If yes, links to documentation would be welcome ! >> >> Thank you > > Another option seems to be to run a webdav client via some kind of > CGI. There is a PHP library which gets plenty of recommendations. > I'm going to be investigating the Mojolicious webdav library because > it looks easy to extend and integrate into my environment (depends if > you have the capability to do some development). There is also a > promising looking Perl DAV implementation > > I also came across a dav implementation testing tool. Don't have the > name at my fingertips, but it seems like a rather good idea to run it > against your proposed implementation to at least baseline the kinds of > issues you can look forward to later. > > If you want to use nginx then I think it works ok if you collect > together the various patches and apply permissions via nginx > permission levels. Not tried though as I decided the authentication > wasn't likely to be flexible enough for my needs (probably the fastest > option though?) > > Good luck > > Ed W Hello I'm affraid not being a developper only an admin :-) I was asking in case of such function do exists ... I really think it would be a great help for our users but I am unable to write it ... anyway thanks for your answer/explains ! From steve.gray.wipro at sonymusic.com Mon Apr 23 15:16:59 2012 From: steve.gray.wipro at sonymusic.com (Gray, Steve, Wipro) Date: Mon, 23 Apr 2012 11:16:59 -0400 Subject: pcre error Message-ID: I realize that this is not your subject, but I am going to be bold and ask anyway. I am installing PCRE, and after I run the configure command with my options, then I issue the "make" command and I get the following error "ld: warning: file /usr/sfw/lib/libstdc++.so: attempted multiple inclusion of file". I have made numerous attempts at correcting my configure options, but I don't think it has anything to do with the options, because running just "configure" by itself gives me the same error. I want to install the PCRE library, so if anyone can shed any light on this error message, it will be much appreciated. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 530 bytes Desc: image001.gif URL: From mdounin at mdounin.ru Mon Apr 23 15:23:57 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 23 Apr 2012 19:23:57 +0400 Subject: stable branch 1.2.x Message-ID: <20120423152357.GJ31671@mdounin.ru> Hello! First version of the 1.2.x stable branch has been released. The 1.2.0 version incorporates many new features developed in the 1.1.x branch, including the following: - support for keepalive connections to upstream servers, - consolidation of multiple simultaneous requests to upstream servers if caching is used, - support for multiple request and connection limits used simultaneously, - reduced memory consumption in various edge cases like handling of long-lived requests. Maxim Dounin From contact at jpluscplusm.com Mon Apr 23 15:51:18 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 23 Apr 2012 16:51:18 +0100 Subject: nginx-1.2.0 In-Reply-To: <20120423134602.GB31671@mdounin.ru> References: <20120423134602.GB31671@mdounin.ru> Message-ID: On 23 April 2012 14:46, Maxim Dounin wrote: > Changes with nginx 1.2.0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 23 Apr 2012 Congrats to all involved! -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From al-nginx at none.at Mon Apr 23 16:13:01 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Mon, 23 Apr 2012 18:13:01 +0200 Subject: nginx-1.2.0 In-Reply-To: <20120423134602.GB31671@mdounin.ru> References: <20120423134602.GB31671@mdounin.ru> Message-ID: <8f730f6394ce2371b9db49da7142b1ab@none.at> Hi, On 23-04-2012 15:46, Maxim Dounin wrote: > Changes with nginx 1.2.0 23 > Apr 2012 [snipp] That's great cool yeah ;-) ;-) Thanks to all for your had work. Cheers Aleks From nginx-forum at nginx.us Mon Apr 23 16:17:40 2012 From: nginx-forum at nginx.us (zeux) Date: Mon, 23 Apr 2012 12:17:40 -0400 (EDT) Subject: Load Balancing https with sticky connection Message-ID: <91712ab1d5c3cc682913c164f034828d.NginxMailingListEnglish@forum.nginx.org> Hi to everybody, first of all I'm very sorry for my English... This is my scenario: Internet; Firewall+nginx as load balancer: pfsense_1(active) + pfsense_2(passive) in CARP; Poos servers: 3 x nginx(PHP5-FPM HTTP+HTTPS); Pfsense 1 and 2 CARP configured with virtual IP (pubblic). Nginx pool servers's ips are all private. I want to load balance inbound HTTP and HTTPS connections between the 3 nginx web servers. An importat thing is that the HTTPS connections must be "sticky connections": in HTTPS connections, after login by username and password, I setup a php session and therefore when a client starts a HTTPS connection it will be always redirected to the same nginx server, until it disconnects itself, it closes the page/browser or after a timeout (30minutes?) without activity. I would like to do that without decript ssl traffic in the load balancer. Is it possible using the directive ip_hash? The configuration will be something like this: upstream poolservers_http { # HTTP (NO sticky connections... server server1.example.com max_fails=1 fail_timeout=10s; server server2.example.com max_fails=1 fail_timeout=10s; server server3.example.com max_fails=1 fail_timeout=10s; } upstream poolservers_https { # HTTPS ip_hash; # sticky connections server server1.example.com max_fails=1 fail_timeout=10s; server server2.example.com max_fails=1 fail_timeout=10s; server server3.example.com max_fails=1 fail_timeout=10s; } server { # HTTP listen public_ip:80; server_name expample.com; location / { proxy_pass http://poolservers_http; } } server { # HTTPS listen public_ip:443; server_name expample.com; location / { proxy_pass https://poolservers_https; } } thank you very much.... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225682,225682#msg-225682 From kworthington at gmail.com Mon Apr 23 17:19:15 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Mon, 23 Apr 2012 13:19:15 -0400 Subject: nginx-1.2.0 In-Reply-To: <20120423134602.GB31671@mdounin.ru> References: <20120423134602.GB31671@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.2.0 For Windows http://goo.gl/nvoA5 (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On 4/23/12, Maxim Dounin wrote: > Changes with nginx 1.2.0 23 Apr 2012 > > *) Bugfix: a segmentation fault might occur in a worker process if the > "try_files" directive was used; the bug had appeared in 1.1.19. > > *) Bugfix: response might be truncated if there were more than IOV_MAX > buffers used. > > *) Bugfix: in the "crop" parameter of the "image_filter" directive. > Thanks to Maxim Bublis. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Best regards, Kevin -- Kevin Worthington kworthington at gmail.com http://www.kevinworthington.com/ (516) 647-1992 http://twitter.com/kworthington From cyril.lavier at davromaniak.eu Mon Apr 23 17:26:18 2012 From: cyril.lavier at davromaniak.eu (Cyril Lavier) Date: Mon, 23 Apr 2012 19:26:18 +0200 Subject: nginx-1.2.0 In-Reply-To: <20120423134602.GB31671@mdounin.ru> References: <20120423134602.GB31671@mdounin.ru> Message-ID: <4F9590BA.9050105@davromaniak.eu> On 04/23/2012 03:46 PM, Maxim Dounin wrote: > Changes with nginx 1.2.0 23 Apr 2012 > > *) Bugfix: a segmentation fault might occur in a worker process if the > "try_files" directive was used; the bug had appeared in 1.1.19. > > *) Bugfix: response might be truncated if there were more than IOV_MAX > buffers used. > > *) Bugfix: in the "crop" parameter of the "image_filter" directive. > Thanks to Maxim Bublis. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hello. Thanks for all the good work you and the NGINX team did throughout the years. -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu From ashishs.dev at gmail.com Mon Apr 23 18:00:23 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Mon, 23 Apr 2012 11:00:23 -0700 Subject: nginx upstream for broadcasting update messages ? In-Reply-To: References: Message-ID: Hi There, Anyone with some experience here? I stumbled upon the http push module http://wiki.nginx.org/HttpPushStreamModule, but do you recommend to follow its path? Thanks, Ashish. On Thu, Apr 19, 2012 at 1:17 PM, Ashish S wrote: > Hi, > > Anyone with experience with a similar use-case? ?Any recommendations here? > > Thanks, > Ashish > > On Wed, Apr 18, 2012 at 6:29 PM, Ashish S wrote: >> Hi, >> >> I have 2 memcache boxes behind nginx. ?For reads, the upstream module >> lets me round-robin between the backend memcache boxes. I want the >> updates to go to all 2 memcache boxes. My question is, what is the >> best way to broadcast the updates to the backend? ?Is there a >> reference implementation of some module which does similar stuff >> (broadcast)? >> >> Thanks >> Ashish From francis at daoine.org Mon Apr 23 18:12:28 2012 From: francis at daoine.org (Francis Daly) Date: Mon, 23 Apr 2012 19:12:28 +0100 Subject: extend the upload module In-Reply-To: <1406912274840e20d2a520f16cbd437a.NginxMailingListEnglish@forum.nginx.org> References: <1406912274840e20d2a520f16cbd437a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120423181228.GG26729@craic.sysops.org> On Mon, Apr 23, 2012 at 09:52:04AM -0400, JCR wrote: Hi there, > I am using the /nginx_upload_module-2.2.0 with nginx 1.0.15 > with great success > > I would like to extend it in two ways: I suspect that these extensions would be out of scope for this module, which seems to be more about making it easier to write your own form handler. That said, I'm sure no-one's going to stop you from coding. > (1) > Each HTTP POST request to the module contains a username and a password > field and I would like to make some checks on those values as early as > possible and possibly reject the request even before the file is > uploaded. If you used http basic authentication, the effect of this could come for free. But you don't. Fundamentally, what you seem to want is for the handler to read a part of the POST request body and then decide whether to respond and close the connection, or accept the rest of the request body. I'm not sure how you'd go about that. > (2) > I would like to save the file in a directory which depends on the file > name and using the original file name instead of the current 10-digit > 000... filename That one is probably better handled in your own form handler -- you can be given the original suggested filename and the 10-digit filename, and do a "mv" of one to the other, handling duplicates and evil filenames as you see fit. No need to hard-code the handling within the module. You probably will want to make sure that "upload_store" is on the same filesystem as you wish the files to end up on. f -- Francis Daly francis at daoine.org From zzz at zzz.org.ua Mon Apr 23 18:40:33 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Mon, 23 Apr 2012 21:40:33 +0300 Subject: extend the upload module In-Reply-To: <20120423181228.GG26729@craic.sysops.org> References: <1406912274840e20d2a520f16cbd437a.NginxMailingListEnglish@forum.nginx.org> <20120423181228.GG26729@craic.sysops.org> Message-ID: > I suspect that these extensions would be out of scope for this module, > which seems to be more about making it easier to write your own form > handler. > Fundamentally, what you seem to want is for the handler to read a part > of the POST request body and then decide whether to respond and close > the connection, or accept the rest of the request body. > > I'm not sure how you'd go about that. This is what nginx-perl is for. From amoiz.shine at gmail.com Tue Apr 24 05:01:29 2012 From: amoiz.shine at gmail.com (Sharl.Jimh.Tsin) Date: Tue, 24 Apr 2012 13:01:29 +0800 Subject: nginx-1.2.0 In-Reply-To: <20120423134602.GB31671@mdounin.ru> References: <20120423134602.GB31671@mdounin.ru> Message-ID: great work,keep rocking. i will test it later. ? 2012-4-23 PM9:46?"Maxim Dounin" ??? > Changes with nginx 1.2.0 23 Apr > 2012 > > *) Bugfix: a segmentation fault might occur in a worker process if the > "try_files" directive was used; the bug had appeared in 1.1.19. > > *) Bugfix: response might be truncated if there were more than IOV_MAX > buffers used. > > *) Bugfix: in the "crop" parameter of the "image_filter" directive. > Thanks to Maxim Bublis. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Apr 24 06:13:54 2012 From: nginx-forum at nginx.us (ctrlbrk) Date: Tue, 24 Apr 2012 02:13:54 -0400 (EDT) Subject: nginx gzip_static not following gzip_types Message-ID: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> The directive gzip_static does not follow the rules in gzip_types gzip on; gzip_static on; gzip_http_version 1.0; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_comp_level 5; gzip_min_length 1000; gzip_vary on; gzip_buffers 64 16k; gzip_types text/plain application/xml text/css application/javascript application/x-javascript text/javascript; #strace open("/var/www/forum/images/smilies/attention.gif.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) open("/var/www/forum/images/smilies/lookoutbelow.gif", O_RDONLY|O_NONBLOCK) = 319 open("/var/www/forum/images/smilies/lookoutbelow.gif.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) open("/var/www/forum/images/smilies/heresyoursign.gif", O_RDONLY|O_NONBLOCK) = 320 open("/var/www/forum/images/smilies/heresyoursign.gif.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) open("/var/www/forum/images/smilies/woohooo.gif", O_RDONLY|O_NONBLOCK) = 321 open("/var/www/forum/images/smilies/woohooo.gif.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) open("/var/www/forum/images/smilies/ohno.gif", O_RDONLY|O_NONBLOCK) = 322 open("/var/www/forum/images/smilies/ohno.gif.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) As you can see, it is looking for .gz images even though the gzip_types excludes images. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225692,225692#msg-225692 From ft at falkotimme.com Tue Apr 24 06:15:17 2012 From: ft at falkotimme.com (Falko Timme) Date: Tue, 24 Apr 2012 08:15:17 +0200 Subject: nginx-1.2.0 References: <20120423134602.GB31671@mdounin.ru> Message-ID: <7B53049CF9EF40EB8FEBE217204535C5@notebook> Great work! Thanks a lot to the whole team for a great piece of software! :-) ----- Original Message ----- From: "Maxim Dounin" To: Sent: Monday, April 23, 2012 3:46 PM Subject: nginx-1.2.0 > Changes with nginx 1.2.0 23 Apr > 2012 > > *) Bugfix: a segmentation fault might occur in a worker process if the > "try_files" directive was used; the bug had appeared in 1.1.19. > > *) Bugfix: response might be truncated if there were more than IOV_MAX > buffers used. > > *) Bugfix: in the "crop" parameter of the "image_filter" directive. > Thanks to Maxim Bublis. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Tue Apr 24 06:23:48 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 24 Apr 2012 10:23:48 +0400 Subject: nginx gzip_static not following gzip_types In-Reply-To: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> References: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120424062348.GX31671@mdounin.ru> Hello! On Tue, Apr 24, 2012 at 02:13:54AM -0400, ctrlbrk wrote: > The directive gzip_static does not follow the rules in gzip_types Yes, and it's documented behaviour, actually: http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html#gzip_static : The following directives are also taken into account: : gzip_http_version, gzip_proxied, gzip_disable, and gzip_vary. Maxim Dounin From nginx-forum at nginx.us Tue Apr 24 06:36:07 2012 From: nginx-forum at nginx.us (ctrlbrk) Date: Tue, 24 Apr 2012 02:36:07 -0400 (EDT) Subject: nginx gzip_static not following gzip_types In-Reply-To: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> References: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks for the quick reply. It would be nice if there was a simple top level directive added to make it follow the gzip_types rule. The default behavior of trying to compress images is pretty futile. Even if I had my bash script compress images to serve up, the extra decompression time on the client would cause the page to be slower, and bandwidth savings of probably less than 1% at expense of much, much more than 1% increased client CPU. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225692,225695#msg-225695 From igor at sysoev.ru Tue Apr 24 08:33:58 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 24 Apr 2012 12:33:58 +0400 Subject: nginx gzip_static not following gzip_types In-Reply-To: References: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120424083358.GA4976@nginx.com> On Tue, Apr 24, 2012 at 02:36:07AM -0400, ctrlbrk wrote: > Thanks for the quick reply. It would be nice if there was a simple top > level directive added to make it follow the gzip_types rule. The > default behavior of trying to compress images is pretty futile. Even if > I had my bash script compress images to serve up, the extra > decompression time on the client would cause the page to be slower, and > bandwidth savings of probably less than 1% at expense of much, much more > than 1% increased client CPU. location /images/ { gzip_static off; ... } -- Igor Sysoev From mdounin at mdounin.ru Tue Apr 24 08:47:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 24 Apr 2012 12:47:03 +0400 Subject: nginx gzip_static not following gzip_types In-Reply-To: References: <3c2b57eb5c6ff254f5089fc29cc104bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120424084703.GY31671@mdounin.ru> Hello! On Tue, Apr 24, 2012 at 02:36:07AM -0400, ctrlbrk wrote: > Thanks for the quick reply. It would be nice if there was a simple top > level directive added to make it follow the gzip_types rule. The > default behavior of trying to compress images is pretty futile. Even if > I had my bash script compress images to serve up, the extra > decompression time on the client would cause the page to be slower, and > bandwidth savings of probably less than 1% at expense of much, much more > than 1% increased client CPU. It doesn't try to compress anything, it's up to you to compress files you think is ok to compress. The gzip_static just checks if a '.gz' file present, and returns it to client if it's present (and client supports gzip). If you want to avoid file lookup, you may (and probably should) disable gzip_static for locations you don't want lookup to happen. Maxim Dounin From nginx-forum at nginx.us Tue Apr 24 10:53:03 2012 From: nginx-forum at nginx.us (chrtistianl) Date: Tue, 24 Apr 2012 06:53:03 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: <651595777759926976b15f34c9b7dc80.NginxMailingListEnglish@forum.nginx.org> So just exactly where would you start off It s surely Karen Millen Dresses a very good notion to discuss with your spending price range worksheet really 1st so you recognize the worth variety to target on. >From there, give thought to what can make you along with your husband or wife distinctive. Do you both love golfing Are you currently wine connoisseurs How about a design In the event your wedding ceremony has a single, there s confident to be a favor to enhance that idea. Would you wish the favor for being the place holder If that is so, choose 1 that enables you to jot down the person s name and table quantity.http://www.birkinuk.com/ [url=http://www.nieos.com/karen-millen-one-shoulder-c-14.html]Karen Millen One Shoulder[/url] [url=http://www.nieos.com/karen-millen-solid-color-c-15.html]Karen Millen Solid Color[/url] [url=http://www.nieos.com/karen-millen-multicolor-c-16.html]Karen Millen Multicolor[/url] [url=http://www.birkinuk.com/accessories-hermes-belts-c-40_41.html]Hermes Belts[/url] [url=http://www.birkinuk.com/hermes-birkin-bag-25-bougainvillier-ostrich-leather-gold-hardware-p-94.html]Hermes Birkin bag 25 Bougainvillier Ostrich leather Gold hardware[/url] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225703#msg-225703 From f.bonnet at esiee.fr Tue Apr 24 11:25:09 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Tue, 24 Apr 2012 13:25:09 +0200 Subject: Per user webdav access to their home directories ? In-Reply-To: <4F955E92.9010605@wildgooses.com> References: <4F9509C2.3000503@esiee.fr> <4F955E92.9010605@wildgooses.com> Message-ID: <4F968D95.6000808@esiee.fr> On 04/23/2012 03:52 PM, Ed W wrote: > On 23/04/2012 08:50, Frank Bonnet wrote: >> >> Hello >> >> I would like to know if the following is possible with NGINX : >> >> Setup a PERSONAL webdav access to our users, that is giving >> access to their unix home directories thru a secure webdav. >> >> If I understand well the main problem is the httpd process >> has to switch to the user's identity after authentication ( LDAP ) >> to let him have RW access to his workspace. >> >> Is it possible with the nginx beast ? >> If yes, links to documentation would be welcome ! >> >> Thank you > > Another option seems to be to run a webdav client via some kind of > CGI. There is a PHP library which gets plenty of recommendations. > I'm going to be investigating the Mojolicious webdav library because > it looks easy to extend and integrate into my environment (depends if > you have the capability to do some development). There is also a > promising looking Perl DAV implementation > > I also came across a dav implementation testing tool. Don't have the > name at my fingertips, but it seems like a rather good idea to run it > against your proposed implementation to at least baseline the kinds of > issues you can look forward to later. > > If you want to use nginx then I think it works ok if you collect > together the various patches and apply permissions via nginx > permission levels. Not tried though as I decided the authentication > wasn't likely to be flexible enough for my needs (probably the fastest > option though?) > > Good luck > > Ed W hello again maybe there are "cloud like" applications running under nginx ? my goal is to let users manage their workspace thru user friendly interfaces , webdav seems a solution IF the http server know how to switch to userid. I know this is a potential security problem but I also know there are really GOOD programmers around there :-) This function would be really practical with mobile devices. From flips01 at googlemail.com Mon Apr 23 14:33:03 2012 From: flips01 at googlemail.com (Philip) Date: Mon, 23 Apr 2012 16:33:03 +0200 Subject: Etag Support Message-ID: Hi, are there any plans to support etags in the future? Internet-Explorer depends on etags otherwise it won't allow its users to pause and resume a download. From nginx-forum at nginx.us Tue Apr 24 14:16:07 2012 From: nginx-forum at nginx.us (borgita) Date: Tue, 24 Apr 2012 10:16:07 -0400 (EDT) Subject: Nginx - Joomla Message-ID: I installed Nginx for Windows. Added the php to run joomla. I'm problems with CGI. I often have the error "502 bad gateway" after a while. how do I fix this? What is the best configuration of nginx to run joomla? Server: Windows 2008 Dual-Core 2.0GHZ. Ram: 2 GB Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225707,225707#msg-225707 From jdorfman at netdna.com Tue Apr 24 15:08:42 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Tue, 24 Apr 2012 08:08:42 -0700 Subject: Nginx - Joomla In-Reply-To: References: Message-ID: Hello, Can you please paste your vhost or nginx.conf file? Regards, Justin Dorfman (sent on my Droid) On Apr 24, 2012 7:16 AM, "borgita" wrote: > I installed Nginx for Windows. Added the php to run joomla. > I'm problems with CGI. > I often have the error "502 bad gateway" after a while. > how do I fix this? > What is the best configuration of nginx to run joomla? > > Server: > Windows 2008 > Dual-Core 2.0GHZ. > Ram: 2 GB > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,225707,225707#msg-225707 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dewanggaba at gmail.com Tue Apr 24 15:30:18 2012 From: dewanggaba at gmail.com (antituhan) Date: Tue, 24 Apr 2012 08:30:18 -0700 (PDT) Subject: Good Directive vs Bad Directives Message-ID: <1335281418117-7496293.post@n2.nabble.com> Hello fellas, I've read on http://wiki.nginx.org/Pitfalls, what the different between bad and good? Any info related to this issue? Such as cpu load or mem load? ----- [daemon at antituhan.com ~]# -- View this message in context: http://nginx.2469901.n2.nabble.com/Good-Directive-vs-Bad-Directives-tp7496293p7496293.html Sent from the nginx mailing list archive at Nabble.com. From ft at falkotimme.com Tue Apr 24 16:03:15 2012 From: ft at falkotimme.com (Falko Timme) Date: Tue, 24 Apr 2012 18:03:15 +0200 Subject: Nginx - Joomla References: Message-ID: This is what works for me on Debian/Ubuntu (with PHP-FPM): http://www.howtoforge.com/running-joomla-1.7-on-nginx-lemp-on-debian-squeeze-ubuntu-11.10 I haven't tested this on Windows, but the configuration should be similar. ----- Original Message ----- From: "borgita" To: Sent: Tuesday, April 24, 2012 4:16 PM Subject: Nginx - Joomla >I installed Nginx for Windows. Added the php to run joomla. > I'm problems with CGI. > I often have the error "502 bad gateway" after a while. > how do I fix this? > What is the best configuration of nginx to run joomla? > > Server: > Windows 2008 > Dual-Core 2.0GHZ. > Ram: 2 GB > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,225707,225707#msg-225707 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Apr 24 16:14:44 2012 From: nginx-forum at nginx.us (borgita) Date: Tue, 24 Apr 2012 12:14:44 -0400 (EDT) Subject: Nginx - Joomla In-Reply-To: References: Message-ID: <0adb52f2eb65f9ccbc7dec6ac85809d7.NginxMailingListEnglish@forum.nginx.org> I've tried lots of things in the file nginx.conf. The server is now more stable. In php settings that are required to include? nginx.conf #user nobody; master_process on; worker_processes 2; events { worker_connections 1024; } http { sendfile on; client_max_body_size 10M; tcp_nopush off; tcp_nodelay on; server_tokens off; include /nginx/conf/mime.types; default_type application/octet-stream; index index.php index.htm index.html redirect.php; charset utf-8; keepalive_timeout 65; #Gzip gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_disable "MSIE [1-6].(?!.*SV1)"; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; #FastCGI fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; upstream fastcgi_backend { server 127.0.0.1:9000 weight=2; server 127.0.0.1:9001 weight=3; server 127.0.0.1:9002 weight=4; } limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; server { listen 80; server_name xxx.pt www.xxx.pt; server_name_in_redirect off; large_client_header_buffers 4 8k; # prevent some 400 errors; error_log /nginx/xxx.log; root html; location / { root html; try_files $uri $uri/ /index.php?p=$uri&$args; expires 30d; error_page 404 = @joomla; error_page 500 502 503 504 = @joomla; log_not_found off; } location @joomla { rewrite ^(.+)$ /index.php?p=$1 last; } location ~ \.php$ { root html; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME c:/nginx/html/$fastcgi_script_name; fastcgi_keep_conn on; fastcgi_intercept_errors on; if ($uri !~ "^/images/") { fastcgi_pass fastcgi_backend; } include fastcgi_params; } if ( $args ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3d)" ) { set $args ""; rewrite ^.*$ http://$host/index.php last; return 403; } if ( $args ~ "base64_encode.*\(.*\)" ) { set $args ""; rewrite ^.*$ http://$host/index.php last; return 403; } if ( $args ~ "(\<|%3C).*script.*(\>|%3E)" ) { set $args ""; rewrite ^.*$ http://$host/index.php last; return 403; } if ( $args ~ "GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ) { set $args ""; rewrite ^.*$ http://$host/index.php last; return 403; } if ( $args ~ "_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ) { set $args ""; rewrite ^.*$ http://$host/index.php last; return 403; } location ~* \.(ico|pdf|flv)$ { access_log off; expires 1y; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ { access_log off; expires 14d; } # fim location ~ \.php$ { deny all; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225707,225715#msg-225715 From nginx-forum at nginx.us Tue Apr 24 17:16:54 2012 From: nginx-forum at nginx.us (borgita) Date: Tue, 24 Apr 2012 13:16:54 -0400 (EDT) Subject: Joomla // Rewrite Url Message-ID: <050e72cc432e76c247bcb2e32e1909a5.NginxMailingListEnglish@forum.nginx.org> I have problems in joomla rewrite the url when I'm in another menu that is not the main menu. examples: Example 1: Returns: http://www.xxx.pt/a-minha-area/index.php Should give: http://www.xxx.pt Example 2: Returns: http://www.xxx.pt/a-minha-area/anuncios/index.php?option=com_listbingo&t ...... It should run: http://www.xxx.pt/index.php?option=com_listbingo&t ...... Should give: http://www.xxx.pt/a-minha-area/anuncios/myads Any Solution to fix this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225718,225718#msg-225718 From francis at daoine.org Tue Apr 24 18:24:53 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 24 Apr 2012 19:24:53 +0100 Subject: Joomla // Rewrite Url In-Reply-To: <050e72cc432e76c247bcb2e32e1909a5.NginxMailingListEnglish@forum.nginx.org> References: <050e72cc432e76c247bcb2e32e1909a5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120424182453.GH26729@craic.sysops.org> On Tue, Apr 24, 2012 at 01:16:54PM -0400, borgita wrote: Hi there, > I have problems in joomla rewrite the url when I'm in another menu that > is not the main menu. http://wiki.nginx.org/Joomla links to http://docs.joomla.org/Nginx Both look "official" enough that it is probably a good idea to start with the configuration there. The configuration file you posted looks a lot more complicated. > Example 1: > Returns: http://www.xxx.pt/a-minha-area/index.php > Should give: http://www.xxx.pt I'm not sure what you mean by this. There is one specific url that you expect to give one response but in fact gives another? If you can provide the initial url, it should be possible to work out from your configuration what nginx will do with it. "curl" is a very good tool for testing how individual requests are processed. Anyway: if you use a configuration more like what the project documents, do you see the same problems? Good luck, f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Tue Apr 24 18:45:29 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 24 Apr 2012 22:45:29 +0400 Subject: Etag Support In-Reply-To: References: Message-ID: <20120424184529.GH31671@mdounin.ru> Hello! On Mon, Apr 23, 2012 at 04:33:03PM +0200, Philip wrote: > are there any plans to support etags in the future? Internet-Explorer > depends on etags otherwise it won't allow its users to pause and > resume a download. Yes, though no ETA yet. And just for the record, here is Microsoft's info about this: http://blogs.msdn.com/b/ieinternals/archive/2011/06/03/send-an-etag-to-enable-http-206-file-download-resume-without-restarting.aspx Maxim Dounin From nginx-forum at nginx.us Wed Apr 25 03:23:25 2012 From: nginx-forum at nginx.us (renyi1986) Date: Tue, 24 Apr 2012 23:23:25 -0400 (EDT) Subject: help me tanslate the rewrite rule to nginx Message-ID: <05b4c182af74ccae4af8c817a30b9595.NginxMailingListEnglish@forum.nginx.org> RewriteEngine on RewriteCond %{REQUEST_URI} !^/(skin|js)/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l #RewriteRule ^(.+)$ /default.php/$1 [L] RewriteRule .* default.php [L] thanks a lot Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225728,225728#msg-225728 From hagaizzz at yahoo.com Wed Apr 25 03:29:03 2012 From: hagaizzz at yahoo.com (hagai avrahami) Date: Tue, 24 Apr 2012 20:29:03 -0700 (PDT) Subject: No subject Message-ID: <1335324543.26327.YahooMailNeo@web125515.mail.ne1.yahoo.com> http://clearingdelight.com/wp-content/themes/wp-creativix/scripts/cache/tpldd.html?hu=vh.sxds&ygu=hg.hrhg&ydl=dqsj -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Apr 25 06:37:30 2012 From: nginx-forum at nginx.us (rite2subodh) Date: Wed, 25 Apr 2012 02:37:30 -0400 (EDT) Subject: Unable to execute PHP file Message-ID: <29f16e0504eaa281da982aabc220688f.NginxMailingListEnglish@forum.nginx.org> Unable to execute PHP file. Below is my default.conf file. # # The default server # server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.php index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225734,225734#msg-225734 From edho at myconan.net Wed Apr 25 06:40:25 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 25 Apr 2012 13:40:25 +0700 Subject: Unable to execute PHP file In-Reply-To: <29f16e0504eaa281da982aabc220688f.NginxMailingListEnglish@forum.nginx.org> References: <29f16e0504eaa281da982aabc220688f.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2012/4/25 rite2subodh : > Unable to execute PHP file. > > Below is my default.conf file. > Install and start php-fpm From nginx-forum at nginx.us Wed Apr 25 06:51:26 2012 From: nginx-forum at nginx.us (rite2subodh) Date: Wed, 25 Apr 2012 02:51:26 -0400 (EDT) Subject: Unable to execute PHP file In-Reply-To: References: Message-ID: <755276156643217b112ea0be8a0d332b.NginxMailingListEnglish@forum.nginx.org> Thanks Edho Arief Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225734,225736#msg-225736 From raviteja at pipallabs.com Wed Apr 25 08:40:53 2012 From: raviteja at pipallabs.com (Raviteja Dodda) Date: Wed, 25 Apr 2012 14:10:53 +0530 Subject: How do I redirect/handle requests from search engines via nginx using location regex Message-ID: Hi, I have developed an ajax-based web application with hash bang urls. I am trying to redirect requests from search engines to another server which generates HTML snapshots and send the response. I am trying to achieve this in nginx with the location directive as mentioned below: location ~ ^(/?_escaped_fragment_=).*$ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 60s; proxy_send_timeout 90s; proxy_read_timeout 90s; proxy_buffering off; proxy_temp_file_write_size 64k; proxy_pass http://x1.x2.x3.x4:8080; proxy_redirect off; } But I am not able to get this working. Can someone correct the regex I am using (or) provide me an alternative solution to achieve this. Thanks in advance, Ravi -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Pipal Tech Ventures Private Limited (www.pipaltechventures.com) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Apr 25 13:30:59 2012 From: nginx-forum at nginx.us (utahemre) Date: Wed, 25 Apr 2012 09:30:59 -0400 (EDT) Subject: Caching images with memcached In-Reply-To: <20120419160220.GY13466@mdounin.ru> References: <20120419160220.GY13466@mdounin.ru> Message-ID: <88360d40ebc4308e36cdb04dcbf50170.NginxMailingListEnglish@forum.nginx.org> Hi My problem has been solved. If i put any image to cache with java spymemcached client, nginx get broken images. After that i changed my java client to whalin memcached client. Now i am putting images with java whalin memcached client and i can get images with nginx properly. But here is a important trick. You have to set SanitizeKeys attribute in whalin memcached client to false. Regards Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225508,225767#msg-225767 From nginx-forum at nginx.us Wed Apr 25 16:59:50 2012 From: nginx-forum at nginx.us (TECK) Date: Wed, 25 Apr 2012 12:59:50 -0400 (EDT) Subject: Does auth_basic changes require a service reload? Message-ID: Hi, I'm wondering if I need to perform a "service nginx restart", if I do any changes to htpasswd file: location / { auth_basic "closed site"; auth_basic_user_file htpasswd; } I noticed that sometimes it works without reloading the service. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225777,225777#msg-225777 From nginx-forum at nginx.us Wed Apr 25 18:45:34 2012 From: nginx-forum at nginx.us (squimmy) Date: Wed, 25 Apr 2012 14:45:34 -0400 (EDT) Subject: Really bizarre problem with Sabredav In-Reply-To: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> References: <312a7883911c6b7a9c81930afa760707.NginxMailingListEnglish@forum.nginx.org> Message-ID: <79c3b0253d0c381d8b4d11a897a786c9.NginxMailingListEnglish@forum.nginx.org> Francis, thanks a lot, that seems to have fixed the issue. I think I need to go through the nginx documentation, seems a little more intricate and problematic than I first thought. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225539,225781#msg-225781 From francis at daoine.org Wed Apr 25 19:23:26 2012 From: francis at daoine.org (Francis Daly) Date: Wed, 25 Apr 2012 20:23:26 +0100 Subject: How do I redirect/handle requests from search engines via nginx using location regex In-Reply-To: References: Message-ID: <20120425192326.GJ26729@craic.sysops.org> On Wed, Apr 25, 2012 at 02:10:53PM +0530, Raviteja Dodda wrote: Hi there, > I have developed an ajax-based web application with hash bang urls. > > I am trying to redirect requests from search engines to another server > which generates HTML snapshots and send the response. I confess I'm not sure how to tie "requests from search engines" and "hash bang urls" into the details of your question. But that probably doesn't matter. nginx doesn't care how or why the url arose; it just knows what request was made to it, and it processes that request in the one location that is configured for the request. So I'll (try to) describe what nginx sees and what nginx does, and then maybe it will be clear to you how that maps to your application and your configuration. In general, the url is of the form http://one:two/three?four#five where some of the parts may be missing. nginx uses the part before the first single / -- one:two -- to decide which server{} to use. (That's not quite true, but it's close enough for now.) nginx then is only sent the part from the first single / to just before the first # -- so all nginx can see is /three?four. When it comes to matching against the location{}s that are defined, nginx stops just before the first ? -- in this case, /three So: can you identify the http requests that are made when someone uses your web application? Or the http requests that come from search engines? Then see what is the part that nginx will consider relevant for the location matching -- from the first single / to just before the first # or ? -- and then write a location directive to match those. > I am trying to > achieve this in nginx with the location directive as mentioned below: > > location ~ ^(/?_escaped_fragment_=).*$ { There is one subtlety, in that it is possible for nginx to consider ? to be part of the url that can be matched in the location directive; but only if it was properly url-encoded originally (which means that the client did not ask for /?four, but for something like /%3ffour). But that's not a common setup; so I'm going to guess that you are not using that, in which case the request that it looks like you are trying to match is exactly "/". > But I am not able to get this working. Can someone correct the regex I am > using (or) provide me an alternative solution to achieve this. Hopefully the above gives you enough information to find the answer. If not, if you can include one url that you are attempting to access (ideally using something like curl, so that it is easily repeatable without being concerned with browser caching), and the response you expect and the response you get, then someone may be able to provide more help. f -- Francis Daly francis at daoine.org From ashishs.dev at gmail.com Thu Apr 26 00:22:05 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Wed, 25 Apr 2012 17:22:05 -0700 Subject: Help with reading response from upstream u->buffer Message-ID: Hi there, In my module which uses upstream to talk to a backend, i do the following in the response processing method (u->process_header) { ngx_http_upstream_t * u = r->upstream; size_t myResponseLength = (u->buffer.last - u->buffer.pos); size_t origUpstreamResponseLength = (u->buffer.last - u->buffer.start); std::string myResponseString ((u_char *) u->buffer.pos, myResponseLength); ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "u->length is %d and Original Upstream response length is %d and myResponseLength is %d", u->length, origUpstreamResponseLength, myResponseLength); .... } My actual response length from upstream is ~16kb, while i get u->length printed as 0, Original upstream response length and myResponseLength printed as 1448 bytes. I also see in nginx debug logs, "Transfer-Encoding: chunked". Is the difference in length printed, because of this encoding? Is there a way to disable chunked transfer, so that i can get the entire response in one go (into my string), as shown in code? If not, what is the right method to read the entire response from upstream buffer into a temporary string (so that i can do further parsing)? Thanks, Ashish From ashishs.dev at gmail.com Thu Apr 26 01:01:10 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Wed, 25 Apr 2012 18:01:10 -0700 Subject: Help with reading response from upstream u->buffer In-Reply-To: References: Message-ID: Maxim had once mentioned about checking out memcache module for an example of non-buffered protocol handling, and i modeled my code around it. Is the behavior below because of buffered protocol (http)? Thanks, Ashish On Wed, Apr 25, 2012 at 5:22 PM, Ashish S wrote: > Hi there, > > In my module which uses upstream to talk to a backend, i do the > following in the response processing method ?(u->process_header) > > { > ? ?ngx_http_upstream_t * u = r->upstream; > ? ?size_t myResponseLength = (u->buffer.last - u->buffer.pos); > ? ?size_t origUpstreamResponseLength = (u->buffer.last - u->buffer.start); > ? ?std::string myResponseString ((u_char *) u->buffer.pos, myResponseLength); > > ? ?ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "u->length is %d > and Original Upstream response length is %d and myResponseLength is > %d", u->length, origUpstreamResponseLength, myResponseLength); > > ? ?.... > } > > My actual response length from upstream is ~16kb, while i get > u->length printed as 0, Original upstream response length and > myResponseLength printed as 1448 bytes. ?I also see in nginx debug > logs, ?"Transfer-Encoding: chunked". Is the difference in length > printed, because of this encoding? Is there a way to disable chunked > transfer, so that i can get the entire response in one go (into my > string), as shown in code? ?If not, what is the right method to read > the entire response from upstream buffer into a temporary string (so > that i can do further parsing)? > > Thanks, > Ashish From nginx-forum at nginx.us Thu Apr 26 07:23:30 2012 From: nginx-forum at nginx.us (rite2subodh) Date: Thu, 26 Apr 2012 03:23:30 -0400 (EDT) Subject: Unable to start php-fpm Message-ID: <349b4899bb3c8449ab7f5b01e79b637f.NginxMailingListEnglish@forum.nginx.org> Unable to start php-fpm. [root at ip-10-28-197-14 html]# service php-fpm start Starting php-fpm: [ OK ] [26-Apr-2012 07:22:32] ERROR: [pool www] cannot get uid for user 'apache' [26-Apr-2012 07:22:32] ERROR: FPM initialization failed Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225788,225788#msg-225788 From nginx-forum at nginx.us Thu Apr 26 07:24:09 2012 From: nginx-forum at nginx.us (rite2subodh) Date: Thu, 26 Apr 2012 03:24:09 -0400 (EDT) Subject: Unable to execute PHP file In-Reply-To: <755276156643217b112ea0be8a0d332b.NginxMailingListEnglish@forum.nginx.org> References: <755276156643217b112ea0be8a0d332b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <058dd6e290deb0139976e1cf86d4a406.NginxMailingListEnglish@forum.nginx.org> Unable to start php-fpm. [root at ip-10-28-197-14 html]# service php-fpm start Starting php-fpm: [ OK ] [26-Apr-2012 07:22:32] ERROR: [pool www] cannot get uid for user 'apache' [26-Apr-2012 07:22:32] ERROR: FPM initialization failed Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225734,225789#msg-225789 From rainer at ultra-secure.de Thu Apr 26 07:48:16 2012 From: rainer at ultra-secure.de (Rainer Duffner) Date: Thu, 26 Apr 2012 09:48:16 +0200 Subject: Unable to execute PHP file In-Reply-To: <058dd6e290deb0139976e1cf86d4a406.NginxMailingListEnglish@forum.nginx.org> References: <755276156643217b112ea0be8a0d332b.NginxMailingListEnglish@forum.nginx.org> <058dd6e290deb0139976e1cf86d4a406.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120426094816.73a7aec5@suse2.ip-tech.ch> Am Thu, 26 Apr 2012 03:24:09 -0400 (EDT) schrieb "rite2subodh" : > Unable to start php-fpm. > > [root at ip-10-28-197-14 html]# service php-fpm start > Starting php-fpm: [ OK ] > [26-Apr-2012 07:22:32] ERROR: [pool www] cannot get uid for user > 'apache' > [26-Apr-2012 07:22:32] ERROR: FPM initialization failed > You must start it as a user that exists. And it's actually the wrong mailing-list here. From sammyraul1 at gmail.com Thu Apr 26 08:10:20 2012 From: sammyraul1 at gmail.com (Sammy Raul) Date: Thu, 26 Apr 2012 17:10:20 +0900 Subject: Adding Caching to Custom handler Message-ID: Hi Guys, I wanted to know, if I can use nginx caching techniques in my handler. There is no backend server and I cannot use proxy_pass. I wanted to store contents from some other library. For example: location /cdn { myhandler; proxy_cache my-cache; proxy_cache_valid 200 302 60m; proxy_cache_valid 404 1m; } I think this will not work. Can anyone help me how I can achieve caching in my handler. Thanks, Raul -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Apr 26 09:36:21 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 Apr 2012 13:36:21 +0400 Subject: Does auth_basic changes require a service reload? In-Reply-To: References: Message-ID: <20120426093621.GT31671@mdounin.ru> Hello! On Wed, Apr 25, 2012 at 12:59:50PM -0400, TECK wrote: > Hi, > > I'm wondering if I need to perform a "service nginx restart", if I do > any changes to htpasswd file: > location / { > auth_basic "closed site"; > auth_basic_user_file htpasswd; > } > > I noticed that sometimes it works without reloading the service. The htpasswd file is looked up at runtime, no reload/restart needed after it's change. Maxim Dounin From delta.yeh at gmail.com Thu Apr 26 09:50:40 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Thu, 26 Apr 2012 17:50:40 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? Message-ID: Hi, I did a simple load test for 1.2 and found that 1.2 is slower than 1.1.12 ? client---nginx(1.2/.1.12)----nginx(1.1.12) The tested nginx worked as a reverse proxy before another nginx box which serve static file, upstream keepalive is not enbaled. Same test suite , the only difference is the version of nginx. 1.2.0 is about 30% slower . BR, DeltaY From ne at vbart.ru Thu Apr 26 10:35:36 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 26 Apr 2012 14:35:36 +0400 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: Message-ID: <201204261435.37153.ne@vbart.ru> On Thursday 26 April 2012 13:50:40 Delta Yeh wrote: > Hi, > > I did a simple load test for 1.2 and found that 1.2 is slower than > 1.1.12 ? > > client---nginx(1.2/.1.12)----nginx(1.1.12) > The tested nginx worked as a reverse proxy before another nginx box > which serve static file, upstream keepalive is not enbaled. > > Same test suite , the only difference is the version of nginx. > 1.2.0 is about 30% slower . > Can you provide more details about how you tested it and what test suite you used? Personally, I found that some test suites are actually can perform slower than nginx and produce incorrect results (e.g. disable logging decrease RPS). wbr, Valentin V. Bartenev From brian at akins.org Thu Apr 26 11:21:51 2012 From: brian at akins.org (Brian Akins) Date: Thu, 26 Apr 2012 07:21:51 -0400 Subject: Adding Caching to Custom handler In-Reply-To: References: Message-ID: <4B1E9159-ABD2-4EE3-8F04-18866BCC2670@akins.org> On Apr 26, 2012, at 4:10 AM, Sammy Raul wrote: > > Can anyone help me how I can achieve caching in my handler. > You can add the http file cache stuff to your handler. It's not too hard, but not documented very well. If you can write an nginx handler, then you already have the skills needed. --Brian From tmp at codepedia.eu Thu Apr 26 13:14:06 2012 From: tmp at codepedia.eu (Luke) Date: Thu, 26 Apr 2012 15:14:06 +0200 Subject: Syslog Message-ID: <4F994A1E.7020105@codepedia.eu> Hi all, I'm new here. Since I need my nginx to be integrated with syslog, I looked at the unofficial patches (udpremote and syslog patch). I saw I can have syslog logging with these, but I can not set a custom program identifier per vhost, so that I can easily distinguish in the syslog daemon and make it save the right log in the right file, making syslog manage location(remote/local) and rotation of the logs. Since the patches do not permit that, I think I'm going to write yet another syslog module/patch. So I have a couple of questions: - why weren't the patches/modules merged into the main ngix project? Any criticism on those patches so that I don't make the same mistakes? - Do you think it's better to support syslog in the access_log/error_log directives, just like the patch, or to have a different error_syslog / access_syslog directives? - Do you have any preference in the format of the directive? (ex: "access_syslog host:local6:notice" instead of "syslog_access host local6 notice" etc...) Thank you for any reply in advance, Luke From defan at nginx.com Thu Apr 26 13:16:03 2012 From: defan at nginx.com (Andrey Belov) Date: Thu, 26 Apr 2012 17:16:03 +0400 Subject: stub_status and other data to be displayed. In-Reply-To: References: Message-ID: Hello! On Apr 23, 2012, at 1:22 , Sam Ashmann wrote: > Hello all, > > I made a debug html that displays some debugging information (additional nginx variables)... but Id also prefer to print along with the output produced by stub_status . Is there anyway to do this? > > Something like this doesnt appear to work: > > > location /static-test { > default_type text/html; > stub_status on; > return 200 "test" > } > > it either prints my test, or if I comment it .. it prints the status of nginx. You can use SSI for this. The following commit allows usage of stub_status content handler from "#include virtual=..." SSI directive: http://trac.nginx.org/nginx/changeset/4612/nginx Best regards, Andrey From ne at vbart.ru Thu Apr 26 13:22:24 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 26 Apr 2012 17:22:24 +0400 Subject: Syslog In-Reply-To: <4F994A1E.7020105@codepedia.eu> References: <4F994A1E.7020105@codepedia.eu> Message-ID: <201204261722.24791.ne@vbart.ru> On Thursday 26 April 2012 17:14:06 Luke wrote: [...] > So I have a couple of questions: > - why weren't the patches/modules merged into the main ngix project? Any > criticism on those patches so that I don't make the same mistakes? > http://trac.nginx.org/nginx/ticket/95 wbr, Valentin V. Bartenev From nginx-forum at nginx.us Thu Apr 26 13:23:40 2012 From: nginx-forum at nginx.us (zeux) Date: Thu, 26 Apr 2012 09:23:40 -0400 (EDT) Subject: Load Balancing https with sticky connection In-Reply-To: <91712ab1d5c3cc682913c164f034828d.NginxMailingListEnglish@forum.nginx.org> References: <91712ab1d5c3cc682913c164f034828d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20e4ea0c6710a37605959ed860aeff96.NginxMailingListEnglish@forum.nginx.org> help me...please.... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225682,225813#msg-225813 From antoine.bonavita at gmail.com Thu Apr 26 13:23:53 2012 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Thu, 26 Apr 2012 15:23:53 +0200 Subject: nginx-Range header-proxy cache- potential patch Message-ID: Hello, I'm currently using nginx to serve "small" video files (<2MB) to mobile devices. The way I set it up is as follow: 2 nginx servers reverse proxying with cache 1 upstream server where the files are actually uploaded It's all working fine except that the iPhones seem to have the habit of always doing range requests with range 0-1 first when they are about to play a video. And they really don't like it when they get the full answer. Now, the problem I'm facing is the one described here: http://forum.nginx.org/read.php?2,215141,215141#msg-215141 Which can be summed up as: - If file in cache: range header honored (206, appropriate Cotnent-Length and Content-Range). - If file not in cache: server ignores the range header and sends the full file (200 and Content-Length set to full file size). Now, to the question "Is this intended behavior", Maxim Dounim said "yes" (http://forum.nginx.org/read.php?2,215141,215142#msg-215142) I looked at the code and there is a flag on request : r->allow_ranges. >From what I can tell, it is set to false in most cases, except in the ngx_http_static_module. I would be happy to work on a patch that allows ranges in all cases when the length of the response from upstream is known (ie not when upstream response uses chunked encoding). But before I start working on this I would really appreciate if one of the gurus here could tell me whether I'm opening a Pandora box or not. And what I should be careful with. Thanks a lot, Antoine. -- Looks like I'm resuming my journey in nginx land at last http://www.nginx-discovery.com From nginx-forum at nginx.us Thu Apr 26 13:29:12 2012 From: nginx-forum at nginx.us (charlie) Date: Thu, 26 Apr 2012 09:29:12 -0400 (EDT) Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: "disable_symlinks" do not work with "try_files" directive. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225152,225816#msg-225816 From root at codepedia.eu Thu Apr 26 13:39:58 2012 From: root at codepedia.eu (root at codepedia.eu) Date: Thu, 26 Apr 2012 15:39:58 +0200 Subject: Syslog In-Reply-To: <201204261722.24791.ne@vbart.ru> References: <4F994A1E.7020105@codepedia.eu> <201204261722.24791.ne@vbart.ru> Message-ID: <4F99502E.1000309@codepedia.eu> On 26/04/2012 15:22, Valentin V. Bartenev wrote: > http://trac.nginx.org/nginx/ticket/95 > > wbr, Valentin V. Bartenev I saw that patch, and I understand that syslog(3) does block, but since I need to set one program identifier per vhost, I wouldn't be using syslog(3), but rather reimplementing it (already done, taken a lot from glib, bsd license). Using udp connections would make the call non-blocking, and should be safe enough on localhost. Then again, other solutions can be found, such as having a dedicated thread send the message to syslog, so that logging calls are non-blocking. Or I could write on a fifo buffer/file the messages and have the dedicated thread send the messages to syslog (date is set on the sent message, not at the time the message arrives to syslog, so no problem with that). Luke From mdounin at mdounin.ru Thu Apr 26 14:03:01 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 Apr 2012 18:03:01 +0400 Subject: Syslog In-Reply-To: <4F994A1E.7020105@codepedia.eu> References: <4F994A1E.7020105@codepedia.eu> Message-ID: <20120426140301.GX31671@mdounin.ru> Hello! On Thu, Apr 26, 2012 at 03:14:06PM +0200, Luke wrote: > Hi all, I'm new here. > > Since I need my nginx to be integrated with syslog, I looked at the unofficial > patches (udpremote and syslog patch). > > I saw I can have syslog logging with these, but I can not set a custom program > identifier per vhost, so that I can easily distinguish in the syslog daemon and > make it save the right log in the right file, making syslog manage > location(remote/local) and rotation of the logs. > > > Since the patches do not permit that, I think I'm going to write yet another > syslog module/patch. > > So I have a couple of questions: > - why weren't the patches/modules merged into the main ngix project? Any > criticism on those patches so that I don't make the same mistakes? The main problem with syslog in general is that it's interface blocks, and if syslogd daemon is dead/can't cope with load nginx won't be able to work. Additionally, it's slow/resource consuming. Writing normal files is much faster and more reliable. Given the above, it's highly unlikely that syslog patches of any quality will be accepted. Maxim Dounin From delta.yeh at gmail.com Thu Apr 26 14:07:48 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Thu, 26 Apr 2012 22:07:48 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: <201204261435.37153.ne@vbart.ru> References: <201204261435.37153.ne@vbart.ru> Message-ID: I use jemeter to get a static file and observe the request per second. For nginx 1.2, I observe the result output stuck for a second ,then decrease. After 2 or 3 times of such stuck, the result become stable. ? 2012?4?26? ??6:35?Valentin V. Bartenev ??? > On Thursday 26 April 2012 13:50:40 Delta Yeh wrote: >> Hi, >> >> ? ?I did a simple load test ?for 1.2 and found that 1.2 is slower than >> 1.1.12 ? >> >> ? client---nginx(1.2/.1.12)----nginx(1.1.12) >> ? ?The tested nginx worked as a reverse proxy before another nginx box >> ?which serve static file, ?upstream keepalive is not enbaled. >> >> ? ? Same test suite , the only difference is the version of nginx. >> 1.2.0 is about 30% slower . >> > > Can you provide more details about how you tested it and what test suite you > used? > > Personally, I found that some test suites are actually can perform slower than > nginx and produce incorrect results (e.g. disable logging decrease RPS). > > ?wbr, Valentin V. Bartenev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu Apr 26 14:10:16 2012 From: nginx-forum at nginx.us (TECK) Date: Thu, 26 Apr 2012 10:10:16 -0400 (EDT) Subject: Does auth_basic changes require a service reload? In-Reply-To: <20120426093621.GT31671@mdounin.ru> References: <20120426093621.GT31671@mdounin.ru> Message-ID: <29967e6bf2c0b9fa24f996a8a86c2b38.NginxMailingListEnglish@forum.nginx.org> Sorry to repeat myself Maxim. The file is looked at startup so if I add a new user or edit an existing password, it will not require a service restart? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225777,225825#msg-225825 From mdounin at mdounin.ru Thu Apr 26 14:15:13 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 Apr 2012 18:15:13 +0400 Subject: nginx-Range header-proxy cache- potential patch In-Reply-To: References: Message-ID: <20120426141513.GY31671@mdounin.ru> Hello! On Thu, Apr 26, 2012 at 03:23:53PM +0200, Antoine Bonavita wrote: > Hello, > > I'm currently using nginx to serve "small" video files (<2MB) to > mobile devices. The way I set it up is as follow: > 2 nginx servers reverse proxying with cache > 1 upstream server where the files are actually uploaded > > It's all working fine except that the iPhones seem to have the habit > of always doing range requests with range 0-1 first when they are > about to play a video. And they really don't like it when they get the > full answer. > > Now, the problem I'm facing is the one described here: > http://forum.nginx.org/read.php?2,215141,215141#msg-215141 > > Which can be summed up as: > - If file in cache: range header honored (206, appropriate > Cotnent-Length and Content-Range). > - If file not in cache: server ignores the range header and sends the > full file (200 and Content-Length set to full file size). > > Now, to the question "Is this intended behavior", Maxim Dounim said > "yes" (http://forum.nginx.org/read.php?2,215141,215142#msg-215142) > > I looked at the code and there is a flag on request : r->allow_ranges. > > From what I can tell, it is set to false in most cases, except in the > ngx_http_static_module. I would be happy to work on a patch that > allows ranges in all cases when the length of the response from > upstream is known (ie not when upstream response uses chunked > encoding). > > But before I start working on this I would really appreciate if one of > the gurus here could tell me whether I'm opening a Pandora box or not. > And what I should be careful with. I've recently committed the patch which makes it (almost) safe to just set allow_ranges on proxied replies, see http://trac.nginx.org/nginx/changeset/4468/nginx Remaining issues are with multiple ranges requests (which aren't really used by anyone in real life except Adobe Acrobat). As long as there are no such requests in your environment (or you are using max_ranges 1; anyway), you may try the following patch: # HG changeset patch # Parent 8a7ee0318b175b8d76275c5d34707eb52b276188 Upstream: allow ranges for cacheable replies. diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -3680,10 +3680,9 @@ ngx_http_upstream_copy_allow_ranges(ngx_ #if (NGX_HTTP_CACHE) - if (r->cached) { + if (r->cached || r->upstream->cacheable) { r->allow_ranges = 1; return NGX_OK; - } #endif (it's a bit old, but should apply cleanly) Maxim Dounin From mdounin at mdounin.ru Thu Apr 26 14:26:35 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 Apr 2012 18:26:35 +0400 Subject: Does auth_basic changes require a service reload? In-Reply-To: <29967e6bf2c0b9fa24f996a8a86c2b38.NginxMailingListEnglish@forum.nginx.org> References: <20120426093621.GT31671@mdounin.ru> <29967e6bf2c0b9fa24f996a8a86c2b38.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120426142635.GA31671@mdounin.ru> Hello! On Thu, Apr 26, 2012 at 10:10:16AM -0400, TECK wrote: > Sorry to repeat myself Maxim. The file is looked at startup so if I add > a new user or edit an existing password, it will not require a service > restart? The file is looked at runtime, i.e. when request comes and nginx checks authentication/authorization for a particular request. There is no need to reload/restart nginx if you add users or change passwords of existing users. Maxim Dounin From ne at vbart.ru Thu Apr 26 14:26:55 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 26 Apr 2012 18:26:55 +0400 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261435.37153.ne@vbart.ru> Message-ID: <201204261826.55427.ne@vbart.ru> On Thursday 26 April 2012 18:07:48 Delta Yeh wrote: > I use jemeter to get a static file and observe the request per second. > For nginx 1.2, I observe the result output stuck for a second ,then > decrease. After 2 or 3 times of such stuck, the result become stable. > Can you reproduce it with other benchmarking tools (httperf, siege)? Do you run it on the same host or from several dedicated machines? I assume that you're benchmarking JMeter itself. wbr, Valentin V. Bartenev From tmp at codepedia.eu Thu Apr 26 14:33:33 2012 From: tmp at codepedia.eu (Luke) Date: Thu, 26 Apr 2012 16:33:33 +0200 Subject: Syslog In-Reply-To: <20120426140301.GX31671@mdounin.ru> References: <4F994A1E.7020105@codepedia.eu> <20120426140301.GX31671@mdounin.ru> Message-ID: <4F995CBD.2030201@codepedia.eu> On 26/04/2012 16:03, Maxim Dounin wrote: > Hello! > The main problem with syslog in general is that it's interface > blocks, and if syslogd daemon is dead/can't cope with load nginx > won't be able to work. Additionally, it's slow/resource > consuming. Writing normal files is much faster and more reliable. > > Given the above, it's highly unlikely that syslog patches of any > quality will be accepted. > > Maxim Dounin Thank you for your reply, but as I said, I already have reimplemented syslog(3), and with the aid of a udp or fifo with a thread things can be made completely asynchronous. Or I could use an aio_write() instead of a write() to write to the local syslog socket, although a fifo is more secure for syslog crashes/hangups (which I've never seen, anyway). Anyway, let's assume for a second that I can get file-like performance. The questions that remains are 2: 1- What format do you like more? I'm inclined towards something like "syslog_access ident:facility:priority:host:port:connectiontype" 2- How should I benchmark it all? Luke From mdounin at mdounin.ru Thu Apr 26 14:43:08 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 Apr 2012 18:43:08 +0400 Subject: nginx + FollowSymLinks owner verification In-Reply-To: References: Message-ID: <20120426144308.GC31671@mdounin.ru> Hello! On Thu, Apr 26, 2012 at 09:29:12AM -0400, charlie wrote: > "disable_symlinks" do not work with "try_files" directive. It does. Maxim Dounin From antoine.bonavita at gmail.com Thu Apr 26 14:49:10 2012 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Thu, 26 Apr 2012 16:49:10 +0200 Subject: nginx-Range header-proxy cache- potential patch In-Reply-To: <20120426141513.GY31671@mdounin.ru> References: <20120426141513.GY31671@mdounin.ru> Message-ID: Hello! On Thu, Apr 26, 2012 at 4:15 PM, Maxim Dounin wrote: > Hello! > > On Thu, Apr 26, 2012 at 03:23:53PM +0200, Antoine Bonavita wrote: > >> Hello, >> >> I'm currently using nginx to serve "small" video files (<2MB) to >> mobile devices. The way I set it up is as follow: >> 2 nginx servers reverse proxying with cache >> 1 upstream server where the files are actually uploaded >> >> It's all working fine except that the iPhones seem to have the habit >> of always doing range requests with range 0-1 first when they are >> about to play a video. And they really don't like it when they get the >> full answer. >> >> Now, the problem I'm facing is the one described here: >> http://forum.nginx.org/read.php?2,215141,215141#msg-215141 >> >> Which can be summed up as: >> - If file in cache: range header honored (206, appropriate >> Cotnent-Length and Content-Range). >> - If file not in cache: server ignores the range header and sends the >> full file (200 and Content-Length set to full file size). >> >> Now, to the question "Is this intended behavior", Maxim Dounim said >> "yes" (http://forum.nginx.org/read.php?2,215141,215142#msg-215142) >> >> I looked at the code and there is a flag on request : r->allow_ranges. >> >> From what I can tell, it is set to false in most cases, except in the >> ngx_http_static_module. I would be happy to work on a patch that >> allows ranges in all cases when the length ?of the response from >> upstream is known (ie not when upstream response uses chunked >> encoding). >> >> But before I start working on this I would really appreciate if one of >> the gurus here could tell me whether I'm opening a Pandora box or not. >> And what I should be careful with. > > I've recently committed the patch which makes it (almost) safe to > just set allow_ranges on proxied replies, see > > http://trac.nginx.org/nginx/changeset/4468/nginx > > Remaining issues are with multiple ranges requests (which aren't > really used by anyone in real life except Adobe Acrobat). ?As long > as there are no such requests in your environment (or you are > using max_ranges 1; anyway), you may try the following patch: > > # HG changeset patch > # Parent 8a7ee0318b175b8d76275c5d34707eb52b276188 > Upstream: allow ranges for cacheable replies. > > diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c > --- a/src/http/ngx_http_upstream.c > +++ b/src/http/ngx_http_upstream.c > @@ -3680,10 +3680,9 @@ ngx_http_upstream_copy_allow_ranges(ngx_ > > ?#if (NGX_HTTP_CACHE) > > - ? ?if (r->cached) { > + ? ?if (r->cached || r->upstream->cacheable) { > ? ? ? ? r->allow_ranges = 1; > ? ? ? ? return NGX_OK; > - > ? ? } > > ?#endif > > > (it's a bit old, but should apply cleanly) As usual you rock: it applies cleanly on 1.2.0 and solves my problem. I've been testing on my machine for now. I'll release it to production beginning of next week and let you know. Thanks a lot, A. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From ashishs.dev at gmail.com Thu Apr 26 15:16:54 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Thu, 26 Apr 2012 08:16:54 -0700 Subject: Program hangs when modifying u->buffer while using proxy module to talk to upstream backend In-Reply-To: <20120410121337.GR13466@mdounin.ru> References: <20120410121337.GR13466@mdounin.ru> Message-ID: Hi Maxim, > > It's hard to say anything without seeing the code, but most likely > you fail to set u->length properly. See e.g. memcached module for > a simple example of non-buffered protocol handler. > Is there an example i can follow, for buffered protocol handler? Thanks Ashish On Tue, Apr 10, 2012 at 5:13 AM, Maxim Dounin wrote: > Hello! > > On Mon, Apr 09, 2012 at 07:02:10PM -0700, Ashish S wrote: > >> Hi, >> >> I currently use upstream to talk to a back-end, which sends me some >> response. In my module, i am trying to re-format the plain-text >> upstream backend response, to XML, and I also add some new data to it, >> based on an in-memory lookup within my module. ?What would be the best >> way to do this? > > Unless you are working on custom protocol module, you may want to > use filter module to re-format data instead. > >> In my setup, I am able to parse response from upstream (u->buffer), >> construct a modified string and assign it back to u->buffer, and am I >> setting ?u->headers_in.content_length_n and >> r->headers_out.content_length_n correctly. The issue i face is, every >> *second* request hangs, if i am trying the request through the >> browser. (However, trying through command-line & curl, works >> everytime). And I always see this error message in the logs: "client >> prematurely closed connection, so upstream connection is closed too >> while sending to client, client: 127.0.0.1". ? What am i doing wrong? > > It's hard to say anything without seeing the code, but most likely > you fail to set u->length properly. ?See e.g. memcached module for > a simple example of non-buffered protocol handler. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu Apr 26 16:09:32 2012 From: nginx-forum at nginx.us (stelios) Date: Thu, 26 Apr 2012 12:09:32 -0400 (EDT) Subject: mod_zip and limit_rate Message-ID: Hi, I've setup nginx (1.0.14) with mod_zip (1.1.6) and it runs fine "by itself". The problem is that limit_rate and limit_rate_after directives (in the location where the files are being served from) are not respected. I can download at full throttle while when not using mod_zip they work. Anyone has encountered this issue, any workarounds? Thanks Stelios Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225839,225839#msg-225839 From jerome.m at gmail.com Thu Apr 26 16:54:02 2012 From: jerome.m at gmail.com (J M) Date: Thu, 26 Apr 2012 12:54:02 -0400 Subject: nginx_status Message-ID: hi, is it possible to have an nginx_status per virtual domain? tia, From roman.vasilyev at yousendit.com Thu Apr 26 16:56:50 2012 From: roman.vasilyev at yousendit.com (Roman Vasilyev) Date: Thu, 26 Apr 2012 09:56:50 -0700 Subject: nginx_status In-Reply-To: References: Message-ID: <4F997E52.4090809@yousendit.com> Seems like nginx_status getting info from global variables which shared for all workers. On 04/26/2012 09:54 AM, J M wrote: > hi, > > is it possible to have an nginx_status per virtual domain? > > tia, > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From jeroen.ooms at stat.ucla.edu Fri Apr 27 00:32:46 2012 From: jeroen.ooms at stat.ucla.edu (Jeroen Ooms) Date: Thu, 26 Apr 2012 17:32:46 -0700 Subject: limiting upstream backend connections Message-ID: I am hosting a CPU intensive service and use nginx as a reverse proxy cache / load balancer to my backend(s). Basic config looks like: upstream myservice { server 127.0.0.1:80; server 123.123.123.123:80; } limit_req_zone $binary_remote_addr zone=softlimit:10m rate=1r/s; location /R { proxy_pass http://myservice/R; proxy_cache mycache; proxy_cache_methods POST; proxy_cache_key "$request_uri|$request_body"; limit_req zone=softlimit burst=10; } So I use limit_req to make sure that no single user can do more than 1 req per sec to my service. However, actually more important is that the upstream backend servers are protected against overload. Some of the requests might take 30 or 60 seconds to return. I want to limit the total number of active concurrent connections to the upstream back-end at, say, 10. Requests that hit the cache and never make it to the backend should not be counted towards this. Only active backend connections. I had a look at limit_conn, but it looks like this limits the client connections rather than the back-end connections, is that correct? Thanks for advice, Jeroen From nginx-forum at nginx.us Fri Apr 27 03:42:39 2012 From: nginx-forum at nginx.us (fLoo) Date: Thu, 26 Apr 2012 23:42:39 -0400 (EDT) Subject: PNP4Nagios + NGinX 1.0.15 Config Message-ID: Hello, i'm having a serious problem which i cant solve within 8 hours of debugging. I would like to use pnp4nagios (for icinga) I got it working under the docroot http://1.2.3.4 but i want it to work in http://1.2.3.4/pnp4nagios location / { root /usr/local/pnp4nagios/share; index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^/(.+)$ /index.php?kohana_uri=$1 last; break; } } location ~ \.php$ { root /usr/local/pnp4nagios/share; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } this code works perfectly for the docroot, but i dont get it working in /pnp4nagios any help much appreciated Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225851,225851#msg-225851 From delta.yeh at gmail.com Fri Apr 27 07:12:38 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Fri, 27 Apr 2012 15:12:38 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: <201204261826.55427.ne@vbart.ru> References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> Message-ID: I use loadrunner, and although get the conclusion:1.2.0 is slower than 1.1.12 I observe connect timeout error in loadrunner console, but I didn't see such error in 1.1.12. For 1.2.0 , the rps line dive to very lower every 15-20 seconds, I think it because connect to nginx timeout . I test 1.1.17 , the result is almost the same as 1.1.12. I then test 1.1.19 , the result is like 1.2.0, So what happened between 1.1.17 and 1.1.19 will result the connection timeout every 15-20 seconds? ? 2012?4?26? ??10:26?Valentin V. Bartenev ??? > On Thursday 26 April 2012 18:07:48 Delta Yeh wrote: >> I use jemeter to get a static file ?and observe the request per second. >> For nginx 1.2, I observe the result output stuck for a second ,then >> decrease. After 2 or 3 times of such stuck, the result become stable. >> > > Can you reproduce it with other benchmarking tools (httperf, siege)? > Do you run it on the same host or from several dedicated machines? > > I assume that you're benchmarking JMeter itself. > > ?wbr, Valentin V. Bartenev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From sb at waeme.net Fri Apr 27 08:08:36 2012 From: sb at waeme.net (Sergey Budnevitch) Date: Fri, 27 Apr 2012 12:08:36 +0400 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> Message-ID: On 27.04.2012, at 11:12, Delta Yeh wrote: > I use loadrunner, and although get the conclusion:1.2.0 is slower than 1.1.12 > I observe connect timeout error in loadrunner console, but I didn't see such > error in 1.1.12. > > For 1.2.0 , the rps line dive to very lower every 15-20 seconds, I think > it because connect to nginx timeout . > > I test 1.1.17 , the result is almost the same as 1.1.12. > I then test 1.1.19 , the result is like 1.2.0, > > So what happened between 1.1.17 and 1.1.19 will result the connection > timeout every 15-20 seconds? Could you show your config? And what OS are you using? From delta.yeh at gmail.com Fri Apr 27 08:43:09 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Fri, 27 Apr 2012 16:43:09 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> Message-ID: The loadrunner output of 1.1.19 is attached, there are many connection timeout error reported by loadrunner. My latest test show that 1.1.18 is OK , so changes between 1.1.18 and 1.1.19 make things worse in my test lab. the os is debian squeeze 32bit, the config is : user root root; worker_rlimit_nofile 81920; worker_processes 2; pid /secone/var/run/nginx.pid; error_log /dev/null error; pcre_jit on; events { use epoll; worker_connections 12000; multi_accept on; accept_mutex off; } http { include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; reset_timedout_connection on; ignore_invalid_headers on; underscores_in_headers on; proxy_buffering on; proxy_ignore_client_abort on; proxy_intercept_errors on; client_header_buffer_size 16k; large_client_header_buffers 4 16k; msie_padding off; msie_refresh off; access_log off; upstream upstream_www { server 192.168.2.3:80 max_fails=0 ; server 192.168.2.4:80 max_fails=0 ; server 192.168.2.5:80 max_fails=0 ; server 192.168.2.6:80 max_fails=0 ; } upstream upstream_www2 { server 192.168.2.254:80 max_fails=0 ; } server { listen 192.168.1.1:80 ; server_name _; proxy_set_header Host $http_host; location / { proxy_pass http://upstream_www2; proxy_redirect default; } } server { client_header_timeout 60; client_body_timeout 120; client_max_body_size 100m; client_header_buffer_size 16k; large_client_header_buffers 4 16k; proxy_buffer_size 16k; proxy_buffers 4 16k; listen 192.168.1.1:80 ; server_name www.test.com; ssl off; keepalive_timeout 0; proxy_cache_key $scheme$host$request_uri; location / { proxy_set_header Accept-Encoding identity; proxy_set_header Host $http_host; proxy_next_upstream error timeout http_500 http_502 http_503 http_504; proxy_cache off; proxy_pass http://upstream_www; } } } ? 2012?4?27? ??4:08?Sergey Budnevitch ??? > > On 27.04.2012, at 11:12, Delta Yeh wrote: > >> I use loadrunner, and although get the conclusion:1.2.0 is slower than 1.1.12 >> I observe connect timeout error in loadrunner console, but I didn't see such >> error in 1.1.12. >> >> For 1.2.0 , the rps line dive to very lower every 15-20 seconds, I think >> it because ?connect ?to nginx timeout . >> >> I test 1.1.17 , the result is almost the same as 1.1.12. >> I then test 1.1.19 , the result is ?like 1.2.0, >> >> So what happened between 1.1.17 and 1.1.19 will result the connection >> timeout every 15-20 seconds? > > Could you show your config? And what OS are you using? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-1.1.19.jpg Type: image/jpeg Size: 30524 bytes Desc: not available URL: From delta.yeh at gmail.com Fri Apr 27 10:51:04 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Fri, 27 Apr 2012 18:51:04 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> Message-ID: After revert svn r4577 of 1.2.0 , I get almost the same benchmark result with 1.2.0 and 1.1.17. So it seems r4577 descrease nginx 1.2.0 performance by 30-40%( a lot of connect timeout reported by loadrunner) in my test lab. nginx box OS is debian squeeze 32bit, CPU is intel core2 . ? 2012?4?27? ??4:43?Delta Yeh ??? > The loadrunner output of 1.1.19 is attached, there are many connection > timeout error ?reported by loadrunner. > > ?My latest test show that 1.1.18 is OK , so changes between 1.1.18 and 1.1.19 > make things worse in my test lab. > > ?the os is debian squeeze 32bit, the config is : > > user root root; > worker_rlimit_nofile 81920; > worker_processes 2; > pid /secone/var/run/nginx.pid; > error_log /dev/null error; > pcre_jit on; > events { > ? ? ? ?use epoll; > ? ? ? ?worker_connections 12000; > ? ? ? ?multi_accept on; > ? ? ? ?accept_mutex off; > } > http { > ? ? ? ?include mime.types; > ? ? ? ?default_type application/octet-stream; > ? ? ? ?sendfile on; > ? ? ? ?tcp_nopush on; > ? ? ? ?reset_timedout_connection on; > ? ? ? ?ignore_invalid_headers on; > ? ? ? ?underscores_in_headers on; > ? ? ? ?proxy_buffering on; > ? ? ? ?proxy_ignore_client_abort on; > ? ? ? ?proxy_intercept_errors on; > ? ? ? ?client_header_buffer_size 16k; > ? ? ? ?large_client_header_buffers 4 16k; > ? ? ? ?msie_padding off; > ? ? ? ?msie_refresh off; > ? ? ? ?access_log off; > > ? ? ? ?upstream upstream_www { > ? ? ? ? ? ? ? ?server 192.168.2.3:80 max_fails=0 ; > ? ? ? ? ? ? ? ?server 192.168.2.4:80 max_fails=0 ; > ? ? ? ? ? ? ? ?server 192.168.2.5:80 max_fails=0 ; > ? ? ? ? ? ? ? ?server 192.168.2.6:80 max_fails=0 ; > ? ? ? ?} > ? ? ? ?upstream upstream_www2 { > ? ? ? ? ? ? ? ?server 192.168.2.254:80 max_fails=0 ; > ? ? ? ?} > > ? ? ? ?server { > > ? ? ? ? ? ? ? ?listen 192.168.1.1:80 ; > ? ? ? ? ? ? ? ?server_name _; > ? ? ? ? ? ? ? ?proxy_set_header Host $http_host; > ? ? ? ? ? ? ? ?location / { > ? ? ? ? ? ? ? ? ? ? ? ?proxy_pass http://upstream_www2; > ? ? ? ? ? ? ? ? ? ? ? ?proxy_redirect default; > ? ? ? ? ? ? ? ?} > ? ? ? ?} > > ? ? ? ?server { > > ? ? ? ? ? ? ? ?client_header_timeout 60; > ? ? ? ? ? ? ? ?client_body_timeout 120; > ? ? ? ? ? ? ? ?client_max_body_size 100m; > ? ? ? ? ? ? ? ?client_header_buffer_size 16k; > ? ? ? ? ? ? ? ?large_client_header_buffers 4 16k; > ? ? ? ? ? ? ? ?proxy_buffer_size 16k; > ? ? ? ? ? ? ? ?proxy_buffers 4 16k; > ? ? ? ? ? ? ? ?listen 192.168.1.1:80 ; > ? ? ? ? ? ? ? ?server_name www.test.com; > > ? ? ? ? ? ? ? ?ssl off; > ? ? ? ? ? ? ? ?keepalive_timeout 0; > ? ? ? ? ? ? ? ?proxy_cache_key $scheme$host$request_uri; > > ? ? ? ? ? ? ? ?location / { > ? ? ? ? ? ? ? ? ? ? ? ?proxy_set_header Accept-Encoding identity; > ? ? ? ? ? ? ? ? ? ? ? ?proxy_set_header Host $http_host; > ? ? ? ? ? ? ? ? ? ? ? ?proxy_next_upstream error timeout http_500 http_502 http_503 http_504; > ? ? ? ? ? ? ? ? ? ? ? ?proxy_cache off; > ? ? ? ? ? ? ? ? ? ? ? ?proxy_pass http://upstream_www; > ? ? ? ? ? ? ? ?} > ? ? ? ?} > > } > > ? 2012?4?27? ??4:08?Sergey Budnevitch ??? >> >> On 27.04.2012, at 11:12, Delta Yeh wrote: >> >>> I use loadrunner, and although get the conclusion:1.2.0 is slower than 1.1.12 >>> I observe connect timeout error in loadrunner console, but I didn't see such >>> error in 1.1.12. >>> >>> For 1.2.0 , the rps line dive to very lower every 15-20 seconds, I think >>> it because ?connect ?to nginx timeout . >>> >>> I test 1.1.17 , the result is almost the same as 1.1.12. >>> I then test 1.1.19 , the result is ?like 1.2.0, >>> >>> So what happened between 1.1.17 and 1.1.19 will result the connection >>> timeout every 15-20 seconds? >> >> Could you show your config? And what OS are you using? >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Fri Apr 27 10:57:05 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 27 Apr 2012 14:57:05 +0400 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> Message-ID: <20120427105705.GM31671@mdounin.ru> Hello! On Fri, Apr 27, 2012 at 06:51:04PM +0800, Delta Yeh wrote: > After revert svn r4577 of 1.2.0 , I get almost the same benchmark > result with 1.2.0 and 1.1.17. > > So it seems r4577 descrease nginx 1.2.0 performance by 30-40%( a lot > of connect timeout reported by loadrunner) in my test lab. > > nginx box OS is debian squeeze 32bit, CPU is intel core2 . Which compiler do you use? Which compiler flags used during compilation? Maxim Dounin From delta.yeh at gmail.com Fri Apr 27 11:06:02 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Fri, 27 Apr 2012 19:06:02 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: <20120427105705.GM31671@mdounin.ru> References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> <20120427105705.GM31671@mdounin.ru> Message-ID: Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.3.5 (Debian 4.3.5-4) ./nginx -V nginx version: nginx/2.1.2.0 built by gcc 4.3.5 (Debian 4.3.5-4) TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --pid-path=/var --with-cpu-opt=pentium4 --with-ipv6 --with-pcre=/usr/local/pcre --with-pcre-jit --without-http_autoindex_module --without-http_ssi_module --without-http_referer_module --without-http_userid_module --without-http_empty_gif_module --without-http_limit_req_module --without-http_browser_module --without-http_memcached_module --without-http_charset_module --without-http_split_clients_module --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_sub_module --with-http_geoip_module - ? 2012?4?27? ??6:57?Maxim Dounin ??? > Hello! > > On Fri, Apr 27, 2012 at 06:51:04PM +0800, Delta Yeh wrote: > >> After revert svn r4577 of 1.2.0 , I get almost the same benchmark >> result with 1.2.0 and 1.1.17. >> >> So it seems r4577 descrease nginx 1.2.0 performance by 30-40%( a lot >> of connect timeout reported by loadrunner) in my test lab. >> >> nginx box ?OS is debian squeeze 32bit, CPU is intel core2 . > > Which compiler do you use? ?Which compiler flags used during > compilation? > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Fri Apr 27 12:22:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 27 Apr 2012 16:22:41 +0400 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> <20120427105705.GM31671@mdounin.ru> Message-ID: <20120427122241.GQ31671@mdounin.ru> Hello! On Fri, Apr 27, 2012 at 07:06:02PM +0800, Delta Yeh wrote: > Using built-in specs. > Target: i486-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Debian > 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs > --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr > --enable-shared --enable-multiarch --enable-linker-build-id > --with-system-zlib --libexecdir=/usr/lib --without-included-gettext > --enable-threads=posix --enable-nls > --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 > --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc > --enable-mpfr --enable-targets=all --with-tune=generic > --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu > --target=i486-linux-gnu > Thread model: posix > gcc version 4.3.5 (Debian 4.3.5-4) > > > > > ./nginx -V > nginx version: nginx/2.1.2.0 This doesn't looks like vanilla nginx. Could you please test vanilla one, without any patches? > built by gcc 4.3.5 (Debian 4.3.5-4) > TLS SNI support enabled > configure arguments: --prefix=/usr/local/nginx --pid-path=/var > --with-cpu-opt=pentium4 --with-ipv6 --with-pcre=/usr/local/pcre > --with-pcre-jit --without-http_autoindex_module > --without-http_ssi_module --without-http_referer_module > --without-http_userid_module --without-http_empty_gif_module > --without-http_limit_req_module --without-http_browser_module > --without-http_memcached_module --without-http_charset_module > --without-http_split_clients_module --with-http_stub_status_module > --with-http_ssl_module --with-http_realip_module > --with-http_sub_module --with-http_geoip_module - The output looks truncated (note trailing "-"), is it? In any case, please provide sample of an actual gcc command as used during compilation of nginx object files, it may contain various flags not visible in "nginx -V" output. Maxim Dounin > > > ? 2012?4?27? ??6:57?Maxim Dounin ??? > > Hello! > > > > On Fri, Apr 27, 2012 at 06:51:04PM +0800, Delta Yeh wrote: > > > >> After revert svn r4577 of 1.2.0 , I get almost the same benchmark > >> result with 1.2.0 and 1.1.17. > >> > >> So it seems r4577 descrease nginx 1.2.0 performance by 30-40%( a lot > >> of connect timeout reported by loadrunner) in my test lab. > >> > >> nginx box ?OS is debian squeeze 32bit, CPU is intel core2 . > > > > Which compiler do you use? ?Which compiler flags used during > > compilation? > > > > 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 delta.yeh at gmail.com Fri Apr 27 13:08:45 2012 From: delta.yeh at gmail.com (Delta Yeh) Date: Fri, 27 Apr 2012 21:08:45 +0800 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: <20120427122241.GQ31671@mdounin.ru> References: <201204261435.37153.ne@vbart.ru> <201204261826.55427.ne@vbart.ru> <20120427105705.GM31671@mdounin.ru> <20120427122241.GQ31671@mdounin.ru> Message-ID: ? 2012?4?27? ??8:22?Maxim Dounin ??? > Hello! > > On Fri, Apr 27, 2012 at 07:06:02PM +0800, Delta Yeh wrote: > >> Using built-in specs. >> Target: i486-linux-gnu >> Configured with: ../src/configure -v --with-pkgversion='Debian >> 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs >> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr >> --enable-shared --enable-multiarch --enable-linker-build-id >> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext >> --enable-threads=posix --enable-nls >> --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 >> --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc >> --enable-mpfr --enable-targets=all --with-tune=generic >> --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu >> --target=i486-linux-gnu >> Thread model: posix >> gcc version 4.3.5 (Debian 4.3.5-4) >> >> >> >> >> ./nginx ?-V >> nginx version: nginx/2.1.2.0 > > This doesn't looks like vanilla nginx. ?Could you please test > vanilla one, without any patches? > It's an openresty like nginx bundle ,consist of modules for reverse proxy only. No thirdparty patch applied except the one "proxy_bind support variable". Maxim, I remember it is from you, :) The major 2 in version string means upstream keepalive feaure only . >> built by gcc 4.3.5 (Debian 4.3.5-4) >> TLS SNI support enabled >> configure arguments: --prefix=/usr/local/nginx --pid-path=/var >> --with-cpu-opt=pentium4 --with-ipv6 --with-pcre=/usr/local/pcre >> --with-pcre-jit --without-http_autoindex_module >> --without-http_ssi_module --without-http_referer_module >> --without-http_userid_module --without-http_empty_gif_module >> --without-http_limit_req_module --without-http_browser_module >> --without-http_memcached_module --without-http_charset_module >> --without-http_split_clients_module --with-http_stub_status_module >> --with-http_ssl_module --with-http_realip_module >> --with-http_sub_module --with-http_geoip_module - > > The output looks truncated (note trailing "-"), is it? > > In any case, please provide sample of an actual gcc command as > used during compilation of nginx object files, it may contain > various flags not visible in "nginx -V" output. > The shell script to build nginx is : DEPLOY_TARGET="/home/ngxproxy" INSTALL_DIR="/home/ngxproxy" # tell nginx's build system where to find lua: #export LUA_LIB=/usr/local/lib #export LUA_INC=/usr/local/include #export LUA_LIB=/usr/lib #export LUA_INC=/usr/include/lua5.1 # or tell where to find LuaJIT when you want to use JIT instead export LUAJIT_LIB=$DEPLOY_TARGET/lib export LUAJIT_INC=$DEPLOY_TARGET/include/luajit-2.0 ./configure --prefix=$INSTALL_DIR \ --with-cpu-opt=pentium4 \ --with-ipv6 \ --with-pcre=$DEPLOY_TARGET/pcre \ --with-pcre-jit \ --with-pcre-jit \ --without-http_autoindex_module \ --without-http_ssi_module \ --without-http_referer_module \ --without-http_userid_module \ --without-http_empty_gif_module \ --without-http_limit_req_module \ --without-http_browser_module \ --without-http_memcached_module \ --without-http_charset_module \ --without-http_split_clients_module \ --with-http_stub_status_module \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_sub_module \ --with-http_geoip_module \ --add-module=src/http/modules/ngx_devel_kit \ --add-module=src/http/modules/lua-nginx \ --add-module=src/http/modules/headers_more \ --add-module=src/http/modules/substitute \ --add-module=src/http/modules/ngx_iconv make make install > Maxim Dounin > >> >> >> ? 2012?4?27? ??6:57?Maxim Dounin ??? >> > Hello! >> > >> > On Fri, Apr 27, 2012 at 06:51:04PM +0800, Delta Yeh wrote: >> > >> >> After revert svn r4577 of 1.2.0 , I get almost the same benchmark >> >> result with 1.2.0 and 1.1.17. >> >> >> >> So it seems r4577 descrease nginx 1.2.0 performance by 30-40%( a lot >> >> of connect timeout reported by loadrunner) in my test lab. >> >> >> >> nginx box ?OS is debian squeeze 32bit, CPU is intel core2 . >> > >> > Which compiler do you use? ?Which compiler flags used during >> > compilation? >> > >> > Maxim Dounin >> > >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From weiyue at taobao.com Fri Apr 27 13:18:15 2012 From: weiyue at taobao.com (=?gb2312?B?zsDUvQ==?=) Date: Fri, 27 Apr 2012 21:18:15 +0800 Subject: =?UTF-8?Q?=E7=AD=94=E5=A4=8D=3A_limiting_upstream_backend_connections?= In-Reply-To: References: Message-ID: <8B08B66A4C097F428BF7BCC5B245019B617855F640@CNHZ-EXCMS-04.ali.com> I think this module will fit your demands: https://github.com/cfsego/nginx-limit-upstream Sunny Chen -----????----- ???: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] ?? Jeroen Ooms ????: 2012?4?27? 8:33 ???: nginx at nginx.org ??: limiting upstream backend connections I am hosting a CPU intensive service and use nginx as a reverse proxy cache / load balancer to my backend(s). Basic config looks like: upstream myservice { server 127.0.0.1:80; server 123.123.123.123:80; } limit_req_zone $binary_remote_addr zone=softlimit:10m rate=1r/s; location /R { proxy_pass http://myservice/R; proxy_cache mycache; proxy_cache_methods POST; proxy_cache_key "$request_uri|$request_body"; limit_req zone=softlimit burst=10; } So I use limit_req to make sure that no single user can do more than 1 req per sec to my service. However, actually more important is that the upstream backend servers are protected against overload. Some of the requests might take 30 or 60 seconds to return. I want to limit the total number of active concurrent connections to the upstream back-end at, say, 10. Requests that hit the cache and never make it to the backend should not be counted towards this. Only active backend connections. I had a look at limit_conn, but it looks like this limits the client connections rather than the back-end connections, is that correct? Thanks for advice, Jeroen _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you. ???(??????)?????????????????????????????????????????????????????????????????????? From mdounin at mdounin.ru Fri Apr 27 14:00:42 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 27 Apr 2012 18:00:42 +0400 Subject: nginx 1.2.0 is slower than 1.1.12? In-Reply-To: References: <201204261826.55427.ne@vbart.ru> <20120427105705.GM31671@mdounin.ru> <20120427122241.GQ31671@mdounin.ru> Message-ID: <20120427140041.GS31671@mdounin.ru> Hello! On Fri, Apr 27, 2012 at 09:08:45PM +0800, Delta Yeh wrote: > ? 2012?4?27? ??8:22?Maxim Dounin ??? > > Hello! > > > > On Fri, Apr 27, 2012 at 07:06:02PM +0800, Delta Yeh wrote: > > > >> Using built-in specs. > >> Target: i486-linux-gnu > >> Configured with: ../src/configure -v --with-pkgversion='Debian > >> 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs > >> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr > >> --enable-shared --enable-multiarch --enable-linker-build-id > >> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext > >> --enable-threads=posix --enable-nls > >> --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 > >> --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc > >> --enable-mpfr --enable-targets=all --with-tune=generic > >> --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu > >> --target=i486-linux-gnu > >> Thread model: posix > >> gcc version 4.3.5 (Debian 4.3.5-4) > >> > >> > >> > >> > >> ./nginx ?-V > >> nginx version: nginx/2.1.2.0 > > > > This doesn't looks like vanilla nginx. ?Could you please test > > vanilla one, without any patches? > > > > It's an openresty like nginx bundle ,consist of modules for reverse proxy only. > No thirdparty patch applied except the one "proxy_bind support variable". > Maxim, I remember it is from you, :) > > The major 2 in version string means upstream keepalive feaure only . Again: it's really good idea to test vanilla nginx, without any patches and 3rd party modules, especially when debugging such subtle problems. Even trivial patch might cause unspecified behaviour e.g. if it applied incorrectly due to context code changes. And the similar thing applies to 3rd party modules. > >> built by gcc 4.3.5 (Debian 4.3.5-4) > >> TLS SNI support enabled > >> configure arguments: --prefix=/usr/local/nginx --pid-path=/var > >> --with-cpu-opt=pentium4 --with-ipv6 --with-pcre=/usr/local/pcre > >> --with-pcre-jit --without-http_autoindex_module > >> --without-http_ssi_module --without-http_referer_module > >> --without-http_userid_module --without-http_empty_gif_module > >> --without-http_limit_req_module --without-http_browser_module > >> --without-http_memcached_module --without-http_charset_module > >> --without-http_split_clients_module --with-http_stub_status_module > >> --with-http_ssl_module --with-http_realip_module > >> --with-http_sub_module --with-http_geoip_module - > > > > The output looks truncated (note trailing "-"), is it? > > > > In any case, please provide sample of an actual gcc command as > > used during compilation of nginx object files, it may contain > > various flags not visible in "nginx -V" output. > > > > The shell script to build nginx is : I need a gcc command as shown during "make", like this: gcc -c -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 objs \ -o objs/src/core/nginx.o \ src/core/nginx.c Maxim Dounin From nginx-forum at nginx.us Fri Apr 27 18:29:27 2012 From: nginx-forum at nginx.us (Nullivex) Date: Fri, 27 Apr 2012 14:29:27 -0400 (EDT) Subject: no mp4 trak atoms were found in Message-ID: <44f9f08954470017315ce66556a3c10d.NginxMailingListEnglish@forum.nginx.org> Hey Guys, I am getting a ton of these errors on certain videos. "no mp4 trak atoms were found in" I have tried changing the mp4_max_buffer_size. However, this has not helped me solve the problem. Is there something else I can try to solve this? Version ~# /usr/local/nginx/sbin/nginx -v nginx version: nginx/1.0.15 OS Debian 6 x86_64 (Fully updated) Complete log entry 2012/04/27 11:27:39 [error] 19642#0: *1714719 no mp4 trak atoms were found in "/cache/7b74b8312d200e9db307a4c26c39121f", client: 190.66.16.106, server: _, request: "GET /cache/stream/mp4/7b74b8312d200e9db307a4c26c39121f?start=0&file_type=video/mp4&file_name=047.mp4&file_size=33046909 HTTP/1.1", host: "xxx", referrer: "http://xxx/jwplayer/player.swf" Let me know if there is anything you need. Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225883,225883#msg-225883 From nginx-forum at nginx.us Fri Apr 27 18:51:52 2012 From: nginx-forum at nginx.us (Nullivex) Date: Fri, 27 Apr 2012 14:51:52 -0400 (EDT) Subject: no mp4 trak atoms were found in In-Reply-To: <44f9f08954470017315ce66556a3c10d.NginxMailingListEnglish@forum.nginx.org> References: <44f9f08954470017315ce66556a3c10d.NginxMailingListEnglish@forum.nginx.org> Message-ID: Actually, I did a little more testing it seems this is coming from video files that missed bytes on the upload. I was able to fix this by re-uploading the file. Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225883,225884#msg-225884 From nginx-forum at nginx.us Sat Apr 28 00:12:42 2012 From: nginx-forum at nginx.us (ctrlbrk) Date: Fri, 27 Apr 2012 20:12:42 -0400 (EDT) Subject: Does nginx plan to support spdy? In-Reply-To: References: Message-ID: Firefox 13 (in beta today, scheduled for public release near end of May) will enable SPDY by default. Any update regarding nginx support? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217299,225885#msg-225885 From admin at yqed.com Sat Apr 28 01:47:03 2012 From: admin at yqed.com (Floren Munteanu) Date: Fri, 27 Apr 2012 21:47:03 -0400 Subject: Does nginx plan to support spdy? In-Reply-To: References: Message-ID: http://trac.nginx.org/nginx/ticket/30 On 4/27/2012 8:12 PM, ctrlbrk wrote: > Firefox 13 (in beta today, scheduled for public release near end of May) > will enable SPDY by default. > > Any update regarding nginx support? > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217299,225885#msg-225885 From steve.gray.wipro at sonymusic.com Sat Apr 28 01:59:15 2012 From: steve.gray.wipro at sonymusic.com (Gray, Steve, Wipro) Date: Fri, 27 Apr 2012 21:59:15 -0400 Subject: nginx: [crit] pread() "/opt/nginx" failed (21: Is a directory) Message-ID: Hi, I am using nginx 1.0.15 running on Solaris 10. When I issue my "/opt/nginx/sbin/nginx -s stop" command, I get this error "nginx: [crit] pread() "/opt/nginx" failed (21: Is a directory)". The funny thing is that I can issue "/opt/nginx/sbin/nginx" to start nginx and get no errors. Nginx starts okay. I can also issue "/opt/nginx/sbin/nginx -V or v" and get no errors. The "nginx: [crit] pread() "/opt/nginx" failed (21: Is a directory)" error happens when I issue the command with the "-s stop|reload|quit|reopen" options. My configure argument is --prefix=/opt/nginx. Has anyone seen this or know why this is happening? Let me know if you need any more information from me. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 530 bytes Desc: image001.gif URL: From nginx-forum at nginx.us Sat Apr 28 02:05:09 2012 From: nginx-forum at nginx.us (dbanks) Date: Fri, 27 Apr 2012 22:05:09 -0400 (EDT) Subject: Inconsistent latency to sub_status In-Reply-To: References: Message-ID: I found the issue -- this server handles a mix of SSL and regular traffic. When initially configuring SSL, I used a 4096-bit CSR and did not manage cypher selection carefully. As a result, nginx workers spent a lot of time in OpenSSL, calls unable to service other requests. The ratio of SSL to regular traffic made the ping latency erratic. The fix was straightforward: use a smaller CSR and select server-preferred cyphers that were less computationally intensive. Cheers, Dean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221270,225889#msg-225889 From andrew at nginx.com Sat Apr 28 06:50:44 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Sat, 28 Apr 2012 10:50:44 +0400 Subject: Does nginx plan to support spdy? In-Reply-To: References: Message-ID: <8CB46FEB-3D67-4E93-BACB-161F091D0D9B@nginx.com> On Apr 28, 2012, at 5:47 AM, Floren Munteanu wrote: > http://trac.nginx.org/nginx/ticket/30 Also this http://trac.nginx.org/nginx/roadmap The work's ongoing. > On 4/27/2012 8:12 PM, ctrlbrk wrote: >> Firefox 13 (in beta today, scheduled for public release near end of May) >> will enable SPDY by default. >> >> Any update regarding nginx support? >> >> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217299,225885#msg-225885 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From agentzh at gmail.com Sun Apr 29 03:58:42 2012 From: agentzh at gmail.com (agentzh) Date: Sun, 29 Apr 2012 11:58:42 +0800 Subject: [ANN] ngx_openresty devel version 1.0.15.1 released! In-Reply-To: References: Message-ID: Hi, folks! After more than one month's hacking, I'm happy to announce the new development release of ngx_openresty, 1.0.15.1: ? ?http://openresty.org/#Download Complete change log (compared to 1.0.11.28) can be seen here: ? ?http://openresty.org/#ChangeLog1000015 This is the first ngx_openresty release based on the Nginx 1.0.15 core. (And yeah, we will eventually move onto the 1.2.x stable branch soon!) Special thanks go to all our contributors and users for helping make this happen :) We've started running extensive regression tests in our test cluster based on Amazon EC2. And you can always view the latest test report here: http://qa.openresty.org/ We're still adding more operating systems and more Nginx versions to the list! 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 advantage 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. See OpenResty's web site for more details: ? ?http://openresty.org/ Have fun! -agentzh From siefke_listen at web.de Sun Apr 29 17:31:34 2012 From: siefke_listen at web.de (Silvio Siefke) Date: Sun, 29 Apr 2012 19:31:34 +0200 Subject: HTML as PHP In-Reply-To: <20120418001749.8d31e902.siefke_listen@web.de> References: <20120418001749.8d31e902.siefke_listen@web.de> Message-ID: <20120429193134.06273ca0.siefke_listen@web.de> Hello, when used Nginx with PHP-FPM, should set the follow in your fpm config. security.limit_extensions = .php .html Regards Silvio From dmiller at amfes.com Sun Apr 29 20:06:03 2012 From: dmiller at amfes.com (Daniel L. Miller) Date: Sun, 29 Apr 2012 13:06:03 -0700 Subject: Location - or how to setup sites in subfolders Message-ID: I'm trying to give nginx a try as an alternative to my current server solutions. Named-based virtual hosting SEEMS straightforward enough - but I'm having a devil of a time trying to get subfolder based sites to work. In other words - egroupware.mydomain.com roundcubemail.mydomain.com ldap-account-manager.mydomain.com for some examples, work just fine. But trying to get - www.mydomain.com/egroupware www.mydomain.com/roundcubemail www.mydomain.com/ldap-account-manager to work is an exercise in extreme frustration. I'm sure it doesn't HAVE to be - but Google thus far has let me down in retrieving the information I need. What I've done thus far, for egroupware for example: I have a site file with: server { server_name www.amfeslan.local egroupware.amfeslan.local; root /opt/egroupware; index index.php; client_max_body_size 8M; rewrite ^/egroupware/(.*)$ /$1 last; try_files $uri $uri/ /index.php$args; include global/php.conf; } my global/php.conf has: location ~ \.php$ { # There's gotta be a better way to do this - try and find it. # Since nginx's "best" match is this one - need to do rewrites # here to get subfolders to work. set $php_root $document_root; if ($request_uri ~* /egroupware) { set $php_root /opt/egroupware; } # Zero-day exploit defense. try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name; fastcgi_pass php; } Note that I tried to add the "if" construct in php.conf based on a previous post - and I gotta believe there's a better way to do this. With or without the if construct, the above site works - but only for egroupware. Revising the site file to: server { server_name www.amfeslan.local egroupware.amfeslan.local; root /var/www; index index.html; client_max_body_size 8M; location / { try_files $uri $uri/ /index.php?$args; } location ^~ /egroupware { root /opt/egroupware; index index.php; rewrite ^/egroupware/(.*)$ /$1 last; try_files $uri $uri/ /index.php$args; } include global/php.conf; } Doesn't work right. Can some kind soul help me not only fix this - but get a better understanding of how to build these generic constructs? Based on experience with other servers, I can't believe folder-based controls in nginx can be as difficult as I seem to be making it! -- Daniel From edho at myconan.net Sun Apr 29 20:22:56 2012 From: edho at myconan.net (Edho Arief) Date: Mon, 30 Apr 2012 03:22:56 +0700 Subject: Location - or how to setup sites in subfolders In-Reply-To: References: Message-ID: 2012/4/30 Daniel L. Miller : > Note that I tried to add the "if" construct in php.conf based on a previous > post - and I gotta believe there's a better way to do this. ?With or without > the if construct, the above site works - but only for egroupware. ?Revising > the site file to: > server { > ? ?server_name www.amfeslan.local egroupware.amfeslan.local; > ? ?root /var/www; > ? ?index index.html; > > ? ?client_max_body_size 8M; > > ? ?location / { > ? ? ? try_files $uri $uri/ /index.php?$args; > ? ?} > > ? ?location ^~ /egroupware { > ? ? ? root /opt/egroupware; > ? ? ? index index.php; > ? ? ? rewrite ^/egroupware/(.*)$ /$1 last; > ? ? ? try_files $uri $uri/ /index.php$args; > ? ?} > > ? ?include global/php.conf; > } > > Doesn't work right. ?Can some kind soul help me not only fix this - but get > a better understanding of how to build these generic constructs? ?Based on > experience with other servers, I can't believe folder-based controls in > nginx can be as difficult as I seem to be making it! Put "location ~ \.php$ { }" inside each "location ^~ /appname/ { }" block instead of globally so it looks like this: location ^~ /egroupware/ { # if index.php's path is /opt/egroupware/index.php, # use "root /opt" instead root /opt/egroupware; index index.php; # and remove this rewrite ^/egroupware/(.*)$ /$1 last; # and update this accordingly try_files $uri $uri/ /index.php$args; location ~ \.php($|/) { ... } } Also remember that some applications may need to know that it's running in a subdirectory or it will generate incorrect link (eg. /something.php instead of /app/something.php). From dmiller at amfes.com Sun Apr 29 21:17:29 2012 From: dmiller at amfes.com (Daniel L. Miller) Date: Sun, 29 Apr 2012 14:17:29 -0700 Subject: Location - or how to setup sites in subfolders In-Reply-To: References: <4F9D9F2B.5050605@amfes.com> Message-ID: On 4/29/2012 1:22 PM, Edho Arief wrote: > 2012/4/30 Daniel L. Miller: >> Note that I tried to add the "if" construct in php.conf based on a previous >> post - and I gotta believe there's a better way to do this. With or without >> the if construct, the above site works - but only for egroupware. [..] >> Doesn't work right. Can some kind soul help me not only fix this - but get >> a better understanding of how to build these generic constructs? Based on >> experience with other servers, I can't believe folder-based controls in >> nginx can be as difficult as I seem to be making it! > Put "location ~ \.php$ { }" inside each "location ^~ /appname/ { }" > block instead of globally so it looks like this: > > location ^~ /egroupware/ { > # if index.php's path is /opt/egroupware/index.php, > # use "root /opt" instead > root /opt/egroupware; > index index.php; > # and remove this > rewrite ^/egroupware/(.*)$ /$1 last; > # and update this accordingly > try_files $uri $uri/ /index.php$args; > location ~ \.php($|/) { > ... > } > } > Thank you! - that helped quite a bit. That way of thinking - of including the php handler inside each location, instead of a global php handler, just didn't seem as "elegant" to me - but I can see the power potential. However - I still don't understand WHY it works - specifically, why I need to have "root /opt" instead of "root /opt/egroupware". I'm inferring that the location path is automatically added to the declared root in processing. But if that's the case, then to be able to declare, "location ^~ /lam/", and be able to reach a physical path of "/opt/ldap-account-manager-3.7", I need to add a symlink from the extended path to "/opt/lam". And while I may in fact do so for other reasons - I WOULD like to be able to control exactly what nginx is doing, and better yet - understand the how/why. -- Daniel From nginx-forum at nginx.us Mon Apr 30 08:20:31 2012 From: nginx-forum at nginx.us (springbok) Date: Mon, 30 Apr 2012 04:20:31 -0400 (EDT) Subject: nginx 1.2.0 - lots of 'client prematurely closed connection while reading client request line' errors Message-ID: Hi, I've upgraded to nginx 1.2.0, I'm using passenger 3.0.12 on a Suse SLE 11.1 server. Since upgrading from nginx 1.0.10 I'm getting lots of errors like these: 2012/04/30 18:13:37 [info] 10435#0: *379 client prematurely closed connection while reading client request line, client: xxx.xxx.xxx.xxx, server: localhost There are 6-7 of these generated for almost every request. Any ideas on what is causing these, is there something I need to change or adjust? Thanks, Etienne. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225913,225913#msg-225913 From mdounin at mdounin.ru Mon Apr 30 11:39:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 30 Apr 2012 15:39:03 +0400 Subject: nginx: [crit] pread() "/opt/nginx" failed (21: Is a directory) In-Reply-To: References: Message-ID: <20120430113903.GE31671@mdounin.ru> Hello! On Fri, Apr 27, 2012 at 09:59:15PM -0400, Gray, Steve, Wipro wrote: > > Hi, > I am using nginx 1.0.15 running on Solaris 10. When I issue my > "/opt/nginx/sbin/nginx -s stop" command, I get this error > "nginx: [crit] pread() "/opt/nginx" failed (21: Is a > directory)". The funny thing is that I can issue > "/opt/nginx/sbin/nginx" to start nginx and get no errors. Nginx > starts okay. I can also issue "/opt/nginx/sbin/nginx -V or v" > and get no errors. The "nginx: [crit] pread() "/opt/nginx" > failed (21: Is a directory)" error happens when I issue the > command with the "-s stop|reload|quit|reopen" options. > My configure argument is --prefix=/opt/nginx. Has anyone seen > this or know why this is happening? Let me know if you need any > more information from me. The message suggests you have pid (either in config via http://nginx.org/r/pid or with --pid-path configure argument) set to "/opt/nginx". The fact that nginx starts is actually strange though. Could you please provide "nginx -V" output and full config used? Maxim Dounin From antoine.bonavita at gmail.com Mon Apr 30 16:30:12 2012 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Mon, 30 Apr 2012 18:30:12 +0200 Subject: nginx-Range header-proxy cache- potential patch In-Reply-To: References: <20120426141513.GY31671@mdounin.ru> Message-ID: Hello, Just a quick update as promised: I applied Maxim patch on 1.2.0 and deployed on my production servers today. Everything is smooth and the original problem fixed. Thanks again, Antoine. On Thu, Apr 26, 2012 at 4:49 PM, Antoine Bonavita wrote: > Hello! > > On Thu, Apr 26, 2012 at 4:15 PM, Maxim Dounin wrote: >> Hello! >> >> On Thu, Apr 26, 2012 at 03:23:53PM +0200, Antoine Bonavita wrote: >> >>> Hello, >>> >>> I'm currently using nginx to serve "small" video files (<2MB) to >>> mobile devices. The way I set it up is as follow: >>> 2 nginx servers reverse proxying with cache >>> 1 upstream server where the files are actually uploaded >>> >>> It's all working fine except that the iPhones seem to have the habit >>> of always doing range requests with range 0-1 first when they are >>> about to play a video. And they really don't like it when they get the >>> full answer. >>> >>> Now, the problem I'm facing is the one described here: >>> http://forum.nginx.org/read.php?2,215141,215141#msg-215141 >>> >>> Which can be summed up as: >>> - If file in cache: range header honored (206, appropriate >>> Cotnent-Length and Content-Range). >>> - If file not in cache: server ignores the range header and sends the >>> full file (200 and Content-Length set to full file size). >>> >>> Now, to the question "Is this intended behavior", Maxim Dounim said >>> "yes" (http://forum.nginx.org/read.php?2,215141,215142#msg-215142) >>> >>> I looked at the code and there is a flag on request : r->allow_ranges. >>> >>> From what I can tell, it is set to false in most cases, except in the >>> ngx_http_static_module. I would be happy to work on a patch that >>> allows ranges in all cases when the length ?of the response from >>> upstream is known (ie not when upstream response uses chunked >>> encoding). >>> >>> But before I start working on this I would really appreciate if one of >>> the gurus here could tell me whether I'm opening a Pandora box or not. >>> And what I should be careful with. >> >> I've recently committed the patch which makes it (almost) safe to >> just set allow_ranges on proxied replies, see >> >> http://trac.nginx.org/nginx/changeset/4468/nginx >> >> Remaining issues are with multiple ranges requests (which aren't >> really used by anyone in real life except Adobe Acrobat). ?As long >> as there are no such requests in your environment (or you are >> using max_ranges 1; anyway), you may try the following patch: >> >> # HG changeset patch >> # Parent 8a7ee0318b175b8d76275c5d34707eb52b276188 >> Upstream: allow ranges for cacheable replies. >> >> diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c >> --- a/src/http/ngx_http_upstream.c >> +++ b/src/http/ngx_http_upstream.c >> @@ -3680,10 +3680,9 @@ ngx_http_upstream_copy_allow_ranges(ngx_ >> >> ?#if (NGX_HTTP_CACHE) >> >> - ? ?if (r->cached) { >> + ? ?if (r->cached || r->upstream->cacheable) { >> ? ? ? ? r->allow_ranges = 1; >> ? ? ? ? return NGX_OK; >> - >> ? ? } >> >> ?#endif >> >> >> (it's a bit old, but should apply cleanly) > As usual you rock: it applies cleanly on 1.2.0 and solves my problem. > I've been testing on my machine for now. I'll release it to production > beginning of next week and let you know. > > Thanks a lot, > > A. > >> >> Maxim Dounin >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx From dewanggaba at gmail.com Mon Apr 30 21:24:15 2012 From: dewanggaba at gmail.com (antituhan) Date: Mon, 30 Apr 2012 14:24:15 -0700 (PDT) Subject: Is it possible applied external module from packages? Message-ID: <1335821055357-7515095.post@n2.nabble.com> Hello, I've found WAF Module for NginX called Naxsi http://code.google.com/p/naxsi/ And I've read the manual to compile it, but is it possible to applied/recompile naxsi module to NginX from packages? Reference: how to install naxsi from tarball http://code.google.com/p/naxsi/wiki/Howto#Installing_nginx_+_naxsi ----- [daemon at antituhan.com ~]# -- View this message in context: http://nginx.2469901.n2.nabble.com/Is-it-possible-applied-external-module-from-packages-tp7515095.html Sent from the nginx mailing list archive at Nabble.com. From dewanggaba at gmail.com Mon Apr 30 21:27:08 2012 From: dewanggaba at gmail.com (antituhan) Date: Mon, 30 Apr 2012 14:27:08 -0700 (PDT) Subject: [ASK] Good Directive vs Bad Directives In-Reply-To: <1335281418117-7496293.post@n2.nabble.com> References: <1335281418117-7496293.post@n2.nabble.com> Message-ID: <1335821228308-7515099.post@n2.nabble.com> *bump* ----- [daemon at antituhan.com ~]# -- View this message in context: http://nginx.2469901.n2.nabble.com/ASK-Good-Directive-vs-Bad-Directives-tp7496293p7515099.html Sent from the nginx mailing list archive at Nabble.com.