From nginx at 2xlp.com Sat Jun 1 01:52:56 2013 From: nginx at 2xlp.com (Jonathan Vanasco) Date: Fri, 31 May 2013 21:52:56 -0400 Subject: making supervisord web interface viewable on nginx In-Reply-To: <546111d7a5d9ce0d970462eed5813883.NginxMailingListEnglish@forum.nginx.org> References: <20100810074126.GA20207@megiteam.pl> <546111d7a5d9ce0d970462eed5813883.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3B5528B3-BB3D-43B1-80E9-4566B019F070@2xlp.com> using the inet interface on supervisord was simple ( proxying to port 9001) i wanted to turn that off, avoid tcp and just use the unix socket after a bit of tinkering, this seems to work : proxy_pass http://unix:///tmp/supervisord.sock:; is this correct way to handle this ? From chamithlkml at gmail.com Sat Jun 1 05:12:37 2013 From: chamithlkml at gmail.com (chamith Jayaweera) Date: Sat, 1 Jun 2013 10:42:37 +0530 Subject: Need help on proxy passing Message-ID: I experience an issue on missing some part of the page (Long page) on passing proxy requests. Please help me to solve this. Thank You. My configuration file is as follow. server { root /usr/share/nginx/www; index index.html index.htm; server_name localhost; location / { proxy_pass https://127.0.0.1:3000/; } location /doc { root /var/www; autoindex on; allow 127.0.0.1; deny all; } location /images { root /usr/share; autoindex off; } } server { listen 443 default_server; server_name chamithlkml.com; ssl on; ssl_certificate /etc/nginx/server.crt; ssl_certificate_key /etc/nginx/server.key; ssl_session_cache shared:SSL:10m; ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; location / { proxy_pass https://127.0.0.1:3000/; proxy_set_header Host $host; proxy_redirect http:// https://; } } -- Chamith Jayaweera Software Engineer, Cyber LMJ. Mobile (+94)77 299 9492 -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Sat Jun 1 09:24:33 2013 From: francis at daoine.org (Francis Daly) Date: Sat, 1 Jun 2013 10:24:33 +0100 Subject: [LB]Bad root document set via proxy_pass In-Reply-To: References: Message-ID: <20130601092433.GO27406@craic.sysops.org> On Thu, May 30, 2013 at 12:14:09PM -0400, mafious wrote: Hi there, > Depending of the url, I forward to the proper backend: > location / { > proxy_pass http://_cluster; > } > > But via the proxy, the web page of my application is not correctly render. > The path to load images files is incorrect and point to the default root > document location. I'm not exactly sure what you are reporting. Is it that your application writes links like "/images/image.png" instead of "/myapp/images/image.png"? (In which case: fix your application.) Or is it that your application writes links like "/myapp/images/image.png" and you want the load balancer to serve them from somewhere else? (In which case: fix your load-balancer config.) Or is it something else? The more specific you are with reports like "I do this, I see this, I expect to see this", the more chance that someone will be able to help. Good luck, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Sat Jun 1 15:50:54 2013 From: nginx-forum at nginx.us (natostanco) Date: Sat, 01 Jun 2013 11:50:54 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: <01f9c3ce8385ad75f05d71701c2ecbb5.NginxMailingListEnglish@forum.nginx.org> And is it possible to use different certificates under different subdomains having the same tld? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239732,239747#msg-239747 From contact at jpluscplusm.com Sat Jun 1 16:05:48 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sat, 1 Jun 2013 17:05:48 +0100 Subject: if statement + ssl_certificate? In-Reply-To: <01f9c3ce8385ad75f05d71701c2ecbb5.NginxMailingListEnglish@forum.nginx.org> References: <01f9c3ce8385ad75f05d71701c2ecbb5.NginxMailingListEnglish@forum.nginx.org> Message-ID: You mean like foo.com and bar.com? Of course - just use different server{} blocks with different SSL certificates on different IPs. Jonathan From nginx-forum at nginx.us Sat Jun 1 16:18:20 2013 From: nginx-forum at nginx.us (natostanco) Date: Sat, 01 Jun 2013 12:18:20 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: <8e493586a28267f25273a39d5a6ce07e.NginxMailingListEnglish@forum.nginx.org> No I mean like foo.bar.com and fooz.bar.com where each subdomain is declared under different server blocks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239732,239749#msg-239749 From avi.keinan at gmail.com Sat Jun 1 16:48:32 2013 From: avi.keinan at gmail.com (Avi Keinan) Date: Sat, 1 Jun 2013 19:48:32 +0300 Subject: Nginx SSL for backend server, do I need another server? In-Reply-To: References: Message-ID: Hi, > > I'm going to open a website to deliver huge files over the internet, > I'm planning to provide secure download (SSL) with nginx. > > But I don't know how much the cpu usage the ssl protocol will use, > I already have lots of 2X Xeon(R) CPU E5-2609 servers, with tons of > 7200RPM 3TB Sata in Raid6 to deliver the files, > . > Each server should handle 250 downloads at the same time (each 4 servers > with 1 10Gbit Port, with limit rate to 800K/S), > > My question is very simple: > Do i need another server for each existing server, to work as a frontend > ssl server? > Or if the ssl protocol will not consume so much cpu power? > > Thanks in advance, > Avi. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sat Jun 1 17:10:46 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sat, 1 Jun 2013 18:10:46 +0100 Subject: if statement + ssl_certificate? In-Reply-To: <8e493586a28267f25273a39d5a6ce07e.NginxMailingListEnglish@forum.nginx.org> References: <8e493586a28267f25273a39d5a6ce07e.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 1 June 2013 17:18, natostanco wrote: > No I mean like foo.bar.com and fooz.bar.com where each subdomain is declared > under different server blocks Yes, that's how nginx works. Just use a different server_name and (unless you have a wildcard cert) a different IP for each server{}. Jonathan From nginx-forum at nginx.us Sat Jun 1 17:17:33 2013 From: nginx-forum at nginx.us (natostanco) Date: Sat, 01 Jun 2013 13:17:33 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: I can't use different ips, I tried with the server_names, but the subdomain just keeps using the certificate of the tld ... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239732,239752#msg-239752 From reallfqq-nginx at yahoo.fr Sat Jun 1 17:21:03 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 1 Jun 2013 13:21:03 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: Hello, You might be interested in the following: http://nginx.org/en/docs/http/configuring_https_servers.html#name_based_https_servers --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From reallfqq-nginx at yahoo.fr Sat Jun 1 17:23:03 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 1 Jun 2013 13:23:03 -0400 Subject: fastcgi_read_timeout with PHP backend In-Reply-To: <20130529164627.GF72282@mdounin.ru> References: <20130527101947.GA72282@mdounin.ru> <20130529164627.GF72282@mdounin.ru> Message-ID: Hello, I do not know if my private emails on the matter to Maxim went through. Non-broken resources were included. --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Jun 1 17:32:12 2013 From: nginx-forum at nginx.us (natostanco) Date: Sat, 01 Jun 2013 13:32:12 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: That does not help because following that example I should use: server { listen 443 ssl; server_name www.sub1.example.com; ssl_certificate www.sub1.example.com.crt; ... } server { listen 443 ssl; server_name www.example.org; ssl_certificate www.example.org.crt; ... } But the first server declaration does not apply the different certificate, instead it applies the certificate of the TLD, so I guess either I can't declare a server with server_name equal to a subdomain of an already declared TLD. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239732,239755#msg-239755 From avi.keinan at gmail.com Sat Jun 1 17:50:24 2013 From: avi.keinan at gmail.com (Avi keinan) Date: Sat, 1 Jun 2013 20:50:24 +0300 Subject: Nginx SSL for backend server, do I need another server? In-Reply-To: References: Message-ID: <1DC1C555-C410-45AE-8F17-DCA83F1B6A98@gmail.com> > Hi, >> >> I'm going to open a website to deliver huge files over the internet with nginx, >> I'm planning to provide secure download (SSL) with nginx. >> >> But I don't know how much the cpu usage the ssl protocol will use, >> I already have lots of 2X Xeon(R) CPU E5-2609 servers, with tons of 7200RPM 3TB Sata in Raid6 to deliver the files, >> . >> Each server should handle 250 downloads at the same time (4 servers with 1 10Gbit shared Port, with limit rate to 800K/S), >> >> My question is very simple: >> Do i need another server(xeon 2609) for each existing server, to work as a frontend ssl server? >> Or if the ssl protocol will not consume so much cpu power? >> >> Thanks in advance, >> Avi. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From reallfqq-nginx at yahoo.fr Sat Jun 1 18:58:47 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 1 Jun 2013 14:58:47 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: I read : "With this configuration a browser receives the default server?s certificate, i.e. www.example.com regardless of the requested server name. This is caused by SSL protocol behaviour. The SSL connection is established before the browser sends an HTTP request and nginx does not know the name of the requested server. Therefore, it may only offer the default server?s certificate." Clear enough IMHO... --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sat Jun 1 20:55:35 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sat, 1 Jun 2013 21:55:35 +0100 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: On 1 June 2013 18:32, natostanco wrote: > I guess either I can't > declare a server with server_name equal to a subdomain of an already > declared TLD. That's not the case. Nginx can do this just fine. You're coming up against the age-old SSL virtual hosting problem, which is caused by the server's SSL certificate having to be presented to the client before the Host header is known. This is a problem for all HTTP servers, and is the reason why (for most cases) you need multiple IPs when hosting multiple sites over HTTPS. There are exceptions to this, and your situation happens to be one of these. Google "wildcard SSL certificate" to discover the sort of cert you'd have to buy to take advantage of this. "SNI" is the long-term fix for this, but as client support for it is not yet near ubiquitous, it's probably not applicable to your situation. If you absolutely control all the clients, it can be an option. HTH, Jonathan From nginx-forum at nginx.us Sun Jun 2 01:09:55 2013 From: nginx-forum at nginx.us (justin) Date: Sat, 01 Jun 2013 21:09:55 -0400 Subject: HTTP status code 499 from long running requests Message-ID: <85c6903389aca19a504b7e3ee2b909bd.NginxMailingListEnglish@forum.nginx.org> Hello, I have long running requests upwards of five minutes that are called via ajax (jQuery) (XHR), and hitting a backend PHP script. I am seeing very strange behavior, intermittently calling the script twice, even though in Chrome developers tools I only see a single XHR request in the network pane. I know that it is running twice because in my backend PHP script I write a log to a MySQL database, and I am seeing two entries. I took a look at the nginx access log, and seeing HTTP status code 499, which seems to be: client closed connection before nginx was able to send anything to client. What is the best way to fix this? Is there a config setting in nginx to keep the connection open? Or is the client terminating the request, and then reissuing the request, thus way I am seeing two entries? Thanks for the help with this. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239759,239759#msg-239759 From nginx-forum at nginx.us Sun Jun 2 09:37:10 2013 From: nginx-forum at nginx.us (natostanco) Date: Sun, 02 Jun 2013 05:37:10 -0400 Subject: if statement + ssl_certificate? In-Reply-To: References: Message-ID: <2650f5dd3a015b0cda194c8f25725397.NginxMailingListEnglish@forum.nginx.org> I know I would need a wildcard ssl yet...every application of SNI I have found uses different TLD, and never only different subdomains...anyway I have control over all the clients. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239732,239764#msg-239764 From mdounin at mdounin.ru Sun Jun 2 11:04:24 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 2 Jun 2013 15:04:24 +0400 Subject: HTTP status code 499 from long running requests In-Reply-To: <85c6903389aca19a504b7e3ee2b909bd.NginxMailingListEnglish@forum.nginx.org> References: <85c6903389aca19a504b7e3ee2b909bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130602110424.GK72282@mdounin.ru> Hello! On Sat, Jun 01, 2013 at 09:09:55PM -0400, justin wrote: > Hello, I have long running requests upwards of five minutes that are called > via ajax (jQuery) (XHR), and hitting a backend PHP script. > > I am seeing very strange behavior, intermittently calling the script twice, > even though in Chrome developers tools I only see a single XHR request in > the network pane. I know that it is running twice because in my backend PHP > script I write a log to a MySQL database, and I am seeing two entries. > > I took a look at the nginx access log, and seeing HTTP status code 499, > which seems to be: client closed connection before nginx > was able to send anything to client. > > What is the best way to fix this? Is there a config setting in nginx to keep > the connection open? Or is the client terminating the request, and then > reissuing the request, thus way I am seeing two entries? The 499 code means that _client_ closed connection, and there is more or less nothing you can do from nginx side. You have to either find a way to ask client to wait longer before it gives up, or return something before it gives up. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Sun Jun 2 12:02:43 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 2 Jun 2013 16:02:43 +0400 Subject: Need help on proxy passing In-Reply-To: References: Message-ID: <20130602120243.GM72282@mdounin.ru> Hello! On Sat, Jun 01, 2013 at 10:42:37AM +0530, chamith Jayaweera wrote: > I experience an issue on missing some part of the page (Long page) on > passing proxy requests. Please help me to solve this. Thank You. My > configuration file is as follow. By "missing some part" do you mean the page is truncated? In most cases this is caused by incorrect access rights on proxy_temp_path directory. Try looking into error_log to see if there is anything there. -- Maxim Dounin http://nginx.org/en/donation.html From optimum.dulopin at laposte.net Sun Jun 2 13:33:34 2013 From: optimum.dulopin at laposte.net (optimum.dulopin at laposte.net) Date: Sun, 02 Jun 2013 15:33:34 +0200 Subject: rewrite utf8 : why lower case Message-ID: <431377923.81802.1370180013991.JavaMail.www@wwinf8310> Hi I have some routes that was previously with uppercase for language and now I want lowrcase. here is a route : /Ka/???????????? that should simply become /ka/???????????? in my conf if ($uri ~ ^/K(.+)){ set $bb $1; rewrite ^(.*)$ $scheme://$host/k$bb permanent; } and I cant understand why but /ka/%E1%83%92%E1%83%90%E1%83%9C%E1%83%AA%E1%83%AE%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%94%E1%83%91%E1%83%98/ become /ka/%e1%83%92%e1%83%90%e1%83%9c%e1%83%aa%e1%83%ae%e1%83%90%e1%83%93%e1%83%94%e1%83%91%e1%83%94%e1%83%91%e1%83%98 ie all uppercase letter become lowercase, that cause ? pb with my rails app. does anyone know why nginx do this ? and is it possible to block this ? I can't just uppercase everything as there is some latin letter and my routes are case sensitive thanks Une messagerie gratuite, garantie ? vie et des services en plus, ?a vous tente ? Je cr?e ma bo?te mail www.laposte.net From francis at daoine.org Sun Jun 2 14:07:41 2013 From: francis at daoine.org (Francis Daly) Date: Sun, 2 Jun 2013 15:07:41 +0100 Subject: rewrite utf8 : why lower case In-Reply-To: <431377923.81802.1370180013991.JavaMail.www@wwinf8310> References: <431377923.81802.1370180013991.JavaMail.www@wwinf8310> Message-ID: <20130602140741.GP27406@craic.sysops.org> On Sun, Jun 02, 2013 at 03:33:34PM +0200, optimum.dulopin at laposte.net wrote: Hi there, > I have some routes that was previously with uppercase for language and now I want lowrcase. here is a route : /Ka/???????????? that should simply become /ka/???????????? > > in my conf if ($uri ~ ^/K(.+)){ set $bb $1; rewrite ^(.*)$ $scheme://$host/k$bb permanent; } > > and I cant understand why but /ka/%E1%83%92%E1%83%90%E1%83%9C%E1%83%AA%E1%83%AE%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%94%E1%83%91%E1%83%98/ > > become > > /ka/%e1%83%92%e1%83%90%e1%83%9c%e1%83%aa%e1%83%ae%e1%83%90%e1%83%93%e1%83%94%e1%83%91%e1%83%94%e1%83%91%e1%83%98 > > ie all uppercase letter become lowercase, that cause ? pb with my rails app. > > does anyone know why nginx do this ? and is it possible to block this ? As I understand it: %AA and %aa are exactly equivalent in a url. nginx rewrite has to pick something, and chooses to use lowercase. I don't think there is a config-file way to control this. (AA and aa are different; but the percent encoding is case-insensitive.) You could try patching your nginx to make it choose to use uppercase, but that is unlikely to be very useful going forward. The best I can suggest is that if your rails app handles %AA and %aa differently, that's a bug in your rails app that might be easier for you to fix. > I can't just uppercase everything as there is some latin letter and my routes are case sensitive urls are case-sensitive *after* the %-decoding has happened. Before %-decoding, "%2E", "%2e", and "." are all equivalent, so requests for "/a.png", "/a%2Epng", and "/a%2epn%67" should be handled identically. Can you get your rails app to only consider the after-decoding request "/ka/????????????" for routing? f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Sun Jun 2 22:32:50 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 3 Jun 2013 02:32:50 +0400 Subject: fastcgi_read_timeout with PHP backend In-Reply-To: References: <20130527101947.GA72282@mdounin.ru> <20130529164627.GF72282@mdounin.ru> Message-ID: <20130602223250.GQ72282@mdounin.ru> Hello! On Sat, Jun 01, 2013 at 01:23:03PM -0400, B.R. wrote: > Hello, > > I do not know if my private emails on the matter to Maxim went through. > Non-broken resources were included. Non-broken tcpdump just confirms what was already said based on error log: nothing is seen from php after 18:48:45, and this results in the timeout at 18:50:45. You have to dig into your code. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Mon Jun 3 04:28:16 2013 From: nginx-forum at nginx.us (meltzerj) Date: Mon, 03 Jun 2013 00:28:16 -0400 Subject: Prevent NGINX from rerouting to a backend that was previously down Message-ID: I'm using NGINX's ip_hash directive to ensure that client requests always end up at the same backend server. In the case of a backend server outage, NGINX will reroute to the available server, and since I can listen for a disconnection event on my client application, I can have my client-side application react accordingly. However, when the previously down server comes back up, NGINX will route requests back to the original server. This breaks my application, as I have no way of knowing that this happens from my client-side application. So is there a way for NGINX to send a notification event to my client-side app when it detects that a previously down server is available, or preferably prevent NGINX from exhibiting this behavior? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239781,239781#msg-239781 From rga at abiosis.dk Mon Jun 3 09:31:58 2013 From: rga at abiosis.dk (Rasmus Glud Andersen) Date: Mon, 3 Jun 2013 11:31:58 +0200 Subject: upstream may not have port 80 ; upgrade from 1.2.1 to 1.4.1 Message-ID: <20130603093158.GB67078@mail.abiosis.dk> Hi, After running nginx 1.2.1 with the following configuration, I now get warnings when testing the same configuration under 1.4.1 Any advice on this would be highly appreciated. [error] $ nginx -t -c /tmp/nginx.conf nginx: [warn] upstream "appcluster-secure" may not have port 80 in /tmp/nginx.conf:60 nginx: configuration file /tmp/nginx.conf test failed $ nginx -V nginx version: nginx/1.4.1 TLS SNI support enabled configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_stub_status_module --add-module=/usr/ports/www/nginx/work/nginx-sticky-module-1.1 --with-pcre --add-module=/usr/ports/www/nginx/work/yaoweibin-nginx_tcp_proxy_module-b83e5a6 --with-http_ssl_module [http] Server listen on 192.168.1.227:80 forwards to 192.168.3.224:80 Server listen on 192.168.1.226:80 forwards to 192.168.0.123:80 and 192.168.0.124:80 [tcp] Server listen on 192.168.1.226:443 forwards to 192.168.0.123:443 and 192.168.0.124:443 ---[ nginx.conf ]--- 1 # $Id: nginx.conf,v 1.15 2013/06/03 07:16:28 root Exp $ 2 3 #user nobody; 4 worker_processes 1; 5 6 events { 7 worker_connections 1024; 8 } 9 10 http { 11 proxy_read_timeout 300; 12 13 upstream appcluster { 14 sticky; 15 server 192.168.0.123:80; 16 server 192.168.0.124:80; 17 } 18 19 upstream single_server { 20 sticky; 21 server 192.168.3.244:80; 22 } 23 24 default_type application/octet-stream; 25 sendfile on; 26 keepalive_timeout 65; 27 28 server { 29 listen 192.168.1.227:80; 30 server_name localhost; 31 location / { 32 proxy_pass http://single_server; 33 proxy_set_header Host $host; 34 } 35 error_page 500 502 503 504 /50x.html; 36 location = /50x.html { 37 root /usr/local/www/nginx-dist; 38 } 39 } 40 41 server { 42 listen 192.168.1.226:80; 43 server_name localhost; 44 location / { 45 proxy_pass http://appcluster; 46 proxy_set_header Host $host; 47 } 48 } 49 } 50 51 tcp { 52 upstream appcluster-secure { 53 server 192.168.0.123:443; 54 server 192.168.0.124:443; 55 } 56 server { 57 listen 192.168.1.226:443; 58 server_name _; 59 tcp_nodelay on; 60 proxy_pass appcluster-secure; 61 } 62 } 63 } 64 ---[ EOF ]--- -- Rasmus G. Andersen From mdounin at mdounin.ru Mon Jun 3 11:06:46 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 3 Jun 2013 15:06:46 +0400 Subject: upstream may not have port 80 ; upgrade from 1.2.1 to 1.4.1 In-Reply-To: <20130603093158.GB67078@mail.abiosis.dk> References: <20130603093158.GB67078@mail.abiosis.dk> Message-ID: <20130603110646.GS72282@mdounin.ru> Hello! On Mon, Jun 03, 2013 at 11:31:58AM +0200, Rasmus Glud Andersen wrote: > Hi, > > After running nginx 1.2.1 with the following configuration, I now get warnings when testing the same configuration under 1.4.1 > > Any advice on this would be highly appreciated. > > > [error] > $ nginx -t -c /tmp/nginx.conf > nginx: [warn] upstream "appcluster-secure" may not have port 80 in /tmp/nginx.conf:60 > nginx: configuration file /tmp/nginx.conf test failed > > $ nginx -V > nginx version: nginx/1.4.1 > TLS SNI support enabled > configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_stub_status_module --add-module=/usr/ports/www/nginx/work/nginx-sticky-module-1.1 --with-pcre --add-module=/usr/ports/www/nginx/work/yaoweibin-nginx_tcp_proxy_module-b83e5a6 --with-http_ssl_module You have to upgrade tcp proxy module to a newer version. [...] -- Maxim Dounin http://nginx.org/en/donation.html From iptablez at yahoo.com Mon Jun 3 11:38:54 2013 From: iptablez at yahoo.com (Indo Php) Date: Mon, 3 Jun 2013 04:38:54 -0700 (PDT) Subject: Import Static File into MogileFS Message-ID: <1370259534.12828.YahooMailNeo@web142305.mail.bf1.yahoo.com> hi all i want to ask about importing our existing static files into nginx + mogilefs module is that posibble to add like proxy_store and proxy_pass from http address? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rga at abiosis.dk Mon Jun 3 11:52:44 2013 From: rga at abiosis.dk (Rasmus Glud Andersen) Date: Mon, 3 Jun 2013 13:52:44 +0200 Subject: upstream may not have port 80 ; upgrade from 1.2.1 to 1.4.1 In-Reply-To: <20130603110646.GS72282@mdounin.ru> References: <20130603093158.GB67078@mail.abiosis.dk> <20130603110646.GS72282@mdounin.ru> Message-ID: <20130603115244.GA68745@mail.abiosis.dk> On Mon, Jun 03, 2013 at 03:06:46PM +0400, Maxim Dounin wrote: > > On Mon, Jun 03, 2013 at 11:31:58AM +0200, Rasmus Glud Andersen wrote: > > > After running nginx 1.2.1 with the following configuration, I now get warnings when testing the same configuration under 1.4.1 > > > > [error] > > $ nginx -t -c /tmp/nginx.conf > > nginx: [warn] upstream "appcluster-secure" may not have port 80 in /tmp/nginx.conf:60 > > nginx: configuration file /tmp/nginx.conf test failed > > > > $ nginx -V > > nginx version: nginx/1.4.1 > > TLS SNI support enabled > > configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_stub_status_module --add-module=/usr/ports/www/nginx/work/nginx-sticky-module-1.1 --with-pcre --add-module=/usr/ports/www/nginx/work/yaoweibin-nginx_tcp_proxy_module-b83e5a6 --with-http_ssl_module > > You have to upgrade tcp proxy module to a newer version. > [...] Thank you, solved the problem. -- Rasmus G. Andersen From nginx-forum at nginx.us Mon Jun 3 12:57:21 2013 From: nginx-forum at nginx.us (Belly) Date: Mon, 03 Jun 2013 08:57:21 -0400 Subject: Memory Management ( > 25GB memory usage) Message-ID: Hello nginx! I have one worker-process, which uses over 25GB memory (and doesn't stop to do that). My configuration is... let's say special: So there is nginx, which proxies all requests to the PHP backend and the PHP backend sends a large request back to nginx. I set the fastcgi_buffers very enormous huge to avoid nginx creating temporary files on my disk - which would result in high CPU load. Here is my configuration: (reduced to the problem) worker_processes 1; worker_rlimit_nofile 80000; worker_priority -20; events { worker_connections 10240; multi_accept on; } # ... # fastcgi settings fastcgi_buffers 20480 1k; fastcgi_connect_timeout 30; fastcgi_read_timeout 30; fastcgi_send_timeout 30; fastcgi_keep_conn on; upstream php-backend { server 127.0.0.1:9000; keepalive 10000; } As you can see the buffers are extreme large, to avoid disk buffering. The problem is that nginx doesn't free the buffers. It just eats and eats. I know it's my fault and not nginx' fault. What am I doing wrong? The response of my php backend could be from 1k to 300mb. What is the best setting for my situation? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239795,239795#msg-239795 From shahzaib.cb at gmail.com Mon Jun 3 13:05:23 2013 From: shahzaib.cb at gmail.com (shahzaib shahzaib) Date: Mon, 3 Jun 2013 18:05:23 +0500 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: References: Message-ID: Hello, Please assign worker-processors according to the number of cpus your server have and reduce or comment the values regarding fastcgi buffers and examine the changes after doing it. On Mon, Jun 3, 2013 at 5:57 PM, Belly wrote: > Hello nginx! > > I have one worker-process, which uses over 25GB memory (and doesn't stop to > do that). > My configuration is... let's say special: > > So there is nginx, which proxies all requests to the PHP backend and the > PHP > backend sends a large request back to nginx. I set the fastcgi_buffers very > enormous huge to avoid nginx creating temporary files on my disk - which > would result in high CPU load. > > Here is my configuration: (reduced to the problem) > > worker_processes 1; > worker_rlimit_nofile 80000; > worker_priority -20; > > events { > worker_connections 10240; > multi_accept on; > } > # ... > # fastcgi settings > fastcgi_buffers 20480 1k; > fastcgi_connect_timeout 30; > fastcgi_read_timeout 30; > fastcgi_send_timeout 30; > fastcgi_keep_conn on; > upstream php-backend { > server 127.0.0.1:9000; > keepalive 10000; > } > > > As you can see the buffers are extreme large, to avoid disk buffering. The > problem is that nginx doesn't free the buffers. It just eats and eats. I > know it's my fault and not nginx' fault. What am I doing wrong? > > The response of my php backend could be from 1k to 300mb. > > What is the best setting for my situation? > > Thanks > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,239795,239795#msg-239795 > > _______________________________________________ > 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 Jun 3 13:13:39 2013 From: nginx-forum at nginx.us (Belly) Date: Mon, 03 Jun 2013 09:13:39 -0400 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: References: Message-ID: <7e1ac1476138e1d6d1a09ccdb1c21f0a.NginxMailingListEnglish@forum.nginx.org> Thanks for your reply! I don't have performance issues. It's just the memory usage. I don't know how nginx handles its memory, but if I increase the number of worker processes wouldn't this lead into much higher memory usage (worker_process*25GB) ? The one worker is able to handle all requests, I don't see the point of adding more workers. I want to know why nginx does not free the buffers after a request is finished. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239795,239797#msg-239797 From mdounin at mdounin.ru Mon Jun 3 13:51:04 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 3 Jun 2013 17:51:04 +0400 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: References: Message-ID: <20130603135104.GW72282@mdounin.ru> Hello! On Mon, Jun 03, 2013 at 08:57:21AM -0400, Belly wrote: > Hello nginx! > > I have one worker-process, which uses over 25GB memory (and doesn't stop to > do that). > My configuration is... let's say special: > > So there is nginx, which proxies all requests to the PHP backend and the PHP > backend sends a large request back to nginx. I set the fastcgi_buffers very > enormous huge to avoid nginx creating temporary files on my disk - which > would result in high CPU load. > > Here is my configuration: (reduced to the problem) > > worker_processes 1; > worker_rlimit_nofile 80000; > worker_priority -20; > > events { > worker_connections 10240; > multi_accept on; > } > # ... > # fastcgi settings > fastcgi_buffers 20480 1k; Just a side note: each buffer structure takes about 100 bytes of memory on 64-bit platforms, and using 1k buffers results in about 10% overhead just because of this. > fastcgi_connect_timeout 30; > fastcgi_read_timeout 30; > fastcgi_send_timeout 30; > fastcgi_keep_conn on; > upstream php-backend { > server 127.0.0.1:9000; > keepalive 10000; > } > > > As you can see the buffers are extreme large, to avoid disk buffering. The > problem is that nginx doesn't free the buffers. It just eats and eats. I > know it's my fault and not nginx' fault. What am I doing wrong? > > The response of my php backend could be from 1k to 300mb. With your settings each connection can allocate up to 20M of buffers. That is, 1500k connections are enough to allocate 25G of memory. So the basic question is - how many connections are open? With pessimistic assumption of 10k connections as per worker_connections, you configuration will result in more than 200G memory used. > What is the best setting for my situation? I would recommend using "fastcgi_max_temp_file_size 0;" if you want to disable disk buffering (see [1]), and configuring some reasonable number of reasonably sized fastcgi_buffers. I would recommend starting tuning with something like 32 x 64k buffers. [1] http://nginx.org/r/fastcgi_max_temp_file_size -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Mon Jun 3 14:13:03 2013 From: nginx-forum at nginx.us (Belly) Date: Mon, 03 Jun 2013 10:13:03 -0400 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: <20130603135104.GW72282@mdounin.ru> References: <20130603135104.GW72282@mdounin.ru> Message-ID: <10fd19b439227d55c7a3200dad891df6.NginxMailingListEnglish@forum.nginx.org> Thanks Maxim for you answer! Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Mon, Jun 03, 2013 at 08:57:21AM -0400, Belly wrote: > > > Hello nginx! > > > > I have one worker-process, which uses over 25GB memory (and doesn't > stop to > > do that). > > My configuration is... let's say special: > > > > So there is nginx, which proxies all requests to the PHP backend and > the PHP > > backend sends a large request back to nginx. I set the > fastcgi_buffers very > > enormous huge to avoid nginx creating temporary files on my disk - > which > > would result in high CPU load. > > > > Here is my configuration: (reduced to the problem) > > > > worker_processes 1; > > worker_rlimit_nofile 80000; > > worker_priority -20; > > > > events { > > worker_connections 10240; > > multi_accept on; > > } > > # ... > > # fastcgi settings > > fastcgi_buffers 20480 1k; > > Just a side note: each buffer structure takes about 100 bytes of > memory on 64-bit platforms, and using 1k buffers results in about > 10% overhead just because of this. > Very interesting! - Didn't know that... Thanks! > > fastcgi_connect_timeout 30; > > fastcgi_read_timeout 30; > > fastcgi_send_timeout 30; > > fastcgi_keep_conn on; > > upstream php-backend { > > server 127.0.0.1:9000; > > keepalive 10000; > > } > > > > > > As you can see the buffers are extreme large, to avoid disk > buffering. The > > problem is that nginx doesn't free the buffers. It just eats and > eats. I > > know it's my fault and not nginx' fault. What am I doing wrong? > > > > The response of my php backend could be from 1k to 300mb. > > With your settings each connection can allocate up to 20M of > buffers. That is, 1500k connections are enough to allocate 25G of > memory. So the basic question is - how many connections are open? > 1000 - 2000... got your point. > With pessimistic assumption of 10k connections as per > worker_connections, you configuration will result in more than > 200G memory used. > > > What is the best setting for my situation? > > I would recommend using "fastcgi_max_temp_file_size 0;" if you > want to disable disk buffering (see [1]), and configuring some > reasonable number of reasonably sized fastcgi_buffers. I would > recommend starting tuning with something like 32 x 64k buffers. > > [1] http://nginx.org/r/fastcgi_max_temp_file_size > I read about fastcgi_max_temp_file_size, but I'm a bit afraid of. fastcgi_max_temp_file_size 0; states that data will be transfered synchronously. What does it mean exactly? Is it faster/better than disk buffering? Nginx is built in an asynchronous way. What happens if a worker will do a synchronous job inside an asynchronous one? Will it block the event loop? > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > 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,239795,239801#msg-239801 From mdounin at mdounin.ru Mon Jun 3 15:13:20 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 3 Jun 2013 19:13:20 +0400 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: <10fd19b439227d55c7a3200dad891df6.NginxMailingListEnglish@forum.nginx.org> References: <20130603135104.GW72282@mdounin.ru> <10fd19b439227d55c7a3200dad891df6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130603151320.GZ72282@mdounin.ru> Hello! On Mon, Jun 03, 2013 at 10:13:03AM -0400, Belly wrote: > Thanks Maxim for you answer! > > Maxim Dounin Wrote: > ------------------------------------------------------- > > Hello! > > > > On Mon, Jun 03, 2013 at 08:57:21AM -0400, Belly wrote: > > > > > Hello nginx! > > > > > > I have one worker-process, which uses over 25GB memory (and doesn't > > stop to > > > do that). > > > My configuration is... let's say special: > > > > > > So there is nginx, which proxies all requests to the PHP backend and > > the PHP > > > backend sends a large request back to nginx. I set the > > fastcgi_buffers very > > > enormous huge to avoid nginx creating temporary files on my disk - > > which > > > would result in high CPU load. > > > > > > Here is my configuration: (reduced to the problem) > > > > > > worker_processes 1; > > > worker_rlimit_nofile 80000; > > > worker_priority -20; > > > > > > events { > > > worker_connections 10240; > > > multi_accept on; > > > } > > > # ... > > > # fastcgi settings > > > fastcgi_buffers 20480 1k; > > > > Just a side note: each buffer structure takes about 100 bytes of > > memory on 64-bit platforms, and using 1k buffers results in about > > 10% overhead just because of this. > > > > Very interesting! - Didn't know that... Thanks! > > > > fastcgi_connect_timeout 30; > > > fastcgi_read_timeout 30; > > > fastcgi_send_timeout 30; > > > fastcgi_keep_conn on; > > > upstream php-backend { > > > server 127.0.0.1:9000; > > > keepalive 10000; > > > } > > > > > > > > > As you can see the buffers are extreme large, to avoid disk > > buffering. The > > > problem is that nginx doesn't free the buffers. It just eats and > > eats. I > > > know it's my fault and not nginx' fault. What am I doing wrong? > > > > > > The response of my php backend could be from 1k to 300mb. > > > > With your settings each connection can allocate up to 20M of > > buffers. That is, 1500k connections are enough to allocate 25G of > > memory. So the basic question is - how many connections are open? > > > > 1000 - 2000... got your point. > > > With pessimistic assumption of 10k connections as per > > worker_connections, you configuration will result in more than > > 200G memory used. > > > > > What is the best setting for my situation? > > > > I would recommend using "fastcgi_max_temp_file_size 0;" if you > > want to disable disk buffering (see [1]), and configuring some > > reasonable number of reasonably sized fastcgi_buffers. I would > > recommend starting tuning with something like 32 x 64k buffers. > > > > [1] http://nginx.org/r/fastcgi_max_temp_file_size > > > > I read about fastcgi_max_temp_file_size, but I'm a bit afraid of. > fastcgi_max_temp_file_size 0; states that data will be transfered > synchronously. What does it mean exactly? Is it faster/better than disk > buffering? Nginx is built in an asynchronous way. What happens if a worker > will do a synchronous job inside an asynchronous one? Will it block the > event loop? Docs ask linked document the effect as follows: : Value of zero disables buffering of responses to temporary files. This is what it actually does - it stops nginx from using disk buffering. Instead, if fastcgi_buffers configured isn't enough, nginx will wait for some buffers to be sent to a client before reading more data from a backend. Note this means the backend will be busy sending the response for a longer time. -- Maxim Dounin http://nginx.org/en/donation.html From nginx at 2xlp.com Mon Jun 3 15:17:31 2013 From: nginx at 2xlp.com (Jonathan Vanasco) Date: Mon, 3 Jun 2013 11:17:31 -0400 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: <10fd19b439227d55c7a3200dad891df6.NginxMailingListEnglish@forum.nginx.org> References: <20130603135104.GW72282@mdounin.ru> <10fd19b439227d55c7a3200dad891df6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <09DF61EF-4118-4943-924D-0CD706875994@2xlp.com> On Jun 3, 2013, at 10:13 AM, Belly wrote: >>> What is the best setting for my situation? >> >> I would recommend using "fastcgi_max_temp_file_size 0;" if you >> want to disable disk buffering (see [1]), and configuring some >> reasonable number of reasonably sized fastcgi_buffers. I would >> recommend starting tuning with something like 32 x 64k buffers. >> >> [1] http://nginx.org/r/fastcgi_max_temp_file_size >> > > I read about fastcgi_max_temp_file_size, but I'm a bit afraid of. > fastcgi_max_temp_file_size 0; states that data will be transfered > synchronously. What does it mean exactly? Is it faster/better than disk > buffering? Nginx is built in an asynchronous way. What happens if a worker > will do a synchronous job inside an asynchronous one? Will it block the > event loop? It's always been my understanding that in this context, "synchronously" means that nginx is proxying the data from php/fcgi to the client in real time. This sounds like a typical problem of application load balancing. The disk buffering / temp files allows for nginx to immediately "slurp" the entire response from the backend process, and then serves the files to the downstream client. This has the advantage of allowing you to immediately re-use the fcgi process for dynamic content ? slow or hangup connections downstream won't tie up your pool of fcgi/apache processes. restated with blocking - the temp files allow for blocking within nginx instead of php ( nginx can handle 10k connections, php is limited to the number of processes ). by removing the tempfiles, blocking will happen within php instead. my advice would be to use URL partitioning to segment this type of behavior. I would only allow specific URLs to have no tmp files , and I would proxy them back to a different pool of fcgi (or apache) servers running with a tweaked config. this would allow the blocking activity from the routes serving large files to not affect the "global" pool of php processes. i would also look into periodic reloads of nginx, to see if that frees things up. if so, that might be a simpler/more elegant solution. I encountered problems like this about 10years ago with mod_perl under apache. The aggressive code optimizations and memory/process management were tailored to making the application work very well ? but did not play nice with the rest of the box. The fix was to keep a low number of max_requests , and move to a "vanilla + mod_perl apache" system. Years later, nginx became the vanilla apache. similar issues like this happen to people in the python and ruby communities as well ? more expensive or intensive routes are often sectioned off and dispatched to a different pool of servers , so their workload doesn't affect the rest of requests. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldernetwork at gmail.com Mon Jun 3 22:24:52 2013 From: aldernetwork at gmail.com (Alder Network) Date: Mon, 3 Jun 2013 15:24:52 -0700 Subject: Need help: websocket proxy stops working after a while Message-ID: I got nginx websocket proxy working but the socket would close in a minute or so. So I add proxy_read_timeout 180s; and it works within 3 minutes but closed the websocket after 3 minutes, but it works OK before that. Why is that? BTW, I am using Nginx 1.4 now. Thanks, - Alder -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Jun 3 23:07:50 2013 From: nginx-forum at nginx.us (kgoess) Date: Mon, 03 Jun 2013 19:07:50 -0400 Subject: HTTP status codes missing description in header for proxy_pass Message-ID: We're using nginx as a middle layer in front of our application server (mod_perl). When mod_perl returns an error page, the HTTP status line is missing the "reason phrase" after the status code, like "Not Found", e.g. HTTP/1.1 404 Server: nginx/1.2.1 ...etc should be HTTP/1.1 404 Not Found ...etc... AFAICT, the HTTP spec requires at least a space after the status code: --------------------------------------------- http://www.w3.org/Protocols/rfc1945/rfc1945 The first line of a Full-Response message is the Status-Line, consisting of the protocol version followed by a numeric status code and its associated textual phrase, with each element separated by SP characters. No CR or LF is allowed except in the final CRLF sequence. Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF Since a status line always begins with the protocol version and status code "HTTP/" 1*DIGIT "." 1*DIGIT SP 3DIGIT SP (e.g., "HTTP/1.0 200 "), --------------------------------------------- Reason-Phrase = * --------------------------------------------- The reason we noticed is that putting Perlbal in front of nginx got the status rejected, since Perlbal is written to strictly follow the spec: ------------------------------------------------ return fail("Bogus response line") unless $self->{responseLine} =~ m!^HTTP\/(\d+)\.(\d+)\s+(\d+)(?:\s+(.*))$!; ------------------------------------------------ Is this a bug in nginx, or a configuration issue that we can fix? The patch to Perlbal is simple enough, is it worth looking for a patch to nginx? Or did we miss something else entirely? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239811,239811#msg-239811 From luky-37 at hotmail.com Mon Jun 3 23:19:49 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Tue, 4 Jun 2013 01:19:49 +0200 Subject: HTTP status codes missing description in header for proxy_pass In-Reply-To: References: Message-ID: Hi, nginx does its job correctly: ?? $ curl -I http://nginx.org/404 ?? $ HTTP/1.1 404 Not Found ?? $ [...] I guess the irregular response comes from your mod_perl backend? Did you check that out? Capturing nginx's debug output of such a request will probably help. http://nginx.org/en/docs/debugging_log.html Regards, Lukas From info at pkern.at Mon Jun 3 23:53:44 2013 From: info at pkern.at (Patrik Kernstock) Date: Tue, 4 Jun 2013 01:53:44 +0200 Subject: WBB ACP HTTPS Rewrite rule Message-ID: <056701ce60b5$99034b00$cb09e100$@pkern.at> Hello, I'm trying since about half an hour to get SSL-only on the administration panel of Woltlab burning board working, but without success. The rule will just be ignored. What I currently have: location /acp/(.*)$ { if ($server_port = 80) { rewrite ^/(.*)$ https://forum/acp/$1 redirect; } } Thanks for any help! :) Kind regards, Patrik Kernstock From appa at perusio.net Tue Jun 4 00:02:11 2013 From: appa at perusio.net (=?ISO-8859-1?Q?Ant=F3nio_P=2E_P=2E_Almeida?=) Date: Tue, 4 Jun 2013 02:02:11 +0200 Subject: WBB ACP HTTPS Rewrite rule In-Reply-To: <056701ce60b5$99034b00$cb09e100$@pkern.at> References: <056701ce60b5$99034b00$cb09e100$@pkern.at> Message-ID: Try: server { server_name forum; ... location ^~ /acp/ { return 301 https://forum$request_uri; } } server { server_name forum; listen 443 ssl; .... location / { return 301 http://forum$request_uri; } location ^~ /acp/ { ... } } ----appa On Tue, Jun 4, 2013 at 1:53 AM, Patrik Kernstock wrote: > Hello, > > I'm trying since about half an hour to get SSL-only on the administration > panel of Woltlab burning board working, but without success. The rule will > just be ignored. > > What I currently have: > location /acp/(.*)$ { > if ($server_port = 80) { > rewrite ^/(.*)$ https://forum/acp/$1 redirect; > } > } > > Thanks for any help! :) > > Kind regards, > Patrik Kernstock > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at pkern.at Tue Jun 4 00:38:04 2013 From: info at pkern.at (Patrik Kernstock) Date: Tue, 4 Jun 2013 02:38:04 +0200 Subject: AW: WBB ACP HTTPS Rewrite rule In-Reply-To: References: <056701ce60b5$99034b00$cb09e100$@pkern.at> Message-ID: <057a01ce60bb$cad0b770$60722650$@pkern.at> Thanks for your fast reply, Antonio! I forgot to say, that I try to only enable SSL on ACP on not for the rest of the forum :) Von: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] Im Auftrag von Ant?nio P. P. Almeida Gesendet: Dienstag, 04. Juni 2013 02:02 An: nginx Betreff: Re: WBB ACP HTTPS Rewrite rule Try: server { ? ? ?server_name forum; ?? ? ? ... ? ? ?location ^~ /acp/ { ? ? ? ? ?return 301 https://forum$request_uri; ? ? ?} } server { ? ? ?server_name forum; ?? ? ? ?listen 443 ssl; ? ? .... ? ? location / { ? ? ? ? return 301 http://forum$request_uri; ? ? } ? ? ?location ^~ /acp/ { ? ? ? ? ?... ? ? ?} } From the.energetic at gmail.com Tue Jun 4 03:17:54 2013 From: the.energetic at gmail.com (Travis Maxwell) Date: Mon, 3 Jun 2013 23:17:54 -0400 Subject: Nginx permission denied for tmp directory (with correct user) Message-ID: <7758B7AE-5F66-4946-83C5-F2A2E28423A4@gmail.com> Whenever I submit a long post from within wordpress, I get the following error: 2013/06/04 03:04:19 [crit] 12248#0: *491 open() "/var/lib/nginx/tmp/client_body/0000000008" failed (13: Permission denied) It works fine if the post isn't that long, but submitting a long one throws a 500 error on the front end, and this in my error log file :/ I tried googling and nothing is much help, other than to change the user or something Right now I already have... /var/lib/nginx/tmp/client_body owned by www:www (nginx) and set to 700 permissions -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at greengecko.co.nz Tue Jun 4 03:46:05 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Tue, 04 Jun 2013 15:46:05 +1200 Subject: Nginx permission denied for tmp directory (with correct user) In-Reply-To: <7758B7AE-5F66-4946-83C5-F2A2E28423A4@gmail.com> References: <7758B7AE-5F66-4946-83C5-F2A2E28423A4@gmail.com> Message-ID: <1370317565.29037.189.camel@steve-new> On Mon, 2013-06-03 at 23:17 -0400, Travis Maxwell wrote: > Whenever I submit a long post from within wordpress, I get the > following error: > > 2013/06/04 03:04:19 [crit] 12248#0: *491 open() "/var/lib/nginx/tmp/client_body/0000000008" failed (13: Permission denied) > It works fine if the post isn't that long, but submitting a long one > throws a 500 error on the front end, and this in my error log file :/ > > I tried googling and nothing is much help, other than to change the > user or something > > Right now I already have... > > /var/lib/nginx/tmp/client_body owned by www:www (nginx) and set to 700 > permissions This is usually caused by user www not having read/execute ( well, technically just execute but that's a bit of a pain to use ) access to one of the parent directories. I expect the file is only used when temp storage is needed for the fastcgi php access, so it may be worth increasing those resources too. hth, Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From the.energetic at gmail.com Tue Jun 4 03:58:20 2013 From: the.energetic at gmail.com (Travis Maxwell) Date: Mon, 3 Jun 2013 23:58:20 -0400 Subject: Nginx permission denied for tmp directory (with correct user) In-Reply-To: <1370317565.29037.189.camel@steve-new> References: <7758B7AE-5F66-4946-83C5-F2A2E28423A4@gmail.com> <1370317565.29037.189.camel@steve-new> Message-ID: Thanks! that worked :) I didn't think about parent directories On Jun 3, 2013, at 11:46 PM, Steve Holdoway wrote: > On Mon, 2013-06-03 at 23:17 -0400, Travis Maxwell wrote: >> Whenever I submit a long post from within wordpress, I get the >> following error: >> >> 2013/06/04 03:04:19 [crit] 12248#0: *491 open() "/var/lib/nginx/tmp/client_body/0000000008" failed (13: Permission denied) >> It works fine if the post isn't that long, but submitting a long one >> throws a 500 error on the front end, and this in my error log file :/ >> >> I tried googling and nothing is much help, other than to change the >> user or something >> >> Right now I already have... >> >> /var/lib/nginx/tmp/client_body owned by www:www (nginx) and set to 700 >> permissions > This is usually caused by user www not having read/execute ( well, > technically just execute but that's a bit of a pain to use ) access to > one of the parent directories. > > I expect the file is only used when temp storage is needed for the > fastcgi php access, so it may be worth increasing those resources too. > > hth, > > Steve > > -- > Steve Holdoway BSc(Hons) MNZCS > http://www.greengecko.co.nz > Linkedin: http://www.linkedin.com/in/steveholdoway > Skype: sholdowa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Jun 4 04:52:03 2013 From: nginx-forum at nginx.us (justin) Date: Tue, 04 Jun 2013 00:52:03 -0400 Subject: HTTP status code 499 from long running requests In-Reply-To: <20130602110424.GK72282@mdounin.ru> References: <20130602110424.GK72282@mdounin.ru> Message-ID: <1e4fd0823496bde4d9bab012f84b5827.NginxMailingListEnglish@forum.nginx.org> Maxim, Does it seem reasonable that the 499 status codes are responsible for double requests? I.E. do you think the client is resending the request after the 499 status? Maxim Dounin Wrote: ------------------------------------------------------- > Hello! > > On Sat, Jun 01, 2013 at 09:09:55PM -0400, justin wrote: > > > Hello, I have long running requests upwards of five minutes that are > called > > via ajax (jQuery) (XHR), and hitting a backend PHP script. > > > > I am seeing very strange behavior, intermittently calling the script > twice, > > even though in Chrome developers tools I only see a single XHR > request in > > the network pane. I know that it is running twice because in my > backend PHP > > script I write a log to a MySQL database, and I am seeing two > entries. > > > > I took a look at the nginx access log, and seeing HTTP status code > 499, > > which seems to be: client closed connection before nginx > > was able to send anything to client. > > > > What is the best way to fix this? Is there a config setting in nginx > to keep > > the connection open? Or is the client terminating the request, and > then > > reissuing the request, thus way I am seeing two entries? > > The 499 code means that _client_ closed connection, and there is > more or less nothing you can do from nginx side. You have to > either find a way to ask client to wait longer before it gives up, > or return something before it gives up. > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > 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,239759,239819#msg-239819 From nginx-forum at nginx.us Tue Jun 4 07:48:27 2013 From: nginx-forum at nginx.us (Belly) Date: Tue, 04 Jun 2013 03:48:27 -0400 Subject: Memory Management ( > 25GB memory usage) In-Reply-To: References: Message-ID: Thanks Maxim and Jonathan for making these things clear to me! Disabling disk buffering by using fastcgi_max_temp_file_size 0; and reducing the number of buffers solved the problem and made my service more efficient. Best Regards, Belly Dancer Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239795,239822#msg-239822 From mdounin at mdounin.ru Tue Jun 4 10:45:07 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 4 Jun 2013 14:45:07 +0400 Subject: Need help: websocket proxy stops working after a while In-Reply-To: References: Message-ID: <20130604104507.GE72282@mdounin.ru> Hello! On Mon, Jun 03, 2013 at 03:24:52PM -0700, Alder Network wrote: > I got nginx websocket proxy working but the socket would close > in a minute or so. So I add > proxy_read_timeout 180s; > and it works within 3 minutes but closed the websocket after 3 > minutes, but it works OK before that. Why is that? > BTW, I am using Nginx 1.4 now. Much like with normal http, nginx will time out connection to the upstream server if it doesn't see any data from it. If with a backend you use there are no data expected from the backend to a client, there are two possible solutions: 1) Send periodic ping frames from the backend. 2) Configure higher proxy_read_timeout in a location where websocket connections are handled. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Tue Jun 4 10:56:05 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 4 Jun 2013 14:56:05 +0400 Subject: HTTP status codes missing description in header for proxy_pass In-Reply-To: References: Message-ID: <20130604105605.GG72282@mdounin.ru> Hello! On Mon, Jun 03, 2013 at 07:07:50PM -0400, kgoess wrote: > We're using nginx as a middle layer in front of our application server > (mod_perl). When mod_perl returns an error page, the HTTP status line is > missing the "reason phrase" after the status code, like "Not Found", e.g. > > HTTP/1.1 404 > Server: nginx/1.2.1 > ...etc > > should be > > HTTP/1.1 404 Not Found > ...etc... [...] > Is this a bug in nginx, or a configuration issue that we can fix? The patch > to Perlbal is simple enough, is it worth looking for a patch to nginx? Or > did we miss something else entirely? As soon as you proxy requests to another server - nginx just returns a status line as got from a backend as soon as it's able to recognize it. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Tue Jun 4 11:28:03 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 4 Jun 2013 15:28:03 +0400 Subject: HTTP status code 499 from long running requests In-Reply-To: <1e4fd0823496bde4d9bab012f84b5827.NginxMailingListEnglish@forum.nginx.org> References: <20130602110424.GK72282@mdounin.ru> <1e4fd0823496bde4d9bab012f84b5827.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130604112803.GH72282@mdounin.ru> Hello! On Tue, Jun 04, 2013 at 12:52:03AM -0400, justin wrote: > Does it seem reasonable that the 499 status codes are responsible for double > requests? I.E. do you think the client is resending the request after the > 499 status? No. But both 499 status codes (i.e. client closed connection) and double requests are likely happen because client times out. -- Maxim Dounin http://nginx.org/en/donation.html From pablo.platt at gmail.com Tue Jun 4 11:39:38 2013 From: pablo.platt at gmail.com (pablo platt) Date: Tue, 4 Jun 2013 14:39:38 +0300 Subject: ulimit in the ubuntu package Message-ID: Hi, I'm using the ubuntu package from nginx.org. In the package from the official ubuntu repo, you can set file descriptor limit by changing /etc/default/nginx # Check if the ULIMIT is set in /etc/default/nginx if [ -n "$ULIMIT" ]; then # Set the ulimits ulimit $ULIMIT fi Is there a reason this setting is missing from the nginx.org package? I increased the limit but checking /proc//limits still shows the default. Should it be enough to set the soft and hard nofile limits in /etc/security/limits.conf or do I have to set ulimit $ULIMIT in the init.d script? Are there plans to use upstart instead of init.d script? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From sb at waeme.net Tue Jun 4 12:30:40 2013 From: sb at waeme.net (Sergey Budnevitch) Date: Tue, 4 Jun 2013 16:30:40 +0400 Subject: ulimit in the ubuntu package In-Reply-To: References: Message-ID: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> On 4 Jun2013, at 15:39 , pablo platt wrote: > Hi, > > I'm using the ubuntu package from nginx.org. > > In the package from the official ubuntu repo, you can set file descriptor limit by changing /etc/default/nginx > # Check if the ULIMIT is set in /etc/default/nginx > if [ -n "$ULIMIT" ]; then > # Set the ulimits > ulimit $ULIMIT > fi ulimit without flags sets max file size in blocks, not file descriptor limit, so you may fill a bug in their bug tracker. > Is there a reason this setting is missing from the nginx.org package? > > I increased the limit but checking /proc//limits still shows the default. > Should it be enough to set the soft and hard nofile limits in /etc/security/limits.conf > or do I have to set ulimit $ULIMIT in the init.d script? You may add worker_rlimit_nofile in nginx.conf (http://nginx.org/r/worker_rlimit_nofile). > > Are there plans to use upstart instead of init.d script? No. I will try to wait until either systemd or upstart win. :-) From mdounin at mdounin.ru Tue Jun 4 12:39:06 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 4 Jun 2013 16:39:06 +0400 Subject: ulimit in the ubuntu package In-Reply-To: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> Message-ID: <20130604123906.GM72282@mdounin.ru> Hello! On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > > On 4 Jun2013, at 15:39 , pablo platt wrote: > > > Hi, > > > > I'm using the ubuntu package from nginx.org. > > > > In the package from the official ubuntu repo, you can set file descriptor limit by changing /etc/default/nginx > > # Check if the ULIMIT is set in /etc/default/nginx > > if [ -n "$ULIMIT" ]; then > > # Set the ulimits > > ulimit $ULIMIT > > fi > > ulimit without flags sets max file size in blocks, not file descriptor limit, so > you may fill a bug in their bug tracker. I think the expected use is to supply arguments within the ULIMIT variable. -- Maxim Dounin http://nginx.org/en/donation.html From andrejaenisch at googlemail.com Tue Jun 4 12:54:23 2013 From: andrejaenisch at googlemail.com (Andre Jaenisch) Date: Tue, 4 Jun 2013 14:54:23 +0200 Subject: ulimit in the ubuntu package In-Reply-To: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> Message-ID: 2013/6/4 Sergey Budnevitch : > No. I will try to wait until either systemd or upstart win. :-) In case you want to support other distros than Ubuntu, you should have an eye on SystemD ?but this is Off-Topic here. Regards, Andre From pablo.platt at gmail.com Tue Jun 4 13:04:02 2013 From: pablo.platt at gmail.com (pablo platt) Date: Tue, 4 Jun 2013 16:04:02 +0300 Subject: ulimit in the ubuntu package In-Reply-To: <20130604123906.GM72282@mdounin.ru> References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> <20130604123906.GM72282@mdounin.ru> Message-ID: It's not clear to me how worker_rlimit_nofile, /etc/security/limits.conf and setting ulimit in the init.d script are related. Is worker_rlimit_nofile the same as using ulimit in the init.d script? Or does ulimit sets the maximum limit and worker_rlimit_nofile the limit per worker? Why does the init.d script from the ubuntu repo let me set using ulimit while the package from nginx.org doesn't? https://gist.github.com/aganov/1121022#file-nginx-L43 Does /etc/security/limits.conf has any effect on the nofile limit in nginx when it is started using init.d script? For upstart, I know that you have to set the limit in the upstart script and can't use /etc/security/limits.conf On Tue, Jun 4, 2013 at 3:39 PM, Maxim Dounin wrote: > Hello! > > On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > > > > > On 4 Jun2013, at 15:39 , pablo platt wrote: > > > > > Hi, > > > > > > I'm using the ubuntu package from nginx.org. > > > > > > In the package from the official ubuntu repo, you can set file > descriptor limit by changing /etc/default/nginx > > > # Check if the ULIMIT is set in /etc/default/nginx > > > if [ -n "$ULIMIT" ]; then > > > # Set the ulimits > > > ulimit $ULIMIT > > > fi > > > > ulimit without flags sets max file size in blocks, not file descriptor > limit, so > > you may fill a bug in their bug tracker. > > I think the expected use is to supply arguments within the ULIMIT > variable. > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sb at waeme.net Tue Jun 4 13:04:22 2013 From: sb at waeme.net (Sergey Budnevitch) Date: Tue, 4 Jun 2013 17:04:22 +0400 Subject: ulimit in the ubuntu package In-Reply-To: <20130604123906.GM72282@mdounin.ru> References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> <20130604123906.GM72282@mdounin.ru> Message-ID: On 4 Jun2013, at 16:39 , Maxim Dounin wrote: > Hello! > > On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > >> >> On 4 Jun2013, at 15:39 , pablo platt wrote: >> >>> Hi, >>> >>> I'm using the ubuntu package from nginx.org. >>> >>> In the package from the official ubuntu repo, you can set file descriptor limit by changing /etc/default/nginx >>> # Check if the ULIMIT is set in /etc/default/nginx >>> if [ -n "$ULIMIT" ]; then >>> # Set the ulimits >>> ulimit $ULIMIT >>> fi >> >> ulimit without flags sets max file size in blocks, not file descriptor limit, so >> you may fill a bug in their bug tracker. > > I think the expected use is to supply arguments within the ULIMIT > variable. You are probably right. From sb at waeme.net Tue Jun 4 13:25:09 2013 From: sb at waeme.net (Sergey Budnevitch) Date: Tue, 4 Jun 2013 17:25:09 +0400 Subject: ulimit in the ubuntu package In-Reply-To: References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> <20130604123906.GM72282@mdounin.ru> Message-ID: <83A93307-C67A-44BC-A8C5-A9ED570EED08@waeme.net> On 4 Jun2013, at 17:04 , pablo platt wrote: > It's not clear to me how worker_rlimit_nofile, /etc/security/limits.conf and setting ulimit in the init.d script are related. > > Is worker_rlimit_nofile the same as using ulimit in the init.d script? > Or does ulimit sets the maximum limit and worker_rlimit_nofile the limit per worker? All of them set RLIMIT_NOFILE (man 2 setrlimit). If there is worker_rlimit_nofile directive in nginx.conf, nginx master process sets RLIMIT_NOFILE for new workers processes. This works no matter how you start nginx. ulimit -n in init script will works if nginx is started by init script. limits.conf is used by pam_limits, so it works for: % grep pam_limits /etc/pam.d/* /etc/pam.d/atd:session required pam_limits.so /etc/pam.d/cron:session required pam_limits.so /etc/pam.d/login:session required pam_limits.so /etc/pam.d/sshd:session required pam_limits.so /etc/pam.d/su:# session required pam_limits.so atd, cron, login, sshd processes and their child processes, for example when you login locally or via ssh. > > Why does the init.d script from the ubuntu repo let me set using ulimit while the package from nginx.org doesn't? > https://gist.github.com/aganov/1121022#file-nginx-L43 > > Does /etc/security/limits.conf has any effect on the nofile limit in nginx when it is started using init.d script? > For upstart, I know that you have to set the limit in the upstart script and can't use /etc/security/limits.conf limits.conf will not work if init script is started on system boot. > > > On Tue, Jun 4, 2013 at 3:39 PM, Maxim Dounin wrote: > Hello! > > On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > > > > > On 4 Jun2013, at 15:39 , pablo platt wrote: > > > > > Hi, > > > > > > I'm using the ubuntu package from nginx.org. > > > > > > In the package from the official ubuntu repo, you can set file descriptor limit by changing /etc/default/nginx > > > # Check if the ULIMIT is set in /etc/default/nginx > > > if [ -n "$ULIMIT" ]; then > > > # Set the ulimits > > > ulimit $ULIMIT > > > fi > > > > ulimit without flags sets max file size in blocks, not file descriptor limit, so > > you may fill a bug in their bug tracker. > > I think the expected use is to supply arguments within the ULIMIT > variable. > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > 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 pablo.platt at gmail.com Tue Jun 4 13:32:59 2013 From: pablo.platt at gmail.com (pablo platt) Date: Tue, 4 Jun 2013 16:32:59 +0300 Subject: ulimit in the ubuntu package In-Reply-To: <83A93307-C67A-44BC-A8C5-A9ED570EED08@waeme.net> References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> <20130604123906.GM72282@mdounin.ru> <83A93307-C67A-44BC-A8C5-A9ED570EED08@waeme.net> Message-ID: "worker_rlimit_nofile set RLIMIT_NOFILE for workers only, so master process still sees previous value." http://mailman.nginx.org/pipermail/nginx/2008-April/004596.html If worker_rlimit_nofile doesn't affect the master process and limits.conf doesn't affect init script, do I need to call ulimit in the init.d script? On Tue, Jun 4, 2013 at 4:25 PM, Sergey Budnevitch wrote: > > On 4 Jun2013, at 17:04 , pablo platt wrote: > > > It's not clear to me how worker_rlimit_nofile, /etc/security/limits.conf > and setting ulimit in the init.d script are related. > > > > Is worker_rlimit_nofile the same as using ulimit in the init.d script? > > Or does ulimit sets the maximum limit and worker_rlimit_nofile the limit > per worker? > > All of them set RLIMIT_NOFILE (man 2 setrlimit). > If there is worker_rlimit_nofile directive in nginx.conf, nginx master > process > sets RLIMIT_NOFILE for new workers processes. This works no matter how > you start nginx. > ulimit -n in init script will works if nginx is started by init script. > limits.conf is used by pam_limits, so it works for: > % grep pam_limits /etc/pam.d/* > /etc/pam.d/atd:session required pam_limits.so > /etc/pam.d/cron:session required pam_limits.so > /etc/pam.d/login:session required pam_limits.so > /etc/pam.d/sshd:session required pam_limits.so > /etc/pam.d/su:# session required pam_limits.so > > atd, cron, login, sshd processes and their child processes, > for example when you login locally or via ssh. > > > > > > Why does the init.d script from the ubuntu repo let me set using ulimit > while the package from nginx.org doesn't? > > https://gist.github.com/aganov/1121022#file-nginx-L43 > > > > Does /etc/security/limits.conf has any effect on the nofile limit in > nginx when it is started using init.d script? > > For upstart, I know that you have to set the limit in the upstart script > and can't use /etc/security/limits.conf > > limits.conf will not work if init script is started on system boot. > > > > > > > > On Tue, Jun 4, 2013 at 3:39 PM, Maxim Dounin wrote: > > Hello! > > > > On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > > > > > > > > On 4 Jun2013, at 15:39 , pablo platt wrote: > > > > > > > Hi, > > > > > > > > I'm using the ubuntu package from nginx.org. > > > > > > > > In the package from the official ubuntu repo, you can set file > descriptor limit by changing /etc/default/nginx > > > > # Check if the ULIMIT is set in /etc/default/nginx > > > > if [ -n "$ULIMIT" ]; then > > > > # Set the ulimits > > > > ulimit $ULIMIT > > > > fi > > > > > > ulimit without flags sets max file size in blocks, not file descriptor > limit, so > > > you may fill a bug in their bug tracker. > > > > I think the expected use is to supply arguments within the ULIMIT > > variable. > > > > -- > > Maxim Dounin > > http://nginx.org/en/donation.html > > > > _______________________________________________ > > 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 Tue Jun 4 13:42:29 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 4 Jun 2013 17:42:29 +0400 Subject: nginx-1.5.1 Message-ID: <20130604134229.GT72282@mdounin.ru> Changes with nginx 1.5.1 04 Jun 2013 *) Feature: the "ssi_last_modified", "sub_filter_last_modified", and "xslt_last_modified" directives. Thanks to Alexey Kolpakov. *) Feature: the "http_403" parameter of the "proxy_next_upstream", "fastcgi_next_upstream", "scgi_next_upstream", and "uwsgi_next_upstream" directives. *) Feature: the "allow" and "deny" directives now support unix domain sockets. *) Bugfix: nginx could not be built with the ngx_mail_ssl_module, but without ngx_http_ssl_module; the bug had appeared in 1.3.14. *) Bugfix: in the "proxy_set_body" directive. Thanks to Lanshun Zhou. *) Bugfix: in the "lingering_time" directive. Thanks to Lanshun Zhou. *) Bugfix: the "fail_timeout" parameter of the "server" directive in the "upstream" context might not work if "max_fails" parameter was used; the bug had appeared in 1.3.0. *) Bugfix: a segmentation fault might occur in a worker process if the "ssl_stapling" directive was used. Thanks to Piotr Sikora. *) Bugfix: in the mail proxy server. Thanks to Filipe Da Silva. *) Bugfix: nginx/Windows might stop accepting connections if several worker processes were used. -- Maxim Dounin http://nginx.org/en/donation.html From sb at waeme.net Tue Jun 4 14:35:32 2013 From: sb at waeme.net (Sergey Budnevitch) Date: Tue, 4 Jun 2013 18:35:32 +0400 Subject: ulimit in the ubuntu package In-Reply-To: References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> <20130604123906.GM72282@mdounin.ru> <83A93307-C67A-44BC-A8C5-A9ED570EED08@waeme.net> Message-ID: <3C0D4CDF-C779-4E1F-BF1B-E722D0D8BF34@waeme.net> On 4 Jun2013, at 17:32 , pablo platt wrote: > "worker_rlimit_nofile set RLIMIT_NOFILE for workers only, so master process still sees previous value." > http://mailman.nginx.org/pipermail/nginx/2008-April/004596.html You hardly need to increase number of file descriptors for master process, because master process do not serve connections. worker_rlimit_nofile will not help you only if you have a lot of log files, more then or about of ulimit -n value. > > If worker_rlimit_nofile doesn't affect the master process and limits.conf doesn't affect init script, do I need to call ulimit in the init.d script? It's up to you. Both ulimit in init script and worker_rlimit_nofile will work. > > > On Tue, Jun 4, 2013 at 4:25 PM, Sergey Budnevitch wrote: > > On 4 Jun2013, at 17:04 , pablo platt wrote: > > > It's not clear to me how worker_rlimit_nofile, /etc/security/limits.conf and setting ulimit in the init.d script are related. > > > > Is worker_rlimit_nofile the same as using ulimit in the init.d script? > > Or does ulimit sets the maximum limit and worker_rlimit_nofile the limit per worker? > > All of them set RLIMIT_NOFILE (man 2 setrlimit). > If there is worker_rlimit_nofile directive in nginx.conf, nginx master process > sets RLIMIT_NOFILE for new workers processes. This works no matter how > you start nginx. > ulimit -n in init script will works if nginx is started by init script. > limits.conf is used by pam_limits, so it works for: > % grep pam_limits /etc/pam.d/* > /etc/pam.d/atd:session required pam_limits.so > /etc/pam.d/cron:session required pam_limits.so > /etc/pam.d/login:session required pam_limits.so > /etc/pam.d/sshd:session required pam_limits.so > /etc/pam.d/su:# session required pam_limits.so > > atd, cron, login, sshd processes and their child processes, > for example when you login locally or via ssh. > > > > > > Why does the init.d script from the ubuntu repo let me set using ulimit while the package from nginx.org doesn't? > > https://gist.github.com/aganov/1121022#file-nginx-L43 > > > > Does /etc/security/limits.conf has any effect on the nofile limit in nginx when it is started using init.d script? > > For upstart, I know that you have to set the limit in the upstart script and can't use /etc/security/limits.conf > > limits.conf will not work if init script is started on system boot. > > > > > > > > On Tue, Jun 4, 2013 at 3:39 PM, Maxim Dounin wrote: > > Hello! > > > > On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > > > > > > > > On 4 Jun2013, at 15:39 , pablo platt wrote: > > > > > > > Hi, > > > > > > > > I'm using the ubuntu package from nginx.org. > > > > > > > > In the package from the official ubuntu repo, you can set file descriptor limit by changing /etc/default/nginx > > > > # Check if the ULIMIT is set in /etc/default/nginx > > > > if [ -n "$ULIMIT" ]; then > > > > # Set the ulimits > > > > ulimit $ULIMIT > > > > fi > > > > > > ulimit without flags sets max file size in blocks, not file descriptor limit, so > > > you may fill a bug in their bug tracker. > > > > I think the expected use is to supply arguments within the ULIMIT > > variable. > > > > -- > > Maxim Dounin > > http://nginx.org/en/donation.html > > > > _______________________________________________ > > 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 lists at ruby-forum.com Tue Jun 4 15:26:50 2013 From: lists at ruby-forum.com (Sergey K.) Date: Tue, 04 Jun 2013 17:26:50 +0200 Subject: resolver does not re-resolve upstream servers after initial cache In-Reply-To: <84F62AA0-260E-488B-890C-5376F443FA54@nginx.com> References: <38f956e05389a1f8e0b887e4a00d760e@ruby-forum.com> <20121108073406.GA23051@lo0.su> <2e1116fbc0bbef620bdc0b3cbfc9d3cf@ruby-forum.com> <0aeba29f8d54cc43d5df2e967be7a677.NginxMailingListEnglish@forum.nginx.org> <55ACB974-B712-4C7E-BEB4-2711B3A58B4B@waeme.net> <851e15012743ca75791645403c68b793@ruby-forum.com> <84F62AA0-260E-488B-890C-5376F443FA54@nginx.com> Message-ID: <3623717b7d582b47320ff931cd80febd@ruby-forum.com> Andrew Alexeev wrote in post #1083715: > Dave, > > On Nov 9, 2012, at 1:14 PM, Dave Nolan wrote: > >>> If you want the flexibility of DNS resolving and safeguard yourself >> else. I'm just interested in why it's not, and whether there are plans >> to change it. We might be interested in sponsoring this work. > > That's the current (and maybe already "legacy") design of nginx upstream > configuration. Unfortunately there's no quick solution but we actually > appreciate your feedback a lot and will try to incorporate a better > upstream design in the future releases. I was wondering if there were any updates on this in more recent nginx versions (1.5.1 at the moment)? This bug causes a lot of problems in cloud environments like AWS where IPs can change at any moment. -- Posted via http://www.ruby-forum.com/. From kworthington at gmail.com Tue Jun 4 16:34:23 2013 From: kworthington at gmail.com (Kevin Worthington) Date: Tue, 4 Jun 2013 12:34:23 -0400 Subject: nginx-1.5.1 In-Reply-To: <20130604134229.GT72282@mdounin.ru> References: <20130604134229.GT72282@mdounin.ru> Message-ID: Hello Nginx users, Now available: Nginx 1.5.1 for Windows http://goo.gl/eeXMm (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. Announcements are also available via my Twitter stream ( http://twitter.com/kworthington), if you prefer to receive updates that way. Thank you, Kevin -- Kevin Worthington kworthington *@* (gmail] [dot} {com) http://kevinworthington.com/ http://twitter.com/kworthington On Tue, Jun 4, 2013 at 9:42 AM, Maxim Dounin wrote: > Changes with nginx 1.5.1 04 Jun > 2013 > > *) Feature: the "ssi_last_modified", "sub_filter_last_modified", and > "xslt_last_modified" directives. > Thanks to Alexey Kolpakov. > > *) Feature: the "http_403" parameter of the "proxy_next_upstream", > "fastcgi_next_upstream", "scgi_next_upstream", and > "uwsgi_next_upstream" directives. > > *) Feature: the "allow" and "deny" directives now support unix domain > sockets. > > *) Bugfix: nginx could not be built with the ngx_mail_ssl_module, but > without ngx_http_ssl_module; the bug had appeared in 1.3.14. > > *) Bugfix: in the "proxy_set_body" directive. > Thanks to Lanshun Zhou. > > *) Bugfix: in the "lingering_time" directive. > Thanks to Lanshun Zhou. > > *) Bugfix: the "fail_timeout" parameter of the "server" directive in > the > "upstream" context might not work if "max_fails" parameter was used; > the bug had appeared in 1.3.0. > > *) Bugfix: a segmentation fault might occur in a worker process if the > "ssl_stapling" directive was used. > Thanks to Piotr Sikora. > > *) Bugfix: in the mail proxy server. > Thanks to Filipe Da Silva. > > *) Bugfix: nginx/Windows might stop accepting connections if several > worker processes were used. > > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt at gmail.com Tue Jun 4 17:12:50 2013 From: pablo.platt at gmail.com (pablo platt) Date: Tue, 4 Jun 2013 20:12:50 +0300 Subject: ulimit in the ubuntu package In-Reply-To: <3C0D4CDF-C779-4E1F-BF1B-E722D0D8BF34@waeme.net> References: <277BD3DF-E518-41A2-B7C4-1BA0D31AE3E9@waeme.net> <20130604123906.GM72282@mdounin.ru> <83A93307-C67A-44BC-A8C5-A9ED570EED08@waeme.net> <3C0D4CDF-C779-4E1F-BF1B-E722D0D8BF34@waeme.net> Message-ID: So ulimit in the init script is redundant. I'll use worker_rlimit_nofile. Thanks On Tue, Jun 4, 2013 at 5:35 PM, Sergey Budnevitch wrote: > > On 4 Jun2013, at 17:32 , pablo platt wrote: > > > "worker_rlimit_nofile set RLIMIT_NOFILE for workers only, so master > process still sees previous value." > > http://mailman.nginx.org/pipermail/nginx/2008-April/004596.html > > You hardly need to increase number of file descriptors for master process, > because > master process do not serve connections. worker_rlimit_nofile will not help > you only if you have a lot of log files, more then or about of ulimit -n > value. > > > > > > If worker_rlimit_nofile doesn't affect the master process and > limits.conf doesn't affect init script, do I need to call ulimit in the > init.d script? > > It's up to you. Both ulimit in init script and worker_rlimit_nofile will > work. > > > > > > > On Tue, Jun 4, 2013 at 4:25 PM, Sergey Budnevitch wrote: > > > > On 4 Jun2013, at 17:04 , pablo platt wrote: > > > > > It's not clear to me how worker_rlimit_nofile, > /etc/security/limits.conf and setting ulimit in the init.d script are > related. > > > > > > Is worker_rlimit_nofile the same as using ulimit in the init.d script? > > > Or does ulimit sets the maximum limit and worker_rlimit_nofile the > limit per worker? > > > > All of them set RLIMIT_NOFILE (man 2 setrlimit). > > If there is worker_rlimit_nofile directive in nginx.conf, nginx master > process > > sets RLIMIT_NOFILE for new workers processes. This works no matter how > > you start nginx. > > ulimit -n in init script will works if nginx is started by init script. > > limits.conf is used by pam_limits, so it works for: > > % grep pam_limits /etc/pam.d/* > > /etc/pam.d/atd:session required pam_limits.so > > /etc/pam.d/cron:session required pam_limits.so > > /etc/pam.d/login:session required pam_limits.so > > /etc/pam.d/sshd:session required pam_limits.so > > /etc/pam.d/su:# session required pam_limits.so > > > > atd, cron, login, sshd processes and their child processes, > > for example when you login locally or via ssh. > > > > > > > > > > Why does the init.d script from the ubuntu repo let me set using > ulimit while the package from nginx.org doesn't? > > > https://gist.github.com/aganov/1121022#file-nginx-L43 > > > > > > Does /etc/security/limits.conf has any effect on the nofile limit in > nginx when it is started using init.d script? > > > For upstart, I know that you have to set the limit in the upstart > script and can't use /etc/security/limits.conf > > > > limits.conf will not work if init script is started on system boot. > > > > > > > > > > > > > On Tue, Jun 4, 2013 at 3:39 PM, Maxim Dounin > wrote: > > > Hello! > > > > > > On Tue, Jun 04, 2013 at 04:30:40PM +0400, Sergey Budnevitch wrote: > > > > > > > > > > > On 4 Jun2013, at 15:39 , pablo platt wrote: > > > > > > > > > Hi, > > > > > > > > > > I'm using the ubuntu package from nginx.org. > > > > > > > > > > In the package from the official ubuntu repo, you can set file > descriptor limit by changing /etc/default/nginx > > > > > # Check if the ULIMIT is set in /etc/default/nginx > > > > > if [ -n "$ULIMIT" ]; then > > > > > # Set the ulimits > > > > > ulimit $ULIMIT > > > > > fi > > > > > > > > ulimit without flags sets max file size in blocks, not file > descriptor limit, so > > > > you may fill a bug in their bug tracker. > > > > > > I think the expected use is to supply arguments within the ULIMIT > > > variable. > > > > > > -- > > > Maxim Dounin > > > http://nginx.org/en/donation.html > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Jun 4 20:09:13 2013 From: nginx-forum at nginx.us (kgoess) Date: Tue, 04 Jun 2013 16:09:13 -0400 Subject: HTTP status codes missing description in header for proxy_pass In-Reply-To: References: Message-ID: <5e77988538c74cc9c64e3b554b0f3947.NginxMailingListEnglish@forum.nginx.org> > I guess the irregular response comes from your mod_perl backend? Aha, from ngrep listening on port 8080 responding to nginx, it is indeed missing the description: T 10.200.1.59:8080 -> 10.200.1.59:57990 [AP] HTTP/1.1 404..Server: Apache/2.2.16 (Debian) mod_perl/2.0.4 Perl/v5.10.1 If apache is in the middle layer, instead of nginx, it looks like apache fills in the status line T 127.0.0.1:8082 -> 127.0.0.1:37887 [AP] HTTP/1.1 404 Not Found..Date: Tue, 04 Jun 2013 20:02:03 GMT..Server: Apache/2.2.16 (Debian) mod_perl/2.0.4 Perl/v5.10.1.. but if nginx is in the middle, it just passes it straight through: T 127.0.0.1:8083 -> 127.0.0.1:46829 [AP] HTTP/1.1 404..Server: nginx/1.2.1.. And sure enough, some pretty old cgi code needed this fix if (! -e $file) { bepress::Statsd->increment('viewcontent.error.native_not_found'); - $self->out( $cgiutils->header( -status => 404 ) ); + $self->out( $cgiutils->header( -status => '404 Not Found' ) ); $self->out( $cgiutils->start_html( Thanks for the help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239811,239869#msg-239869 From nginx-forum at nginx.us Wed Jun 5 00:39:14 2013 From: nginx-forum at nginx.us (solitaryr) Date: Tue, 04 Jun 2013 20:39:14 -0400 Subject: nginx proxy vs apache proxy Message-ID: <4e1ac52177a2fa140555024cadf33fb7.NginxMailingListEnglish@forum.nginx.org> I'm sure this is probably just a misconfiguration or a misunderstanding of nginx proxying. I'm looking to replace apache as my ssl/proxy server for a Jboss/tcServer backend. Unfortunately, I have a java web start app that builds the jnlp files dynamically based on the scheme, protocol and server info passed back to it. I'm not getting the https (port 443) passed back as expected. I thought it was the application so I googled and found a some quick and dirty jsp pages that let me test the responses being passed back. For the apache server, I see the following: Scheme: https Name: my.example.com Port: 443 Nginx responses show (regardless of how I try to connect): Scheme: http Name: my.example.com Port: 80 I'm fairly new to nginx but I've read and googled fairly extensively to no avail. I'm trying to do similar to the following: location /myJWSapp/ { proxy_pass http://127.0.0.1:8080; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-By $server_addr:$server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } I can see the url in the jnlp file Also, for some reason the jnlp file is now being truncated at 10k (I've googled this to no avail as well). This is making it even more difficult to debug this issue. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239872,239872#msg-239872 From shahzaib.cb at gmail.com Wed Jun 5 05:56:53 2013 From: shahzaib.cb at gmail.com (shahzaib shahzaib) Date: Wed, 5 Jun 2013 10:56:53 +0500 Subject: slow streaming due to high %utilization !! Message-ID: Hello, We're using nginx-1.2.8 to stream large files size 1G but found the slow stream with high utilization of harddrive using command "iostat -x -d 3" Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util sdc 0.00 444.00 78.67 7.00 18336.00 3608.00 256.16 3.28 39.17 11.02 94.40 sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 16G Ram 8X CPU E31240 HDD SATA Following are the main nginx configuration :- http { include mime.types; default_type application/octet-stream; #tcp_nopush on; client_body_buffer_size 128k; client_header_buffer_size 128k; client_max_body_size 1200M; keepalive_timeout 10; ignore_invalid_headers on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; reset_timedout_connection on; #gzip on; access_log off; include /usr/local/nginx/conf/vhosts/*; } Would be very thankful If someone could help me with better configuration of nginx to reduce HDD-utilization. Best Regards.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From reallfqq-nginx at yahoo.fr Wed Jun 5 06:46:50 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Wed, 5 Jun 2013 02:46:50 -0400 Subject: slow streaming due to high %utilization !! In-Reply-To: References: Message-ID: Hello, On Wed, Jun 5, 2013 at 1:56 AM, shahzaib shahzaib wrote: > Hello, > > We're using nginx-1.2.8 to stream large files size 1G but found the > slow stream with high utilization of harddrive using command "iostat -x -d > 3" > > Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s > avgrq-sz avgqu-sz await svctm %util > sdc 0.00 444.00 78.67 7.00 18336.00 3608.00 > 256.16 3.28 39.17 11.02 94.40 > sdb 0.00 0.00 0.00 0.00 0.00 > 0.00 0.00 0.00 0.00 0.00 0.00 > sda 0.00 0.00 0.00 0.00 0.00 > 0.00 0.00 0.00 0.00 0.00 0.00 > > 16G Ram > 8X CPU E31240 > HDD SATA > > ?The best way of serving large files is to use asynchronous transfer to avoid blocking disk requests. To do so, have a look at the aiodirective. The default behavior uses sendfile, which sends file in a synchronous fashion?. Note 1: On Linux, aio will work for writing requests only if activated alone. To activate asynchronous read requests (which seems coherent to your use case, since you stream files - I understand yo usend them, thus you read them), you need to activate the directiodirective. Refer to the aio documentaiton (link above) for details. Note 2: Using directio will automatically disable sendfile. If you don't use it, you'll need to deactivate sendfile manually. You might also wanna have a look at your output_buffers (once again see the aio directive documentation) to improve large files buffering. I read around that buffers large enough (>= 4MiB) are usually advised for big files (splitting them in less parts). Maybe you would like to make some tests for your specific use case to find the most appropriate values. The number of those buffers also have an impact: too much buffers consumes RAM for nothing, whereas too little of them will slow down requests by creating an artificial bottleneck. Following are the main nginx configuration :- > > http { > include mime.types; > default_type application/octet-stream; > #tcp_nopush on; > client_body_buffer_size 128k; > client_header_buffer_size 128k; > client_max_body_size 1200M; > keepalive_timeout 10; > ignore_invalid_headers on; > client_header_timeout 3m; > client_body_timeout 3m; > send_timeout 3m; > reset_timedout_connection on; > #gzip on; > access_log off; > include /usr/local/nginx/conf/vhosts/*; > > } > ?? > > ?By default, Nginx sets gzip to off. Depending on the content you stream and since you seem to have a nice CPU potential (you didn't provide information on CPU usage, you'll need to see if you have room for gzip compression there), you might wanna activate gzip to reduce the amount of data transferred, thus lowering the transmission time at the cost of a more sollicitated CPU... if your content provides room for a sensible compression efficiency (once again, it depends on your specific use case).? ?No need? for it if the benefit is 1% ;o) > > > Would be very thankful If someone could help me with better configuration > of nginx to reduce HDD-utilization. > > Best Regards.. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > ?No other idea. Hope I helped,? --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Jun 5 06:54:34 2013 From: nginx-forum at nginx.us (justin) Date: Wed, 05 Jun 2013 02:54:34 -0400 Subject: etag support Message-ID: <973b4d9b19078d7c1d53f244fc837b13.NginxMailingListEnglish@forum.nginx.org> Are etags supported in nginx? I am running nginx/1.4.1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239877,239877#msg-239877 From ru at nginx.com Wed Jun 5 07:45:23 2013 From: ru at nginx.com (Ruslan Ermilov) Date: Wed, 5 Jun 2013 11:45:23 +0400 Subject: etag support In-Reply-To: <973b4d9b19078d7c1d53f244fc837b13.NginxMailingListEnglish@forum.nginx.org> References: <973b4d9b19078d7c1d53f244fc837b13.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130605074523.GV66845@lo0.su> On Wed, Jun 05, 2013 at 02:54:34AM -0400, justin wrote: > Are etags supported in nginx? I am running nginx/1.4.1 http://nginx.org/r/etag From nginx-forum at nginx.us Wed Jun 5 07:53:23 2013 From: nginx-forum at nginx.us (justin) Date: Wed, 05 Jun 2013 03:53:23 -0400 Subject: etag support In-Reply-To: <20130605074523.GV66845@lo0.su> References: <20130605074523.GV66845@lo0.su> Message-ID: <80d1efc0513890cc41a875beed674e57.NginxMailingListEnglish@forum.nginx.org> I added etag on to my config, but still don't see etags in the response headers. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239877,239879#msg-239879 From shahzaib.cb at gmail.com Wed Jun 5 08:06:05 2013 From: shahzaib.cb at gmail.com (shahzaib shahzaib) Date: Wed, 5 Jun 2013 13:06:05 +0500 Subject: slow streaming due to high %utilization !! In-Reply-To: References: Message-ID: Thanks for co-operation B.R but i've got to know that aio doesn't work well with linux centos and i already used it once with one of our content servers for serving large-files. I noted that after enabling aio, the svctime reduced but %util increased upto 20% using command iostat -x -d 3 Regarding gzip compression, i am afraid that our content server is used for large videos serving as well as conversion which consumes 80% of cpu resources and gzip compression would overwhelm the cpus. Also trying to figure out that how nginx works with the terms asynchronous and synchronous ? Best Regards. On Wed, Jun 5, 2013 at 11:46 AM, B.R. wrote: > Hello, > > On Wed, Jun 5, 2013 at 1:56 AM, shahzaib shahzaib wrote: > >> Hello, >> >> We're using nginx-1.2.8 to stream large files size 1G but found >> the slow stream with high utilization of harddrive using command "iostat -x >> -d 3" >> >> Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s >> avgrq-sz avgqu-sz await svctm %util >> sdc 0.00 444.00 78.67 7.00 18336.00 3608.00 >> 256.16 3.28 39.17 11.02 94.40 >> sdb 0.00 0.00 0.00 0.00 0.00 >> 0.00 0.00 0.00 0.00 0.00 0.00 >> sda 0.00 0.00 0.00 0.00 0.00 >> 0.00 0.00 0.00 0.00 0.00 0.00 >> >> 16G Ram >> 8X CPU E31240 >> HDD SATA >> >> The best way of serving large files is to use asynchronous transfer to > avoid blocking disk requests. > To do so, have a look at the aiodirective. The default behavior uses sendfile, which sends file in a > synchronous fashion. > > Note 1: On Linux, aio will work for writing requests only if activated > alone. To activate asynchronous read requests (which seems coherent to your > use case, since you stream files - I understand yo usend them, thus you > read them), you need to activate the directiodirective. > Refer to the aio documentaiton (link above) for details. > > Note 2: Using directio will automatically disable sendfile. If you don't > use it, you'll need to deactivate sendfile manually. > > You might also wanna have a look at your output_buffers (once again see > the aio directive documentation) to improve large files buffering. > I read around that buffers large enough (>= 4MiB) are usually advised for > big files (splitting them in less parts). Maybe you would like to make some > tests for your specific use case to find the most appropriate values. > The number of those buffers also have an impact: too much buffers consumes > RAM for nothing, whereas too little of them will slow down requests by > creating an artificial bottleneck. > > Following are the main nginx configuration :- >> >> http { >> include mime.types; >> default_type application/octet-stream; >> #tcp_nopush on; >> client_body_buffer_size 128k; >> client_header_buffer_size 128k; >> client_max_body_size 1200M; >> keepalive_timeout 10; >> ignore_invalid_headers on; >> client_header_timeout 3m; >> client_body_timeout 3m; >> send_timeout 3m; >> reset_timedout_connection on; >> #gzip on; >> access_log off; >> include /usr/local/nginx/conf/vhosts/*; >> >> } >> >> >> > By default, Nginx sets gzip to off. Depending on the content you stream > and since you seem to have a nice CPU potential (you didn't provide > information on CPU usage, you'll need to see if you have room for gzip > compression there), you might wanna activate gzip to reduce the amount of > data transferred, thus lowering the transmission time at the cost of a more > sollicitated CPU... if your content provides room for a sensible > compression efficiency (once again, it depends on your specific use case). > No need for it if the benefit is 1% ;o) > >> >> >> Would be very thankful If someone could help me with better configuration >> of nginx to reduce HDD-utilization. >> >> Best Regards.. >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > No other idea. > > Hope I helped, > --- > *B. R.* > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ru at nginx.com Wed Jun 5 09:55:09 2013 From: ru at nginx.com (Ruslan Ermilov) Date: Wed, 5 Jun 2013 13:55:09 +0400 Subject: etag support In-Reply-To: <80d1efc0513890cc41a875beed674e57.NginxMailingListEnglish@forum.nginx.org> References: <20130605074523.GV66845@lo0.su> <80d1efc0513890cc41a875beed674e57.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130605095509.GW66845@lo0.su> On Wed, Jun 05, 2013 at 03:53:23AM -0400, justin wrote: > I added etag on to my config, but still don't see etags in the response > headers. ETag's are generated for static resources only. Modules that add dynamic contents to static resources may cause the ETag header to be removed from response, such as the ngx_http_addition_module, or when gzipping a response. From nginx-forum at nginx.us Wed Jun 5 10:26:25 2013 From: nginx-forum at nginx.us (honwel) Date: Wed, 05 Jun 2013 06:26:25 -0400 Subject: How can i get ip and port under forward proxy Message-ID: <3ef0b1c5b9a93baaf8ac23214b5d6eaa.NginxMailingListEnglish@forum.nginx.org> Hi, there I want to get ip and port under forward proxy use NGINX, a forward proxy sketch like this: [Client ]-> [NGINX] -> [Internet] so i want to get proxy's ip and port . i have try and made some modifications to the source code including ngx_http_upstream.c ngx_event_connect.c , there are some details: 1?add local_socket variable to get socket fd in ngx_event_connect_peer() 2?add local_sockaddr to get sockaddr structure in ngx_http_upstream_process_header(), because in this function the proxy had connected(connect() in ngx_event_connect_peer() is nonblocking) to the upstream(web, e.g. google.com) 3?add a $upstream_laddr variable in the ngx_http_upstream.c as ngx_http_upstream_addr_variable() function. 4?set log property like: fragment ****************************************************************************** log property start '$remote_addr:$remote_port ($upstream_laddr) [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; ****************************************************************************** log property end However, everthing does not work properly, the debug.log like this: 2013/06/05 16:35:50 [debug] 4978#0: *1 http upstream process header 2013/06/05 16:35:50 [debug] 4978#0: *1 http upstream connect socket: 12 2013/06/05 16:35:50 [debug] 4978#0: *1 http upstream connect sa_family: 21920 2013/06/05 16:35:50 [debug] 4978#0: *1 http upstream connect uri: / HTTP/1.1^M Host 2013/06/05 16:35:50 [debug] 4978#0: *1 http upstream connect ip: 255.127.0.0:5067 note: Worng ip and Port 2013/06/05 16:35:50 [debug] 4978#0: *1 http proxy status 200 "200 OK" ....................... 2013/06/05 16:38:57 [debug] 4978#0: *14 http upstream connect sa_family: 29728 note: Worng sa_family type 2013/06/05 16:38:57 [debug] 4978#0: *14 http upstream connect uri: /static/channel/focustop/focustop/focustop_105e9cbe.js HTTP/1.1^M Host 2013/06/05 16:38:57 [debug] 4978#0: *14 http upstream connect ip: 112.111.114.97:25965?^? note:Worng IP and Port 2013/06/05 16:38:57 [debug] 4978#0: *14 http proxy status 304 "304 Not Modified" ......................... 2013/06/05 17:05:32 [debug] 4978#0: *62 http upstream connect socket: 20 2013/06/05 17:05:32 [debug] 4978#0: *62 http upstream connect sa_family: 2 2013/06/05 17:05:32 [debug] 4978#0: *62 http upstream connect uri: /images1/ch/09xwzx/h_1.gif HTTP/1.1^M Host 2013/06/05 17:05:32 [debug] 4978#0: *62 http upstream connect ip: 192.168.1.163:49217??^? note:Correct IP and Port 2013/06/05 17:05:32 [debug] 4978#0: *62 http proxy status 304 "304 Not Modified" Does i have made mistake for code or worng understanding of NGINX event model. how can make this work correctly to get IP and Port. Thanks in advance. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239883,239883#msg-239883 From mdounin at mdounin.ru Wed Jun 5 12:18:15 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 5 Jun 2013 16:18:15 +0400 Subject: How can i get ip and port under forward proxy In-Reply-To: <3ef0b1c5b9a93baaf8ac23214b5d6eaa.NginxMailingListEnglish@forum.nginx.org> References: <3ef0b1c5b9a93baaf8ac23214b5d6eaa.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130605121815.GE72282@mdounin.ru> Hello! On Wed, Jun 05, 2013 at 06:26:25AM -0400, honwel wrote: > Hi, there > > I want to get ip and port under forward proxy use NGINX, a forward proxy > sketch like this: > > [Client ]-> [NGINX] -> [Internet] > > so i want to get proxy's ip and port . i have try and made some > modifications to the source code including ngx_http_upstream.c > ngx_event_connect.c , there are some details: 1?add local_socket variable to > get socket fd in ngx_event_connect_peer() 2?add local_sockaddr to get > sockaddr structure in ngx_http_upstream_process_header(), because in this > function the proxy had connected(connect() in ngx_event_connect_peer() is > nonblocking) to the upstream(web, e.g. google.com) 3?add a $upstream_laddr > variable in the ngx_http_upstream.c as ngx_http_upstream_addr_variable() > function. 4?set log property like: [...] > Does i have made mistake for code or worng understanding of NGINX event > model. how can make this work correctly to get IP and Port. You may want to show your code if you want us to help. Note well: upstream connection socket's file descriptor is available via u->peer.connection->fd after a successful ngx_event_connect_peer() call in ngx_http_upstream_connect(). At this point, local sockaddr of the socket should be also valid as connect() was already called. -- Maxim Dounin http://nginx.org/en/donation.html From reallfqq-nginx at yahoo.fr Wed Jun 5 12:50:49 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Wed, 5 Jun 2013 08:50:49 -0400 Subject: fastcgi_read_timeout with PHP backend In-Reply-To: <20130602223250.GQ72282@mdounin.ru> References: <20130527101947.GA72282@mdounin.ru> <20130529164627.GF72282@mdounin.ru> <20130602223250.GQ72282@mdounin.ru> Message-ID: Hello, Non-broken tcpdump just confirms what was already said based on > error log: nothing is seen from php after 18:48:45, and > this results in the timeout at 18:50:45. You have to dig into > your code. > > ?I agree. However, if you look at the output, you'll notice that the output is cut in the middle of what is sent at 16:45:43.8 UTC. The content of the array as printed by PHP in the TCP socket contains 29 elements (numbered from 0 to 28). The output is cut at the 24th. All the following content sent by PHP (and... received by Nginx?) are not displayed which produces the faulty browser output. I understand there is a timeout at some point (PHP runs out of memory). It seems that the error is not sent through the FastCGI tunnel and PHP simply stops answering. But that is another problem, not the main one I wanna outline here.? --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed Jun 5 13:48:36 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 5 Jun 2013 17:48:36 +0400 Subject: fastcgi_read_timeout with PHP backend In-Reply-To: References: <20130527101947.GA72282@mdounin.ru> <20130529164627.GF72282@mdounin.ru> <20130602223250.GQ72282@mdounin.ru> Message-ID: <20130605134836.GI72282@mdounin.ru> Hello! On Wed, Jun 05, 2013 at 08:50:49AM -0400, B.R. wrote: > Hello, > > Non-broken tcpdump just confirms what was already said based on > > > error log: nothing is seen from php after 18:48:45, and > > this results in the timeout at 18:50:45. You have to dig into > > your code. > > > > > ?I agree. > > However, if you look at the output, you'll notice that the output is cut in > the middle of what is sent at 16:45:43.8 UTC. > The content of the array as printed by PHP in the TCP socket contains 29 > elements (numbered from 0 to 28). The output is cut at the 24th. > > All the following content sent by PHP (and... received by Nginx?) are not > displayed which produces the faulty browser output. > > I understand there is a timeout at some point (PHP runs out of memory). It > seems that the error is not sent through the FastCGI tunnel and PHP simply > stops answering. > But that is another problem, not the main one I wanna outline here.? As long as upstream server times out, nginx stops processing of the request without sending what was buffered by nginx but not yet sent to a client. -- Maxim Dounin http://nginx.org/en/donation.html From reallfqq-nginx at yahoo.fr Wed Jun 5 14:28:26 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Wed, 5 Jun 2013 10:28:26 -0400 Subject: fastcgi_read_timeout with PHP backend In-Reply-To: <20130605134836.GI72282@mdounin.ru> References: <20130527101947.GA72282@mdounin.ru> <20130529164627.GF72282@mdounin.ru> <20130602223250.GQ72282@mdounin.ru> <20130605134836.GI72282@mdounin.ru> Message-ID: oO Is that a bug or a feature? Wouldn't it be nice not to lose information in the middle? PHP sends information and probably wants the Web server to do its job forwarding it to the browser. I'd like that, as a personal note. Thanks for that insight Maxim, that was one of the piece of information I was seeking for. ;o) --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed Jun 5 15:26:25 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 5 Jun 2013 19:26:25 +0400 Subject: fastcgi_read_timeout with PHP backend In-Reply-To: References: <20130527101947.GA72282@mdounin.ru> <20130529164627.GF72282@mdounin.ru> <20130602223250.GQ72282@mdounin.ru> <20130605134836.GI72282@mdounin.ru> Message-ID: <20130605152625.GL72282@mdounin.ru> Hello! On Wed, Jun 05, 2013 at 10:28:26AM -0400, B.R. wrote: > oO > > Is that a bug or a feature? > Wouldn't it be nice not to lose information in the middle? PHP sends > information and probably wants the Web server to do its job forwarding it > to the browser. I'd like that, as a personal note. This is how it works. With proxy, you may avoid buffering in nginx with proxy_buffering off. With fastcgi you can't, as unbuffered mode isn't implemented (well, fastcgi_keep_conn will do something comparable, but not exactly). As long as this only happens if connection is broken anyway - this isn't considered to be a problem as information is lost anyway. > Thanks for that insight Maxim, that was one of the piece of information I > was seeking for. ;o) This what I wrote in my very first message in this thread: : There is buffering on nginx side, too, which may prevent last part : of the response from appearing in the output as seen by a browser. : It doesn't explain why read timeout isn't reset though. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Thu Jun 6 01:10:10 2013 From: nginx-forum at nginx.us (honwel) Date: Wed, 05 Jun 2013 21:10:10 -0400 Subject: How can i get ip and port under forward proxy In-Reply-To: <20130605121815.GE72282@mdounin.ru> References: <20130605121815.GE72282@mdounin.ru> Message-ID: <52615253d4df328d0f594fe269d61727.NginxMailingListEnglish@forum.nginx.org> Ok, code is as follow: Code: src/event/ngx_event_connect.c In ngx_event_connect_peer() .................................... rc = connect(s, pc->sockaddr, pc->socklen); if (rc == -1) { err = ngx_socket_errno; if (err != NGX_EINPROGRESS #if (NGX_WIN32) /* Winsock returns WSAEWOULDBLOCK (NGX_EAGAIN) */ && err != NGX_EAGAIN #endif ) { if (err == NGX_ECONNREFUSED #if (NGX_LINUX) /* * Linux returns EAGAIN instead of ECONNREFUSED * for unix sockets if listen queue is full */ || err == NGX_EAGAIN #endif || err == NGX_ECONNRESET || err == NGX_ENETDOWN || err == NGX_ENETUNREACH || err == NGX_EHOSTDOWN || err == NGX_EHOSTUNREACH) { level = NGX_LOG_ERR; } else { level = NGX_LOG_CRIT; } ngx_log_error(level, c->log, err, "connect() to %V failed", pc->name); ngx_close_connection(c); pc->connection = NULL; return NGX_DECLINED; } } pc->local_socket = s; /* save socket fd after connect() */ Code: src/http/ngx_http_upstream.c In ngx_http_upstream_process_header() ssize_t n; ngx_int_t rc; ngx_connection_t *c; ngx_peer_connection_t *pc; u_char sa[NGX_SOCKADDRLEN]; socklen_t len; u_char text[NGX_SOCKADDR_STRLEN]; u_char *p; struct sockaddr_in *sin; pc = &u->peer; c = u->peer.connection; ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http upstream process header"); c->log->action = "reading response header from upstream"; if (c->read->timedout) { ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_TIMEOUT); return; } if (!u->request_sent && ngx_http_upstream_test_connect(c) != NGX_OK) { ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); return; } ......................................... /* getsockname by pc->local_socket which saved in ngx_event_connect_peer()*/ if (pc == NULL) { return; } if (pc->local_socket) { if (getsockname(pc->local_socket, (struct sockaddr *) &sa, &len) != -1) { if (pc->local_sockaddr != NULL) { ngx_memcpy(pc->local_sockaddr, &sa, len); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http upstream connect socket: %i", pc->local_socket); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http upstream connect sa_family: %i", pc->local_sockaddr->sa_family); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http upstream connect uri: %s", r->uri.data); sin = (struct sockaddr_in *) sa; p = (u_char *) &sin->sin_addr; p = ngx_snprintf(text, NGX_SOCKADDR_STRLEN, "%ud.%ud.%ud.%ud:%d", p[0], p[1], p[2], p[3], ntohs(sin->sin_port)); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http upstream connect ip: %s", &text); } } } Code: src/http/ngx_http_upstream.c static ngx_int_t ngx_http_upstream_laddr_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) { ngx_peer_connection_t *pc; struct sockaddr_in *sin; u_char sa[NGX_SOCKADDRLEN]; socklen_t len; #if (NGX_HAVE_INET6) ngx_uint_t i; struct sockaddr_in6 *sin6; #endif ngx_str_t s; u_char addr[NGX_SOCKADDR_STRLEN]; s.len = NGX_SOCKADDR_STRLEN; s.data = addr; if (r->upstream == NULL) { return NGX_ERROR; } pc = &r->upstream->peer; if (pc == NULL){ return NGX_ERROR; } if (pc->local_sockaddr == NULL) { return NGX_ERROR; s.len = ngx_sock_ntop(pc->local_sockaddr, s.data, s.len, 1); s.data = ngx_pnalloc(r->pool, s.len); if (s.data == NULL) { return NGX_ERROR; } ngx_memcpy(s.data, addr, s.len); v->len = s.len; v->valid = 1; v->no_cacheable = 0; v->not_found = 0; v->data = s.data; return NGX_OK; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239883,239903#msg-239903 From nginx-forum at nginx.us Thu Jun 6 01:37:52 2013 From: nginx-forum at nginx.us (honwel) Date: Wed, 05 Jun 2013 21:37:52 -0400 Subject: How can i get ip and port under forward proxy In-Reply-To: <3ef0b1c5b9a93baaf8ac23214b5d6eaa.NginxMailingListEnglish@forum.nginx.org> References: <3ef0b1c5b9a93baaf8ac23214b5d6eaa.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1e7f14c8d8df2bb273b1c177ef9b0738.NginxMailingListEnglish@forum.nginx.org> static void 457 ngx_http_upstream_init_request(ngx_http_request_t *r) ........................................ 498 #endif 499 500 u->store = (u->conf->store || u->conf->store_lengths); 501 502 if (!u->store && !r->post_action && !u->conf->ignore_client_abort) { 503 r->read_event_handler = ngx_http_upstream_rd_check_broken_connection; 504 r->write_event_handler = ngx_http_upstream_wr_check_broken_connection; 505 } 506 507 if (r->request_body) { 508 u->request_bufs = r->request_body->bufs; 509 } 510 511 if (u->create_request(r) != NGX_OK) { 512 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); 513 return; 514 } 515 516 u->peer.local = u->conf->local; 517 /* init */ 518 u->peer.local_sockaddr = ngx_palloc(r->pool, NGX_SOCKADDRLEN); .................... 650 return; 651 } 652 653 ngx_http_upstream_connect(r, u); } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239883,239904#msg-239904 From nginx-forum at nginx.us Thu Jun 6 04:10:51 2013 From: nginx-forum at nginx.us (justin) Date: Thu, 06 Jun 2013 00:10:51 -0400 Subject: etag support In-Reply-To: <20130605095509.GW66845@lo0.su> References: <20130605095509.GW66845@lo0.su> Message-ID: <39fcd116b3170156e9332fa17bbe7858.NginxMailingListEnglish@forum.nginx.org> Ok, I see the etag for images, but not for javascript or css. Is this because I have gzip enabled? Thanks for the help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239877,239906#msg-239906 From ru at nginx.com Thu Jun 6 08:49:40 2013 From: ru at nginx.com (Ruslan Ermilov) Date: Thu, 6 Jun 2013 12:49:40 +0400 Subject: etag support In-Reply-To: <39fcd116b3170156e9332fa17bbe7858.NginxMailingListEnglish@forum.nginx.org> References: <20130605095509.GW66845@lo0.su> <39fcd116b3170156e9332fa17bbe7858.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130606084940.GG66845@lo0.su> On Thu, Jun 06, 2013 at 12:10:51AM -0400, justin wrote: > Ok, I see the etag for images, but not for javascript or css. Is this > because I have gzip enabled? ETag is cleared when gzipping a response on the fly. You can use http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html for javascript and css files, in which case the responses will include ETag. From mdounin at mdounin.ru Thu Jun 6 13:03:10 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 6 Jun 2013 17:03:10 +0400 Subject: How can i get ip and port under forward proxy In-Reply-To: <52615253d4df328d0f594fe269d61727.NginxMailingListEnglish@forum.nginx.org> References: <20130605121815.GE72282@mdounin.ru> <52615253d4df328d0f594fe269d61727.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130606130310.GP72282@mdounin.ru> Hello! On Wed, Jun 05, 2013 at 09:10:10PM -0400, honwel wrote: > Ok, code is as follow: [...] > ngx_peer_connection_t *pc; > u_char sa[NGX_SOCKADDRLEN]; > socklen_t len; > u_char text[NGX_SOCKADDR_STRLEN]; > u_char *p; > struct sockaddr_in *sin; [...] > if (pc->local_socket) { > if (getsockname(pc->local_socket, (struct sockaddr *) &sa, &len) != > -1) { At this point, len is uninitialized. It is used by getsockname() as an input paramter though, and specifies the length of supplied sockaddr structure. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Thu Jun 6 13:16:14 2013 From: nginx-forum at nginx.us (geopcgeo) Date: Thu, 06 Jun 2013 09:16:14 -0400 Subject: Proxypass subfolder entries to another link Message-ID: Dear Support Currently we have nginx proxypass to tomcat service and is working fine. server { listen 80; server_name app.geo.com; location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } } location /docs { proxy_pass http://localhost:8080/officework; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } So while accessing app.geo.com/docs/* we are getting the contents of http://localhost:8080/officework Now we have another tomcat war folder /homework and while accessing app.geo.com/docs/home* we need to get the contents of http://localhost:8080/homework That is we need as follows: http://app.geo.com/docs/* -> http://localhost:8080/officework http://app.geo.com/docs/home/* -> http://localhost:8080/homework Can anyone please help us to configure this in our nginx. Thanks Geo Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239916,239916#msg-239916 From nginx-forum at nginx.us Thu Jun 6 15:17:01 2013 From: nginx-forum at nginx.us (mzabani) Date: Thu, 06 Jun 2013 11:17:01 -0400 Subject: thread started by module put to sleep state Message-ID: <7b67ef1d7cf904276d1d703e2b1134ee.NginxMailingListEnglish@forum.nginx.org> Hi everyone, I've been trying to embed mono within nginx to serve requests with ASP.NET just for learning purposes (I know there is a FastCGI server for mono out there), and I'm running into a problem. When I call into C# code, mono's runtime creates a thread to serve the request, but this thread is always in sleep state, and for this reason the response never comes, i.e. the browser appears to try to load the page indefinitely. I have tried to embed the same C# code into a C application that simulates the request (no nginx involved) and the request gets processed normally. I don't know what kind of information I can show you to help debug the problem, but, so far, this is just a simple handler that pretty much kills nginx's event loop by waiting for the full response to come. I know that if I simulate a quick response in the C# side (without really handling it appropriately, i.e. just creating some buffers with "Hello world") the response comes out nicely. What could be the cause of this? Thank you in advance, Marcelo Zabani. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239921,239921#msg-239921 From nginx-forum at nginx.us Thu Jun 6 21:57:54 2013 From: nginx-forum at nginx.us (kpstein) Date: Thu, 06 Jun 2013 17:57:54 -0400 Subject: gunzip module and buffer managment Message-ID: <3bce5767ce78282f77c14bc3ac8a4ba5.NginxMailingListEnglish@forum.nginx.org> I'm trying to use the http_gunzip module as an example for a filter I am trying to write. I'm particularly interested in the buffer management. The module has a value in its ctx stuct called last_buf ... ngx_chain_t **last_out; ... last_out is set in various places throughout the code. Sometimes to other chains in the ctx, sometimes to newly allocated chains. But as far as I can tell, none of the code ever uses the value stored in last_out. (It seems to be a write-only variable :-) Anybody know what I'm missing? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239934,239934#msg-239934 From vbart at nginx.com Thu Jun 6 22:33:55 2013 From: vbart at nginx.com (Valentin V. Bartenev) Date: Fri, 7 Jun 2013 02:33:55 +0400 Subject: gunzip module and buffer managment In-Reply-To: <3bce5767ce78282f77c14bc3ac8a4ba5.NginxMailingListEnglish@forum.nginx.org> References: <3bce5767ce78282f77c14bc3ac8a4ba5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201306070233.55682.vbart@nginx.com> On Friday 07 June 2013 01:57:54 kpstein wrote: > I'm trying to use the http_gunzip module as an example for a filter I am > trying to write. I'm particularly interested in the buffer management. > > The module has a value in its ctx stuct called last_buf > > ... > ngx_chain_t **last_out; > ... > > last_out is set in various places throughout the code. Sometimes to other > chains in the ctx, sometimes to newly allocated chains. > > But as far as I can tell, none of the code ever uses the value stored in > last_out. (It seems to be a write-only variable :-) > > Anybody know what I'm missing? > % grep '*ctx->last_out' -n src/http/modules/ngx_http_gunzip_filter_module.c 461: *ctx->last_out = cl; 497: *ctx->last_out = cl; 546: *ctx->last_out = cl; 592: *ctx->last_out = cl; wbr, Valentin V. Bartenev -- http://nginx.org/en/donation.html From nginx-forum at nginx.us Fri Jun 7 01:29:36 2013 From: nginx-forum at nginx.us (honwel) Date: Thu, 06 Jun 2013 21:29:36 -0400 Subject: How can i get ip and port under forward proxy In-Reply-To: <20130606130310.GP72282@mdounin.ru> References: <20130606130310.GP72282@mdounin.ru> Message-ID: <19a4bb2c60d8ab9e5d30ea2256786577.NginxMailingListEnglish@forum.nginx.org> Thanks, i add a line " len = NGX_SOCKADDRLEN ", then , it is ok! thanks very much. but i want to know , why? (struct sockaddr *) &sa and &len as are input paramter, why len need initialized? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239883,239939#msg-239939 From mdounin at mdounin.ru Fri Jun 7 02:04:42 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 7 Jun 2013 06:04:42 +0400 Subject: How can i get ip and port under forward proxy In-Reply-To: <19a4bb2c60d8ab9e5d30ea2256786577.NginxMailingListEnglish@forum.nginx.org> References: <20130606130310.GP72282@mdounin.ru> <19a4bb2c60d8ab9e5d30ea2256786577.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130607020442.GV72282@mdounin.ru> Hello! On Thu, Jun 06, 2013 at 09:29:36PM -0400, honwel wrote: > Thanks, i add a line " len = NGX_SOCKADDRLEN ", then , it is ok! thanks > very much. > but i want to know , why? (struct sockaddr *) &sa and &len as are input > paramter, why len need initialized? As I already said, len value is used as an input parameter by getsockname() function, and hence it must be initialized properly. See here for more details: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html : The address_len argument points to a socklen_t object which on : input specifies the length of the supplied sockaddr structure, and : on output specifies the length of the stored address. If the : actual length of the address is greater than the length of the : supplied sockaddr structure, the stored address shall be : truncated. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Fri Jun 7 02:08:40 2013 From: nginx-forum at nginx.us (honwel) Date: Thu, 06 Jun 2013 22:08:40 -0400 Subject: gunzip module and buffer managment In-Reply-To: <3bce5767ce78282f77c14bc3ac8a4ba5.NginxMailingListEnglish@forum.nginx.org> References: <3bce5767ce78282f77c14bc3ac8a4ba5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <56e7ef265cf1c26ffb52ba2fc24f1762.NginxMailingListEnglish@forum.nginx.org> second rank pointer. ---- ctx->last_out Matches (10 in 1 files) ---- Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &ctx->out; Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &ctx->out; Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl; Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &cl->next; Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl; Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &cl->next; Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl; Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &cl->next; Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl; Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &cl->next; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239934,239941#msg-239941 From nginx-forum at nginx.us Fri Jun 7 04:23:34 2013 From: nginx-forum at nginx.us (justin) Date: Fri, 07 Jun 2013 00:23:34 -0400 Subject: HTTP status code 499 from long running requests In-Reply-To: <20130604112803.GH72282@mdounin.ru> References: <20130604112803.GH72282@mdounin.ru> Message-ID: Maxim, I dug a bit deeper and here is the nginx access log showing the 499 status request, and then a repost of the same request: XX.XX.XXX.253 - - [06/Jun/2013:21:09:08 -0700] "POST /actions/execute.php HTTP/1.1" 499 0 "https://dev.mydomain.com/execute" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" XX.XXX.XXX.253 - - [06/Jun/2013:21:11:32 -0700] "POST /actions/execute.php HTTP/1.1" 200 673 "https://dev.mydomain.com/execute" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" I obviously need a solution, since I am essentially creating duplicate transactions. This only happens when the execute.php takes a long time though. In jQuery when I am making the AJAX request I am setting the timeout to 15 minutes. Is there anything else I can look at or try? Thanks for the help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239759,239943#msg-239943 From steve at greengecko.co.nz Fri Jun 7 05:24:39 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Fri, 07 Jun 2013 17:24:39 +1200 Subject: index.php in folders. Message-ID: <1370582679.29037.401.camel@steve-new> Is there a simple config I can use to check for an index.php in subfolders? It was my understanding that if I used index index.php; in the server block, and try_files $uri $uri/ /index.php; in location / {} that it would look for $uri/index.php. But I do seem to be misunderstanding. Help! Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From reallfqq-nginx at yahoo.fr Fri Jun 7 05:54:38 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Fri, 7 Jun 2013 01:54:38 -0400 Subject: index.php in folders. In-Reply-To: <1370582679.29037.401.camel@steve-new> References: <1370582679.29037.401.camel@steve-new> Message-ID: Hello, On Fri, Jun 7, 2013 at 1:24 AM, Steve Holdoway wrote: > Is there a simple config I can use to check for an index.php in > subfolders? > > It was my understanding that if I used > > index index.php; > > in the server block, and > > try_files $uri $uri/ /index.php; > > in location / {} that it would look for $uri/index.php. But I do seem to > be misunderstanding. > ? Your try_files directive is only working if your content is served by the location block where it is placed. If another location block serves content, the try_files directive won't apply. I don't know the default behavior then, but I guess that you either need to specify a directory by ending the URI with a trailing slash (directory) or specify the 'index.php' file at the end of it. I suggest you move the try_files directive up in the hierarchy, thus in the containing server block. ? > > Help! > ? I also suggest that you add something after the last part of the try_files directive or replace it with a proper handler for missing files. In your example, you specified that requests missing files should be redirected to '/index.php'. That can end-up in a loop-hole if there is no index.php file at root. I suggest you use something like: try_files $uri $uri/ /index.php =404; Please read the documentation of the try_files directivefor more information.? --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.lavier at davromaniak.eu Fri Jun 7 06:37:49 2013 From: cyril.lavier at davromaniak.eu (Cyril Lavier) Date: Fri, 07 Jun 2013 08:37:49 +0200 Subject: Updated patch for CVE-2013-2070 ? Message-ID: <51B17FBD.5050607@davromaniak.eu> Hello. As stated here (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708164), the patch nginx developers wrote for fixing CVE-2013-2070 is not 100% correct C. This is a big issue for us (I'm part of the nginx debian packaging team), because this patch can be applied on the Debian Wheezy's packages (1.2.1) but won't be accepted in the repositories because the patch can create new security issues. Does anyone has an updated version of this patch ? Thanks. -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu From mike503 at gmail.com Fri Jun 7 07:18:16 2013 From: mike503 at gmail.com (Michael Shadle) Date: Fri, 7 Jun 2013 00:18:16 -0700 Subject: kerberos In-Reply-To: References: Message-ID: This is a long time coming - I wanted to reply, I funded a project to try to get GSSAPI/SPNEGO support into nginx. The developer didn't know Kerberos nor nginx - but tried his best to get it to work. I could never get it to work, but my company's AD/Kerberos setup is confusing even for an Apache setup (especially since I do not have admin access to the domain and such) Anyway, that code is up here, no idea if it works with newer versions of nginx. https://github.com/mike503/spnego-http-auth-nginx-module and a bunch of forks, but nobody is very vocal about this functionality with nginx sadly. https://github.com/mike503/spnego-http-auth-nginx-module/network One of the more active forks is here: https://github.com/stnoonan/spnego-http-auth-nginx-module I'd love to see this get further developed/tested/etc. - if anyone has done this successfully, what their configs look like, OS, keytabs, whatever else... because I'd like to *use* it :) On Thu, Apr 18, 2013 at 12:02 PM, Friedrich Locke wrote: > I wonder if nginx supports kerberos in the same sense as apache does! > I mean: with apache i may specify if i will want SSO or password (by > retrieving the password from the kerberos database). > > The configuration options are: > > KrbMethodNegotiate off/on > KrbMethodK5Passwd off/on > > These above are the directives for SSO or password (fetched from kdc > database). > > Does nginx support the same way too ? > > Thanks in advance. > > > _______________________________________________ > 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 Jun 7 12:02:14 2013 From: nginx-forum at nginx.us (Larry) Date: Fri, 07 Jun 2013 08:02:14 -0400 Subject: Caching any point to go in ram ? Message-ID: <06cc93d827e31821f345a70d9152b9ff.NginxMailingListEnglish@forum.nginx.org> Hello, I have a 15k rpm server 16g ram on which is fiercely installed nginx 1.5.1 on a debian 7 machine (no apache installed). I read a lot (up to crunching my head) about caching strategy. I would like to reduce the latency of file serving. currently, my webpage (static html) loads in 43-70 ms but then 44ms are spent doing nothing then load the images. The total for a 120k page is 500ms. What is bugging me is that even with 4 cookie-less domain (actually same disk) the answer is always page load + 44 ms idle. So not a browser limitation. How could nginx cache the images so that the answer be really fast ? proxy_cache is useless in my case, isn't it ? Varnish would maybe help but it is something on the stack to debug when things go wrong. Not really a solution. Thanks, Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239951,239951#msg-239951 From mdounin at mdounin.ru Fri Jun 7 13:28:55 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 7 Jun 2013 17:28:55 +0400 Subject: Updated patch for CVE-2013-2070 ? In-Reply-To: <51B17FBD.5050607@davromaniak.eu> References: <51B17FBD.5050607@davromaniak.eu> Message-ID: <20130607132855.GY72282@mdounin.ru> Hello! On Fri, Jun 07, 2013 at 08:37:49AM +0200, Cyril Lavier wrote: > Hello. > > As stated here > (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708164), the patch > nginx developers wrote for fixing CVE-2013-2070 is not 100% correct C. >From standards point of view - yes, the patch in question might not be enough and the check might be, in theory, optimized out by a compiler. It's not a practical problem though. > This is a big issue for us (I'm part of the nginx debian packaging > team), because this patch can be applied on the Debian Wheezy's packages > (1.2.1) but won't be accepted in the repositories because the patch can > create new security issues. The patch can't create new security issues as in worst (theoretical) case the check added will be optimized out by a compiler. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Fri Jun 7 14:42:01 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 7 Jun 2013 18:42:01 +0400 Subject: HTTP status code 499 from long running requests In-Reply-To: References: <20130604112803.GH72282@mdounin.ru> Message-ID: <20130607144201.GB72282@mdounin.ru> Hello! On Fri, Jun 07, 2013 at 12:23:34AM -0400, justin wrote: > Maxim, > > I dug a bit deeper and here is the nginx access log showing the 499 status > request, and then a repost of the same request: > > XX.XX.XXX.253 - - [06/Jun/2013:21:09:08 -0700] "POST /actions/execute.php > HTTP/1.1" 499 0 "https://dev.mydomain.com/execute" "Mozilla/5.0 (Macintosh; > Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) > Chrome/27.0.1453.110 Safari/537.36" > > XX.XXX.XXX.253 - - [06/Jun/2013:21:11:32 -0700] "POST /actions/execute.php > HTTP/1.1" 200 673 "https://dev.mydomain.com/execute" "Mozilla/5.0 > (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) > Chrome/27.0.1453.110 Safari/537.36" Just a side note: from the log there is no reason to assume these requests are duplicate. > I obviously need a solution, since I am essentially creating duplicate > transactions. This only happens when the execute.php takes a long time > though. In jQuery when I am making the AJAX request I am setting the timeout > to 15 minutes. Is there anything else I can look at or try? I would recommend reproducing the issue on a client, and looking into network traffic via tcpdump / browser details via built in tools to see why duplicate requests are sent. On the other hand, duplicate POSTs aren't at all new - they used to happen due to users pressing "Submit" button multiple times. An obvious solution is to use some one-time form tokens. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Fri Jun 7 14:50:51 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 7 Jun 2013 18:50:51 +0400 Subject: Caching any point to go in ram ? In-Reply-To: <06cc93d827e31821f345a70d9152b9ff.NginxMailingListEnglish@forum.nginx.org> References: <06cc93d827e31821f345a70d9152b9ff.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130607145051.GC72282@mdounin.ru> Hello! On Fri, Jun 07, 2013 at 08:02:14AM -0400, Larry wrote: > Hello, > > I have a 15k rpm server 16g ram on which is fiercely installed nginx 1.5.1 > on a debian 7 machine (no apache installed). > > I read a lot (up to crunching my head) about caching strategy. > > I would like to reduce the latency of file serving. > > currently, my webpage (static html) loads in 43-70 ms but then 44ms are > spent doing nothing then load the images. > > The total for a 120k page is 500ms. > > What is bugging me is that even with 4 cookie-less domain (actually same > disk) the answer is always page load + 44 ms idle. > So not a browser limitation. >From your description it looks like 44ms is a time spent by a browser doing something prerequisite (parsing the page? resolving dns names? loading some external javascript?). -- Maxim Dounin http://nginx.org/en/donation.html From reallfqq-nginx at yahoo.fr Fri Jun 7 15:03:23 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Fri, 7 Jun 2013 11:03:23 -0400 Subject: Check applied confirguration per container (http, server, location, etc.) Message-ID: Hello, I wondered if the foolowing improvement ideas had been aleready mentioned or not and if they could prove useful. 1) Having the possibility of displaying the applied configuration for a specific level in configuration hierarchy providing enough information to identify it. This would output all the configuration variables and their state for the targeted block. nginx --block-check http nginx --block-check server (no argument provided, would display a list of servers with unique server ID nginx --block-check server (would display a list similar to the servers one for the locations of this server) nginx --block-check location Is Does it sound like gasworks? --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldernetwork at gmail.com Fri Jun 7 21:54:28 2013 From: aldernetwork at gmail.com (Alder Network) Date: Fri, 7 Jun 2013 14:54:28 -0700 Subject: Need help: websocket proxy stops working after a while In-Reply-To: <20130604104507.GE72282@mdounin.ru> References: <20130604104507.GE72282@mdounin.ru> Message-ID: Thanks for the info. For 2) , it would be nice to accept value of -1 ( or 0 ) for proxy_read_timeout as indefinite, namely no timeout checking at proxy. On Tue, Jun 4, 2013 at 3:45 AM, Maxim Dounin wrote: > Hello! > > On Mon, Jun 03, 2013 at 03:24:52PM -0700, Alder Network wrote: > > > I got nginx websocket proxy working but the socket would close > > in a minute or so. So I add > > proxy_read_timeout 180s; > > and it works within 3 minutes but closed the websocket after 3 > > minutes, but it works OK before that. Why is that? > > BTW, I am using Nginx 1.4 now. > > Much like with normal http, nginx will time out connection to the > upstream server if it doesn't see any data from it. If with a > backend you use there are no data expected from the backend to a > client, there are two possible solutions: > > 1) Send periodic ping frames from the backend. > > 2) Configure higher proxy_read_timeout in a location where > websocket connections are handled. > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.energetic at gmail.com Sat Jun 8 18:18:46 2013 From: the.energetic at gmail.com (Travis Maxwell) Date: Sat, 8 Jun 2013 14:18:46 -0400 Subject: Simple SSL Question Message-ID: <67FFA6D7-954F-497F-9538-8401B7190A49@gmail.com> Hi, I'm using nginx with SSL, and I want to always redirect to www, regardless of whether the request is http or https. I just want to redirect to the respective protocol but with www. I have the port 80 server block working fine. Beneath my first server block I have... server { listen 80; server_name example.com; return 301 http://www.example.com$request_uri; } and this works fine. But for my port 443 server block for https, I have all kinds of information inside regarding ssl on and different ciphers to use. I really don't want to mess up anything up related to security by doing something stupid.. so my question is on this second block for port 443 underneath the first one... server { listen 443; server_name example.com; return 301 https://www.example.com$request_uri; } do I need anything else? do I need ssl on or any other security related things? If they visit non-www does that mean it transfers the request insecurely or something (even for a split second while its redirecting?) Just want to make sure what I have is solid and secure. It seems to work but I want to double check. Thanks! From reallfqq-nginx at yahoo.fr Sat Jun 8 18:29:15 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Sat, 8 Jun 2013 14:29:15 -0400 Subject: Simple SSL Question In-Reply-To: <67FFA6D7-954F-497F-9538-8401B7190A49@gmail.com> References: <67FFA6D7-954F-497F-9538-8401B7190A49@gmail.com> Message-ID: Hello, On Sat, Jun 8, 2013 at 2:18 PM, Travis Maxwell wrote: > Hi, > > I'm using nginx with SSL, and I want to always redirect to www, regardless > of whether the request is http or https. I just want to redirect to the > respective protocol but with www. > > I have the port 80 server block working fine. Beneath my first server > block I have... > > server { > listen 80; > server_name example.com; > return 301 http://www.example.com$request_uri; > } > > and this works fine. But for my port 443 server block for https, I have > all kinds of information inside regarding ssl on and different ciphers to > use. > > I really don't want to mess up anything up related to security by doing > something stupid.. so my question is on this second block for port 443 > underneath the first one... > > server { > listen 443; > server_name example.com; > return 301 https://www.example.com$request_uri; > } > > do I need anything else? do I need ssl on or any other security related > things? If they visit non-www does that mean it transfers the request > insecurely or something (even for a split second while its redirecting?) > ?? > > ? Put both 'listen' directives in the same server block. ? > Just want to make sure what I have is solid and secure. It seems to work > but I want to double check. > > Thanks! > --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Sat Jun 8 18:54:36 2013 From: appa at perusio.net (=?ISO-8859-1?Q?Ant=F3nio_P=2E_P=2E_Almeida?=) Date: Sat, 8 Jun 2013 20:54:36 +0200 Subject: Simple SSL Question In-Reply-To: References: <67FFA6D7-954F-497F-9538-8401B7190A49@gmail.com> Message-ID: You need to include the SSL certificate and the key directives on the server block that does the SSL redirect. Le 8 juin 2013 20:30, "B.R." a ?crit : > Hello, > > On Sat, Jun 8, 2013 at 2:18 PM, Travis Maxwell wrote: > >> Hi, >> >> I'm using nginx with SSL, and I want to always redirect to www, >> regardless of whether the request is http or https. I just want to redirect >> to the respective protocol but with www. >> >> I have the port 80 server block working fine. Beneath my first server >> block I have... >> >> server { >> listen 80; >> server_name example.com; >> return 301 http://www.example.com$request_uri; >> } >> >> and this works fine. But for my port 443 server block for https, I have >> all kinds of information inside regarding ssl on and different ciphers to >> use. >> >> I really don't want to mess up anything up related to security by doing >> something stupid.. so my question is on this second block for port 443 >> underneath the first one... >> >> server { >> listen 443; >> server_name example.com; >> return 301 https://www.example.com$request_uri; >> } >> >> do I need anything else? do I need ssl on or any other security related >> things? If they visit non-www does that mean it transfers the request >> insecurely or something (even for a split second while its redirecting?) >> >> >> > Put both 'listen' directives in the same server block. > > > > >> Just want to make sure what I have is solid and secure. It seems to work >> but I want to double check. >> >> Thanks! >> > --- > *B. R.* > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hostdl at gmail.com Sun Jun 9 01:47:10 2013 From: hostdl at gmail.com (Host DL) Date: Sun, 9 Jun 2013 06:17:10 +0430 Subject: All workers in 'D' state using sendfile Message-ID: Hi, I am facing the same exact issue as explained by Drew, is there any working solution to tune nginx for higher throughput? or how to deal with sleeping D state nginx processes ? i can post my server specs and nginx conf is needed but I would like to ask Drew if he found the working properly solution or not Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Jun 9 05:10:05 2013 From: nginx-forum at nginx.us (George) Date: Sun, 09 Jun 2013 01:10:05 -0400 Subject: Nginx SPDY: Missing NPN Extension in SSL/TLS Handshake ? Message-ID: <7a539a70e942756bb993ae92c4a195a9.NginxMailingListEnglish@forum.nginx.org> Hi guys, I've tried setting up CentOS 6.4, Nginx 1.4.1 with Google SPDY support and used spdycheck.org to check the site and all SPDY checks pass except this notice: Missing NPN Extension in SSL/TLS Handshake Sorry, but this server is not including an NPN Entension during the SSL/TLS handshake. The NPN Extension is an additional part of the SSL/TLS ServerHello message which allows web servers to tell browsers they support additional protocols, like SPDY. SSL/TLS servers that don't use send the NPN Extension cannot use SPDY because they have no way to tell the browser to use SPDY instead of HTTP. What exactly am I missing from Nginx 1.4.1, openssl 1.0.1e and SPDY setup to properly satisfy NPN Extension in SSL/TLS handshake ? Chrome reports SPDY support fine though. cheers Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239971,239971#msg-239971 From luky-37 at hotmail.com Sun Jun 9 11:53:27 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sun, 9 Jun 2013 13:53:27 +0200 Subject: Nginx SPDY: Missing NPN Extension in SSL/TLS Handshake ? In-Reply-To: <7a539a70e942756bb993ae92c4a195a9.NginxMailingListEnglish@forum.nginx.org> References: <7a539a70e942756bb993ae92c4a195a9.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi, this doesn't really make sense; NPN is absolutely required for SPDY. What does the ssllabs test say in "Next Protocol Negotiation"? https://www.ssllabs.com/ssltest/index.html Regards, Lukas From mdounin at mdounin.ru Sun Jun 9 12:13:00 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 9 Jun 2013 16:13:00 +0400 Subject: All workers in 'D' state using sendfile In-Reply-To: References: Message-ID: <20130609121300.GP72282@mdounin.ru> Hello! On Sun, Jun 09, 2013 at 06:17:10AM +0430, Host DL wrote: > I am facing the same exact issue as explained by Drew, > > is there any working solution to tune nginx for higher throughput? > > or how to deal with sleeping D state nginx processes ? See this reply for basic tuning suggestions: http://mailman.nginx.org/pipermail/nginx/2012-May/033761.html -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Sun Jun 9 12:48:36 2013 From: nginx-forum at nginx.us (George) Date: Sun, 09 Jun 2013 08:48:36 -0400 Subject: Nginx SPDY: Missing NPN Extension in SSL/TLS Handshake ? In-Reply-To: References: Message-ID: According to ssllabs for NPN Next Protocol Negotiation Yes spdy/2 http/1.1 so spdycheck.org incorrect ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239971,239977#msg-239977 From luky-37 at hotmail.com Sun Jun 9 13:39:42 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sun, 9 Jun 2013 15:39:42 +0200 Subject: Nginx SPDY: Missing NPN Extension in SSL/TLS Handshake ? In-Reply-To: References: , Message-ID: > so spdycheck.org incorrect ? I guess so. I would suggest to report this to support at zoompf dot com so they can fix it (or tell what exactly is wrong). Regards, Lukas From hostdl at gmail.com Sun Jun 9 14:54:49 2013 From: hostdl at gmail.com (Host DL) Date: Sun, 9 Jun 2013 19:24:49 +0430 Subject: All workers in 'D' state using sendfile In-Reply-To: <20130609121300.GP72282@mdounin.ru> References: <20130609121300.GP72282@mdounin.ru> Message-ID: Hello Maxim, Thanks for your response, and sorry that I am new to mailing list and my 1st message may was not very clear to you I've already read all posts in this conversation and all tuning options has been tested I'm using 8x 2TB SATA ENT in RAID10 level + 64G RAM on my box CentOS 5.9 x64_84 / 2.6.18-348.6.1.el5 nginx.conf: worker_priority -10; worker_processes 64; worker_rlimit_nofile 20000; events { worker_connections 2048; use epoll; worker_aio_requests 128; } http { sendfile off; tcp_nopush on; tcp_nodelay on; aio on; directio 2m; #directio_alignment 4k; output_buffers 1 1m; keepalive_timeout 15; ...... } During the peak time connections will reach up to 14-15K in total and more than 1Gbit/s outgoing throughput Please note that the server was stable with about 12K connections in the peak time and about 1-1.1Gbit/s throughput but after adding another VH with about 2-3K connections it seems that server is unable to handle the request properly at the peak time Its expected the throughput to exceed the previous ~1.1Gbit/s rate but it doesn't, Even it doesn't reach to 1Gbit/s while the connections are now getting more and bigger During every peak time the LA will each to the number of nginx workers ( 64 for my current config ) and will stay at the same rate to the end of peak time, all processes are in D state and the interesting thing, memory is not being used fully and it may push about 30-40G with about 20-30% I/O wait Connections are not being processed fast and it will stay in connecting and request sent/wait for a few seconds and then data transfer will start at a very slow rate I've already tried both sendfile and AIO, and AIO seems to handle the connections better Played with output_buffer and increased both number and size of buffers but no any special effect, even the throughput got lower The interesting thing is that at the same peak time the read transfer rate is more than 500mbit/s using scp/rsync from the RAID to /dev/null Sorry for my long post and if my english sux Any suggestion would be greatly appreciarted Respect, Moozi ============================================ On Sun, Jun 9, 2013 at 4:43 PM, Maxim Dounin wrote: > Hello! > > On Sun, Jun 09, 2013 at 06:17:10AM +0430, Host DL wrote: > > > I am facing the same exact issue as explained by Drew, > > > > is there any working solution to tune nginx for higher throughput? > > > > or how to deal with sleeping D state nginx processes ? > > See this reply for basic tuning suggestions: > > http://mailman.nginx.org/pipermail/nginx/2012-May/033761.html > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > 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 Jun 10 09:38:25 2013 From: nginx-forum at nginx.us (molj) Date: Mon, 10 Jun 2013 05:38:25 -0400 Subject: error 504, gateway timeout nginx, Message-ID: Hello! I've setup a web server running on debian with Nginx, PHP5 (PHP-FPM), And Fcgiwrap My webpage is running ok but a friend recently noticed me that while trying to access my page it gives him the Error 504(others can see my page with no problem), gateway timeout. I've searched for a solution and I've done this so far (still gives him the same error): in /etc/nginx/sites-enabled/900-ponnod.com.vhost location @php { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9012; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_read_timeout 300s; fastcgi_send_timeout 300s; } in /etc/php5/fpm/php.ini max_execution_time = 300 max_input_time = 300 Can't find anything useful in my /var/log/nginx/acess or log or in php5-fpm.log i also turned the debug in the php-fpm.conf and this is what it puts out: [10-jun-2013 11:35:33.974656] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently 0 active children, 2 spare children, 2 $ [10-jun-2013 11:35:33.974765] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently 0 active children, 2 spare children, 2 $ [10-jun-2013 11:35:33.974786] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] currently 0 active children, 3 spare childre$ [10-jun-2013 11:35:33.974802] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 r$ [10-jun-2013 11:35:34.975851] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently 0 active children, 2 spare children, 2 $ [10-jun-2013 11:35:34.975963] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently 0 active children, 2 spare children, 2 $ [10-jun-2013 11:35:34.975984] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] currently 0 active children, 3 spare childre$ [10-jun-2013 11:35:34.975998] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 r$ [10-jun-2013 11:35:35.977049] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently 0 active children, 2 spare children, 2 $ [10-jun-2013 11:35:35.977162] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently 0 active children, 2 spare children, 2 $ [10-jun-2013 11:35:35.977183] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] currently 0 active children, 3 spare childre$ [10-jun-2013 11:35:35.977227] DEBUG: pid 29522, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 r$ Nothing useful as far as i can see. Any help or direction would be appriciated, thanks! Matej Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239986,239986#msg-239986 From stageline at gmail.com Mon Jun 10 09:48:47 2013 From: stageline at gmail.com (suttya) Date: Mon, 10 Jun 2013 11:48:47 +0200 Subject: error 504, gateway timeout nginx, In-Reply-To: References: Message-ID: Hy! in /etc/php5/fpm/pool.d/www.conf: check this: request_slowlog_timeout = 0s request_terminate_timeout = 0 Hope help you 2013/6/10 molj > Hello! > > I've setup a web server running on debian with Nginx, PHP5 (PHP-FPM), And > Fcgiwrap > > My webpage is running ok but a friend recently noticed me that while trying > to access my page it gives him the Error 504(others can see my page with no > problem), gateway timeout. I've searched for a solution and I've done this > so far (still gives him the same error): > > in /etc/nginx/sites-enabled/900-ponnod.com.vhost > > > location @php { > try_files $uri =404; > include /etc/nginx/fastcgi_params; > fastcgi_pass 127.0.0.1:9012; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > #fastcgi_param PATH_INFO $fastcgi_script_name; > fastcgi_intercept_errors on; > fastcgi_read_timeout 300s; > fastcgi_send_timeout 300s; > } > > in /etc/php5/fpm/php.ini > > max_execution_time = 300 > max_input_time = 300 > > > > Can't find anything useful in my /var/log/nginx/acess or log or in > php5-fpm.log i also turned the debug in the php-fpm.conf and this is what > it puts out: > [10-jun-2013 11:35:33.974656] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently > 0 active children, 2 spare children, 2 $ > [10-jun-2013 11:35:33.974765] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently > 0 active children, 2 spare children, 2 $ > [10-jun-2013 11:35:33.974786] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] > currently 0 active children, 3 spare childre$ > [10-jun-2013 11:35:33.974802] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently > 0 > active children, 2 spare children, 2 r$ > [10-jun-2013 11:35:34.975851] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently > 0 active children, 2 spare children, 2 $ > [10-jun-2013 11:35:34.975963] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently > 0 active children, 2 spare children, 2 $ > [10-jun-2013 11:35:34.975984] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] > currently 0 active children, 3 spare childre$ > [10-jun-2013 11:35:34.975998] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently > 0 > active children, 2 spare children, 2 r$ > [10-jun-2013 11:35:35.977049] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently > 0 active children, 2 spare children, 2 $ > [10-jun-2013 11:35:35.977162] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently > 0 active children, 2 spare children, 2 $ > [10-jun-2013 11:35:35.977183] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] > currently 0 active children, 3 spare childre$ > [10-jun-2013 11:35:35.977227] DEBUG: pid 29522, > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently > 0 > active children, 2 spare children, 2 r$ > > Nothing useful as far as i can see. > > > Any help or direction would be appriciated, thanks! > > Matej > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,239986,239986#msg-239986 > > _______________________________________________ > 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 Jun 10 10:55:22 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Jun 2013 14:55:22 +0400 Subject: All workers in 'D' state using sendfile In-Reply-To: References: <20130609121300.GP72282@mdounin.ru> Message-ID: <20130610105521.GR72282@mdounin.ru> Hello! On Sun, Jun 09, 2013 at 07:24:49PM +0430, Host DL wrote: > Hello Maxim, > > Thanks for your response, and sorry that I am new to mailing list and my > 1st message may was not very clear to you > > I've already read all posts in this conversation and all tuning options has > been tested > > I'm using 8x 2TB SATA ENT in RAID10 level + 64G RAM on my box > CentOS 5.9 x64_84 / 2.6.18-348.6.1.el5 > > nginx.conf: > > worker_priority -10; > worker_processes 64; > worker_rlimit_nofile 20000; > > events { > worker_connections 2048; > use epoll; > worker_aio_requests 128; > } > > http { > sendfile off; > tcp_nopush on; > tcp_nodelay on; > aio on; > directio 2m; > #directio_alignment 4k; > output_buffers 1 1m; > > keepalive_timeout 15; > > ...... > } > > During the peak time connections will reach up to 14-15K in total and more > than 1Gbit/s outgoing throughput > Please note that the server was stable with about 12K connections in the > peak time and about 1-1.1Gbit/s throughput but after adding another VH with > about 2-3K connections it seems that server is unable to handle the request > properly at the peak time > Its expected the throughput to exceed the previous ~1.1Gbit/s rate but it > doesn't, Even it doesn't reach to 1Gbit/s while the connections are now > getting more and bigger > > During every peak time the LA will each to the number of nginx workers ( 64 > for my current config ) and will stay at the same rate to the end of peak > time, all processes are in D state and the interesting thing, memory is not > being used fully and it may push about 30-40G with about 20-30% I/O wait Main problem with AIO on Linux is that it requires directio to actually work asynchronously. I would assume you've just reached a critical number of synchronous requests to disks as due to "directio 2m" in your config (and that's why you see all workers in D state). Try tuning directio to a lower value to see if it helps. Note well: memory is not used for filesystem cache with directio, so there is no surprise it's not being used fully. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Mon Jun 10 11:04:33 2013 From: nginx-forum at nginx.us (khine) Date: Mon, 10 Jun 2013 07:04:33 -0400 Subject: nginx proxy to apache ERR_TOO_MANY_REDIRECTS Message-ID: <971ba2e79b880345b46daf542a323f93.NginxMailingListEnglish@forum.nginx.org> i have the following setup which uses nginx as proxy to an apache instance running prestashop, this works ok, but i get from time to time Error 310 ERR_TOO_MANY_REDIRECTS and i can't figure out where this is coming from and i also get these error in the apache log: [Sun Jun 09 18:57:01 2013] [error] [client xx.xx.xx.xx] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Sun Jun 09 19:21:29 2013] [error] [client xx.xx.xx.xx] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) here is my setup: # nginx -V nginx version: nginx/1.4.1 TLS SNI support enabled configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --with-google_perftools_module --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_geoip_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --add-module=/usr/ports/www/nginx/work/simpl-ngx_devel_kit-48bc5dd --add-module=/usr/ports/www/nginx/work/chaoslawful-lua-nginx-module-3915187 --with-pcre --add-module=/usr/ports/www/nginx/work/yaoweibin-nginx_tcp_proxy_module-b83e5a6 --with-http_ssl_module # httpd -M Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) authn_file_module (shared) authn_dbm_module (shared) authn_anon_module (shared) authn_default_module (shared) authn_alias_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_dbm_module (shared) authz_owner_module (shared) authz_default_module (shared) auth_basic_module (shared) auth_digest_module (shared) file_cache_module (shared) cache_module (shared) disk_cache_module (shared) dumpio_module (shared) reqtimeout_module (shared) include_module (shared) filter_module (shared) charset_lite_module (shared) deflate_module (shared) log_config_module (shared) logio_module (shared) env_module (shared) mime_magic_module (shared) cern_meta_module (shared) expires_module (shared) headers_module (shared) usertrack_module (shared) unique_id_module (shared) setenvif_module (shared) version_module (shared) ssl_module (shared) mime_module (shared) dav_module (shared) status_module (shared) autoindex_module (shared) asis_module (shared) info_module (shared) cgi_module (shared) dav_fs_module (shared) vhost_alias_module (shared) negotiation_module (shared) dir_module (shared) imagemap_module (shared) actions_module (shared) speling_module (shared) userdir_module (shared) alias_module (shared) rewrite_module (shared) php5_module (shared) rpaf_module (shared) then in my /usr/local/etc/nginx/nginx.conf i have: #user nobody; worker_processes 4; #x2 per CPU error_log /var/www/logs/nginx_error.log notice; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 5; gzip on; gzip_http_version 1.1; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml; gzip_buffers 16 8k; server { listen 178.xxx.xxx.xxx:80; server_name test.domain.tld; location ~ ^.+\.(jpg|jpeg|gif|png|ico|css|js)$ { root /www/domain.tld/http; expires max; access_log off; include custom/prestashop_params; } include custom/expires_params; location / { include custom/proxy_params; proxy_pass http://127.0.0.1:81; } } the `custom/prestashop_params` are as follows: # cat custom/prestashop_params rewrite "^/([a-z]{2})/js/(.+)$" /js/$2 last; rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last; rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last; and `custom/proxy_params`: # cat custom/proxy_params proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; proxy_set_header Range ""; proxy_set_header Request-Range ""; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffers 16 128k; proxy_busy_buffers_size 128k; proxy_buffer_size 128k; proxy_cache nginx-cache; proxy_cache_valid 200 302 60m; proxy_cache_valid 404 1m; proxy_redirect off; http.conf is setup to listen to port 81 and the vhost is: ServerAdmin admin at domain.tld DocumentRoot /www/domain.tld/http/ ServerName domain.tld Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all ErrorLog /www/domain.tld/logs/error_log CustomLog /www/domain.tld/logs/access_log common i also have IPFW setup on my server and have opened both port 80 and 81 but not sure this has anything to do with it. is there a way to trace this, so that i can understand it better? perhaps the issue is the .htaccess in the /www/domain.tld/http root directory that is causing this! and can this setup be made simpler, as i will have several prestashops instances running from this server with individual SSL certificates? any advice much appreciated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239993,239993#msg-239993 From hostdl at gmail.com Mon Jun 10 11:08:45 2013 From: hostdl at gmail.com (Host DL) Date: Mon, 10 Jun 2013 15:38:45 +0430 Subject: All workers in 'D' state using sendfile In-Reply-To: <20130610105521.GR72282@mdounin.ru> References: <20130609121300.GP72282@mdounin.ru> <20130610105521.GR72282@mdounin.ru> Message-ID: Dear Maxim, Thanks for your response, I don't think it will help much since all of my files are larger enough than 2MB Regarding AIO problem in linux, do you think using AIO + sendfile together on FreeBSD will be better in performance in my case? Respect ============================================ On Mon, Jun 10, 2013 at 3:25 PM, Maxim Dounin wrote: > Hello! > > On Sun, Jun 09, 2013 at 07:24:49PM +0430, Host DL wrote: > > > Hello Maxim, > > > > Thanks for your response, and sorry that I am new to mailing list and my > > 1st message may was not very clear to you > > > > I've already read all posts in this conversation and all tuning options > has > > been tested > > > > I'm using 8x 2TB SATA ENT in RAID10 level + 64G RAM on my box > > CentOS 5.9 x64_84 / 2.6.18-348.6.1.el5 > > > > nginx.conf: > > > > worker_priority -10; > > worker_processes 64; > > worker_rlimit_nofile 20000; > > > > events { > > worker_connections 2048; > > use epoll; > > worker_aio_requests 128; > > } > > > > http { > > sendfile off; > > tcp_nopush on; > > tcp_nodelay on; > > aio on; > > directio 2m; > > #directio_alignment 4k; > > output_buffers 1 1m; > > > > keepalive_timeout 15; > > > > ...... > > } > > > > During the peak time connections will reach up to 14-15K in total and > more > > than 1Gbit/s outgoing throughput > > Please note that the server was stable with about 12K connections in the > > peak time and about 1-1.1Gbit/s throughput but after adding another VH > with > > about 2-3K connections it seems that server is unable to handle the > request > > properly at the peak time > > Its expected the throughput to exceed the previous ~1.1Gbit/s rate but it > > doesn't, Even it doesn't reach to 1Gbit/s while the connections are now > > getting more and bigger > > > > During every peak time the LA will each to the number of nginx workers ( > 64 > > for my current config ) and will stay at the same rate to the end of peak > > time, all processes are in D state and the interesting thing, memory is > not > > being used fully and it may push about 30-40G with about 20-30% I/O wait > > Main problem with AIO on Linux is that it requires directio to > actually work asynchronously. I would assume you've just reached > a critical number of synchronous requests to disks as due to > "directio 2m" in your config (and that's why you see all workers > in D state). Try tuning directio to a lower value to see if it > helps. > > Note well: memory is not used for filesystem cache with directio, > so there is no surprise it's not being used fully. > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > 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 Jun 10 11:09:22 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 10 Jun 2013 12:09:22 +0100 Subject: nginx proxy to apache ERR_TOO_MANY_REDIRECTS In-Reply-To: <971ba2e79b880345b46daf542a323f93.NginxMailingListEnglish@forum.nginx.org> References: <971ba2e79b880345b46daf542a323f93.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 10 June 2013 12:04, khine wrote: > i also get these error in the apache log: > > [Sun Jun 09 18:57:01 2013] [error] [client xx.xx.xx.xx] client sent > HTTP/1.1 request without hostname (see RFC2616 section 14.23): > /w00tw00t.at.ISC.SANS.DFind:) > [Sun Jun 09 19:21:29 2013] [error] [client xx.xx.xx.xx] client sent > HTTP/1.1 request without hostname (see RFC2616 section 14.23): > /w00tw00t.at.ISC.SANS.DFind:) http://bit.ly/12eMCLC Jonathan From wigyori at uid0.hu Mon Jun 10 11:18:35 2013 From: wigyori at uid0.hu (Zoltan HERPAI) Date: Mon, 10 Jun 2013 13:18:35 +0200 (CEST) Subject: extended_status module for 1.5.x Message-ID: Hi all, Has someone forwardported this module to 1.5.x? Although the 1.0.11 diff can be applied to 1.2.6 as per the doc, it gives a shipload of fails when touching ngx_http_request.c. Thanks, -w- From vbart at nginx.com Mon Jun 10 11:30:55 2013 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 10 Jun 2013 15:30:55 +0400 Subject: All workers in 'D' state using sendfile In-Reply-To: References: <20130610105521.GR72282@mdounin.ru> Message-ID: <201306101530.55168.vbart@nginx.com> On Monday 10 June 2013 15:08:45 Host DL wrote: > Dear Maxim, > > Thanks for your response, > I don't think it will help much since all of my files are larger enough > than 2MB [...] How large? And how big is the entire dataset? Perhaps, quite the opposite you should increase the directio value for better utilization of pagecache. wbr, Valentin V. Bartenev -- http://nginx.org/en/donation.html From mdounin at mdounin.ru Mon Jun 10 11:57:06 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Jun 2013 15:57:06 +0400 Subject: All workers in 'D' state using sendfile In-Reply-To: References: <20130609121300.GP72282@mdounin.ru> <20130610105521.GR72282@mdounin.ru> Message-ID: <20130610115706.GT72282@mdounin.ru> Hello! On Mon, Jun 10, 2013 at 03:38:45PM +0430, Host DL wrote: > Dear Maxim, > > Thanks for your response, > I don't think it will help much since all of my files are larger enough > than 2MB The "D" state of nginx workers has only one explanation: blocking operations on disks. When serving static files with nginx on Linux, this basically means one of the following: 1. opening / stat()'ing files 2. blocking aio reads due to no directio on unaligned reads 3. blocking aio reads due to no directio on small files Within nginx, you may reduce possibility of (3) using directio directive with a smaller value. Both (1) and (2) are more or less unavoidable, but aren't likely to happen, at least with proper OS tuning. If in doubt, try tracing where worker processes are blocked. As a very first step, ps(1) output should be examined for a wait channel column (wchan). > Regarding AIO problem in linux, do you think using AIO + sendfile together > on FreeBSD will be better in performance in my case? Yes. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Mon Jun 10 12:21:47 2013 From: nginx-forum at nginx.us (xiaowl) Date: Mon, 10 Jun 2013 08:21:47 -0400 Subject: I see unusual amount of 408 errors from access log Message-ID: <8236f873160351fbc464c5eb5f8af95f.NginxMailingListEnglish@forum.nginx.org> /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:01:20 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:10:57 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:16:55 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:18:31 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:21:54 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:25:57 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:33:43 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:36:02 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:36:21 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:49:05 +0000] "-" 408 0 "-" "-" /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:55:31 +0000] "-" 408 0 "-" "-" As you can see, the log doesn't contain any information about request, like request method and request uri. A normal access log should like this: /var/log/nginx/nost_access.log.1:x.x.x.x - - [09/Jun/2013:22:49:58 +0000] "POST /some/resource/3984/upload/ HTTP/1.1" 408 0 "-" "APIClient-Android-16#v0.8.6" My question is, why some access log entries have no request method/uri? I guess the 408 occurs in a early phase when the request entry is not processed yet. Since I'm enable HTTPS, is that can be a reason about this error? My Nginx version is 1.2.1. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240003,240003#msg-240003 From nginx-forum at nginx.us Mon Jun 10 12:24:08 2013 From: nginx-forum at nginx.us (yogeshnachnani) Date: Mon, 10 Jun 2013 08:24:08 -0400 Subject: Sending SSL Client Certificate upstream In-Reply-To: <1cad592bfd9800e6e2d472f8afa03681.NginxMailingListEnglish@forum.nginx.org> References: <1cad592bfd9800e6e2d472f8afa03681.NginxMailingListEnglish@forum.nginx.org> Message-ID: <25a399d5c4bf5bca6ad8c14ec450c3da.NginxMailingListEnglish@forum.nginx.org> I have a similar requirement. Dave, Did you find a solution for this? The only thing that I can think of currently is have the servers use a basic http auth instead off ssl client cert auth. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,236314,240004#msg-240004 From mdounin at mdounin.ru Mon Jun 10 12:28:51 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 10 Jun 2013 16:28:51 +0400 Subject: I see unusual amount of 408 errors from access log In-Reply-To: <8236f873160351fbc464c5eb5f8af95f.NginxMailingListEnglish@forum.nginx.org> References: <8236f873160351fbc464c5eb5f8af95f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130610122851.GU72282@mdounin.ru> Hello! On Mon, Jun 10, 2013 at 08:21:47AM -0400, xiaowl wrote: > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:01:20 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:10:57 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:16:55 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:18:31 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:21:54 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:25:57 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:33:43 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:36:02 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:36:21 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:49:05 +0000] > "-" 408 0 "-" "-" > /var/log/nginx/nost_access.log.1:x.x.x.x - - [10/Jun/2013:09:55:31 +0000] > "-" 408 0 "-" "-" > > As you can see, the log doesn't contain any information about request, like > request method and request uri. A normal access log should like this: > > /var/log/nginx/nost_access.log.1:x.x.x.x - - [09/Jun/2013:22:49:58 +0000] > "POST /some/resource/3984/upload/ HTTP/1.1" 408 0 "-" > "APIClient-Android-16#v0.8.6" > > My question is, why some access log entries have no request method/uri? I > guess the 408 occurs in a early phase when the request entry is not > processed yet. Since I'm enable HTTPS, is that can be a reason about this > error? > > My Nginx version is 1.2.1. These are https connections without anything sent (closed due to timeout). In 1.3.15+, such connections are no longer result in access_log entries. -- Maxim Dounin http://nginx.org/en/donation.html From r at roze.lv Mon Jun 10 12:37:40 2013 From: r at roze.lv (Reinis Rozitis) Date: Mon, 10 Jun 2013 15:37:40 +0300 Subject: I see unusual amount of 408 errors from access log In-Reply-To: <8236f873160351fbc464c5eb5f8af95f.NginxMailingListEnglish@forum.nginx.org> References: <8236f873160351fbc464c5eb5f8af95f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2A989E12A6E04606B137EA3527CDCB6D@MezhRoze> > My question is, why some access log entries have no request method/uri? I guess the 408 occurs in a early phase when the request entry is not processed yet. It is usually generated by browsers (like Chrome http://code.google.com/p/chromium/issues/detail?id=85229 ) opening more sockets to the webserver (a way of "optimisation") and not actually using them - eg not sending any http request. rr From nginx-forum at nginx.us Mon Jun 10 12:42:01 2013 From: nginx-forum at nginx.us (George) Date: Mon, 10 Jun 2013 08:42:01 -0400 Subject: Nginx SPDY: Missing NPN Extension in SSL/TLS Handshake ? In-Reply-To: References: Message-ID: <2cd5b8bb748d045910746fe24fb98c00.NginxMailingListEnglish@forum.nginx.org> Thanks Lukas for your help :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239971,240007#msg-240007 From agentzh at gmail.com Mon Jun 10 19:35:40 2013 From: agentzh at gmail.com (agentzh) Date: Mon, 10 Jun 2013 12:35:40 -0700 Subject: [ANN] ngx_openresty stable version 1.2.8.6 released Message-ID: Hello folks! I am happy to announce that the new stable version of ngx_openresty, 1.2.8.6, is now released: http://openresty.org/#Download Below is the change log for this release, as compared to the last (devel) release, 1.2.8.5: * upgraded LuaJIT to 2.0.2. * changes: The following components are bundled: * LuaJIT-2.0.2 * array-var-nginx-module-0.03rc1 * auth-request-nginx-module-0.2 * drizzle-nginx-module-0.1.5 * echo-nginx-module-0.45 * encrypted-session-nginx-module-0.03 * form-input-nginx-module-0.07 * headers-more-nginx-module-0.20 * iconv-nginx-module-0.10 * lua-5.1.5 * lua-cjson-1.0.3 * lua-rds-parser-0.05 * lua-redis-parser-0.10 * lua-resty-dns-0.09 * lua-resty-memcached-0.11 * lua-resty-mysql-0.13 * lua-resty-redis-0.15 * lua-resty-string-0.08 * lua-resty-upload-0.08 * memc-nginx-module-0.13rc3 * nginx-1.2.8 * ngx_coolkit-0.2rc1 * ngx_devel_kit-0.2.18 * ngx_lua-0.8.2 * ngx_postgres-1.0rc2 * rds-csv-nginx-module-0.05rc2 * rds-json-nginx-module-0.12rc10 * redis-nginx-module-0.3.6 * redis2-nginx-module-0.10 * set-misc-nginx-module-0.22rc8 * srcache-nginx-module-0.21 * xss-nginx-module-0.03rc9 We'll move onto the latest Nginx stable series 1.4.x for the next release :) OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules and Lua libraries, as well as most of their external dependencies. See OpenResty's homepage for details: http://openresty.org/ We have been running extensive testing on our Amazon EC2 test cluster and ensure that all the components (including the Nginx core) play well together. The latest test report can always be found here: http://qa.openresty.org Enjoy! -agentzh From nginx-forum at nginx.us Mon Jun 10 20:51:19 2013 From: nginx-forum at nginx.us (freerk55) Date: Mon, 10 Jun 2013 16:51:19 -0400 Subject: EGroupWare nginx config In-Reply-To: <20120113195141.3ad9aa14@e-healthexpert.org> References: <20120113195141.3ad9aa14@e-healthexpert.org> Message-ID: <50f3d505b6f56ee600a25309c84d93ad.NginxMailingListEnglish@forum.nginx.org> Hello Mark, I had Egroupware on Apache2 and have everything now on Nginx Everything works fine. Exept... The filemanager: Ik can upload files en see an icon wich "proofs" that the file arrived on the server. But when I click on the link of that file, i get an error: 404 Not Found nginx/1.2.6 (Ubuntu) Does this work on your situation? Freerk Jongsma Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221202,240012#msg-240012 From nginx-forum at nginx.us Mon Jun 10 21:33:23 2013 From: nginx-forum at nginx.us (Perel) Date: Mon, 10 Jun 2013 17:33:23 -0400 Subject: Any equivalent of mod_dumpio In-Reply-To: References: Message-ID: <14b2683a7513a948e552e270e0b7cd27.NginxMailingListEnglish@forum.nginx.org> jeff7091 Wrote: ------------------------------------------------------- > Is there anything like Apache's mod_dumpio? Any way to get a full > running trace of request & responses, including the body data? Would > such a thing be useful to anyone besides me? I would be quite interested in this as well. Debug log is great, but does not show full response bodies like mod_dumpio does. Did you end up writing something? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,238419,240013#msg-240013 From nginx-forum at nginx.us Tue Jun 11 01:53:39 2013 From: nginx-forum at nginx.us (soisita) Date: Mon, 10 Jun 2013 21:53:39 -0400 Subject: Nginx http-bind eJabbered pending requests Chrome Message-ID: <84e82163c0f3af15ea514850badfaf9f.NginxMailingListEnglish@forum.nginx.org> Hi, I'm working on a server where nginx runs as proxy on Apache It proxies php files & ejabbered requests & serves static files Everything was fine until a few weeks, and only on Chrome: when http-bind is pending, it makes all further requests pending also, thus all images called after the http-bind request are "pending" until ejabbered answers (about 1.5 min) Any idea? here part of the conf: nginx/0.7.67 user www-data; worker_processes 8; worker_cpu_affinity 0001 0010 0011 0100 0101 0110 0111 1000; 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; default_type application/octet-stream; sendfile on; tcp_nopush on; server_tokens off; server_names_hash_bucket_size 128; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; add_header Access-Control-Allow-Origin *; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } site: server { bla bla location /http-bind/ { tcp_nodelay on; keepalive_timeout 55; proxy_pass http://chatdomain:5280/http-bind/; } } server { listen 80; server_name STATICSDOMAIN; # 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; } location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|srt|swf|pdf)$ { root /PATHTOSTATICS; expires 30d; } } 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; client_max_body_size 20m; client_body_buffer_size 128k; client_header_buffer_size 64k; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; proxy_buffer_size 64k; proxy_buffers 32 64k; proxy_busy_buffers_size 128k; large_client_header_buffers 8 64k; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240016,240016#msg-240016 From nginx-forum at nginx.us Tue Jun 11 09:10:20 2013 From: nginx-forum at nginx.us (n1xman) Date: Tue, 11 Jun 2013 05:10:20 -0400 Subject: Nginx cache files by mime type using ngx_srcache module Message-ID: Hi, I?m using ngx_srcache module with Memcached to cache static contents of the upstream servers. This is based on static file extensions. Now I need to cached them by looking at Content-Type of the header to cache .html pages as we do not use the .html extension. (i.e. http://www.example.com/this-is-my-site ) Is this possible with ngx_srcache module using map module or something similar.. http { map $upstream_http_content_type $no_proxy { default 0; ~*^html/ 0; } and hook this $no_proxy to ngx_srcache variables like I?m doing with extension?? location ~* \.(html)$ { set $key $uri$args; srcache_fetch GET /memc key=$key; srcache_store PUT /memc key=$key&exptime=$ttl_1m; proxy_pass http://www.example.com; } Any help to this is really appreciated. Thanks in advance. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240023,240023#msg-240023 From jakob at jet-stream.nl Tue Jun 11 12:19:46 2013 From: jakob at jet-stream.nl (Jakob van Bethlehem) Date: Tue, 11 Jun 2013 14:19:46 +0200 Subject: Problems combining 'backup' command in upstream block with 'fair'-command Message-ID: Dear users, My first message here; I discussed my issue already with some folks on IRC; my main conclusion was that I should try it with a broader audience. So here's the problem: * we're using the ngx_http_upstream_module, and ngx_http_upstream_fair_module together with the HttpProxyModule * The 'proxy'-configuration looks like this: location "/jvbnet/betsy/ip-vhost-trial/" { rewrite "^/jvbnet/betsy/ip-vhost-trial/(.*)$" "/$1" break; proxy_pass http://0893697e3d3e9e1a78d79c5d3b13c258; proxy_set_header Host rd.devel.xxx-xxxxx.nl; proxy_cache cache; } * There is a separate configuration file defining the upstream: upstream 0893697e3d3e9e1a78d79c5d3b13c258 { server 172.17.88.10; server 172.17.88.20 backup; fair; } * What I see: - If no connection can be made to 172.17.88.10 (because I switched off Apache over there), no roll-over to 172.17.88.20 happens - Next I remove the 'fair' command: upstream 0893697e3d3e9e1a78d79c5d3b13c258 { server 172.17.88.10; server 172.17.88.20 backup; } - Now, in the same situation, nginx -does- rollover to 172.17.88.20, as I expected * What I expected: nginx performing rollover in the first scenario I get the same results if more non-backup servers are configured. And if I put 'fair' as the first command in the initial scenario: upstream 0893697e3d3e9e1a78d79c5d3b13c258 { fair; server 172.17.88.10; server 172.17.88.20 backup; } the nginx configuration tester gives an error: nginx: [emerg] invalid parameter "backup" To me it seems that the fair-module does not cooperate properly with the 'backup' parameter. Did anyone else notice this problem, and if so, is there a workaround/solution? Are there other configuration issues I may have to check? Sincerely, Jakob van Bethlehem -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Tue Jun 11 12:55:19 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 11 Jun 2013 16:55:19 +0400 Subject: Problems combining 'backup' command in upstream block with 'fair'-command In-Reply-To: References: Message-ID: <20130611125519.GG72282@mdounin.ru> Hello! On Tue, Jun 11, 2013 at 02:19:46PM +0200, Jakob van Bethlehem wrote: [...] > I get the same results if more non-backup servers are configured. And if I put 'fair' as the first command in the initial scenario: > upstream 0893697e3d3e9e1a78d79c5d3b13c258 { > fair; > server 172.17.88.10; > server 172.17.88.20 backup; > } > > the nginx configuration tester gives an error: > nginx: [emerg] invalid parameter "backup" > > To me it seems that the fair-module does not cooperate properly with the 'backup' parameter. Did anyone else notice this problem, and if so, is there a workaround/solution? Are there other configuration issues I may have to check? The error message suggests that fair balancer isn't able to work with backup servers. The error is only reported if a balancer is activated before "server" directives as the check in question only done when parsing "server" directives. -- Maxim Dounin http://nginx.org/en/donation.html From agentzh at gmail.com Tue Jun 11 19:05:31 2013 From: agentzh at gmail.com (agentzh) Date: Tue, 11 Jun 2013 12:05:31 -0700 Subject: Nginx cache files by mime type using ngx_srcache module In-Reply-To: References: Message-ID: Hello! On Tue, Jun 11, 2013 at 2:10 AM, n1xman wrote: > Now I need to > cached them by looking at Content-Type of the header to cache .html pages as > we do not use the .html extension. (i.e. > http://www.example.com/this-is-my-site ) > > Is this possible with ngx_srcache module using map module or something > similar.. > > http { > map $upstream_http_content_type $no_proxy { > default 0; > ~*^html/ 0; > } > > and hook this $no_proxy to ngx_srcache variables like I?m doing with > extension?? > > location ~* \.(html)$ { > set $key $uri$args; Just a side note: because you're using the key in the "key" URI argument below, you should escape it because the value may contain special characters. That is, set_escape_uri $key $uri$args; And then in your location = /memc, you should unescape the "key" URI argument like this: set_unescape_uri $key $arg_key; > srcache_fetch GET /memc key=$key; > srcache_store PUT /memc key=$key&exptime=$ttl_1m; > proxy_pass http://www.example.com; > } > You can use the srcache_store_skip directive to achieve this: http://wiki.nginx.org/HttpSRCacheModule#srcache_store_skip Basically, you can do something like this: map $upstream_http_content_type $no_store { default 1; ~*html 0; } server { ... location / { set_escape_uri $key $uri$args; srcache_fetch GET /memc key=$key; srcache_store PUT /memc key=$key&exptime=$ttl_1m; proxy_pass http://www.example.com; srcache_store_skip $no_store; } } Best regards, -agentzh From nginx-forum at nginx.us Tue Jun 11 23:46:25 2013 From: nginx-forum at nginx.us (solitaryr) Date: Tue, 11 Jun 2013 19:46:25 -0400 Subject: nginx proxy vs apache proxy In-Reply-To: <4e1ac52177a2fa140555024cadf33fb7.NginxMailingListEnglish@forum.nginx.org> References: <4e1ac52177a2fa140555024cadf33fb7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <91889cdd888d38ea8a589a01dbcf535e.NginxMailingListEnglish@forum.nginx.org> This apparently handles the proxying differently. Guess it's back to Apache since it handles it readily and has AJP support. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239872,240043#msg-240043 From jan.algermissen at nordsc.com Wed Jun 12 06:31:47 2013 From: jan.algermissen at nordsc.com (Jan Algermissen) Date: Wed, 12 Jun 2013 08:31:47 +0200 Subject: OpenSSL memory management Message-ID: Hi, I am new to this list and to nginx, so here is a short intro: I am Jan Algermissen, primarily a complete REST/HTTP-head and recently focussing on REST API security. About to write an nginx module as an authenticating HTTP gateway. I have a question regarding memory management and the use of OpenSSL (libcrypto) in nginx: AFAIK, libcrypto is doing quite a lot of memory allocations/deallocations internally, unsing standard malloc etc. When a piece software that builds upon libcrypto provides its own memory management (for example nginx) it can explicitly set the memory management functions used by libcrypto. This can be done by using CRYPTO_set_mem_functions (#include ). Looking at the nginx sources, I did not find any use of this feature. Am I missing something, or does the SSL module of nginx simply ignore the memory management issue, defering to the use of malloc inside libcrypto? If so, can anyone explain the rationale for doiing so? Jan From nginx-forum at nginx.us Wed Jun 12 10:28:48 2013 From: nginx-forum at nginx.us (funtimezone) Date: Wed, 12 Jun 2013 06:28:48 -0400 Subject: Best Entertaining Platform from all over the world Message-ID: Welcome to the best entertaining program from all over the word. Make Money Online with best investment in Hedge fund day trading with high returns on Daily Interest the world best revenue sharing program. Post free classified ads, play free online games, find free recipes from all over the world, send free sms from all over the world and make live chat from all over the world and also private chat as well to do it, so enjoy with the best entertaining program in the world. For More Details click the link below: http://www.funtimezone.com Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240048,240048#msg-240048 From nginx-forum at nginx.us Wed Jun 12 10:51:31 2013 From: nginx-forum at nginx.us (n1xman) Date: Wed, 12 Jun 2013 06:51:31 -0400 Subject: Nginx cache files by mime type using ngx_srcache module In-Reply-To: References: Message-ID: <71a7e6901155d24e9058fe9568ce1c64.NginxMailingListEnglish@forum.nginx.org> Hi agentzh, Thanks for the support and it is working :) However, I have noticed every srcache_fetch GET /memc subrequest hits the memcached even though srcache_store skipped content-type which is not defined. This will keep busy the memcached server and I think srcache_fetch GET subrequest should not executed if srcache_store_skip triggered first. Or am I missing something here... map $upstream_http_content_type $no_store { default 1; ~*html 0; } server { .. location /memc { internal; set_unescape_uri $memc_key $arg_key; set $memc_key $arg_key; set $memc_exptime $arg_exptime; memc_pass 127.0.0.1:11211; } location / { srcache_response_cache_control off; set_escape_uri $key $uri$args; set $ttl_1d 60; srcache_fetch GET /memc key=$key; srcache_store PUT /memc key=$key&exptime=$ttl_1d; srcache_store_statuses 200; proxy_pass http://192.168.0.61:900; srcache_store_skip $no_store; } .. } Find the debug logs when firing following urls curl -i http://192.168.0.160/index.html < served from the memcached curl -i http://192.168.0.160/santa.jpg < not served from the memcached but the request hits the memcached error.log http://pastebin.com/jbMm83qh [root at localhost conf.d]# nginx -V nginx version: nginx/1.4.1 built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail_ssl_module --with-file-aio --without-mail_smtp_module --without-mail_imap_module --without-mail_pop3_module --with-debug --with-http_spdy_module --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/ngx_devel_kit-master --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/echo-nginx-module-master --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/set-misc-nginx-module-master --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/srcache-nginx-module-master --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/nginx-sticky-module-1.1 --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/nginx_upstream_check_module-master --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/memc-nginx-module-master --add-module=/usr/local/hirantha/rpmbuild/BUILD/nginx-1.4.1/contrib/nginx_cross_origin_module-master --with-cc-opt='-O2 -g' Really appreciate your support here. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240023,240049#msg-240049 From mailinglisten at simonhoenscheid.de Wed Jun 12 22:14:41 2013 From: mailinglisten at simonhoenscheid.de (=?ISO-8859-15?Q?Simon_H=F6nscheid?=) Date: Thu, 13 Jun 2013 00:14:41 +0200 Subject: Need some help with rewrite rule translation Message-ID: <51B8F2D1.8000602@simonhoenscheid.de> Hello List, I managed to translate nearly all our old apache rules, but have some problems with the following ones: # skip existing files RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule .* - [L] RewriteRule ^favicon\.ico$ - [R=404,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([0-9]+)\.(flv|gif)$ getFile.php?itemid=$1&type=$2 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\/upload\/ RewriteRule ^(.*)$ upload/$1 [L] Thanks for the help Simon From luky-37 at hotmail.com Wed Jun 12 23:20:02 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Thu, 13 Jun 2013 01:20:02 +0200 Subject: nginx proxy vs apache proxy In-Reply-To: <91889cdd888d38ea8a589a01dbcf535e.NginxMailingListEnglish@forum.nginx.org> References: <4e1ac52177a2fa140555024cadf33fb7.NginxMailingListEnglish@forum.nginx.org>, <91889cdd888d38ea8a589a01dbcf535e.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi, > Nginx responses show (regardless of how I try to connect): > > Scheme: http > Name: my.example.com > Port: 80 > [...] > proxy_set_header Host $http_host; > proxy_set_header X-Forwarded-By $server_addr:$server_port; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header X-Forwarded-Proto $scheme; Are you sure Apache uses exactly the same headers when passing the request to the backend? Compare the frontend/backend traffic with apache and nginx, and adjust the nginx configuration accordingly. Nginx will do what you configure; but I guess the values above are not really inspected by your backend. > Guess it's back to Apache since it handles it readily and has AJP support. Take a look at nginx_ajp_module: https://github.com/yaoweibin/nginx_ajp_module#readme Regards, Lukas From artemrts at ukr.net Thu Jun 13 03:46:25 2013 From: artemrts at ukr.net (wishmaster) Date: Thu, 13 Jun 2013 06:46:25 +0300 Subject: Need some help with rewrite rule translation In-Reply-To: <51B8F2D1.8000602@simonhoenscheid.de> References: <51B8F2D1.8000602@simonhoenscheid.de> Message-ID: <68473.1371095185.14077873764824907776@ffe16.ukr.net> --- Original message --- From: "Simon H?nscheid" Date: 13 June 2013, 01:14:11 > Hello List, > > I managed to translate nearly all our old apache rules, but have some > problems with the following ones: > > # skip existing files > RewriteCond %{REQUEST_FILENAME} -f [OR] > RewriteCond %{REQUEST_FILENAME} -d > RewriteRule .* - [L] > > RewriteRule ^favicon\.ico$ - [R=404,L] > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^([0-9]+)\.(flv|gif)$ getFile.php?itemid=$1&type=$2 [L] > > > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_URI} !\/upload\/ > RewriteRule ^(.*)$ upload/$1 [L] > And what is your own (draft) rules after reading http://nginx.org/en/docs/http/converting_rewrite_rules.html ?? From mailinglisten at simonhoenscheid.de Thu Jun 13 08:38:59 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Thu, 13 Jun 2013 10:38:59 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: <68473.1371095185.14077873764824907776@ffe16.ukr.net> References: <51B8F2D1.8000602@simonhoenscheid.de> <68473.1371095185.14077873764824907776@ffe16.ukr.net> Message-ID: <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> That is what I have got: Am 13.06.2013 05:46, schrieb wishmaster: > --- Original message --- > From: "Simon H?nscheid" > Date: 13 June 2013, 01:14:11 > > > Hello List, > > I managed to translate nearly all our old apache rules, but have some > problems with the following ones: > > # skip existing files > RewriteCond %{REQUEST_FILENAME} -f [OR] > RewriteCond %{REQUEST_FILENAME} -d > RewriteRule .* - [L] I have no solution here > RewriteRule ^favicon\.ico$ - [R=404,L] location /(^favicon)/(.*\.(ico)) { return 404; } > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^([0-9]+)\.(flv|gif)$ getFile.php?itemid=$1&type=$2 [L] > location / { if (!-e $request_filename){ rewrite ^/([0-9]+)\.(flv|gif)$ /getFile.php?itemid=$1&type=$2 last; } } > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_URI} !\/upload\/ > RewriteRule ^(.*)$ upload/$1 [L] location ~ \/upload\/ { } location / { if (!-e $request_filename){ rewrite ^(.*)$ /upload/$1 last; } } > And what is your own (draft) rules after reading > http://nginx.org/en/docs/http/converting_rewrite_rules.html ?? > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From hostdl at gmail.com Thu Jun 13 08:52:16 2013 From: hostdl at gmail.com (Host DL) Date: Thu, 13 Jun 2013 13:22:16 +0430 Subject: Need some help with rewrite rule translation In-Reply-To: <51B8F2D1.8000602@simonhoenscheid.de> References: <51B8F2D1.8000602@simonhoenscheid.de> Message-ID: On Thu, Jun 13, 2013 at 2:44 AM, Simon H?nscheid < mailinglisten at simonhoenscheid.de> wrote: > > # skip existing files > RewriteCond %{REQUEST_FILENAME} -f [OR] > RewriteCond %{REQUEST_FILENAME} -d > RewriteRule .* - [L] > if (-e $request_filename){ break; } try this at the first of your location/server block -------------- next part -------------- An HTML attachment was scrubbed... URL: From hostdl at gmail.com Thu Jun 13 09:04:31 2013 From: hostdl at gmail.com (Host DL) Date: Thu, 13 Jun 2013 13:34:31 +0430 Subject: All workers in 'D' state using sendfile In-Reply-To: <20130610115706.GT72282@mdounin.ru> References: <20130609121300.GP72282@mdounin.ru> <20130610105521.GR72282@mdounin.ru> <20130610115706.GT72282@mdounin.ru> Message-ID: Thanks you for clarification on this issue The last modification that worked properly was reducing workers I tried both 64, 24 and 12 workers and less workers was better in performances during the peak time I can't recognize why but it works like a charm PS: Dual E5-2620 has been used which leads to 24 HT core and 12 real core -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Jun 13 11:41:31 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 13 Jun 2013 15:41:31 +0400 Subject: OpenSSL memory management In-Reply-To: References: Message-ID: <20130613114131.GN72282@mdounin.ru> Hello! On Wed, Jun 12, 2013 at 08:31:47AM +0200, Jan Algermissen wrote: > Hi, > > I am new to this list and to nginx, so here is a short intro: > > I am Jan Algermissen, primarily a complete REST/HTTP-head and recently > focussing on REST API security. About to write an nginx module as an > authenticating HTTP gateway. > > I have a question regarding memory management and the use of OpenSSL > (libcrypto) in nginx: > > AFAIK, libcrypto is doing quite a lot of memory allocations/deallocations > internally, unsing standard malloc etc. > > When a piece software that builds upon libcrypto provides its own > memory management (for example nginx) it can explicitly set the > memory management functions used by libcrypto. This can be done > by using CRYPTO_set_mem_functions (#include ). > > Looking at the nginx sources, I did not find any use of this feature. Am > I missing something, or does the SSL module of nginx simply ignore > the memory management issue, defering to the use of malloc inside > libcrypto? > > If so, can anyone explain the rationale for doiing so? OpenSSL allocations life time often more than a request life time, and sometimes more than a connection life time. This makes use of nginx memory management functions mostly pointless. -- Maxim Dounin http://nginx.org/en/donation.html From m00n.silv3r at gmail.com Thu Jun 13 12:26:35 2013 From: m00n.silv3r at gmail.com (Silver Moon) Date: Thu, 13 Jun 2013 17:56:35 +0530 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: Message-ID: Hi I need to add expires headers conditionally based on a certain mime type. For example add expires 7d to text/css How to do this ? So far I found that $sent_http_content_type contains the mime type that is send in http response. But its not possible to put it in a if directive and do expires either, if ($sent_http_content_type = "text/css") { expires 7d; } will not work. Also tried to create a map and try to hack around, but could not do it. I cannot do on file based or specific directory location based because lots of css/js content is generated from php files dynamically. And there are multiple php files generating content. I need a neat way to implement this, is it possible ? -- Silver -------------- next part -------------- An HTML attachment was scrubbed... URL: From gregm at servu.net.au Thu Jun 13 15:25:39 2013 From: gregm at servu.net.au (Greg M) Date: Thu, 13 Jun 2013 15:25:39 +0000 Subject: ipv6 upstream support Message-ID: <758BD56B30B33343A02413D9CADBD34310A9C722@HKNPRD0310MB361.apcprd03.prod.outlook.com> Hi Maxim, Is ipv6 upstream support available in nginx's proxy modules just yet? Thanks, Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 6469 bytes Desc: not available URL: From vbart at nginx.com Thu Jun 13 17:03:54 2013 From: vbart at nginx.com (Valentin V. Bartenev) Date: Thu, 13 Jun 2013 21:03:54 +0400 Subject: ipv6 upstream support In-Reply-To: <758BD56B30B33343A02413D9CADBD34310A9C722@HKNPRD0310MB361.apcprd03.prod.outlook.com> References: <758BD56B30B33343A02413D9CADBD34310A9C722@HKNPRD0310MB361.apcprd03.prod.outlook.com> Message-ID: <201306132103.54804.vbart@nginx.com> On Thursday 13 June 2013 19:25:39 Greg M wrote: > Is ipv6 upstream support available in nginx's proxy modules just yet? Yes, it's available since nginx 1.3.1 and 1.2.2. wbr, Valentin V. Bartenev -- http://nginx.org/en/donation.html From mailinglisten at simonhoenscheid.de Thu Jun 13 17:24:12 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Thu, 13 Jun 2013 19:24:12 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> Message-ID: I have an other rule driving me crazy: Apache: RewriteRule ^image/resized/(\d+)/([0-9a-fA-F]{6}/|)(.+)_(\d+)(|m)x(\d+)(|m)(_.+|).(jpg|jpeg|png|gif) resized/getByDimension.php?domainid=$1&objectid=$3&width=$4&height=$6&format=$9&random=$8&color=$2&maxwidth=$5&maxheight=$7 [L] nginx: location / { rewrite "^/image/resized/(\d+)/([0-9a-fA-F]{6}/|)(.+)_(\d+)(|m)x(\d+)(|m)(_.+|)\.(jpg|jpeg|png|gif)" /resized/getByDimension.php?domainid=$1&objectid=$3&width=$4&height=$6&format=$9&random=$8&color=$2&maxwidth=$5&maxheight=$7 last; } Is there a fault? Thanks for the Help Simon Am 13.06.2013 10:52, schrieb Host DL: > On Thu, Jun 13, 2013 at 2:44 AM, Simon H?nscheid > wrote: > > # skip existing files > RewriteCond %{REQUEST_FILENAME} -f [OR] > RewriteCond %{REQUEST_FILENAME} -d > RewriteRule .* - [L] > > if (-e $request_filename){ > > break; > } > > try this at the first of your location/server block > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From reallfqq-nginx at yahoo.fr Thu Jun 13 17:35:17 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Thu, 13 Jun 2013 13:35:17 -0400 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> Message-ID: What is the observed behavior? What do show your logs? --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglisten at simonhoenscheid.de Thu Jun 13 18:53:21 2013 From: mailinglisten at simonhoenscheid.de (=?ISO-8859-1?Q?Simon_H=F6nscheid?=) Date: Thu, 13 Jun 2013 20:53:21 +0200 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: Message-ID: <51BA1521.1000002@simonhoenscheid.de> Hi Silver, this will fit your needs: location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 7d; } Simon Am 13.06.2013 14:26, schrieb Silver Moon: > Hi > > I need to add expires headers conditionally based on a certain mime type. > For example add expires 7d to text/css > > How to do this ? > > So far I found that $sent_http_content_type contains the mime type that > is send in http response. But its not possible to put it in a if > directive and do expires > either, > > if ($sent_http_content_type = "text/css") > { > expires 7d; > } > > will not work. > > Also tried to create a map and try to hack around, but could not do it. > > I cannot do on file based or specific directory location based because > lots of css/js content is generated from php files dynamically. And > there are multiple php files generating content. > > I need a neat way to implement this, is it possible ? > > -- > Silver > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From jbarton at conquerthe.net Thu Jun 13 19:31:28 2013 From: jbarton at conquerthe.net (John Barton) Date: Thu, 13 Jun 2013 14:31:28 -0500 Subject: Question about multiple applicable locations in a server config Message-ID: <38f0c82fb111e5878b1cccb300798697@conquerthe.net> I have read documentation from several sources, and there is still 1 detail about nginx configuration that I do not fully understand, and would like some additional guidance. In the nginx location configuration, how does one handle locations that would match multiple criteria, but nginx can only match on one? For example, lets say I have a php application and I am using php-fpm, which has an admin interface that I want to protect using htaccess. I would have location directives in my config with the following contents: location ~* /admin/ { auth_basic "Restricted"; auth_basic_user_file htpasswd; } location ~* .php$ { try_files $uri =404; fastcgi_index index.php; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } >From my understanding of how nginx processes the config file, it would match the /admin/ regex first, but what if the files contained in this directory are PHP scripts? Since the first location matches in my config, I believe that the second location with the PHP redirect is never processed? Thanks in advance, -JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Thu Jun 13 19:38:32 2013 From: agentzh at gmail.com (agentzh) Date: Thu, 13 Jun 2013 12:38:32 -0700 Subject: Nginx cache files by mime type using ngx_srcache module In-Reply-To: <71a7e6901155d24e9058fe9568ce1c64.NginxMailingListEnglish@forum.nginx.org> References: <71a7e6901155d24e9058fe9568ce1c64.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hello! On Wed, Jun 12, 2013 at 3:51 AM, n1xman wrote: > However, I have noticed every srcache_fetch GET /memc subrequest hits the > memcached even though srcache_store skipped content-type which is not > defined. > The cache fetch operation must be performed *before* sending a request to the backend while the Content-Type response header is only available *after* the backend request is already sent. You're having a chicken and egg problem here. And I don't see how the srcache_fetch can be skipped without a Content-Type response header available for checks. > This will keep busy the memcached server and I think srcache_fetch GET > subrequest should not executed if srcache_store_skip triggered first. Are you sure? srcache_store_skip always runs after srcache_fetch for a particular request. The caching workflow looks like this: srcache_fetch send backend request if it's a cache miss receive backend response (headers) srcache_store I cannot see how srcache_store_skip can be triggered before srcache_fetch without sending a backend request to get the Content-Type response header. Best regards, -agentzh From contact at jpluscplusm.com Thu Jun 13 20:48:33 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Thu, 13 Jun 2013 21:48:33 +0100 Subject: Question about multiple applicable locations in a server config In-Reply-To: <38f0c82fb111e5878b1cccb300798697@conquerthe.net> References: <38f0c82fb111e5878b1cccb300798697@conquerthe.net> Message-ID: On 13 June 2013 20:31, John Barton wrote: > I have read documentation from several sources, and there is still 1 detail > about nginx configuration that I do not fully understand, and would like > some additional guidance. In the nginx location configuration, how does one > handle locations that would match multiple criteria, but nginx can only > match on one? > For example, lets say I have a php application and I am using php-fpm, which > has an admin interface that I want to protect using htaccess. I would have > location directives in my config with the following contents: > > location ~* /admin/ { > auth_basic "Restricted"; > auth_basic_user_file htpasswd; > } > > location ~* \.php$ { > try_files $uri =404; > fastcgi_index index.php; > fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; > include fastcgi_params; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > } > > > From my understanding of how nginx processes the config file, it would match > the /admin/ regex first, but what if the files contained in this directory > are PHP scripts? Since the first location matches in my config, I believe > that the second location with the PHP redirect is never processed? Remember you can use nested location. I would imagine (though haven't tested) that this will work: --------------------------------- location ~ \.php { try_files $uri =404; fastcgi_index index.php; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; location ~ /admin/ { auth_basic "Restricted"; auth_basic_user_file htpasswd; } } --------------------------------- Regards, Jonathan -- Jonathan Matthews // Oxford, London, UK http://www.jpluscplusm.com/contact.html From contact at jpluscplusm.com Thu Jun 13 20:51:34 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Thu, 13 Jun 2013 21:51:34 +0100 Subject: Need some help with rewrite rule translation In-Reply-To: <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> References: <51B8F2D1.8000602@simonhoenscheid.de> <68473.1371095185.14077873764824907776@ffe16.ukr.net> <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> Message-ID: On 13 June 2013 09:38, wrote: [snip] >> RewriteRule ^favicon\.ico$ - [R=404,L] > > location /(^favicon)/(.*\.(ico)) { > return 404; Don't do that. You're only hurting yourself. Just return an empty gif (http://wiki.nginx.org/HttpEmptyGifModule) or ico/etc equivalent. Jonathan -- Jonathan Matthews // Oxford, London, UK http://www.jpluscplusm.com/contact.html From reallfqq-nginx at yahoo.fr Thu Jun 13 21:01:15 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Thu, 13 Jun 2013 17:01:15 -0400 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> <68473.1371095185.14077873764824907776@ffe16.ukr.net> <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> Message-ID: On Thu, Jun 13, 2013 at 4:51 PM, Jonathan Matthews wrote: > On 13 June 2013 09:38, wrote: > [snip] > >> RewriteRule ^favicon\.ico$ - [R=404,L] > > > > location /(^favicon)/(.*\.(ico)) { > > return 404; > > Don't do that. You're only hurting yourself. Just return an empty gif > (http://wiki.nginx.org/HttpEmptyGifModule) or ico/etc equivalent. > ? You could also do that: location /favicon.ico { return 204; access_log off; log_not_found off; }? > Jonathan > -- > Jonathan Matthews // Oxford, London, UK > http://www.jpluscplusm.com/contact.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From m00n.silv3r at gmail.com Fri Jun 14 02:58:47 2013 From: m00n.silv3r at gmail.com (Silver Moon) Date: Fri, 14 Jun 2013 08:28:47 +0530 Subject: Need to add expires header conditionally based on mime types In-Reply-To: <51BA1521.1000002@simonhoenscheid.de> References: <51BA1521.1000002@simonhoenscheid.de> Message-ID: hi this is not sufficient. in my application for example, js, css and images are generated dynamically from php scripts. and there are multiple scripts to generate such content. therefore i need mime based expire headers. On Fri, Jun 14, 2013 at 12:23 AM, Simon H?nscheid < mailinglisten at simonhoenscheid.de> wrote: > Hi Silver, > > this will fit your needs: > > location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { > expires 7d; > } > > Simon > Am 13.06.2013 14:26, schrieb Silver Moon: > > Hi > > > > I need to add expires headers conditionally based on a certain mime type. > > For example add expires 7d to text/css > > > > How to do this ? > > > > So far I found that $sent_http_content_type contains the mime type that > > is send in http response. But its not possible to put it in a if > > directive and do expires > > either, > > > > if ($sent_http_content_type = "text/css") > > { > > expires 7d; > > } > > > > will not work. > > > > Also tried to create a map and try to hack around, but could not do it. > > > > I cannot do on file based or specific directory location based because > > lots of css/js content is generated from php files dynamically. And > > there are multiple php files generating content. > > > > I need a neat way to implement this, is it possible ? > > > > -- > > Silver > > > > > > _______________________________________________ > > 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 > -- Silver -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at greengecko.co.nz Fri Jun 14 03:04:42 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Fri, 14 Jun 2013 15:04:42 +1200 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: <51BA1521.1000002@simonhoenscheid.de> Message-ID: <1371179082.25974.91.camel@steve-new> Are they presented as .js, .css etc to the client browser? If so, then this is sufficient. Steve On Fri, 2013-06-14 at 08:28 +0530, Silver Moon wrote: > hi > > > this is not sufficient. > > > in my application for example, js, css and images are generated > dynamically from php scripts. and there are multiple scripts to > generate such content. > > > therefore i need mime based expire headers. > > On Fri, Jun 14, 2013 at 12:23 AM, Simon H?nscheid > wrote: > Hi Silver, > > this will fit your needs: > > location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { > expires 7d; > } > > Simon > Am 13.06.2013 14:26, schrieb Silver Moon: > > Hi > > > > I need to add expires headers conditionally based on a > certain mime type. > > For example add expires 7d to text/css > > > > How to do this ? > > > > So far I found that $sent_http_content_type contains the > mime type that > > is send in http response. But its not possible to put it in > a if > > directive and do expires > > either, > > > > if ($sent_http_content_type = "text/css") > > { > > expires 7d; > > } > > > > will not work. > > > > Also tried to create a map and try to hack around, but could > not do it. > > > > I cannot do on file based or specific directory location > based because > > lots of css/js content is generated from php files > dynamically. And > > there are multiple php files generating content. > > > > I need a neat way to implement this, is it possible ? > > > > -- > > Silver > > > > > > > _______________________________________________ > > 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 > > > > > -- > Silver > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From hostdl at gmail.com Fri Jun 14 03:05:42 2013 From: hostdl at gmail.com (Host DL) Date: Fri, 14 Jun 2013 07:35:42 +0430 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: <51BA1521.1000002@simonhoenscheid.de> Message-ID: If you handle your js, css and images by php scripts you can use header function to send out Expires and Cache-Control directives example: -------------- next part -------------- An HTML attachment was scrubbed... URL: From m00n.silv3r at gmail.com Fri Jun 14 03:12:05 2013 From: m00n.silv3r at gmail.com (Silver Moon) Date: Fri, 14 Jun 2013 08:42:05 +0530 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: <51BA1521.1000002@simonhoenscheid.de> Message-ID: yes, i could send out headers from php itself but mime based header generation in the webserver itself would make things easier. so finally it is impossible to achieve that ? On Fri, Jun 14, 2013 at 8:35 AM, Host DL wrote: > If you handle your js, css and images by php scripts you can use header > function to send out Expires and Cache-Control directives > > example: > > header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 > header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past > ?> > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Silver -------------- next part -------------- An HTML attachment was scrubbed... URL: From miguelmclara at gmail.com Fri Jun 14 04:30:15 2013 From: miguelmclara at gmail.com (Miguel Clara) Date: Fri, 14 Jun 2013 04:30:15 +0000 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: <51BA1521.1000002@simonhoenscheid.de> Message-ID: <51BA9C57.1000905@gmail.com> >From what you describe I do think the suggested nginx config is enough... However maybe you're looking for something like this: http://stackoverflow.com/questions/14631044/expires-header-based-on-dynamic-content-type-in-nginx Not really sure if it suits you're needs, but It seems this is what you're looking for. You can also find more info on mime type here: http://wiki.nginx.org/HttpCoreModule#types Hope this helps, Mike On 06/14/13 03:12, Silver Moon wrote: > yes, i could send out headers from php itself > but mime based header generation in the webserver itself would make > things easier. > > so finally it is impossible to achieve that ? > > On Fri, Jun 14, 2013 at 8:35 AM, Host DL > wrote: > > If you handle your js, css and images by php scripts you can use > header function to send out Expires and Cache-Control directives > > example: > > header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 > header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past > ?> > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > -- > Silver > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From m00n.silv3r at gmail.com Fri Jun 14 03:41:51 2013 From: m00n.silv3r at gmail.com (Silver Moon) Date: Fri, 14 Jun 2013 09:11:51 +0530 Subject: Need to add expires header conditionally based on mime types In-Reply-To: <51BA9C57.1000905@gmail.com> References: <51BA1521.1000002@simonhoenscheid.de> <51BA9C57.1000905@gmail.com> Message-ID: the putting $upstream_http_content_type or $sent_http_content_type or $content_type inside "if" does not work. i wish someone could test and provide a working example. none of the samples shown in the stackoverflow post work. i tested enough and found that only $sent_http_content_type contains the http response Content-type and that can be tested like this add_header TEST $sent_http_content_type however putting that inside an if and trying to add further headers inside that if will not work i opened a ticket in trac and they said that it does not work like that however no one confirms if it is strictly possible or impossible. On Fri, Jun 14, 2013 at 10:00 AM, Miguel Clara wrote: > From what you describe I do think the suggested nginx config is enough... > > However maybe you're looking for something like this: > > > http://stackoverflow.com/questions/14631044/expires-header-based-on-dynamic-content-type-in-nginx > > Not really sure if it suits you're needs, but It seems this is what you're > looking for. > > You can also find more info on mime type here: > http://wiki.nginx.org/HttpCoreModule#types > > Hope this helps, > > Mike > > > > On 06/14/13 03:12, Silver Moon wrote: > > yes, i could send out headers from php itself > but mime based header generation in the webserver itself would make things > easier. > > so finally it is impossible to achieve that ? > > On Fri, Jun 14, 2013 at 8:35 AM, Host DL wrote: > >> If you handle your js, css and images by php scripts you can use header >> function to send out Expires and Cache-Control directives >> >> example: >> >> > header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 >> header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past >> ?> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > > -- > Silver > > > _______________________________________________ > nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Silver -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Fri Jun 14 06:35:54 2013 From: appa at perusio.net (=?ISO-8859-1?Q?Ant=F3nio_P=2E_P=2E_Almeida?=) Date: Fri, 14 Jun 2013 08:35:54 +0200 Subject: Need to add expires header conditionally based on mime types In-Reply-To: References: <51BA1521.1000002@simonhoenscheid.de> <51BA9C57.1000905@gmail.com> Message-ID: If you use the Lua embedded module you can do that AFAICT. http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua Le 14 juin 2013 05:42, "Silver Moon" a ?crit : > the > > putting $upstream_http_content_type or $sent_http_content_type or > $content_type inside "if" does not work. > i wish someone could test and provide a working example. > > none of the samples shown in the stackoverflow post work. > > i tested enough and found that only $sent_http_content_type contains the > http response Content-type > and that can be tested like this > > add_header TEST $sent_http_content_type > > however putting that inside an if and trying to add further headers inside > that if will not work > i opened a ticket in trac and they said that it does not work like that > > however no one confirms if it is strictly possible or impossible. > > On Fri, Jun 14, 2013 at 10:00 AM, Miguel Clara wrote: > >> From what you describe I do think the suggested nginx config is >> enough... >> >> However maybe you're looking for something like this: >> >> >> http://stackoverflow.com/questions/14631044/expires-header-based-on-dynamic-content-type-in-nginx >> >> Not really sure if it suits you're needs, but It seems this is what >> you're looking for. >> >> You can also find more info on mime type here: >> http://wiki.nginx.org/HttpCoreModule#types >> >> Hope this helps, >> >> Mike >> >> >> >> On 06/14/13 03:12, Silver Moon wrote: >> >> yes, i could send out headers from php itself >> but mime based header generation in the webserver itself would make >> things easier. >> >> so finally it is impossible to achieve that ? >> >> On Fri, Jun 14, 2013 at 8:35 AM, Host DL wrote: >> >>> If you handle your js, css and images by php scripts you can use >>> header function to send out Expires and Cache-Control directives >>> >>> example: >>> >>> >> header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 >>> header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past >>> ?> >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >> >> >> >> -- >> Silver >> >> >> _______________________________________________ >> nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx >> >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx >> > > > > -- > Silver > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglisten at simonhoenscheid.de Fri Jun 14 07:58:12 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Fri, 14 Jun 2013 09:58:12 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> <68473.1371095185.14077873764824907776@ffe16.ukr.net> <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> Message-ID: Both solutions look interesting, I will have a look on it. Am 13.06.2013 23:01, schrieb B.R.: > On Thu, Jun 13, 2013 at 4:51 PM, Jonathan Matthews > wrote: > > On 13 June 2013 09:38, ? wrote: > [snip] > RewriteRule ^favicon.ico$ - [R=404,L] > > location /(^favicon)/(.*.(ico)) { > return 404; > > Don't do that. You're only hurting yourself. Just return an empty gif > (http://wiki.nginx.org/HttpEmptyGifModule [1]) or ico/etc equivalent. > > ? > You could also do that: > location /favicon.ico { > ??? return 204; > ??? access_log????? off; > ??? log_not_found?? off; > }? > > Jonathan > -- > Jonathan Matthews // Oxford, London, UK > http://www.jpluscplusm.com/contact.html [2] > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx [3] > --- > B. R. > > Links: > ------ > [1] http://wiki.nginx.org/HttpEmptyGifModule > [2] http://www.jpluscplusm.com/contact.html > [3] http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mailinglisten at simonhoenscheid.de Fri Jun 14 08:35:12 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Fri, 14 Jun 2013 10:35:12 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> Message-ID: <9a58e16240d3b1c755947b82acae57ba@simonhoenscheid.de> Am 13.06.2013 19:35, schrieb B.R.: > What is the observed behavior? The parameters are not given corectly to the php script, delivering the picture. > What do show your logs? As expected there ist a 404 in the belonging access log. I activated the rewrite_log but there is no output in the error log. Simon > > --- > B. R. > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From m6rkalan at gmail.com Fri Jun 14 09:15:02 2013 From: m6rkalan at gmail.com (Mark Alan) Date: Fri, 14 Jun 2013 10:15:02 +0100 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> <68473.1371095185.14077873764824907776@ffe16.ukr.net> <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> Message-ID: <51badf18.8918b40a.5454.7c37@mx.google.com> On Fri, 14 Jun 2013 09:58:12 +0200, mailinglisten at simonhoenscheid.de wrote: > Both solutions look interesting, I will have a look on it. We use been successfully the "return no content=204" opiton: location = /favicon.ico { access_log off; log_not_found off; expires 30d; try_files /sites/$server_name/files/favicon.ico $uri =204; } Meaning that try_files first looks in a directory where we usually keep favicon.ico and logos (.png, .jpg, etc.), then it tries the user provied $uri and, if it does not find any then thows out a "no content" code (204). There is no need to load one more module (Empty Gif Module) just to do that. M. From mailinglisten at simonhoenscheid.de Fri Jun 14 09:44:08 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Fri, 14 Jun 2013 11:44:08 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: <51badf18.8918b40a.5454.7c37@mx.google.com> References: <51B8F2D1.8000602@simonhoenscheid.de> <68473.1371095185.14077873764824907776@ffe16.ukr.net> <7a890132376ff0a045304fb0e1aa4c16@simonhoenscheid.de> <51badf18.8918b40a.5454.7c37@mx.google.com> Message-ID: Thanks for the Detailed Information :-) I have still problems with this role: Client sends the first part of the urls, server rewrites it, and php delivers the picture. I tried to escape \ and dots, but this does not help. Server gives back a 404. Then I activated the error_log with level notice and added rewrite_log on, but there is no log output. Any hints? Simon Apache: RewriteRule ^image/resized/(\d+)/([0-9a-fA-F]{6}/|)(.+)_(\d+)(|m)x(\d+)(|m)(_.+|).(jpg|jpeg|png|gif) resized/getByDimension.php?domainid=$1&objectid=$3&width=$4&height=$6&format=$9&random=$8&color=$2&maxwidth=$5&maxheight=$7 [L] nginx: location / { rewrite "^/image/resized/(\d+)/([0-9a-fA-F]{6}/|)(.+)_(\d+)(|m)x(\d+)(|m)(_.+|)\.(jpg|jpeg|png|gif)" /resized/getByDimension.php?domainid=$1&objectid=$3&width=$4&height=$6&format=$9&random=$8&color=$2&maxwidth=$5&maxheight=$7 last; } Is there a fault? Am 14.06.2013 11:15, schrieb Mark Alan: > On Fri, 14 Jun 2013 09:58:12 +0200, mailinglisten at simonhoenscheid.de > wrote: > > Both solutions look interesting, I will have a look on it. > > We use been successfully the "return no content=204" opiton: > > location = /favicon.ico { access_log off; log_not_found off; expires > 30d; try_files /sites/$server_name/files/favicon.ico $uri =204; } > > Meaning that try_files first looks in a directory where we usually keep > favicon.ico and logos (.png, .jpg, etc.), then it tries the user > provied $uri and, if it does not find any then thows out a "no content" > code (204). > > There is no need to load one more module (Empty Gif Module) just to do > that. > > M. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From lista at oxdrove.co.uk Fri Jun 14 11:05:10 2013 From: lista at oxdrove.co.uk (James Lee) Date: Fri, 14 Jun 2013 12:05:10 +0100 Subject: truncated output for large files through proxy Message-ID: <51BAF8E6.4020204@oxdrove.co.uk> Hello, nginx 1.4.1 is truncating proxy output for large files. *** Steps to reproduce *** nginx.conf: location ^~ /download/ { proxy_pass http://localhost:9000; proxy_set_header Host $host; } The back end is a very simple servlet that copies a static file to the output stream. The test file is 7147652 bytes. Small files are delivered correctly, *** Test results *** First to show that the back end is sending a full file access it directly on port 9000: $ curl http://domain.local:9000/download/file.pdf | wc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6980k 0 6980k 0 0 39.3M 0 --:--:-- --:--:-- --:--:-- 39.6M 39699 166238 7147652 7147652 bytes delivered correctly. Example of failure, request via nginx: $ curl http://domain.local/download/file.pdf | wc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 167k 0 167k 0 0 5779k 0 --:--:-- --:--:-- --:--:-- 5992k 1959 3853 171828 Only 171828 bytes delivered. By restricting the download speed more bytes are delivered, slower is better, eg: $ curl --limit-rate 200k http://domain.local/download/file.pdf | wc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6980k 0 6980k 0 0 200k 0 --:--:-- 0:00:34 --:--:-- 200k 39699 166238 7147652 *** Workaround *** Add limit-rate to nginx.conf: location ^~ /download/ { proxy_pass http://localhost:9000; proxy_set_header Host $host; limit_rate 1000k; } $ curl http://domain.local/download/file.pdf | wc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6980k 0 6980k 0 0 1000k 0 --:--:-- 0:00:06 --:--:-- 1001k 39699 166238 7147652 Full 7147652bytes delivered *** Other information *** This is similar to: http://mailman.nginx.org/pipermail/nginx/2012-April/033272.html The workaround for this was also set a limit rate in nginx.conf. nginx 1.4.1 Solaris 10u11 James. From reallfqq-nginx at yahoo.fr Fri Jun 14 11:40:45 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Fri, 14 Jun 2013 07:40:45 -0400 Subject: Need some help with rewrite rule translation In-Reply-To: <9a58e16240d3b1c755947b82acae57ba@simonhoenscheid.de> References: <51B8F2D1.8000602@simonhoenscheid.de> <9a58e16240d3b1c755947b82acae57ba@simonhoenscheid.de> Message-ID: Hello, On Fri, Jun 14, 2013 at 4:35 AM, wrote: > Am 13.06.2013 19:35, schrieb B.R.: > >> What is the observed behavior? >> > > The parameters are not given corectly to the php script, delivering the > picture. > ?What? ?does the script receive ? Details! > What do show your logs? >> > > As expected there ist a 404 in the belonging access log. I activated the > rewrite_log but there is no output in the error log. > ? Are you sure you log everything correctly? The error output from rewrite_log is produced at the 'notice' level. Is that error level written to the log file?? Do you have access_logs telling you which files are being accessed and what answers are provided? > > Simon > >> >> --- >> B. R. >> ______________________________**_________________ >> 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 > --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglisten at simonhoenscheid.de Fri Jun 14 12:11:18 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Fri, 14 Jun 2013 14:11:18 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> <9a58e16240d3b1c755947b82acae57ba@simonhoenscheid.de> Message-ID: I have found the point where my rules break, I've had the following location on top, to enable browser caching for images, for one month: #images give caching response for 1 month, browser will request after this period of time again location ~* \.(png|jpg|jpeg|gif)$ { expires 1m; log_not_found off; } This prevented the Rules to run. Is there a chance to get this functionality without breaking other rules? Simon Am 14.06.2013 13:40, schrieb B.R.: > Hello, > > On Fri, Jun 14, 2013 at 4:35 AM, > wrote: > > Am 13.06.2013 19:35, schrieb B.R.: > > What is the observed behavior? > > The parameters are not given corectly to the php script, delivering the > picture. > > ?What?? > ?does the script receive ? Details! > > What do show your logs? > > As expected there ist a 404 in the belonging access log. I activated > the rewrite_log but there is no output in the error log. > > ? > > Are you sure you log everything correctly? > The error output from rewrite_log is produced at the 'notice' level. > Is that error level written to the log file?? > > Do you have access_logs telling you which files are being accessed and > what answers are provided? > > Simon > > --- > B. R. > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx [1] > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx [1] > --- > B. R. > > Links: > ------ > [1] http://mailman.nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From lists at ruby-forum.com Fri Jun 14 14:54:26 2013 From: lists at ruby-forum.com (Tu Tr) Date: Fri, 14 Jun 2013 16:54:26 +0200 Subject: proxy_pass defaulting to http 1.0 Message-ID: Since proxy_pass by default uses HTTP 1.0 shouldn't it also clear the Connection header by default? This causes major problems for the unsuspecting reverse proxy that encounters a .NET system.net.WebClient request. WebClient automatically sends Connection: keep-alive even for a HTTP 1.1 request. Some calls to WebClient#downloadFile will apparently chew up a connection in the underlying .NET connection pool, and then WebClient will hang waiting for a connection to free up without issuing the HTTP GET request. The fix was to do proxy_set_header Connection "" For some reason "proxy_http_version 1.1" by itself didn't do anything to prevent the random WebClient hangs. -- Posted via http://www.ruby-forum.com/. From mlangenberg at gmail.com Sat Jun 15 12:58:33 2013 From: mlangenberg at gmail.com (Matthijs Langenberg) Date: Sat, 15 Jun 2013 14:58:33 +0200 Subject: Weak ETags and on-the-fly gzipping Message-ID: I am serving dynamic requests behind the Nginx HTTP server. HTTP requests are mostly from mobile HTTP clients. That's is why I care about two things. 1. Do not send the same representation twice: Use ETag caching mechanism. 2. Make better us of available bandwidth: Use Accept-Encoding HTTP compression. Today I noticed that these two don't match. My application sets the ETag header in the response, but when I set the 'Accept-Encoding: gzip' in the request header, nginx clears the ETag header when gzipping on-the-fly. I understand why this is: If two responses have the same ETag, their bodies should be byte-for-byte comparable. When the content is gzipped, and actually modified, this is of course not the case. The gzipped response is not equal to the non-gzipped response. That's why there are two ETag validation mechanisms. A strong validation, used in case of byte-for-byte comparable responses, and a weak validation, to indicate semantic equivalency. In the case of weak validation an ETag would look like: ETag: W/"123456789" Why is Nginx stripping weak ETag validators in its gzip filter? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasil at ludost.net Sat Jun 15 13:32:04 2013 From: vasil at ludost.net (Vasil Kolev) Date: Sat, 15 Jun 2013 16:32:04 +0300 Subject: Weird issues with nginx Message-ID: <1371303124.5394.108.camel@nymphadora.home.ludost.net> Hello, I was trying to add rate limiting to our setup (mp4 file serving) and got into some very strange issues. First, with version 1.2.0, I was seeing the following: 2013/06/14 13:25:02 [emerg] 12470#0: *147816 malloc(18446744073709551608) failed (12: Cannot allocate memory), client: 92.247.59.175, server: localhost, request: "GET /vid3/QkpnNF3f5RY0_D9j0L8ovw/1371217700/12/46812/46812_720x406_500k.mp4 HTTP/1.1", host: "vm0.xxxxxxx" The same happened with 1.2.7. I tried doing the same with 1.4.1, and what I got was a crash, with stuff like this: 2013/06/14 20:50:58 [alert] 1690#0: worker process 26026 exited on signal 6 2013/06/14 20:50:58 [alert] 1690#0: worker process 25973 exited on signal 11 2013/06/14 20:50:58 [alert] 1690#0: worker process 25976 exited on signal 11 and something like this, a bit cut: *** glibc detected *** nginx: worker process: free(): invalid next size (normal): 0x000000000199b900 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x76d76)[0x7f4ea69fed76] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f4ea6a03aac] nginx: worker process[0x4059eb] nginx: worker process[0x43067b] Removing the ifs in the config fixes the problem, but that doesn't help me :) This is a compiled nginx from source, on debian stable (wheezy), with a few small additions available at https://github.com/krokodilerian/trafstat/tree/master/nginx . Any ideas how to proceed with this, maybe adding a stack trace to find who does the offending malloc? I've looked at some google results, and some people have seen such insane mallocs (this one is -6 on a 64bit unsigned value), when trying to use a variable that wasn't there, but that doesn't seem to be my case. I have a debug log and other stuff I can send, if that would be helpful. Here's my config, the file names look something like /data/v/63/27763/27763_1920x1080_4000k.mp4 : location /vid3/ { error_log /usr/local/nginx/logs/debug.log debug; location ~ ^/vid3/(?[\w\-=]+)/(?\w+)(?/[0-9/]+._[0-9]+x[0-9]+_)(?[0-9]+00)(?k\.mp4)?(?.*)$ { mp4; mp4_buffer_size 1m; mp4_max_buffer_size 5m; if ($invalid_referer) { return 403; } secure_link $rcvmd5,$linkexp; secure_link_md5 "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$remote_net$fnm$spd$kmp$linkexp" ; if ($secure_link = "") { # invalid return 403; } if ($secure_link = "0") { # expired return 410; } if ($spd = 400 ) { limit_rate_after 400k; limit_rate 50k; } if ($spd = 500 ) { limit_rate_after 500k; limit_rate 50k; } if ($spd = 1000 ) { limit_rate_after 1600k; limit_rate 200k; } if ($spd = 4000 ) { limit_rate_after 3200k; limit_rate 400k; } alias /data/v$fnm$spd$kmp; } return 404; } -- Regards, Vasil Kolev -------------- 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 jrm at ftfl.ca Fri Jun 14 12:41:20 2013 From: jrm at ftfl.ca (Joseph Mingrone) Date: Fri, 14 Jun 2013 09:41:20 -0300 Subject: remote host name in access log Message-ID: <867ghwsw3z.fsf@gly.ath.cx> Hello; Is it possible to log the remote host name (as opposed to just the IP address) in the access log? I run a low traffic web server and I'm not concerned with the overhead for the lookups. Thanks, Joseph From francis at daoine.org Sat Jun 15 21:06:36 2013 From: francis at daoine.org (Francis Daly) Date: Sat, 15 Jun 2013 22:06:36 +0100 Subject: Weird issues with nginx In-Reply-To: <1371303124.5394.108.camel@nymphadora.home.ludost.net> References: <1371303124.5394.108.camel@nymphadora.home.ludost.net> Message-ID: <20130615210636.GX27406@craic.sysops.org> On Sat, Jun 15, 2013 at 04:32:04PM +0300, Vasil Kolev wrote: Hi there, > Removing the ifs in the config fixes the problem, but that doesn't help > me :) > > This is a compiled nginx from source, on debian stable (wheezy), with a > few small additions available at > https://github.com/krokodilerian/trafstat/tree/master/nginx . > > Any ideas how to proceed with this, The usual first step would be to see whether the problem persists when you just use the distributed nginx, with no external modules or patches. But in this case, that's probably unnecessary, since you already know that without the "if" statements, no problems appear. You use "if" inside "location", and you do something other than "return ..." or "rewrite ... last". Under those circumstances, pretty much all bets are off (unless you can explain why your use is safe). See http://wiki.nginx.org/IfIsEvil for some more details. Perhaps using a "map" to set values to be used in limit_rate and limit_rate_after directives would avoid the "if in location" problem? f -- Francis Daly francis at daoine.org From vasil at ludost.net Sat Jun 15 22:01:37 2013 From: vasil at ludost.net (Vasil Kolev) Date: Sun, 16 Jun 2013 01:01:37 +0300 Subject: Weird issues with nginx In-Reply-To: <20130615210636.GX27406@craic.sysops.org> References: <1371303124.5394.108.camel@nymphadora.home.ludost.net> <20130615210636.GX27406@craic.sysops.org> Message-ID: <1371333697.5394.111.camel@nymphadora.home.ludost.net> ? 22:06 +0100 ?? 15.06.2013 (??), Francis Daly ??????: > The usual first step would be to see whether the problem persists when > you just use the distributed nginx, with no external modules or patches. > > But in this case, that's probably unnecessary, since you already know > that without the "if" statements, no problems appear. > > > You use "if" inside "location", and you do something other than "return > ..." or "rewrite ... last". Under those circumstances, pretty much all > bets are off (unless you can explain why your use is safe). > > See http://wiki.nginx.org/IfIsEvil for some more details. > > Perhaps using a "map" to set values to be used in limit_rate and > limit_rate_after directives would avoid the "if in location" problem? > The limit_rate directive doesn't accept a variable as a parameter, otherwise that would've been easier. I might just copy the location 4 times with the speed hardcoded for each one, to get rid of the ifs, shouldn't be too ugly. I'll test this tomorrow. -- Regards, Vasil Kolev -------------- 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 francis at daoine.org Sun Jun 16 00:07:51 2013 From: francis at daoine.org (Francis Daly) Date: Sun, 16 Jun 2013 01:07:51 +0100 Subject: Weird issues with nginx In-Reply-To: <1371333697.5394.111.camel@nymphadora.home.ludost.net> References: <1371303124.5394.108.camel@nymphadora.home.ludost.net> <20130615210636.GX27406@craic.sysops.org> <1371333697.5394.111.camel@nymphadora.home.ludost.net> Message-ID: <20130616000751.GY27406@craic.sysops.org> On Sun, Jun 16, 2013 at 01:01:37AM +0300, Vasil Kolev wrote: > ? 22:06 +0100 ?? 15.06.2013 (??), Francis Daly ??????: > > But in this case, that's probably unnecessary, since you already know > > that without the "if" statements, no problems appear. > > Perhaps using a "map" to set values to be used in limit_rate and > > limit_rate_after directives would avoid the "if in location" problem? > The limit_rate directive doesn't accept a variable as a parameter, > otherwise that would've been easier. Ah, yes, you're correct. $limit_rate could help there, but there doesn't seem to be an equivalent $limit_rate_after variable, so you're still stuck. > I might just copy the location 4 > times with the speed hardcoded for each one, to get rid of the ifs, > shouldn't be too ugly. That should work. A series of server-level ifs to set the directive values might also work -- that may end up more maintainable, perhaps. Good luck with it, f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Sun Jun 16 01:37:59 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 16 Jun 2013 05:37:59 +0400 Subject: truncated output for large files through proxy In-Reply-To: <51BAF8E6.4020204@oxdrove.co.uk> References: <51BAF8E6.4020204@oxdrove.co.uk> Message-ID: <20130616013759.GX72282@mdounin.ru> Hello! On Fri, Jun 14, 2013 at 12:05:10PM +0100, James Lee wrote: > Hello, > > nginx 1.4.1 is truncating proxy output for large files. [...] > *** Other information *** > > This is similar to: > http://mailman.nginx.org/pipermail/nginx/2012-April/033272.html > The workaround for this was also set a limit rate in nginx.conf. > > > nginx 1.4.1 > Solaris 10u11 Most interesting line, as usual, is at the end of your message. Could you please provide debug log, nginx -V output and a minimal full config to reproduce the problem? -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Sun Jun 16 01:38:38 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 16 Jun 2013 05:38:38 +0400 Subject: remote host name in access log In-Reply-To: <867ghwsw3z.fsf@gly.ath.cx> References: <867ghwsw3z.fsf@gly.ath.cx> Message-ID: <20130616013837.GY72282@mdounin.ru> Hello! On Fri, Jun 14, 2013 at 09:41:20AM -0300, Joseph Mingrone wrote: > Is it possible to log the remote host name (as opposed to just the IP > address) in the access log? I run a low traffic web server and I'm not > concerned with the overhead for the lookups. No. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Sun Jun 16 01:48:17 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 16 Jun 2013 05:48:17 +0400 Subject: proxy_pass defaulting to http 1.0 In-Reply-To: References: Message-ID: <20130616014817.GZ72282@mdounin.ru> Hello! On Fri, Jun 14, 2013 at 04:54:26PM +0200, Tu Tr wrote: > Since proxy_pass by default uses HTTP 1.0 shouldn't it also clear the > Connection header by default? By default, nginx uses "Connection: close" in upstream requests for maximum compatibility with various backend servers. > This causes major problems for the unsuspecting reverse proxy that > encounters a .NET system.net.WebClient request. WebClient automatically > sends Connection: keep-alive even for a HTTP 1.1 request. Some calls to > WebClient#downloadFile will apparently chew up a connection in the > underlying .NET connection pool, and then WebClient will hang waiting > for a connection to free up without issuing the HTTP GET request. > > The fix was to do > > proxy_set_header Connection "" > > For some reason "proxy_http_version 1.1" by itself didn't do anything to > prevent the random WebClient hangs. >From your description it isn't clear what goes wrong and what fixes the problem. You may want to investigate further. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Sun Jun 16 02:08:20 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 16 Jun 2013 06:08:20 +0400 Subject: Weak ETags and on-the-fly gzipping In-Reply-To: References: Message-ID: <20130616020820.GA72282@mdounin.ru> Hello! On Sat, Jun 15, 2013 at 02:58:33PM +0200, Matthijs Langenberg wrote: > I am serving dynamic requests behind the Nginx HTTP server. HTTP requests > are mostly from mobile HTTP clients. That's is why I care about two things. > > 1. Do not send the same representation twice: Use ETag caching mechanism. > 2. Make better us of available bandwidth: Use Accept-Encoding HTTP > compression. > > Today I noticed that these two don't match. My application sets the ETag > header in the response, but when I set the 'Accept-Encoding: gzip' in the > request header, nginx clears the ETag header when gzipping on-the-fly. > > I understand why this is: If two responses have the same ETag, their bodies > should be byte-for-byte comparable. When the content is gzipped, and > actually modified, this is of course not the case. The gzipped response is > not equal to the non-gzipped response. > > That's why there are two ETag validation mechanisms. A strong validation, > used in case of byte-for-byte comparable responses, and a weak validation, > to indicate semantic equivalency. > > In the case of weak validation an ETag would look like: > ETag: W/"123456789" > > Why is Nginx stripping weak ETag validators in its gzip filter? Just stripping ETags are easier than converting them to weak etags (and implementing weak etags support various places). On the other hand, relevant caching functionality is still here with Last-Modified cache validator. -- Maxim Dounin http://nginx.org/en/donation.html From paulnpace at gmail.com Sun Jun 16 02:39:24 2013 From: paulnpace at gmail.com (Paul N. Pace) Date: Sat, 15 Jun 2013 19:39:24 -0700 Subject: Hosting multiple domains Message-ID: I have a server that I set up to run several domains from and it has worked great and without issue for about 6 months. I have another server that I had set up and was only running one domain from it and I just added a second domain. For some reason, this second server does not want to serve two domains, and I can find no substantial differences in the configuration files (nginx.conf and sites-available files). On both servers I put a symlink in the sites-enabled folder to the corresponding sites-available file. On the second, problematic server, when creating a symlink to the second site and restarting nginx, testing the second domain only brings up the first domain. Rebooting the server disables both domains and the server appears unresponsive, except that I can SSH into it. Then removing the symlink to the second domain and restarting nginx returns the server to serving the one domain as it has been doing. The first server is running nginx 1.5.0 and the second server is running nginx 1.4.1. What should I be looking at to resolve this issue? From sajan at noppix.com Sun Jun 16 03:00:42 2013 From: sajan at noppix.com (Sajan Parikh) Date: Sat, 15 Jun 2013 22:00:42 -0500 Subject: Hosting multiple domains In-Reply-To: References: Message-ID: <51BD2A5A.4070607@noppix.com> I'm sure it's something small you've overlooked. Going to take a shot in the dark and say you've copy and pasted your server blocks and perhaps forgot to change something you needed to for that particular server. Sajan Parikh /Owner, Noppix LLC/ e: sajan at noppix.com p: (563) 726-0371 Noppix LLC Logo On 06/15/2013 09:39 PM, Paul N. Pace wrote: > I have a server that I set up to run several domains from and it has > worked great and without issue for about 6 months. > > I have another server that I had set up and was only running one > domain from it and I just added a second domain. For some reason, this > second server does not want to serve two domains, and I can find no > substantial differences in the configuration files (nginx.conf and > sites-available files). > > On both servers I put a symlink in the sites-enabled folder to the > corresponding sites-available file. > > On the second, problematic server, when creating a symlink to the > second site and restarting nginx, testing the second domain only > brings up the first domain. Rebooting the server disables both domains > and the server appears unresponsive, except that I can SSH into it. > Then removing the symlink to the second domain and restarting nginx > returns the server to serving the one domain as it has been doing. > > The first server is running nginx 1.5.0 and the second server is > running nginx 1.4.1. > > What should I be looking at to resolve this issue? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: emailsiglogo.png Type: image/png Size: 6717 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4473 bytes Desc: S/MIME Cryptographic Signature URL: From steve at greengecko.co.nz Sun Jun 16 03:04:14 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Sun, 16 Jun 2013 15:04:14 +1200 Subject: Hosting multiple domains In-Reply-To: References: Message-ID: <1371351854.25974.122.camel@steve-new> Hello! On Sat, 2013-06-15 at 19:39 -0700, Paul N. Pace wrote: > I have a server that I set up to run several domains from and it has > worked great and without issue for about 6 months. > > I have another server that I had set up and was only running one > domain from it and I just added a second domain. For some reason, this > second server does not want to serve two domains, and I can find no > substantial differences in the configuration files (nginx.conf and > sites-available files). > > On both servers I put a symlink in the sites-enabled folder to the > corresponding sites-available file. > > On the second, problematic server, when creating a symlink to the > second site and restarting nginx, testing the second domain only > brings up the first domain. Rebooting the server disables both domains > and the server appears unresponsive, except that I can SSH into it. > Then removing the symlink to the second domain and restarting nginx > returns the server to serving the one domain as it has been doing. > > The first server is running nginx 1.5.0 and the second server is > running nginx 1.4.1. > > What should I be looking at to resolve this issue? > Without seeing the config files/error logs, it's difficult to find the problem. However, I can confirm that both name and IP address based hosting works perfectly. nginx -t may well help identify incorrect config files. Note there is some precedence in the listen 80 / listen ip:80 statements which might be causing the problem. Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From mlangenberg at gmail.com Sun Jun 16 09:39:44 2013 From: mlangenberg at gmail.com (Matthijs Langenberg) Date: Sun, 16 Jun 2013 11:39:44 +0200 Subject: Weak ETags and on-the-fly gzipping In-Reply-To: <20130616020820.GA72282@mdounin.ru> References: <20130616020820.GA72282@mdounin.ru> Message-ID: Hi, thanks for answering so quickly. You are right, we should not go so far as to implement a conversion from strong to weak ETags. And alo, Last-Modified header could be preferable. Wen dynamic content is generated, setting a Last-Modified header requires inside knowledge from the app server. ETags are much simpler, as it's often implemented as an md5 hash of the response body. A (Ruby) app server can easily add an ETag to all responses. Setting a Last-Modified header is different per request, depending on what dynamic resource is generated. So I would not say that the Last-Modified header covers all cases that ETag does. Instead of stripping all ETags, I would propose to only strip strong ETags. According to the spec: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.3 a weak ETag is perfectly fine for validating semantic equivalence. Just not for range requests. So by adding something like: if (is_strong_etag(r)) { ngx_http_clear_etag(r) } We would allow applications to set weak Etags for caching. On Sun, Jun 16, 2013 at 4:08 AM, Maxim Dounin wrote: > Hello! > > On Sat, Jun 15, 2013 at 02:58:33PM +0200, Matthijs Langenberg wrote: > > > I am serving dynamic requests behind the Nginx HTTP server. HTTP requests > > are mostly from mobile HTTP clients. That's is why I care about two > things. > > > > 1. Do not send the same representation twice: Use ETag caching mechanism. > > 2. Make better us of available bandwidth: Use Accept-Encoding HTTP > > compression. > > > > Today I noticed that these two don't match. My application sets the ETag > > header in the response, but when I set the 'Accept-Encoding: gzip' in the > > request header, nginx clears the ETag header when gzipping on-the-fly. > > > > I understand why this is: If two responses have the same ETag, their > bodies > > should be byte-for-byte comparable. When the content is gzipped, and > > actually modified, this is of course not the case. The gzipped response > is > > not equal to the non-gzipped response. > > > > That's why there are two ETag validation mechanisms. A strong validation, > > used in case of byte-for-byte comparable responses, and a weak > validation, > > to indicate semantic equivalency. > > > > In the case of weak validation an ETag would look like: > > ETag: W/"123456789" > > > > Why is Nginx stripping weak ETag validators in its gzip filter? > > Just stripping ETags are easier than converting them to weak > etags (and implementing weak etags support various places). > > On the other hand, relevant caching functionality is still here > with Last-Modified cache validator. > > -- > Maxim Dounin > http://nginx.org/en/donation.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rivero at soitu.es Sun Jun 16 17:22:35 2013 From: rivero at soitu.es (Raul Rivero) Date: Sun, 16 Jun 2013 19:22:35 +0200 Subject: slowfs + gzip_static? Message-ID: <51BDF45B.2080803@soitu.es> Hi all, Today, I'm doing some trials with slowfs module but "static gzpied content" (example: css and js files also have compressed companions on disk) is been stored in plain text and not compressed. So, they'll be compressed again and again on each request. Any help? -- Raul Rivero From vasil at ludost.net Sun Jun 16 19:56:22 2013 From: vasil at ludost.net (Vasil Kolev) Date: Sun, 16 Jun 2013 22:56:22 +0300 Subject: Weird issues with nginx In-Reply-To: <1371333697.5394.111.camel@nymphadora.home.ludost.net> References: <1371303124.5394.108.camel@nymphadora.home.ludost.net> <20130615210636.GX27406@craic.sysops.org> <1371333697.5394.111.camel@nymphadora.home.ludost.net> Message-ID: <1371412582.5394.118.camel@nymphadora.home.ludost.net> ? 01:01 +0300 ?? 16.06.2013 (??), Vasil Kolev ??????: > ? 22:06 +0100 ?? 15.06.2013 (??), Francis Daly ??????: > > > The usual first step would be to see whether the problem persists when > > you just use the distributed nginx, with no external modules or patches. > > > > But in this case, that's probably unnecessary, since you already know > > that without the "if" statements, no problems appear. > > > > > > You use "if" inside "location", and you do something other than "return > > ..." or "rewrite ... last". Under those circumstances, pretty much all > > bets are off (unless you can explain why your use is safe). > > > > See http://wiki.nginx.org/IfIsEvil for some more details. > > > > Perhaps using a "map" to set values to be used in limit_rate and > > limit_rate_after directives would avoid the "if in location" problem? > > > > > The limit_rate directive doesn't accept a variable as a parameter, > otherwise that would've been easier. I might just copy the location 4 > times with the speed hardcoded for each one, to get rid of the ifs, > shouldn't be too ugly. > > I'll test this tomorrow. > It definitely works this way. Is there anything that can be done to detect whenever the "if" is used in a dangerous way? Seems like a bad idea to be able to crash the webserver with a simple config. -- Regards, Vasil Kolev -------------- 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 emailgrant at gmail.com Sun Jun 16 20:29:40 2013 From: emailgrant at gmail.com (Grant) Date: Sun, 16 Jun 2013 13:29:40 -0700 Subject: munin plugin for nginx Message-ID: I'm having some trouble getting the nginx plugin working for munin. I've added the following to nginx config and restarted: location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } I've added the following munin config: [nginx*] env.url http://localhost/nginx_status Unfortunately I still get: # munin-run nginx_request request.value U # munin-run nginx_status total.value U reading.value U writing.value U waiting.value U If I remove the allow/deny, I can browse to /nginx_status and I get: Active connections: 13 server accepts handled requests 15 15 16 Reading: 0 Writing: 1 Waiting: 12 What could be the problem? - Grant From daniel.black at openquery.com Mon Jun 17 06:34:02 2013 From: daniel.black at openquery.com (Daniel Black) Date: Mon, 17 Jun 2013 16:34:02 +1000 (EST) Subject: munin plugin for nginx In-Reply-To: Message-ID: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> ----- Original Message ----- > I'm having some trouble getting the nginx plugin working for munin. > I've added the following to nginx config and restarted: > > location /nginx_status { > stub_status on; > access_log off; > allow 127.0.0.1; > deny all; > } > > I've added the following munin config: > > [nginx*] > env.url http://localhost/nginx_status > > Unfortunately I still get: > > # munin-run nginx_request > request.value U > # munin-run nginx_status > total.value U > reading.value U > writing.value U > waiting.value U > > If I remove the allow/deny, I can browse to /nginx_status and I get: > > Active connections: 13 > server accepts handled requests > 15 15 16 > Reading: 0 Writing: 1 Waiting: 12 > > What could be the problem? the munin plugin is broken or not getting the status information. Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. -- Daniel Black, Engineer @ Open Query (http://openquery.com) Remote expertise & maintenance for MySQL/MariaDB server environments. From luky-37 at hotmail.com Mon Jun 17 06:39:50 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Mon, 17 Jun 2013 08:39:50 +0200 Subject: munin plugin for nginx In-Reply-To: References: Message-ID: Perhaps munin connects over ipv6? Can you allow ::1? From steve at greengecko.co.nz Mon Jun 17 06:44:50 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Mon, 17 Jun 2013 18:44:50 +1200 Subject: munin plugin for nginx In-Reply-To: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> References: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> Message-ID: <1371451490.25974.296.camel@steve-new> On Mon, 2013-06-17 at 16:34 +1000, Daniel Black wrote: > > ----- Original Message ----- > > I'm having some trouble getting the nginx plugin working for munin. > > I've added the following to nginx config and restarted: > > > > location /nginx_status { > > stub_status on; > > access_log off; > > allow 127.0.0.1; > > deny all; > > } > > > > I've added the following munin config: > > > > [nginx*] > > env.url http://localhost/nginx_status > > > > Unfortunately I still get: > > > > # munin-run nginx_request > > request.value U > > # munin-run nginx_status > > total.value U > > reading.value U > > writing.value U > > waiting.value U > > > > If I remove the allow/deny, I can browse to /nginx_status and I get: > > > > Active connections: 13 > > server accepts handled requests > > 15 15 16 > > Reading: 0 Writing: 1 Waiting: 12 > > > > What could be the problem? > > the munin plugin is broken or not getting the status information. > > Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. > Well, I run it all over the place with no problem. I usually set it up only on localhost server { listen 127.0.0.1:80 default; server_name localhost; root /var/www; access_log /var/log/nginx/localhost.access.log; error_log /var/log/nginx/localhost.error.log; location ~ /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } } ( in /etc/nginx/conf.d/stub, or /etc/nginx/sites-available/stub, symlinked to ../sites-enabled/stub depending on preference ) and restart nginx. Then test this bit works... $ wget -O - http://localhost/nginx_status 2> /dev/null Active connections: 1 server accepts handled requests 67892 67892 70215 Reading: 0 Writing: 1 Waiting: 0 Some os's seem to like [nginx*] env.url http://localhost/nginx_status added to /etc/munin/plugin-conf.d/munin_node then munin-run nginx_status should run just fine. Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From lista at oxdrove.co.uk Mon Jun 17 10:56:31 2013 From: lista at oxdrove.co.uk (James Lee) Date: Mon, 17 Jun 2013 11:56:31 +0100 Subject: truncated output for large files through proxy In-Reply-To: <20130616013759.GX72282@mdounin.ru> References: <51BAF8E6.4020204@oxdrove.co.uk> <20130616013759.GX72282@mdounin.ru> Message-ID: <51BEEB5F.6020903@oxdrove.co.uk> On 16/06/2013 02:37, Maxim Dounin wrote: Hello, > > Could you please provide debug log, nginx -V output and a minimal > full config to reproduce the problem? *** cut down http.conf *** error_log /path/to/logs/error.log debug; events { worker_connections 1024; use eventport; } http { server { listen 80; server_name domain.local; location ^~ / { proxy_pass http://localhost:9000; proxy_set_header Host $host; } } } *** workaround *** remove "use eventport;". This was added as per: http://wiki.nginx.org/NginxOptimizations It uses "devpoll" by default. *** debug log *** Attached as "nginx.debug.log.bz2" *** nginx -V *** # nginx -V nginx version: nginx/1.4.1 TLS SNI support enabled configure arguments: --prefix=/opt/PREFIX --http-client-body-temp-path=/var/opt/PREFIX/nginx/client --http-fastcgi-temp-path=/var/opt/PREFIX/nginx/fastcgi --http-uwsgi-temp-path=/var/opt/PREFIX/nginx/uwsgi_temp --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: nginx.debug.log.bz2 Type: application/x-bzip Size: 4619 bytes Desc: not available URL: From mdounin at mdounin.ru Mon Jun 17 11:06:07 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 17 Jun 2013 15:06:07 +0400 Subject: truncated output for large files through proxy In-Reply-To: <51BEEB5F.6020903@oxdrove.co.uk> References: <51BAF8E6.4020204@oxdrove.co.uk> <20130616013759.GX72282@mdounin.ru> <51BEEB5F.6020903@oxdrove.co.uk> Message-ID: <20130617110607.GB72282@mdounin.ru> Hello! On Mon, Jun 17, 2013 at 11:56:31AM +0100, James Lee wrote: > On 16/06/2013 02:37, Maxim Dounin wrote: > > > Hello, > > > > >Could you please provide debug log, nginx -V output and a minimal > >full config to reproduce the problem? > > *** cut down http.conf *** > > error_log /path/to/logs/error.log debug; > > events { > worker_connections 1024; > use eventport; The eventport event method is known to have problems. Use devpoll (default) instead. -- Maxim Dounin http://nginx.org/en/donation.html From lista at oxdrove.co.uk Mon Jun 17 11:10:07 2013 From: lista at oxdrove.co.uk (James Lee) Date: Mon, 17 Jun 2013 12:10:07 +0100 Subject: truncated output for large files through proxy In-Reply-To: <20130617110607.GB72282@mdounin.ru> References: <51BAF8E6.4020204@oxdrove.co.uk> <20130616013759.GX72282@mdounin.ru> <51BEEB5F.6020903@oxdrove.co.uk> <20130617110607.GB72282@mdounin.ru> Message-ID: <51BEEE8F.7080600@oxdrove.co.uk> On 17/06/2013 12:06, Maxim Dounin wrote: Hello, > The eventport event method is known to have problems. Use devpoll > (default) instead. Not by me [until now]. Please remove it and update the documentation! James. From janet at wifispark.com Mon Jun 17 14:36:27 2013 From: janet at wifispark.com (Janet Valbuena) Date: Mon, 17 Jun 2013 15:36:27 +0100 Subject: virtual server configuration Message-ID: Hi I'm new to nginx. I'm trying to configure a virtual server. I've created a new server file under sites-enabled like this: server { listen 80; ## listen for ipv4; this line is default and implied server_name blogtest; root /usr/share/nginx/cakephptest/app/webroot; index index.php; location / { # First attempt to serve request as file, then # as directory, then fall back to 404 try_files $uri $uri/ =404; } # PHP FPM location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_intercept_errors on; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } Is there anything wrong with that? When I type in blogtest/index.php on the browser I get the default config, which points to /usr/share/nginx/www/, even though I deleted the symbolic link to sites-available/default from sites-enabled. Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. Could anyone please help. Thanks JV -- [image: WiFi SPARK] [image: Facebook] [image: Twitter] *Janet Valbuena* Software Developer *t:* 0844 848 9555 | *f: *01626 834 745 *w: *wifispark.com WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton Abbot, Devon, TQ12 6TZ This message and its attachments are deemed confidential. If you are not the intended recipient, you are strictly prohibited to disclose, copy, distribute or take any action in relation to the contents of this message. WiFi SPARK accepts no liability for virus transmission, for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sajan at noppix.com Mon Jun 17 14:48:08 2013 From: sajan at noppix.com (Sajan Parikh) Date: Mon, 17 Jun 2013 09:48:08 -0500 Subject: virtual server configuration In-Reply-To: References: Message-ID: <51BF21A8.8060307@noppix.com> Did you restart nginx for the new configuration to take effect? Run 'sudo service nginx restart' to do this. Also run 'nginx -t' to test your configuration. Sajan Parikh /Owner, Noppix LLC/ e: sajan at noppix.com p: (563) 726-0371 Noppix LLC Logo On 06/17/2013 09:36 AM, Janet Valbuena wrote: > Hi > > I'm new to nginx. I'm trying to configure a virtual server. > > I've created a new server file under sites-enabled like this: > > server { > listen 80; ## listen for ipv4; this line is default and implied > > server_name blogtest; > > root /usr/share/nginx/cakephptest/app/webroot; > index index.php; > > location / { > # First attempt to serve request as file, then > # as directory, then fall back to 404 > try_files $uri $uri/ =404; > } > # PHP FPM > location ~ \.php$ { > fastcgi_pass 127.0.0.1:9000 ; > fastcgi_index index.php; > include fastcgi_params; > fastcgi_intercept_errors on; > fastcgi_buffers 8 16k; > fastcgi_buffer_size 32k; > fastcgi_split_path_info ^(.+\.php)(/.+)$; > fastcgi_param PATH_INFO $fastcgi_path_info; > fastcgi_param PATH_TRANSLATED > $document_root$fastcgi_path_info; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > } > } > > > Is there anything wrong with that? > When I type in blogtest/index.php on the browser I get the default > config, which points to /usr/share/nginx/www/, even though I deleted > the symbolic link to sites-available/default from sites-enabled. > > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. > > Could anyone please help. > > Thanks > > JV > > > > -- > WiFi SPARK > Facebook Twitter > > *Janet Valbuena* > Software Developer > *t:* 0844 848 9555 | *f:*01626 834 745 > *w: *wifispark.com > > WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton > Abbot, Devon, TQ12 6TZ > > This message and its attachments are deemed confidential. If you are > not the intended recipient, you are strictly prohibited to disclose, > copy, distribute or take any action in relation to the contents of > this message. WiFi SPARK accepts no liability for virus transmission, > for the content of this email, or for the consequences of any actions > taken on the basis of the information provided, unless that > information is subsequently confirmed in writing. > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: emailsiglogo.png Type: image/png Size: 6717 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4473 bytes Desc: S/MIME Cryptographic Signature URL: From janet at wifispark.com Mon Jun 17 14:53:38 2013 From: janet at wifispark.com (Janet Valbuena) Date: Mon, 17 Jun 2013 15:53:38 +0100 Subject: virtual server configuration In-Reply-To: <51BF21A8.8060307@noppix.com> References: <51BF21A8.8060307@noppix.com> Message-ID: Hi Sajan Yes I did restart nginx. I've tried several times. Just tried nginx -t and all seems to be fine. nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful JV On 17 June 2013 15:48, Sajan Parikh wrote: > Did you restart nginx for the new configuration to take effect? Run > 'sudo service nginx restart' to do this. Also run 'nginx -t' to test your > configuration. > > Sajan Parikh > *Owner, Noppix LLC* > > e: sajan at noppix.com > p: (563) 726-0371 > > [image: Noppix LLC Logo] > On 06/17/2013 09:36 AM, Janet Valbuena wrote: > > Hi > > I'm new to nginx. I'm trying to configure a virtual server. > > I've created a new server file under sites-enabled like this: > > server { > listen 80; ## listen for ipv4; this line is default and implied > > server_name blogtest; > > root /usr/share/nginx/cakephptest/app/webroot; > index index.php; > > location / { > # First attempt to serve request as file, then > # as directory, then fall back to 404 > try_files $uri $uri/ =404; > } > # PHP FPM > location ~ \.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > include fastcgi_params; > fastcgi_intercept_errors on; > fastcgi_buffers 8 16k; > fastcgi_buffer_size 32k; > fastcgi_split_path_info ^(.+\.php)(/.+)$; > fastcgi_param PATH_INFO $fastcgi_path_info; > fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > } > } > > > Is there anything wrong with that? > When I type in blogtest/index.php on the browser I get the default > config, which points to /usr/share/nginx/www/, even though I deleted the > symbolic link to sites-available/default from sites-enabled. > > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. > > Could anyone please help. > > Thanks > > JV > > > > -- > [image: WiFi SPARK] > [image: Facebook] [image: Twitter] > *Janet Valbuena* > Software Developer > *t:* 0844 848 9555 | *f: *01626 834 745 > *w: *wifispark.com > > WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton Abbot, > Devon, TQ12 6TZ > > This message and its attachments are deemed confidential. If you are not > the intended recipient, you are strictly prohibited to disclose, copy, > distribute or take any action in relation to the contents of this message. > WiFi SPARK accepts no liability for virus transmission, for the content of > this email, or for the consequences of any actions taken on the basis of > the information provided, unless that information is subsequently confirmed > in writing. > > > _______________________________________________ > nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- [image: WiFi SPARK] [image: Facebook] [image: Twitter] *Janet Valbuena* Software Developer *t:* 0844 848 9555 | *f: *01626 834 745 *w: *wifispark.com WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton Abbot, Devon, TQ12 6TZ This message and its attachments are deemed confidential. If you are not the intended recipient, you are strictly prohibited to disclose, copy, distribute or take any action in relation to the contents of this message. WiFi SPARK accepts no liability for virus transmission, for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cprenzberg at googlemail.com Mon Jun 17 15:25:38 2013 From: cprenzberg at googlemail.com (Charles) Date: Mon, 17 Jun 2013 17:25:38 +0200 Subject: Problems with HTTP PUT with nginx-mogilefs-module Message-ID: Hi, I am having issues executing the http PUT to upload a file to MogileFS via nginx-mogilefs-module v1.0.4. I am running nginx 1.4.1 compiled with --with-debug option on CentOS 6.3. The nginx-mogilefs-module was forked from https://github.com/gnosek/nginx-mogilefs-module where a fix for -Werror=unused-but-set-variable warnings (with newer gcc) was fixed. Then I manually merged changes from https://github.com/pyh/nginx-mogilefs-module which implements variables for "mogilefs_domain" (and makes the directive mandatory). I guess there is a sleeker way to merge changes like that but I am still relatively new at using git. Anyway, I compiled nginx with the resulting module and the compile was ok. My nginx configuration is as follows: server { listen 192.168.0.109:80 ; error_log logs/node1.storage.dfs.log debug; location ~ ^/download/(?\w.+)/(?\w.+)/(?.+)$ { allow 192.168.0.0/24; deny all; mogilefs_tracker mogilefs_tracker_nodes; mogilefs_domain $domain; mogilefs_class $class; mogilefs_methods GET; mogilefs_pass $key { proxy_pass $mogilefs_path; proxy_hide_header Content-Type; proxy_buffering off; } } location ~ ^/upload/(?\w.+)/(?\w.+)/(?.+)$ { allow 192.168.0.0/24; deny all; mogilefs_tracker mogilefs_tracker_nodes; mogilefs_domain $domain; mogilefs_class $class; mogilefs_methods PUT DELETE; mogilefs_pass $key { proxy_pass $mogilefs_path; proxy_hide_header Content-Type; proxy_buffering off; } } } On start of the server I have the following in node1.storage.dfs.log: 2013/06/17 17:02:47 [debug] 12417#0: epoll add event: fd:7 op:1 ev:00000001 GET and DELETE work fine but not PUT. When I try to PUT a file via curl, I get the following on the console: root at node1.storage.dfs:~# curl -v --upload-file ./castle.jpg http://192.168.0.109/upload/defaultdomain/defaultclass/schwarzwald.jpg * About to connect() to 192.168.0.109 port 80 (#0) * Trying 192.168.0.109... connected * Connected to 192.168.0.109 (192.168.0.109) port 80 (#0) > PUT /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/ 3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: 192.168.0.109 > Accept: */* > Content-Length: 301027 > Expect: 100-continue > < HTTP/1.1 100 Continue and it just hangs there And these are the debug logs for the PUT request: 2013/06/17 17:06:08 [debug] 12417#0: accept on 192.168.0.109:80, ready: 0 2013/06/17 17:06:08 [debug] 12417#0: posix_memalign: 0000000002639F80:256 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 accept: 192.168.0.109 fd:3 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 3: 60000:1371481628599 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 1 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add event: fd:3 op:1 ev:80000001 2013/06/17 17:06:08 [debug] 12417#0: *1 http wait request handler 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: 000000000263A0E0:256 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 000000000266B1D0:1024 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 263 of 1024 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: 0000000002646430:4096 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 http process request line 2013/06/17 17:06:08 [debug] 12417#0: *1 http request line: "PUT /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1" 2013/06/17 17:06:08 [debug] 12417#0: *1 http uri: "/upload/defaultdomain/defaultclass/schwarzwald.jpg" 2013/06/17 17:06:08 [debug] 12417#0: *1 http args: "" 2013/06/17 17:06:08 [debug] 12417#0: *1 http exten: "jpg" 2013/06/17 17:06:08 [debug] 12417#0: *1 http process request header line 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2" 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Host: 192.168.0.109" 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Accept: */*" 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Content-Length: 301027" 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Expect: 100-continue" 2013/06/17 17:06:08 [debug] 12417#0: *1 http header done 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 3: 1371481628599 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "mogstored_spare_40237552/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "mogstored_spare_40262152/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "robots.txt" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: ~ "^/download/(?\w.+)/(?\w.+)/(?.+)$" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: ~ "^/upload/(?\w.+)/(?\w.+)/(?.+)$" 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $class to "defaultclass" 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $domain to "defaultdomain" 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $key to "schwarzwald.jpg" 2013/06/17 17:06:08 [debug] 12417#0: *1 using configuration "^/upload/(?\w.+)/(?\w.+)/(?.+)$" 2013/06/17 17:06:08 [debug] 12417#0: *1 http cl:301027 max:10485760 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 2 2013/06/17 17:06:08 [debug] 12417#0: *1 post rewrite phase: 3 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 4 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 5 2013/06/17 17:06:08 [debug] 12417#0: *1 access phase: 6 2013/06/17 17:06:08 [debug] 12417#0: *1 access: 6D00A8C0 00FFFFFF 0000A8C0 2013/06/17 17:06:08 [debug] 12417#0: *1 access phase: 7 2013/06/17 17:06:08 [debug] 12417#0: *1 post access phase: 8 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -5, "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" a:1, c:1 2013/06/17 17:06:08 [debug] 12417#0: *1 content phase: 9 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: 000000000263E530:4096 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "schwarzwald.jpg" 2013/06/17 17:06:08 [debug] 12417#0: *1 send 100 Continue 2013/06/17 17:06:08 [debug] 12417#0: *1 send: fd:3 25 of 25 2013/06/17 17:06:08 [debug] 12417#0: *1 http request body content length filter 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 000000000263F540:8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource temporarily unavailable) 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest 301027 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 3: 60000:1371481628603 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" a:1, c:2 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:2 blk:0 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E698 2013/06/17 17:06:08 [debug] 12417#0: *1 add cleanup: 000000000263E7D0 2013/06/17 17:06:08 [debug] 12417#0: *1 hashed path: /usr/local/nginx/client_body_temp/0000000001 2013/06/17 17:06:08 [debug] 12417#0: *1 temp fd:10 2013/06/17 17:06:08 [warn] 12417#0: *1 a client request body is buffered to a temporary file /usr/local/nginx/client_body_temp/0000000001, client: 192.168.0.109, server: , request: "PUT /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1", host: "192.168.0.109" 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 0 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E800 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E810 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 16384 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E820 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 24576 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E830 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 32768 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E840 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 40960 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E850 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 49152 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E860 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 57344 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E870 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 65536 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E880 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 73728 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E890 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 81920 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E8A0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 90112 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E8B0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 98304 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E8C0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 106496 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E8D0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 114688 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E8E0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 122880 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E8F0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 131072 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E900 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 139264 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource temporarily unavailable) 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest 153571 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer: 3, old: 1371481628603, new: 1371481628627 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E910 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 147456 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E920 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 155648 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E930 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 163840 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E940 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 172032 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E950 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 180224 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E960 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 188416 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E970 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 196608 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E980 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 204800 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E990 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 212992 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E9A0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 221184 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource temporarily unavailable) 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest 71651 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer: 3, old: 1371481628603, new: 1371481628646 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E9B0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 229376 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E9C0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 237568 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E9D0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 245760 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E9E0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 253952 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263E9F0 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 262144 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263EA00 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 270336 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263EA10 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 278528 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263EA20 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 8192, 286720 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 6115 of 6115 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 6115 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 000000000263F540, pos 000000000263F540, size: 6115 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest 0 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 3: 1371481628603 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, bufs 000000000263EA30 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, 6115, 294912 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs body handler 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler state: 0, status: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http subrequest "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http posted request: "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "mogstored_spare_40237552/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "mogstored_spare_40262152/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "mogstored_spare_40256728/" 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "mogstored_spare_40251304/" 2013/06/17 17:06:08 [debug] 12417#0: *1 using configuration "/mogstored_spare_40251304/" 2013/06/17 17:06:08 [debug] 12417#0: *1 http cl:301027 max:10485760 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 2 2013/06/17 17:06:08 [debug] 12417#0: *1 post rewrite phase: 3 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 4 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 5 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: 0000000002641550:4096 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 http init upstream, client timer: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add event: fd:3 op:3 ev:80000005 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "defaultdomain" 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "defaultclass" 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs request: "create_open key=schwarzwald.jpg&domain=defaultdomain&class=defaultclass" 2013/06/17 17:06:08 [debug] 12417#0: *1 http cleanup add: 0000000002641B40 2013/06/17 17:06:08 [debug] 12417#0: *1 get rr peer, try: 1 2013/06/17 17:06:08 [debug] 12417#0: *1 socket 11 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add connection: fd:11 ev:80000005 2013/06/17 17:06:08 [debug] 12417#0: *1 connect to 192.168.0.109:6001, fd:11 #2 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream connect: -2 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: 000000000263A1F0:128 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: 60000:1371481628674 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:3 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:3 blk:0 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream check client, write event:1, "/mogstored_spare_40251304/schwarzwald.jpg" 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add connection: fd:11 ev:80000005 2013/06/17 17:06:08 [debug] 12417#0: *1 connect to 192.168.0.109:6001, fd:11 #2 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream connect: -2 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: 000000000263A1F0:128 @16 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: 60000:1371481628674 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:3 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:3 blk:0 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream check client, write event:1, "/mogstored_spare_40251304/schwarzwald.jpg" 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream recv(): -1 (11: Resource temporarily unavailable) 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream request: "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream send request handler 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream send request 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer buf fl:0 s:73 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer in: 0000000002641B78 2013/06/17 17:06:08 [debug] 12417#0: *1 writev: 73 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer out: 0000000000000000 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 11: 1371481628674 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: 60000:1371481628676 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream request: "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream process header 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 00000000026A59F0:4096 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:11 80 of 4096 "013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs: "OK devid=2&fid=50&path= http://192.168.0.108:7500/dev2/0/000/000/0000000050.fid 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "devid"="2" 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "fid"="50" 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "path"=" http://192.168.0.108:7500/dev2/0/000/000/0000000050.fid" 2013/06/17 17:06:08 [debug] 12417#0: *1 tcp_nodelay 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream process non buffered downstream 2013/06/17 17:06:08 [debug] 12417#0: *1 finalize http upstream request: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 finalize mogilefs request 2013/06/17 17:06:08 [debug] 12417#0: *1 free rr peer 1 0 2013/06/17 17:06:08 [debug] 12417#0: *1 close http upstream connection: 11 2013/06/17 17:06:08 [debug] 12417#0: *1 free: 000000000263A1F0, unused: 48 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 11: 1371481628676 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http output filter "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http copy filter: "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http postpone filter "/mogstored_spare_40251304/schwarzwald.jpg?" 00007FFFC19595A0 2013/06/17 17:06:08 [debug] 12417#0: *1 write new buf t:0 f:0 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0 2013/06/17 17:06:08 [debug] 12417#0: *1 http write filter: l:0 f:0 s:0 2013/06/17 17:06:08 [debug] 12417#0: *1 http copy filter: 0 "/mogstored_spare_40251304/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: 0, "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:2 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs finish phase handler: state=1, status=0 2013/06/17 17:06:08 [debug] 12417#0: *1 http wake parent request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http posted request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:08 [debug] 12417#0: *1 http request empty handler 2013/06/17 17:06:28 [debug] 12417#0: *1 http run request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:28 [debug] 12417#0: *1 http reading blocked 2013/06/17 17:06:28 [debug] 12417#0: *1 http run request: "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" 2013/06/17 17:06:28 [debug] 12417#0: *1 http request empty handler -------------- next part -------------- An HTML attachment was scrubbed... URL: From wongkeewee at gmail.com Mon Jun 17 15:41:48 2013 From: wongkeewee at gmail.com (Wong Kee Wee) Date: Mon, 17 Jun 2013 23:41:48 +0800 Subject: virtual server configuration Message-ID: Hi Janet, Can you show us the content of your nginx.conf? Do you have the 'include' directive in your nginx.conf to point to your sites-available? For example: http { ... include /etc/nginx/sites-available/*; ... } Best regards, Wong Kee Wee Hi Sajan > > Yes I did restart nginx. I've tried several times. > > Just tried nginx -t and all seems to be fine. > > nginx -t > nginx: the configuration file /etc/nginx/nginx.conf syntax is ok > nginx: configuration file /etc/nginx/nginx.conf test is successful > > > JV > > > On 17 June 2013 15:48, Sajan Parikh wrote: > > > Did you restart nginx for the new configuration to take effect? Run > > 'sudo service nginx restart' to do this. Also run 'nginx -t' to test > your > > configuration. > > > > Sajan Parikh > > *Owner, Noppix LLC* > > > > e: sajan at noppix.com > > p: (563) 726-0371 > > > > [image: Noppix LLC Logo] > > On 06/17/2013 09:36 AM, Janet Valbuena wrote: > > > > Hi > > > > I'm new to nginx. I'm trying to configure a virtual server. > > > > I've created a new server file under sites-enabled like this: > > > > server { > > listen 80; ## listen for ipv4; this line is default and implied > > > > server_name blogtest; > > > > root /usr/share/nginx/cakephptest/app/webroot; > > index index.php; > > > > location / { > > # First attempt to serve request as file, then > > # as directory, then fall back to 404 > > try_files $uri $uri/ =404; > > } > > # PHP FPM > > location ~ \.php$ { > > fastcgi_pass 127.0.0.1:9000; > > fastcgi_index index.php; > > include fastcgi_params; > > fastcgi_intercept_errors on; > > fastcgi_buffers 8 16k; > > fastcgi_buffer_size 32k; > > fastcgi_split_path_info ^(.+\.php)(/.+)$; > > fastcgi_param PATH_INFO $fastcgi_path_info; > > fastcgi_param PATH_TRANSLATED > $document_root$fastcgi_path_info; > > fastcgi_param SCRIPT_FILENAME > > $document_root$fastcgi_script_name; > > } > > } > > > > > > Is there anything wrong with that? > > When I type in blogtest/index.php on the browser I get the default > > config, which points to /usr/share/nginx/www/, even though I deleted the > > symbolic link to sites-available/default from sites-enabled. > > > > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. > > > > Could anyone please help. > > > > Thanks > > > > JV > -------------- next part -------------- An HTML attachment was scrubbed... URL: From janet at wifispark.com Mon Jun 17 15:56:47 2013 From: janet at wifispark.com (Janet Valbuena) Date: Mon, 17 Jun 2013 16:56:47 +0100 Subject: virtual server configuration In-Reply-To: References: Message-ID: Hi Wong I installed nginx recently and haven't changed anything in nginx.conf. It actually doesn't include /etc/nginx/sites-available/* but it does include /etc/nginx/sites-enabled/*, which is where I put a symbolic link of my config file. user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ## # nginx-naxsi config ## # Uncomment it if you installed nginx-naxsi ## #include /etc/nginx/naxsi_core.rules; ## # nginx-passenger config ## # Uncomment it if you installed nginx-passenger ## #passenger_root /usr; #passenger_ruby /usr/bin/ruby; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; * include /etc/nginx/sites-enabled/*;* } Just in case it helps I'm using Ubuntu 12.04 LTS Thanks On 17 June 2013 16:41, Wong Kee Wee wrote: > Hi Janet, > > Can you show us the content of your nginx.conf? > > Do you have the 'include' directive in your nginx.conf to point to your > sites-available? > > For example: > http { > > ... > include /etc/nginx/sites-available/*; > ... > > } > > Best regards, > Wong Kee Wee > > > Hi Sajan >> >> Yes I did restart nginx. I've tried several times. >> >> Just tried nginx -t and all seems to be fine. >> >> nginx -t >> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok >> nginx: configuration file /etc/nginx/nginx.conf test is successful >> >> >> JV >> >> >> On 17 June 2013 15:48, Sajan Parikh wrote: >> >> > Did you restart nginx for the new configuration to take effect? Run >> > 'sudo service nginx restart' to do this. Also run 'nginx -t' to test >> your >> > configuration. >> > >> > Sajan Parikh >> > *Owner, Noppix LLC* >> >> > >> > e: sajan at noppix.com >> > p: (563) 726-0371 >> > >> > [image: Noppix LLC Logo] >> > On 06/17/2013 09:36 AM, Janet Valbuena wrote: >> > >> > Hi >> > >> > I'm new to nginx. I'm trying to configure a virtual server. >> > >> > I've created a new server file under sites-enabled like this: >> > >> > server { >> > listen 80; ## listen for ipv4; this line is default and implied >> > >> > server_name blogtest; >> > >> > root /usr/share/nginx/cakephptest/app/webroot; >> > index index.php; >> > >> > location / { >> > # First attempt to serve request as file, then >> > # as directory, then fall back to 404 >> > try_files $uri $uri/ =404; >> > } >> > # PHP FPM >> > location ~ \.php$ { >> > fastcgi_pass 127.0.0.1:9000; >> > fastcgi_index index.php; >> > include fastcgi_params; >> > fastcgi_intercept_errors on; >> > fastcgi_buffers 8 16k; >> > fastcgi_buffer_size 32k; >> > fastcgi_split_path_info ^(.+\.php)(/.+)$; >> > fastcgi_param PATH_INFO $fastcgi_path_info; >> > fastcgi_param PATH_TRANSLATED >> $document_root$fastcgi_path_info; >> > fastcgi_param SCRIPT_FILENAME >> > $document_root$fastcgi_script_name; >> > } >> > } >> > >> > >> > Is there anything wrong with that? >> > When I type in blogtest/index.php on the browser I get the default >> > config, which points to /usr/share/nginx/www/, even though I deleted the >> > symbolic link to sites-available/default from sites-enabled. >> > >> > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. >> > >> > Could anyone please help. >> > >> > Thanks >> > >> > JV >> > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- [image: WiFi SPARK] [image: Facebook] [image: Twitter] *Janet Valbuena* Software Developer *t:* 0844 848 9555 | *f: *01626 834 745 *w: *wifispark.com WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton Abbot, Devon, TQ12 6TZ This message and its attachments are deemed confidential. If you are not the intended recipient, you are strictly prohibited to disclose, copy, distribute or take any action in relation to the contents of this message. WiFi SPARK accepts no liability for virus transmission, for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasil at ludost.net Mon Jun 17 19:58:56 2013 From: vasil at ludost.net (Vasil Kolev) Date: Mon, 17 Jun 2013 22:58:56 +0300 Subject: virtual server configuration In-Reply-To: References: Message-ID: <1371499136.5394.125.camel@nymphadora.home.ludost.net> rm /etc/nginx/sites-enabled/default should fix it, the default takes over everything, from what I've seen. ? 16:56 +0100 ?? 17.06.2013 (??), Janet Valbuena ??????: > Hi Wong > > I installed nginx recently and haven't changed anything in nginx.conf. > > > It actually doesn't include /etc/nginx/sites-available/* but it does > include /etc/nginx/sites-enabled/*, which is where I put a symbolic > link of my config file. > > user www-data; > worker_processes 4; > pid /var/run/nginx.pid; > > events { > worker_connections 768; > # multi_accept on; > } > > http { > > ## > # Basic Settings > ## > > sendfile on; > tcp_nopush on; > tcp_nodelay on; > keepalive_timeout 65; > types_hash_max_size 2048; > # server_tokens off; > > # server_names_hash_bucket_size 64; > # server_name_in_redirect off; > > include /etc/nginx/mime.types; > default_type application/octet-stream; > > ## > # Logging Settings > ## > > access_log /var/log/nginx/access.log; > error_log /var/log/nginx/error.log; > > ## > # Gzip Settings > ## > > gzip on; > gzip_disable "msie6"; > > # gzip_vary on; > # gzip_proxied any; > # gzip_comp_level 6; > # gzip_buffers 16 8k; > # gzip_http_version 1.1; > # gzip_types text/plain text/css application/json > application/x-javascript text/xml application/xml application/xml+rss > text/javascript; > > ## > # nginx-naxsi config > ## > # Uncomment it if you installed nginx-naxsi > ## > > #include /etc/nginx/naxsi_core.rules; > > ## > # nginx-passenger config > ## > # Uncomment it if you installed nginx-passenger > ## > > #passenger_root /usr; > #passenger_ruby /usr/bin/ruby; > > ## > # Virtual Host Configs > ## > > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; > } > > > Just in case it helps I'm using Ubuntu 12.04 LTS > > > Thanks > > > > > > On 17 June 2013 16:41, Wong Kee Wee wrote: > Hi Janet, > > Can you show us the content of your nginx.conf? > > > Do you have the 'include' directive in your nginx.conf to > point to your sites-available? > > > For example: > http { > ... > include /etc/nginx/sites-available/*; > ... > } > > > Best regards, > Wong Kee Wee > > > Hi Sajan > > Yes I did restart nginx. I've tried several times. > > Just tried nginx -t and all seems to be fine. > > nginx -t > nginx: the configuration file /etc/nginx/nginx.conf > syntax is ok > nginx: configuration file /etc/nginx/nginx.conf test > is successful > > > JV > > > On 17 June 2013 15:48, Sajan Parikh > wrote: > > > Did you restart nginx for the new configuration to > take effect? Run > > 'sudo service nginx restart' to do this. Also run > 'nginx -t' to test your > > configuration. > > > > Sajan Parikh > > > *Owner, Noppix LLC* > > > > > e: sajan at noppix.com > > p: (563) 726-0371 > > > > [image: Noppix LLC Logo] > > On 06/17/2013 09:36 AM, Janet Valbuena wrote: > > > > Hi > > > > I'm new to nginx. I'm trying to configure a virtual > server. > > > > I've created a new server file under sites-enabled > like this: > > > > server { > > listen 80; ## listen for ipv4; this line is > default and implied > > > > server_name blogtest; > > > > root /usr/share/nginx/cakephptest/app/webroot; > > index index.php; > > > > location / { > > # First attempt to serve request as > file, then > > # as directory, then fall back to 404 > > try_files $uri $uri/ =404; > > } > > # PHP FPM > > location ~ \.php$ { > > fastcgi_pass 127.0.0.1:9000; > > fastcgi_index index.php; > > include fastcgi_params; > > fastcgi_intercept_errors on; > > fastcgi_buffers 8 16k; > > fastcgi_buffer_size 32k; > > fastcgi_split_path_info > ^(.+\.php)(/.+)$; > > fastcgi_param PATH_INFO > $fastcgi_path_info; > > fastcgi_param PATH_TRANSLATED > $document_root$fastcgi_path_info; > > fastcgi_param SCRIPT_FILENAME > > $document_root$fastcgi_script_name; > > } > > } > > > > > > Is there anything wrong with that? > > When I type in blogtest/index.php on the browser I > get the default > > config, which points to /usr/share/nginx/www/, even > though I deleted the > > symbolic link to sites-available/default from > sites-enabled. > > > > > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. > > > > Could anyone please help. > > > > Thanks > > > > JV > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > > -- > WiFi SPARK > Facebook Twitter > Janet Valbuena > Software Developer > t: 0844 848 9555 | f: 01626 834 745 > w: wifispark.com > WiFi SPARK Ltd, Teignbridge > Business Centre, Cavalier Road, > Newton Abbot, Devon, TQ12 6TZ > > > This message and its attachments are deemed confidential. If you are > not the intended recipient, you are strictly prohibited to disclose, > copy, distribute or take any action in relation to the contents of > this message. WiFi SPARK accepts no liability for virus transmission, > for the content of this email, or for the consequences of any actions > taken on the basis of the information provided, unless that > information is subsequently confirmed in writing. > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Regards, Vasil Kolev -------------- 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 steve at greengecko.co.nz Mon Jun 17 22:05:07 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Tue, 18 Jun 2013 10:05:07 +1200 Subject: try_files question... or alternative? Message-ID: <1371506707.25974.333.camel@steve-new> Is there a simple way of getting nginx to search for the index when given a bare directory as URL? eg in a server block... index index.php index.html index.htm; when passed an URL of http://www.example.com/sub where there is no location /sub {} block it looks for http://www.example.com/sub/index.php etc... Cheers, Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From francis at daoine.org Mon Jun 17 22:27:12 2013 From: francis at daoine.org (Francis Daly) Date: Mon, 17 Jun 2013 23:27:12 +0100 Subject: try_files question... or alternative? In-Reply-To: <1371506707.25974.333.camel@steve-new> References: <1371506707.25974.333.camel@steve-new> Message-ID: <20130617222712.GZ27406@craic.sysops.org> On Tue, Jun 18, 2013 at 10:05:07AM +1200, Steve Holdoway wrote: Hi there, > Is there a simple way of getting nginx to search for the index when > given a bare directory as URL? In general, this is a bad idea. In your specific case, it may not be. So if an explicit listing is acceptable, then you could try something like location / { try_files $uri $uri/index.php $uri/index.html $uri/ =404; } with whatever surrounding extra configuration is needed. But really, /sub and /sub/ are different urls, and you should have a good reason to not just use the defaults. f -- Francis Daly francis at daoine.org From paulnpace at gmail.com Tue Jun 18 01:46:31 2013 From: paulnpace at gmail.com (Paul N. Pace) Date: Mon, 17 Jun 2013 18:46:31 -0700 Subject: Hosting multiple domains In-Reply-To: <1371351854.25974.122.camel@steve-new> References: <1371351854.25974.122.camel@steve-new> Message-ID: Thank you Steve for nginx -t, and Sajan was correct, I had a syntax error in a server block. However, while I was troubleshooting I noticed my log files getting rather huge. I keep the access_log and error_log files in the directories for each site. How can I keep these log files to a reasonable size without losing the data? (I use Piwik to analyze access logs, so I don't want to lose any data). Thanks! On Sat, Jun 15, 2013 at 8:04 PM, Steve Holdoway wrote: > Hello! > > On Sat, 2013-06-15 at 19:39 -0700, Paul N. Pace wrote: >> I have a server that I set up to run several domains from and it has >> worked great and without issue for about 6 months. >> >> I have another server that I had set up and was only running one >> domain from it and I just added a second domain. For some reason, this >> second server does not want to serve two domains, and I can find no >> substantial differences in the configuration files (nginx.conf and >> sites-available files). >> >> On both servers I put a symlink in the sites-enabled folder to the >> corresponding sites-available file. >> >> On the second, problematic server, when creating a symlink to the >> second site and restarting nginx, testing the second domain only >> brings up the first domain. Rebooting the server disables both domains >> and the server appears unresponsive, except that I can SSH into it. >> Then removing the symlink to the second domain and restarting nginx >> returns the server to serving the one domain as it has been doing. >> >> The first server is running nginx 1.5.0 and the second server is >> running nginx 1.4.1. >> >> What should I be looking at to resolve this issue? >> > Without seeing the config files/error logs, it's difficult to find the > problem. However, I can confirm that both name and IP address based > hosting works perfectly. > > nginx -t > > may well help identify incorrect config files. > > Note there is some precedence in the listen 80 / listen ip:80 statements > which might be causing the problem. > > Steve > > -- > Steve Holdoway BSc(Hons) MNZCS > http://www.greengecko.co.nz > Linkedin: http://www.linkedin.com/in/steveholdoway > Skype: sholdowa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From steve at greengecko.co.nz Tue Jun 18 02:12:44 2013 From: steve at greengecko.co.nz (steve) Date: Tue, 18 Jun 2013 14:12:44 +1200 Subject: Hosting multiple domains In-Reply-To: References: <1371351854.25974.122.camel@steve-new> Message-ID: If it's a linux server, look at logrotate. This will keep old versions, and can also zip them up... being text files they compress very well. hth, Steve On 2013-06-18 13:46, Paul N. Pace wrote: > Thank you Steve for nginx -t, and Sajan was correct, I had a syntax > error in a server block. > > However, while I was troubleshooting I noticed my log files getting > rather huge. I keep the access_log and error_log files in the > directories for each site. > > How can I keep these log files to a reasonable size without losing > the > data? (I use Piwik to analyze access logs, so I don't want to lose > any > data). > > Thanks! > > On Sat, Jun 15, 2013 at 8:04 PM, Steve Holdoway > wrote: >> Hello! >> >> On Sat, 2013-06-15 at 19:39 -0700, Paul N. Pace wrote: >>> I have a server that I set up to run several domains from and it >>> has >>> worked great and without issue for about 6 months. >>> >>> I have another server that I had set up and was only running one >>> domain from it and I just added a second domain. For some reason, >>> this >>> second server does not want to serve two domains, and I can find no >>> substantial differences in the configuration files (nginx.conf and >>> sites-available files). >>> >>> On both servers I put a symlink in the sites-enabled folder to the >>> corresponding sites-available file. >>> >>> On the second, problematic server, when creating a symlink to the >>> second site and restarting nginx, testing the second domain only >>> brings up the first domain. Rebooting the server disables both >>> domains >>> and the server appears unresponsive, except that I can SSH into it. >>> Then removing the symlink to the second domain and restarting nginx >>> returns the server to serving the one domain as it has been doing. >>> >>> The first server is running nginx 1.5.0 and the second server is >>> running nginx 1.4.1. >>> >>> What should I be looking at to resolve this issue? >>> >> Without seeing the config files/error logs, it's difficult to find >> the >> problem. However, I can confirm that both name and IP address based >> hosting works perfectly. >> >> nginx -t >> >> may well help identify incorrect config files. >> >> Note there is some precedence in the listen 80 / listen ip:80 >> statements >> which might be causing the problem. >> >> Steve >> >> -- >> Steve Holdoway BSc(Hons) MNZCS >> http://www.greengecko.co.nz >> Linkedin: http://www.linkedin.com/in/steveholdoway >> Skype: sholdowa >> >> _______________________________________________ >> 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 wongkeewee at gmail.com Tue Jun 18 05:34:49 2013 From: wongkeewee at gmail.com (Wong Kee Wee) Date: Tue, 18 Jun 2013 13:34:49 +0800 Subject: virtual server configuration Message-ID: Hi Janet, It is weird then Once you remove the 'default' symlink and reload the config, the old configuration should no longer take effect. Have you tried refreshing your browser after restarting/reloading nginx? I'm suspecting the old index page was cached by your browser Best regards, Wong Kee Wee On 18/6/2013 3:59 AM, nginx-request at nginx.org wrote: > Message: 2 > Date: Mon, 17 Jun 2013 16:56:47 +0100 > From: Janet Valbuena > To: nginx at nginx.org > Subject: Re: virtual server configuration > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Wong > > I installed nginx recently and haven't changed anything in nginx.conf. > > It actually doesn't include /etc/nginx/sites-available/* but it does > include /etc/nginx/sites-enabled/*, which is where I put a symbolic link of > my config file. > > user www-data; > worker_processes 4; > pid /var/run/nginx.pid; > > events { > worker_connections 768; > # multi_accept on; > } > > http { > > ## > # Basic Settings > ## > > sendfile on; > tcp_nopush on; > tcp_nodelay on; > keepalive_timeout 65; > types_hash_max_size 2048; > # server_tokens off; > > # server_names_hash_bucket_size 64; > # server_name_in_redirect off; > > include /etc/nginx/mime.types; > default_type application/octet-stream; > > ## > # Logging Settings > ## > > access_log /var/log/nginx/access.log; > error_log /var/log/nginx/error.log; > > ## > # Gzip Settings > ## > > gzip on; > gzip_disable "msie6"; > > # gzip_vary on; > # gzip_proxied any; > # gzip_comp_level 6; > # gzip_buffers 16 8k; > # gzip_http_version 1.1; > # gzip_types text/plain text/css application/json > application/x-javascript text/xml application/xml application/xml+rss > text/javascript; > > ## > # nginx-naxsi config > ## > # Uncomment it if you installed nginx-naxsi > ## > > #include /etc/nginx/naxsi_core.rules; > > ## > # nginx-passenger config > ## > # Uncomment it if you installed nginx-passenger > ## > > #passenger_root /usr; > #passenger_ruby /usr/bin/ruby; > > ## > # Virtual Host Configs > ## > > include /etc/nginx/conf.d/*.conf; > * include /etc/nginx/sites-enabled/*;* > } > > Just in case it helps I'm using Ubuntu 12.04 LTS > > Thanks > > > > On 17 June 2013 16:41, Wong Kee Wee wrote: > >> > Hi Janet, >> > >> > Can you show us the content of your nginx.conf? >> > >> > Do you have the 'include' directive in your nginx.conf to point to your >> > sites-available? >> > >> > For example: >> > http { >> > >> > ... >> > include /etc/nginx/sites-available/*; >> > ... >> > >> > } >> > >> > Best regards, >> > Wong Kee Wee >> > >> > >> > Hi Sajan >>> >> >>> >> Yes I did restart nginx. I've tried several times. >>> >> >>> >> Just tried nginx -t and all seems to be fine. >>> >> >>> >> nginx -t >>> >> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok >>> >> nginx: configuration file /etc/nginx/nginx.conf test is successful >>> >> >>> >> >>> >> JV >>> >> >>> >> >>> >> On 17 June 2013 15:48, Sajan Parikh wrote: >>> >> >>>> >> > Did you restart nginx for the new configuration to take effect? Run >>>> >> > 'sudo service nginx restart' to do this. Also run 'nginx -t' to test >>> >> your >>>> >> > configuration. >>>> >> > >>>> >> > Sajan Parikh >>>> >> > *Owner, Noppix LLC* >>> >> >>>> >> > >>>> >> > e: sajan at noppix.com >>>> >> > p: (563) 726-0371 >>>> >> > >>>> >> > [image: Noppix LLC Logo] >>>> >> > On 06/17/2013 09:36 AM, Janet Valbuena wrote: >>>> >> > >>>> >> > Hi >>>> >> > >>>> >> > I'm new to nginx. I'm trying to configure a virtual server. >>>> >> > >>>> >> > I've created a new server file under sites-enabled like this: >>>> >> > >>>> >> > server { >>>> >> > listen 80; ## listen for ipv4; this line is default and implied >>>> >> > >>>> >> > server_name blogtest; >>>> >> > >>>> >> > root /usr/share/nginx/cakephptest/app/webroot; >>>> >> > index index.php; >>>> >> > >>>> >> > location / { >>>> >> > # First attempt to serve request as file, then >>>> >> > # as directory, then fall back to 404 >>>> >> > try_files $uri $uri/ =404; >>>> >> > } >>>> >> > # PHP FPM >>>> >> > location ~ \.php$ { >>>> >> > fastcgi_pass 127.0.0.1:9000; >>>> >> > fastcgi_index index.php; >>>> >> > include fastcgi_params; >>>> >> > fastcgi_intercept_errors on; >>>> >> > fastcgi_buffers 8 16k; >>>> >> > fastcgi_buffer_size 32k; >>>> >> > fastcgi_split_path_info ^(.+\.php)(/.+)$; >>>> >> > fastcgi_param PATH_INFO $fastcgi_path_info; >>>> >> > fastcgi_param PATH_TRANSLATED >>> >> $document_root$fastcgi_path_info; >>>> >> > fastcgi_param SCRIPT_FILENAME >>>> >> > $document_root$fastcgi_script_name; >>>> >> > } >>>> >> > } >>>> >> > >>>> >> > >>>> >> > Is there anything wrong with that? >>>> >> > When I type in blogtest/index.php on the browser I get the default >>>> >> > config, which points to /usr/share/nginx/www/, even though I deleted the >>>> >> > symbolic link to sites-available/default from sites-enabled. >>>> >> > >>>> >> > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist. >>>> >> > >>>> >> > Could anyone please help. >>>> >> > >>>> >> > Thanks >>>> >> > >>>> >> > JV >>> >> >> > >> > _______________________________________________ >> > nginx mailing list >> > nginx at nginx.org >> > http://mailman.nginx.org/mailman/listinfo/nginx >> > > -- [image: WiFi SPARK] [image: Facebook] [image: Twitter] *Janet Valbuena* Software Developer *t:* 0844 848 9555 | *f: *01626 834 745 *w: *wifispark.com < http://www.wifispark.com/> WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton Abbot, Devon, TQ12 6TZ This message and its attachments are deemed confidential. If you are not the intended recipient, you are strictly prohibited to disclose, copy, distribute or take any action in relation to the contents of this message. WiFi SPARK accepts no liability for virus transmission, for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.nginx.org/pipermail/nginx/attachments/20130617/89980779/attachment-0001.html > -------------- next part -------------- An HTML attachment was scrubbed... URL: From janet at wifispark.com Tue Jun 18 09:31:29 2013 From: janet at wifispark.com (Janet Valbuena) Date: Tue, 18 Jun 2013 10:31:29 +0100 Subject: virtual server configuration In-Reply-To: References: Message-ID: Hi Wong, hi Vasil I did restart nginx and reloaded the browser while I was setting up this virtual server yesterday several times. Strangely, this morning when I started my computer all worked well. Maybe I needed to restart the network or something else? Thanks very much for your help. Janet On 18 June 2013 06:34, Wong Kee Wee wrote: > Hi Janet, > > It is weird then > Once you remove the 'default' symlink and reload the config, the old > configuration should no longer take effect. > > Have you tried refreshing your browser after restarting/reloading nginx? > I'm suspecting the old index page was cached by your browser > > Best regards, > Wong Kee Wee > > On 18/6/2013 3:59 AM, nginx-request at nginx.org wrote: > > Message: 2 > > Date: Mon, 17 Jun 2013 16:56:47 +0100 > > From: Janet Valbuena > > To: nginx at nginx.org > > Subject: Re: virtual server configuration > > Message-ID: > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Wong > > > > I installed nginx recently and haven't changed anything in nginx.conf. > > > > It actually doesn't include /etc/nginx/sites-available/* but it does > > include /etc/nginx/sites-enabled/*, which is where I put a symbolic link > of > > my config file. > > > > user www-data; > > worker_processes 4; > > pid /var/run/nginx.pid; > > > > events { > > worker_connections 768; > > # multi_accept on; > > } > > > > http { > > > > ## > > # Basic Settings > > ## > > > > sendfile on; > > tcp_nopush on; > > tcp_nodelay on; > > keepalive_timeout 65; > > types_hash_max_size 2048; > > # server_tokens off; > > > > # server_names_hash_bucket_size 64; > > # server_name_in_redirect off; > > > > include /etc/nginx/mime.types; > > default_type application/octet-stream; > > > > ## > > # Logging Settings > > ## > > > > access_log /var/log/nginx/access.log; > > error_log /var/log/nginx/error.log; > > > > ## > > # Gzip Settings > > ## > > > > gzip on; > > gzip_disable "msie6"; > > > > # gzip_vary on; > > # gzip_proxied any; > > # gzip_comp_level 6; > > # gzip_buffers 16 8k; > > # gzip_http_version 1.1; > > # gzip_types text/plain text/css application/json > > application/x-javascript text/xml application/xml application/xml+rss > > text/javascript; > > > > ## > > # nginx-naxsi config > > ## > > # Uncomment it if you installed nginx-naxsi > > ## > > > > #include /etc/nginx/naxsi_core.rules; > > > > ## > > # nginx-passenger config > > ## > > # Uncomment it if you installed nginx-passenger > > ## > > > > #passenger_root /usr; > > #passenger_ruby /usr/bin/ruby; > > > > ## > > # Virtual Host Configs > > ## > > > > include /etc/nginx/conf.d/*.conf; > > * include /etc/nginx/sites-enabled/*;* > > } > > > > Just in case it helps I'm using Ubuntu 12.04 LTS > > > > Thanks > > > > > > > > On 17 June 2013 16:41, Wong Kee Wee wrote: > > > >> > Hi Janet, > >> > > >> > Can you show us the content of your nginx.conf? > >> > > >> > Do you have the 'include' directive in your nginx.conf to point to > your > >> > sites-available? > >> > > >> > For example: > >> > http { > >> > > >> > ... > >> > include /etc/nginx/sites-available/*; > >> > ... > >> > > >> > } > >> > > >> > Best regards, > >> > Wong Kee Wee > >> > > >> > > >> > Hi Sajan > >>> >> > >>> >> Yes I did restart nginx. I've tried several times. > >>> >> > >>> >> Just tried nginx -t and all seems to be fine. > >>> >> > >>> >> nginx -t > >>> >> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok > >>> >> nginx: configuration file /etc/nginx/nginx.conf test is successful > >>> >> > >>> >> > >>> >> JV > >>> >> > >>> >> > >>> >> On 17 June 2013 15:48, Sajan Parikh wrote: > >>> >> > >>>> >> > Did you restart nginx for the new configuration to take effect? > Run > >>>> >> > 'sudo service nginx restart' to do this. Also run 'nginx -t' to > test > >>> >> your > >>>> >> > configuration. > >>>> >> > > >>>> >> > Sajan Parikh > >>>> >> > *Owner, Noppix LLC* > >>> >> > >>>> >> > > >>>> >> > e: sajan at noppix.com > >>>> >> > p: (563) 726-0371 > >>>> >> > > >>>> >> > [image: Noppix LLC Logo] > >>>> >> > On 06/17/2013 09:36 AM, Janet Valbuena wrote: > >>>> >> > > >>>> >> > Hi > >>>> >> > > >>>> >> > I'm new to nginx. I'm trying to configure a virtual server. > >>>> >> > > >>>> >> > I've created a new server file under sites-enabled like this: > >>>> >> > > >>>> >> > server { > >>>> >> > listen 80; ## listen for ipv4; this line is default and > implied > >>>> >> > > >>>> >> > server_name blogtest; > >>>> >> > > >>>> >> > root /usr/share/nginx/cakephptest/app/webroot; > >>>> >> > index index.php; > >>>> >> > > >>>> >> > location / { > >>>> >> > # First attempt to serve request as file, then > >>>> >> > # as directory, then fall back to 404 > >>>> >> > try_files $uri $uri/ =404; > >>>> >> > } > >>>> >> > # PHP FPM > >>>> >> > location ~ \.php$ { > >>>> >> > fastcgi_pass 127.0.0.1:9000; > >>>> >> > fastcgi_index index.php; > >>>> >> > include fastcgi_params; > >>>> >> > fastcgi_intercept_errors on; > >>>> >> > fastcgi_buffers 8 16k; > >>>> >> > fastcgi_buffer_size 32k; > >>>> >> > fastcgi_split_path_info ^(.+\.php)(/.+)$; > >>>> >> > fastcgi_param PATH_INFO $fastcgi_path_info; > >>>> >> > fastcgi_param PATH_TRANSLATED > >>> >> $document_root$fastcgi_path_info; > >>>> >> > fastcgi_param SCRIPT_FILENAME > >>>> >> > $document_root$fastcgi_script_name; > >>>> >> > } > >>>> >> > } > >>>> >> > > >>>> >> > > >>>> >> > Is there anything wrong with that? > >>>> >> > When I type in blogtest/index.php on the browser I get the > default > >>>> >> > config, which points to /usr/share/nginx/www/, even though I > deleted the > >>>> >> > symbolic link to sites-available/default from sites-enabled. > >>>> >> > > >>>> >> > Note: /usr/share/nginx/cakephptest/app/webroot/index.php does > exist. > >>>> >> > > >>>> >> > Could anyone please help. > >>>> >> > > >>>> >> > Thanks > >>>> >> > > >>>> >> > JV > >>> >> > >> > > >> > _______________________________________________ > >> > nginx mailing list > >> > nginx at nginx.org > >> > http://mailman.nginx.org/mailman/listinfo/nginx > >> > > > -- [image: WiFi SPARK] [image: Facebook] > [image: Twitter] *Janet Valbuena* Software > Developer *t:* 0844 848 9555 | *f: *01626 834 745 *w: *wifispark.com < > http://www.wifispark.com/> WiFi SPARK Ltd, Teignbridge Business Centre, > Cavalier Road, Newton Abbot, Devon, TQ12 6TZ This message and its > attachments are deemed confidential. If you are not the intended recipient, > you are strictly prohibited to disclose, copy, distribute or take any > action in relation to the contents of this message. WiFi SPARK accepts no > liability for virus transmission, for the content of this email, or for the > consequences of any actions taken on the basis of the information provided, > unless that information is subsequently confirmed in writing. > -------------- next part -------------- An HTML attachment was scrubbed... > URL: < > http://mailman.nginx.org/pipermail/nginx/attachments/20130617/89980779/attachment-0001.html > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- [image: WiFi SPARK] [image: Facebook] [image: Twitter] *Janet Valbuena* Software Developer *t:* 0844 848 9555 | *f: *01626 834 745 *w: *wifispark.com WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton Abbot, Devon, TQ12 6TZ This message and its attachments are deemed confidential. If you are not the intended recipient, you are strictly prohibited to disclose, copy, distribute or take any action in relation to the contents of this message. WiFi SPARK accepts no liability for virus transmission, for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From emailgrant at gmail.com Tue Jun 18 13:42:14 2013 From: emailgrant at gmail.com (Grant) Date: Tue, 18 Jun 2013 06:42:14 -0700 Subject: munin plugin for nginx In-Reply-To: <1371451490.25974.296.camel@steve-new> References: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> <1371451490.25974.296.camel@steve-new> Message-ID: >> > I'm having some trouble getting the nginx plugin working for munin. >> > I've added the following to nginx config and restarted: >> > >> > location /nginx_status { >> > stub_status on; >> > access_log off; >> > allow 127.0.0.1; >> > deny all; >> > } >> > >> > I've added the following munin config: >> > >> > [nginx*] >> > env.url http://localhost/nginx_status >> > >> > Unfortunately I still get: >> > >> > # munin-run nginx_request >> > request.value U >> > # munin-run nginx_status >> > total.value U >> > reading.value U >> > writing.value U >> > waiting.value U >> > >> > If I remove the allow/deny, I can browse to /nginx_status and I get: >> > >> > Active connections: 13 >> > server accepts handled requests >> > 15 15 16 >> > Reading: 0 Writing: 1 Waiting: 12 >> > >> > What could be the problem? >> >> the munin plugin is broken or not getting the status information. >> >> Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. >> > > Well, I run it all over the place with no problem. I usually set it up > only on localhost > > server { > listen 127.0.0.1:80 default; > server_name localhost; > root /var/www; > > access_log /var/log/nginx/localhost.access.log; > error_log /var/log/nginx/localhost.error.log; > > location ~ /nginx_status { > stub_status on; > access_log off; > allow 127.0.0.1; > deny all; > } > } > > ( in /etc/nginx/conf.d/stub, or /etc/nginx/sites-available/stub, > symlinked to ../sites-enabled/stub depending on preference ) and restart > nginx. > > Then test this bit works... > > $ wget -O - http://localhost/nginx_status 2> /dev/null > Active connections: 1 > server accepts handled requests > 67892 67892 70215 > Reading: 0 Writing: 1 Waiting: 0 > > Some os's seem to like > > [nginx*] > env.url http://localhost/nginx_status > > added to /etc/munin/plugin-conf.d/munin_node > > then > > munin-run nginx_status > > should run just fine. You fixed it! Reducing it to the simplest config that still works, I found that the location /nginx_status block doesn't work with munin inside of any other server block. It only works inside its own server block like so: server { location ~ ^/nginx_status$ { stub_status on; access_log off; allow 127.0.0.1; deny all; } } Is this a munin bug? Thank you! - Grant From black.fledermaus at arcor.de Tue Jun 18 14:00:10 2013 From: black.fledermaus at arcor.de (basti) Date: Tue, 18 Jun 2013 16:00:10 +0200 Subject: munin plugin for nginx In-Reply-To: References: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> <1371451490.25974.296.camel@steve-new> Message-ID: <51C067EA.8060002@arcor.de> My config looks like: /etc/munin/plugin-conf.d/munin-node ... [nginx_*] user root /etc/nginx/sites-enabled/default ... ## munin nginx status (request/ connections handeled) location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } ... This runs for me very well, so try to edit your /etc/munin/plugin-conf.d/munin-node. You can also Debug by munin-configure --suggest Am 18.06.2013 15:42, schrieb Grant: >>>> I'm having some trouble getting the nginx plugin working for munin. >>>> I've added the following to nginx config and restarted: >>>> >>>> location /nginx_status { >>>> stub_status on; >>>> access_log off; >>>> allow 127.0.0.1; >>>> deny all; >>>> } >>>> >>>> I've added the following munin config: >>>> >>>> [nginx*] >>>> env.url http://localhost/nginx_status >>>> >>>> Unfortunately I still get: >>>> >>>> # munin-run nginx_request >>>> request.value U >>>> # munin-run nginx_status >>>> total.value U >>>> reading.value U >>>> writing.value U >>>> waiting.value U >>>> >>>> If I remove the allow/deny, I can browse to /nginx_status and I get: >>>> >>>> Active connections: 13 >>>> server accepts handled requests >>>> 15 15 16 >>>> Reading: 0 Writing: 1 Waiting: 12 >>>> >>>> What could be the problem? >>> the munin plugin is broken or not getting the status information. >>> >>> Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. >>> >> Well, I run it all over the place with no problem. I usually set it up >> only on localhost >> >> server { >> listen 127.0.0.1:80 default; >> server_name localhost; >> root /var/www; >> >> access_log /var/log/nginx/localhost.access.log; >> error_log /var/log/nginx/localhost.error.log; >> >> location ~ /nginx_status { >> stub_status on; >> access_log off; >> allow 127.0.0.1; >> deny all; >> } >> } >> >> ( in /etc/nginx/conf.d/stub, or /etc/nginx/sites-available/stub, >> symlinked to ../sites-enabled/stub depending on preference ) and restart >> nginx. >> >> Then test this bit works... >> >> $ wget -O - http://localhost/nginx_status 2> /dev/null >> Active connections: 1 >> server accepts handled requests >> 67892 67892 70215 >> Reading: 0 Writing: 1 Waiting: 0 >> >> Some os's seem to like >> >> [nginx*] >> env.url http://localhost/nginx_status >> >> added to /etc/munin/plugin-conf.d/munin_node >> >> then >> >> munin-run nginx_status >> >> should run just fine. > You fixed it! Reducing it to the simplest config that still works, I > found that the location /nginx_status block doesn't work with munin > inside of any other server block. It only works inside its own server > block like so: > > server { > location ~ ^/nginx_status$ { > stub_status on; > access_log off; > allow 127.0.0.1; > deny all; > } > } > > Is this a munin bug? > > Thank you! > > - Grant > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From emailgrant at gmail.com Tue Jun 18 14:10:12 2013 From: emailgrant at gmail.com (Grant) Date: Tue, 18 Jun 2013 07:10:12 -0700 Subject: munin plugin for nginx In-Reply-To: <51C067EA.8060002@arcor.de> References: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> <1371451490.25974.296.camel@steve-new> <51C067EA.8060002@arcor.de> Message-ID: > My config looks like: > > /etc/munin/plugin-conf.d/munin-node > > ... > [nginx_*] > user root > > /etc/nginx/sites-enabled/default I don't have /etc/nginx/sites-enabled/ at all. What kind of stuff is in the default file? I'm on Gentoo. - Grant > ... > ## munin nginx status (request/ connections handeled) > location /nginx_status { > stub_status on; > access_log off; > allow 127.0.0.1; > deny all; > } > ... > This runs for me very well, so try to edit your > /etc/munin/plugin-conf.d/munin-node. > You can also Debug by > > munin-configure --suggest > > Am 18.06.2013 15:42, schrieb Grant: >>>>> I'm having some trouble getting the nginx plugin working for munin. >>>>> I've added the following to nginx config and restarted: >>>>> >>>>> location /nginx_status { >>>>> stub_status on; >>>>> access_log off; >>>>> allow 127.0.0.1; >>>>> deny all; >>>>> } >>>>> >>>>> I've added the following munin config: >>>>> >>>>> [nginx*] >>>>> env.url http://localhost/nginx_status >>>>> >>>>> Unfortunately I still get: >>>>> >>>>> # munin-run nginx_request >>>>> request.value U >>>>> # munin-run nginx_status >>>>> total.value U >>>>> reading.value U >>>>> writing.value U >>>>> waiting.value U >>>>> >>>>> If I remove the allow/deny, I can browse to /nginx_status and I get: >>>>> >>>>> Active connections: 13 >>>>> server accepts handled requests >>>>> 15 15 16 >>>>> Reading: 0 Writing: 1 Waiting: 12 >>>>> >>>>> What could be the problem? >>>> the munin plugin is broken or not getting the status information. >>>> >>>> Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. >>>> >>> Well, I run it all over the place with no problem. I usually set it up >>> only on localhost >>> >>> server { >>> listen 127.0.0.1:80 default; >>> server_name localhost; >>> root /var/www; >>> >>> access_log /var/log/nginx/localhost.access.log; >>> error_log /var/log/nginx/localhost.error.log; >>> >>> location ~ /nginx_status { >>> stub_status on; >>> access_log off; >>> allow 127.0.0.1; >>> deny all; >>> } >>> } >>> >>> ( in /etc/nginx/conf.d/stub, or /etc/nginx/sites-available/stub, >>> symlinked to ../sites-enabled/stub depending on preference ) and restart >>> nginx. >>> >>> Then test this bit works... >>> >>> $ wget -O - http://localhost/nginx_status 2> /dev/null >>> Active connections: 1 >>> server accepts handled requests >>> 67892 67892 70215 >>> Reading: 0 Writing: 1 Waiting: 0 >>> >>> Some os's seem to like >>> >>> [nginx*] >>> env.url http://localhost/nginx_status >>> >>> added to /etc/munin/plugin-conf.d/munin_node >>> >>> then >>> >>> munin-run nginx_status >>> >>> should run just fine. >> You fixed it! Reducing it to the simplest config that still works, I >> found that the location /nginx_status block doesn't work with munin >> inside of any other server block. It only works inside its own server >> block like so: >> >> server { >> location ~ ^/nginx_status$ { >> stub_status on; >> access_log off; >> allow 127.0.0.1; >> deny all; >> } >> } >> >> Is this a munin bug? >> >> Thank you! >> >> - Grant From black.fledermaus at arcor.de Tue Jun 18 14:29:11 2013 From: black.fledermaus at arcor.de (basti) Date: Tue, 18 Jun 2013 16:29:11 +0200 Subject: munin plugin for nginx In-Reply-To: References: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> <1371451490.25974.296.camel@steve-new> <51C067EA.8060002@arcor.de> Message-ID: <51C06EB7.80404@arcor.de> Replace [nginx*] env.url http://localhost/nginx_status with [nginx_*] user root my nginx default file egrep -v "(^$|^#)" /etc/nginx/sites-enabled/default server { listen 80; ## listen for ipv4 listen [::]:80 default ipv6only=on; ## listen for ipv6 server_name localhost; access_log /var/log/nginx/localhost.access.log; location / { root /var/www; index index.html index.htm; } location /doc { root /usr/share; autoindex on; allow 127.0.0.1; deny all; } location /images { root /usr/share; autoindex on; } location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } #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; #} } Am 18.06.2013 16:10, schrieb Grant: >> My config looks like: >> >> /etc/munin/plugin-conf.d/munin-node >> >> ... >> [nginx_*] >> user root >> >> /etc/nginx/sites-enabled/default > I don't have /etc/nginx/sites-enabled/ at all. What kind of stuff is > in the default file? I'm on Gentoo. > > - Grant > > >> ... >> ## munin nginx status (request/ connections handeled) >> location /nginx_status { >> stub_status on; >> access_log off; >> allow 127.0.0.1; >> deny all; >> } >> ... >> This runs for me very well, so try to edit your >> /etc/munin/plugin-conf.d/munin-node. >> You can also Debug by >> >> munin-configure --suggest >> >> Am 18.06.2013 15:42, schrieb Grant: >>>>>> I'm having some trouble getting the nginx plugin working for munin. >>>>>> I've added the following to nginx config and restarted: >>>>>> >>>>>> location /nginx_status { >>>>>> stub_status on; >>>>>> access_log off; >>>>>> allow 127.0.0.1; >>>>>> deny all; >>>>>> } >>>>>> >>>>>> I've added the following munin config: >>>>>> >>>>>> [nginx*] >>>>>> env.url http://localhost/nginx_status >>>>>> >>>>>> Unfortunately I still get: >>>>>> >>>>>> # munin-run nginx_request >>>>>> request.value U >>>>>> # munin-run nginx_status >>>>>> total.value U >>>>>> reading.value U >>>>>> writing.value U >>>>>> waiting.value U >>>>>> >>>>>> If I remove the allow/deny, I can browse to /nginx_status and I get: >>>>>> >>>>>> Active connections: 13 >>>>>> server accepts handled requests >>>>>> 15 15 16 >>>>>> Reading: 0 Writing: 1 Waiting: 12 >>>>>> >>>>>> What could be the problem? >>>>> the munin plugin is broken or not getting the status information. >>>>> >>>>> Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. >>>>> >>>> Well, I run it all over the place with no problem. I usually set it up >>>> only on localhost >>>> >>>> server { >>>> listen 127.0.0.1:80 default; >>>> server_name localhost; >>>> root /var/www; >>>> >>>> access_log /var/log/nginx/localhost.access.log; >>>> error_log /var/log/nginx/localhost.error.log; >>>> >>>> location ~ /nginx_status { >>>> stub_status on; >>>> access_log off; >>>> allow 127.0.0.1; >>>> deny all; >>>> } >>>> } >>>> >>>> ( in /etc/nginx/conf.d/stub, or /etc/nginx/sites-available/stub, >>>> symlinked to ../sites-enabled/stub depending on preference ) and restart >>>> nginx. >>>> >>>> Then test this bit works... >>>> >>>> $ wget -O - http://localhost/nginx_status 2> /dev/null >>>> Active connections: 1 >>>> server accepts handled requests >>>> 67892 67892 70215 >>>> Reading: 0 Writing: 1 Waiting: 0 >>>> >>>> Some os's seem to like >>>> >>>> [nginx*] >>>> env.url http://localhost/nginx_status >>>> >>>> added to /etc/munin/plugin-conf.d/munin_node >>>> >>>> then >>>> >>>> munin-run nginx_status >>>> >>>> should run just fine. >>> You fixed it! Reducing it to the simplest config that still works, I >>> found that the location /nginx_status block doesn't work with munin >>> inside of any other server block. It only works inside its own server >>> block like so: >>> >>> server { >>> location ~ ^/nginx_status$ { >>> stub_status on; >>> access_log off; >>> allow 127.0.0.1; >>> deny all; >>> } >>> } >>> >>> Is this a munin bug? >>> >>> Thank you! >>> >>> - Grant > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From emailgrant at gmail.com Tue Jun 18 15:08:06 2013 From: emailgrant at gmail.com (Grant) Date: Tue, 18 Jun 2013 08:08:06 -0700 Subject: munin plugin for nginx In-Reply-To: <51C06EB7.80404@arcor.de> References: <1153542275.7000.1371450842939.JavaMail.root@zimbra.lentz.com.au> <1371451490.25974.296.camel@steve-new> <51C067EA.8060002@arcor.de> <51C06EB7.80404@arcor.de> Message-ID: > Replace > > [nginx*] > env.url http://localhost/nginx_status > > with > [nginx_*] > user root Thanks! - Grant > my nginx default file > > egrep -v "(^$|^#)" /etc/nginx/sites-enabled/default > server { > listen 80; ## listen for ipv4 > listen [::]:80 default ipv6only=on; ## listen for ipv6 > server_name localhost; > access_log /var/log/nginx/localhost.access.log; > location / { > root /var/www; > index index.html index.htm; > } > location /doc { > root /usr/share; > autoindex on; > allow 127.0.0.1; > deny all; > } > location /images { > root /usr/share; > autoindex on; > } > location /nginx_status { > stub_status on; > access_log off; > allow 127.0.0.1; > deny all; > } > > #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; > #} > } > > > > Am 18.06.2013 16:10, schrieb Grant: > >>> My config looks like: >>> >>> /etc/munin/plugin-conf.d/munin-node >>> >>> ... >>> [nginx_*] >>> user root >>> >>> /etc/nginx/sites-enabled/default >> I don't have /etc/nginx/sites-enabled/ at all. What kind of stuff is >> in the default file? I'm on Gentoo. >> >> - Grant >> >> >>> ... >>> ## munin nginx status (request/ connections handeled) >>> location /nginx_status { >>> stub_status on; >>> access_log off; >>> allow 127.0.0.1; >>> deny all; >>> } >>> ... >>> This runs for me very well, so try to edit your >>> /etc/munin/plugin-conf.d/munin-node. >>> You can also Debug by >>> >>> munin-configure --suggest >>> >>> Am 18.06.2013 15:42, schrieb Grant: >>>>>>> I'm having some trouble getting the nginx plugin working for munin. >>>>>>> I've added the following to nginx config and restarted: >>>>>>> >>>>>>> location /nginx_status { >>>>>>> stub_status on; >>>>>>> access_log off; >>>>>>> allow 127.0.0.1; >>>>>>> deny all; >>>>>>> } >>>>>>> >>>>>>> I've added the following munin config: >>>>>>> >>>>>>> [nginx*] >>>>>>> env.url http://localhost/nginx_status >>>>>>> >>>>>>> Unfortunately I still get: >>>>>>> >>>>>>> # munin-run nginx_request >>>>>>> request.value U >>>>>>> # munin-run nginx_status >>>>>>> total.value U >>>>>>> reading.value U >>>>>>> writing.value U >>>>>>> waiting.value U >>>>>>> >>>>>>> If I remove the allow/deny, I can browse to /nginx_status and I get: >>>>>>> >>>>>>> Active connections: 13 >>>>>>> server accepts handled requests >>>>>>> 15 15 16 >>>>>>> Reading: 0 Writing: 1 Waiting: 12 >>>>>>> >>>>>>> What could be the problem? >>>>>> the munin plugin is broken or not getting the status information. >>>>>> >>>>>> Try stracing the munin-run, network capature or turning on the access logs on /nginx_status just to be sure. >>>>>> >>>>> Well, I run it all over the place with no problem. I usually set it up >>>>> only on localhost >>>>> >>>>> server { >>>>> listen 127.0.0.1:80 default; >>>>> server_name localhost; >>>>> root /var/www; >>>>> >>>>> access_log /var/log/nginx/localhost.access.log; >>>>> error_log /var/log/nginx/localhost.error.log; >>>>> >>>>> location ~ /nginx_status { >>>>> stub_status on; >>>>> access_log off; >>>>> allow 127.0.0.1; >>>>> deny all; >>>>> } >>>>> } >>>>> >>>>> ( in /etc/nginx/conf.d/stub, or /etc/nginx/sites-available/stub, >>>>> symlinked to ../sites-enabled/stub depending on preference ) and restart >>>>> nginx. >>>>> >>>>> Then test this bit works... >>>>> >>>>> $ wget -O - http://localhost/nginx_status 2> /dev/null >>>>> Active connections: 1 >>>>> server accepts handled requests >>>>> 67892 67892 70215 >>>>> Reading: 0 Writing: 1 Waiting: 0 >>>>> >>>>> Some os's seem to like >>>>> >>>>> [nginx*] >>>>> env.url http://localhost/nginx_status >>>>> >>>>> added to /etc/munin/plugin-conf.d/munin_node >>>>> >>>>> then >>>>> >>>>> munin-run nginx_status >>>>> >>>>> should run just fine. >>>> You fixed it! Reducing it to the simplest config that still works, I >>>> found that the location /nginx_status block doesn't work with munin >>>> inside of any other server block. It only works inside its own server >>>> block like so: >>>> >>>> server { >>>> location ~ ^/nginx_status$ { >>>> stub_status on; >>>> access_log off; >>>> allow 127.0.0.1; >>>> deny all; >>>> } >>>> } >>>> >>>> Is this a munin bug? >>>> >>>> Thank you! >>>> >>>> - Grant From nginx-forum at nginx.us Tue Jun 18 15:37:19 2013 From: nginx-forum at nginx.us (n1xman) Date: Tue, 18 Jun 2013 11:37:19 -0400 Subject: Nginx cache files by mime type using ngx_srcache module In-Reply-To: References: Message-ID: <5bcb72bd6631716c8c1ccadb351618df.NginxMailingListEnglish@forum.nginx.org> Hi agentzh, Thanks for the response. It is not happening on my uat site as I have redone the configuration and tested with the full setup. However it happened on my try out setup where I did not want image/* content-type to be cached. 2013/06/12 15:51:43 [info] 11016#0: *19 key: "%252fsanta.jpg" was not found by memcached while reading response header from upstream, client: 192.168.0.61, server: -, request: "GET /santa.jpg HTTP/1.1", subrequest: "/memc" Maybe my configuration problem :( Thanks again for the support and the setup is now cached by MIME types also; we are running ngx_srcache without a problem. :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240023,240195#msg-240195 From ben at indietorrent.org Tue Jun 18 19:22:04 2013 From: ben at indietorrent.org (Ben Johnson) Date: Tue, 18 Jun 2013 15:22:04 -0400 Subject: Using try_files while forcing a trailing-slash in the URL Message-ID: <51C0B35C.90107@indietorrent.org> Hello, Brand new to nginx and loving it so far. Thanks to all who contribute to the project. The try_files directive is brilliant. The only problem I'm having is that I would like to be able to force a trailing-slash, a la "rewrite", on the fallback URL. The try_files documentation at http://wiki.nginx.org/NginxHttpCoreModule#try_files states that something like this is usually sufficient (and it is): # for Drupal 6 or 7: try_files $uri $uri/ /index.php?q=$uri&$args; This works well, but I have a need to eliminate duplicate URLs (for SEO ["duplicate-content penalty"] reasons) by forcing a trailing slash on all virtual URLs (that is, URLs that do not point to a real file or directory). Am I missing something obvious? I was able to cook-up a "working solution", but it will probably bristle a few peoples' hair: --------------------------------------------------------- location / { # Because nginx doesn't support compound logical # expressions in this context, e.g., "if $a = 1 && $b = 2". set $test ""; if (!-d $request_filename) { set $test "${test}nd"; } if (!-f $request_filename) { set $test "${test}nf"; } # The request is NOT for an existing file or directory; # It must be for a) a file that doesn't exist, b) a legitimate # clean-URL PHP resource. # Even if the request is for a legitimate clean-URL PHP resource, we # always force a trailing slash. if ($request_filename !~ "/$") { set $test "${test}nts"; } # Not a directory, not a file, and doesn't contain a trailing # slash; we need to redirect and append the slash. if ($test = 'ndnfnts') { rewrite ^(.*[^/])$ $1/ permanent; break; } # Not a directory and not a file, but contains a trailing slash; # we're done, and we can rewrite the URL per our # Controller Pattern logic. if ($test = 'ndnf') { rewrite ^(.*)$ /index.php?q=$1 last; } } --------------------------------------------------------- Ultimately, I'm wondering if there's a means by which to achieve the above with try_files, and if not, if there's a better means than what I've employed on my own. A related "problem" (more an inconvenience, really) is that using try_files in the manner described in the cited documentation causes the trailing ampersand ("&") to be appended to "q" even when there are no $args. Is this behavior intentional? Maybe there's an RFC of which I"m unaware that lead to this decision. Thanks for any help! -Ben From reallfqq-nginx at yahoo.fr Tue Jun 18 20:17:05 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Tue, 18 Jun 2013 16:17:05 -0400 Subject: Using try_files while forcing a trailing-slash in the URL In-Reply-To: <51C0B35C.90107@indietorrent.org> References: <51C0B35C.90107@indietorrent.org> Message-ID: Hello,? On Tue, Jun 18, 2013 at 3:22 PM, Ben Johnson wrote: > Hello, > > Brand new to nginx and loving it so far. Thanks to all who contribute to > the project. > > The try_files directive is brilliant. The only problem I'm having is > that I would like to be able to force a trailing-slash, a la "rewrite", > on the fallback URL. > > The try_files documentation at > http://wiki.nginx.org/NginxHttpCoreModule#try_files states that > something like this is usually sufficient (and it is): > ? I would recommend the original documentation: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files ? > > # for Drupal 6 or 7: > try_files $uri $uri/ /index.php?q=$uri&$args; > > This works well, but I have a need to eliminate duplicate URLs (for SEO > ["duplicate-content penalty"] reasons) by forcing a trailing slash on > all virtual URLs (that is, URLs that do not point to a real file or > directory). > > Am I missing something obvious? > ? If I am correct, the last parameter of the try_files directive handles error situations. It is used when every rule before failed. If you use: try_files? ? $uri $uri/; then you have the wanted behavior. >From what I see of your rules and what I understand from what you wish to do, you have a conflicting expected behavior : - Falling back to index.php?q=$uri&$args - Falling back to $uri/ You need to choose... You'll also note that try_files context is either server or location, thus you can set up a default rule server-wide and overwrite it for specific locations. > I was able to cook-up a "working solution", but it will probably bristle > a few peoples' hair: > > --------------------------------------------------------- > location / { > # Because nginx doesn't support compound logical > # expressions in this context, e.g., "if $a = 1 && $b = 2". > > set $test ""; > > if (!-d $request_filename) { > set $test "${test}nd"; > } > > if (!-f $request_filename) { > set $test "${test}nf"; > } > > # The request is NOT for an existing file or directory; > # It must be for a) a file that doesn't exist, b) a legitimate > # clean-URL PHP resource. > > # Even if the request is for a legitimate clean-URL PHP resource, we > # always force a trailing slash. > > if ($request_filename !~ "/$") { > set $test "${test}nts"; > } > > # Not a directory, not a file, and doesn't contain a trailing > # slash; we need to redirect and append the slash. > > if ($test = 'ndnfnts') { > rewrite ^(.*[^/])$ $1/ permanent; > break; > } > > # Not a directory and not a file, but contains a trailing slash; > # we're done, and we can rewrite the URL per our > # Controller Pattern logic. > > if ($test = 'ndnf') { > rewrite ^(.*)$ /index.php?q=$1 last; > } > } > --------------------------------------------------------- > > Ultimately, I'm wondering if there's a means by which to achieve the > above with try_files, and if not, if there's a better means than what > I've employed on my own. > > A related "problem" (more an inconvenience, really) is that using > try_files in the manner described in the cited documentation causes the > trailing ampersand ("&") to be appended to "q" even when there are no > $args. Is this behavior intentional? Maybe there's an RFC of which I"m > unaware that lead to this decision. > > Thanks for any help! > > -Ben > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From cprenzberg at googlemail.com Tue Jun 18 21:00:21 2013 From: cprenzberg at googlemail.com (Charles) Date: Tue, 18 Jun 2013 23:00:21 +0200 Subject: Problems with HTTP PUT with nginx-mogilefs-module In-Reply-To: References: Message-ID: well....that's really really too bad. it's such a great module. On Mon, Jun 17, 2013 at 9:40 PM, Akzhan Abdulin wrote: > nginx-mogilefs-module is not maintained by author now. It works ok with > nginx 0.7.1 up to 0.8. It has some issues on nginx 1.0 and higher due to > updates of nginx APIs. > > > 2013/6/17 Charles > >> Hi, >> >> I am having issues executing the http PUT to upload a file to MogileFS >> via nginx-mogilefs-module v1.0.4. >> >> I am running nginx 1.4.1 compiled with --with-debug option on CentOS 6.3. >> >> The nginx-mogilefs-module was forked from >> https://github.com/gnosek/nginx-mogilefs-module where a fix for >> -Werror=unused-but-set-variable warnings (with newer gcc) >> was fixed. Then I manually merged changes from >> https://github.com/pyh/nginx-mogilefs-module which implements variables >> for "mogilefs_domain" (and makes the directive mandatory). >> >> I guess there is a sleeker way to merge changes like that but I am still >> relatively new at using git. Anyway, I compiled nginx with the resulting >> module and the compile was ok. >> >> My nginx configuration is as follows: >> >> server { >> >> listen 192.168.0.109:80; >> >> error_log logs/node1.storage.dfs.log debug; >> >> location ~ ^/download/(?\w.+)/(?\w.+)/(?.+)$ { >> >> allow 192.168.0.0/24; >> deny all; >> >> mogilefs_tracker mogilefs_tracker_nodes; >> mogilefs_domain $domain; >> mogilefs_class $class; >> mogilefs_methods GET; >> >> mogilefs_pass $key { >> proxy_pass $mogilefs_path; >> proxy_hide_header Content-Type; >> proxy_buffering off; >> } >> } >> >> location ~ ^/upload/(?\w.+)/(?\w.+)/(?.+)$ { >> allow 192.168.0.0/24; >> deny all; >> >> mogilefs_tracker mogilefs_tracker_nodes; >> mogilefs_domain $domain; >> mogilefs_class $class; >> mogilefs_methods PUT DELETE; >> >> mogilefs_pass $key { >> proxy_pass $mogilefs_path; >> proxy_hide_header Content-Type; >> proxy_buffering off; >> } >> } >> >> } >> >> On start of the server I have the following in node1.storage.dfs.log: >> >> 2013/06/17 17:02:47 [debug] 12417#0: epoll add event: fd:7 op:1 >> ev:00000001 >> >> >> GET and DELETE work fine but not PUT. When I try to PUT a file via curl, >> I get the following on the console: >> >> root at node1.storage.dfs:~# curl -v --upload-file ./castle.jpg >> http://192.168.0.109/upload/defaultdomain/defaultclass/schwarzwald.jpg >> * About to connect() to 192.168.0.109 port 80 (#0) >> * Trying 192.168.0.109... connected >> * Connected to 192.168.0.109 (192.168.0.109) port 80 (#0) >> > PUT /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1 >> > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/ >> 3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 >> > Host: 192.168.0.109 >> > Accept: */* >> > Content-Length: 301027 >> > Expect: 100-continue >> > >> < HTTP/1.1 100 Continue >> >> and it just hangs there >> >> >> And these are the debug logs for the PUT request: >> >> 2013/06/17 17:06:08 [debug] 12417#0: accept on 192.168.0.109:80, ready: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: posix_memalign: 0000000002639F80:256 >> @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 accept: 192.168.0.109 fd:3 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 3: >> 60000:1371481628599 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 1 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add event: fd:3 op:1 >> ev:80000001 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http wait request handler >> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >> 000000000263A0E0:256 @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 000000000266B1D0:1024 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 263 of 1024 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >> 0000000002646430:4096 @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http process request line >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request line: "PUT >> /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http uri: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http args: "" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http exten: "jpg" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http process request header line >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "User-Agent: >> curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0zlib/1.2.3 libidn/1.18 libssh2/1.2.2" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Host: 192.168.0.109" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Accept: */*" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Content-Length: >> 301027" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Expect: >> 100-continue" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header done >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 3: 1371481628599 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >> "mogstored_spare_40237552/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >> "mogstored_spare_40262152/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "robots.txt" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: ~ >> "^/download/(?\w.+)/(?\w.+)/(?.+)$" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: ~ >> "^/upload/(?\w.+)/(?\w.+)/(?.+)$" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $class to >> "defaultclass" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $domain to >> "defaultdomain" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $key to >> "schwarzwald.jpg" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 using configuration >> "^/upload/(?\w.+)/(?\w.+)/(?.+)$" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http cl:301027 max:10485760 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 post rewrite phase: 3 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 4 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 5 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 access phase: 6 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 access: 6D00A8C0 00FFFFFF 0000A8C0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 access phase: 7 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 post access phase: 8 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -5, >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" a:1, c:1 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 content phase: 9 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler >> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >> 000000000263E530:4096 @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "schwarzwald.jpg" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 send 100 Continue >> 2013/06/17 17:06:08 [debug] 12417#0: *1 send: fd:3 25 of 25 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request body content length >> filter >> 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 000000000263F540:8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource >> temporarily unavailable) >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest >> 301027 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 3: >> 60000:1371481628603 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" a:1, c:2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:2 blk:0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E698 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 add cleanup: 000000000263E7D0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 hashed path: >> /usr/local/nginx/client_body_temp/0000000001 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 temp fd:10 >> 2013/06/17 17:06:08 [warn] 12417#0: *1 a client request body is buffered >> to a temporary file /usr/local/nginx/client_body_temp/0000000001, client: >> 192.168.0.109, server: , request: "PUT >> /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1", host: >> "192.168.0.109" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E800 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E810 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 16384 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E820 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 24576 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E830 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 32768 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E840 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 40960 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E850 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 49152 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E860 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 57344 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E870 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 65536 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E880 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 73728 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E890 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 81920 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E8A0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 90112 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E8B0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 98304 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E8C0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 106496 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E8D0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 114688 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E8E0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 122880 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E8F0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 131072 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E900 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 139264 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource >> temporarily unavailable) >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest >> 153571 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer: 3, old: >> 1371481628603, new: 1371481628627 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E910 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 147456 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E920 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 155648 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E930 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 163840 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E940 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 172032 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E950 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 180224 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E960 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 188416 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E970 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 196608 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E980 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 204800 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E990 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 212992 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E9A0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 221184 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource >> temporarily unavailable) >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest >> 71651 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer: 3, old: >> 1371481628603, new: 1371481628646 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E9B0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 229376 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E9C0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 237568 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E9D0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 245760 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E9E0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 253952 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263E9F0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 262144 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263EA00 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 270336 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263EA10 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 278528 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 8192 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263EA20 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 8192, 286720 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 6115 of 6115 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv 6115 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >> 000000000263F540, pos 000000000263F540, size: 6115 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 3: 1371481628603 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >> bufs 000000000263EA30 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >> 6115, 294912 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs body handler >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler state: 0, >> status: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http subrequest >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http posted request: >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >> "mogstored_spare_40237552/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >> "mogstored_spare_40262152/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >> "mogstored_spare_40256728/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >> "mogstored_spare_40251304/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 using configuration >> "/mogstored_spare_40251304/" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http cl:301027 max:10485760 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 post rewrite phase: 3 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 4 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 5 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >> 0000000002641550:4096 @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http init upstream, client timer: >> 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add event: fd:3 op:3 >> ev:80000005 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "defaultdomain" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "defaultclass" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs request: "create_open >> key=schwarzwald.jpg&domain=defaultdomain&class=defaultclass" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http cleanup add: 0000000002641B40 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 get rr peer, try: 1 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 socket 11 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add connection: fd:11 >> ev:80000005 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 connect to 192.168.0.109:6001, >> fd:11 #2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream connect: -2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >> 000000000263A1F0:128 @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: >> 60000:1371481628674 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, >> "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:3 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:3 blk:0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream check client, write >> event:1, "/mogstored_spare_40251304/schwarzwald.jpg" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add connection: fd:11 >> ev:80000005 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 connect to 192.168.0.109:6001, >> fd:11 #2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream connect: -2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >> 000000000263A1F0:128 @16 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: >> 60000:1371481628674 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, >> "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:3 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:3 blk:0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream check client, write >> event:1, "/mogstored_spare_40251304/schwarzwald.jpg" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream recv(): -1 (11: >> Resource temporarily unavailable) >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream request: >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream send request handler >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream send request >> 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer buf fl:0 s:73 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer in: 0000000002641B78 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 writev: 73 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer out: 0000000000000000 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 11: 1371481628674 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: >> 60000:1371481628676 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream request: >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream process header >> 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 00000000026A59F0:4096 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:11 80 of 4096 >> "013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs: "OK devid=2&fid=50&path= >> http://192.168.0.108:7500/dev2/0/000/000/0000000050.fid >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "devid"="2" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "fid"="50" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "path"=" >> http://192.168.0.108:7500/dev2/0/000/000/0000000050.fid" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 tcp_nodelay >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream process non >> buffered downstream >> 2013/06/17 17:06:08 [debug] 12417#0: *1 finalize http upstream request: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 finalize mogilefs request >> 2013/06/17 17:06:08 [debug] 12417#0: *1 free rr peer 1 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 close http upstream connection: 11 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 free: 000000000263A1F0, unused: 48 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 11: 1371481628676 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http output filter >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http copy filter: >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http postpone filter >> "/mogstored_spare_40251304/schwarzwald.jpg?" 00007FFFC19595A0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 write new buf t:0 f:0 >> 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write filter: l:0 f:0 s:0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http copy filter: 0 >> "/mogstored_spare_40251304/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: 0, >> "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:2 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs finish phase handler: >> state=1, status=0 >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http wake parent request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http posted request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request empty handler >> 2013/06/17 17:06:28 [debug] 12417#0: *1 http run request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:28 [debug] 12417#0: *1 http reading blocked >> 2013/06/17 17:06:28 [debug] 12417#0: *1 http run request: >> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >> 2013/06/17 17:06:28 [debug] 12417#0: *1 http request empty handler >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "mogile" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to mogile+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > > --- > You received this message because you are subscribed to the Google Groups > "mogile" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mogile+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Tue Jun 18 21:55:00 2013 From: francis at daoine.org (Francis Daly) Date: Tue, 18 Jun 2013 22:55:00 +0100 Subject: Using try_files while forcing a trailing-slash in the URL In-Reply-To: <51C0B35C.90107@indietorrent.org> References: <51C0B35C.90107@indietorrent.org> Message-ID: <20130618215500.GA27406@craic.sysops.org> On Tue, Jun 18, 2013 at 03:22:04PM -0400, Ben Johnson wrote: Hi there, > The try_files directive is brilliant. The only problem I'm having is > that I would like to be able to force a trailing-slash, a la "rewrite", > on the fallback URL. > This works well, but I have a need to eliminate duplicate URLs (for SEO > ["duplicate-content penalty"] reasons) by forcing a trailing slash on > all virtual URLs (that is, URLs that do not point to a real file or > directory). > > Am I missing something obvious? try_files decides which file to serve, with a single fallback option. If that fallback option is something complicated, it is probably best to use a named location and put the complications in there. > I was able to cook-up a "working solution", but it will probably bristle > a few peoples' hair: If it works, it works. If you can measure the load on your test server, you may be interested in trying other things too and comparing. For example: location / { try_files $uri $uri/ @virtual; } location @virtual { if ($uri !~ '/$') { return 301 $uri/$is_args$args; } fastcgi_pass unix:php.sock; fastcgi_param SCRIPT_FILENAME $document_root/index.php; include fastcgi_params; } as well as a location for handling /index.php or any similar things directly. (Depending on what exactly your php script does, you may also want to set QUERY_STRING explicitly.) > Ultimately, I'm wondering if there's a means by which to achieve the > above with try_files, and if not, if there's a better means than what > I've employed on my own. The above uses try_files, and uses "if" within "location" with only "return", which is a safe thing to do. http://wiki.nginx.org/IfIsEvil > A related "problem" (more an inconvenience, really) is that using > try_files in the manner described in the cited documentation causes the > trailing ampersand ("&") to be appended to "q" even when there are no > $args. Is this behavior intentional? Maybe there's an RFC of which I"m > unaware that lead to this decision. You asked for $uri, then &, then $args. You should be surprised if you get anything other than $uri, then &, then $args. I suspect it was done because the php script it feeds is known to ignore the unnecessary &. nginx does provide the variable $is_args, but that is intended for other circumstances where it is more useful. You could do more "if" things on $is_args or on $args to decide whether to add the &, if you want to. Good luck with it, f -- Francis Daly francis at daoine.org From david.birdsong at gmail.com Wed Jun 19 01:46:33 2013 From: david.birdsong at gmail.com (David Birdsong) Date: Tue, 18 Jun 2013 18:46:33 -0700 Subject: Problems with HTTP PUT with nginx-mogilefs-module In-Reply-To: References: Message-ID: nginx-0.8.55 exhibits this problem for me too. i tried nginx-0.7.69 which seems to fix. On Tue, Jun 18, 2013 at 2:00 PM, Charles wrote: > well....that's really really too bad. it's such a great module. > > > On Mon, Jun 17, 2013 at 9:40 PM, Akzhan Abdulin wrote: > >> nginx-mogilefs-module is not maintained by author now. It works ok with >> nginx 0.7.1 up to 0.8. It has some issues on nginx 1.0 and higher due to >> updates of nginx APIs. >> >> >> 2013/6/17 Charles >> >>> Hi, >>> >>> I am having issues executing the http PUT to upload a file to MogileFS >>> via nginx-mogilefs-module v1.0.4. >>> >>> I am running nginx 1.4.1 compiled with --with-debug option on CentOS 6.3. >>> >>> The nginx-mogilefs-module was forked from >>> https://github.com/gnosek/nginx-mogilefs-module where a fix for >>> -Werror=unused-but-set-variable warnings (with newer gcc) >>> was fixed. Then I manually merged changes from >>> https://github.com/pyh/nginx-mogilefs-module which implements variables >>> for "mogilefs_domain" (and makes the directive mandatory). >>> >>> I guess there is a sleeker way to merge changes like that but I am still >>> relatively new at using git. Anyway, I compiled nginx with the resulting >>> module and the compile was ok. >>> >>> My nginx configuration is as follows: >>> >>> server { >>> >>> listen 192.168.0.109:80; >>> >>> error_log logs/node1.storage.dfs.log debug; >>> >>> location ~ ^/download/(?\w.+)/(?\w.+)/(?.+)$ { >>> >>> allow 192.168.0.0/24; >>> deny all; >>> >>> mogilefs_tracker mogilefs_tracker_nodes; >>> mogilefs_domain $domain; >>> mogilefs_class $class; >>> mogilefs_methods GET; >>> >>> mogilefs_pass $key { >>> proxy_pass $mogilefs_path; >>> proxy_hide_header Content-Type; >>> proxy_buffering off; >>> } >>> } >>> >>> location ~ ^/upload/(?\w.+)/(?\w.+)/(?.+)$ { >>> allow 192.168.0.0/24; >>> deny all; >>> >>> mogilefs_tracker mogilefs_tracker_nodes; >>> mogilefs_domain $domain; >>> mogilefs_class $class; >>> mogilefs_methods PUT DELETE; >>> >>> mogilefs_pass $key { >>> proxy_pass $mogilefs_path; >>> proxy_hide_header Content-Type; >>> proxy_buffering off; >>> } >>> } >>> >>> } >>> >>> On start of the server I have the following in node1.storage.dfs.log: >>> >>> 2013/06/17 17:02:47 [debug] 12417#0: epoll add event: fd:7 op:1 >>> ev:00000001 >>> >>> >>> GET and DELETE work fine but not PUT. When I try to PUT a file via curl, >>> I get the following on the console: >>> >>> root at node1.storage.dfs:~# curl -v --upload-file ./castle.jpg >>> http://192.168.0.109/upload/defaultdomain/defaultclass/schwarzwald.jpg >>> * About to connect() to 192.168.0.109 port 80 (#0) >>> * Trying 192.168.0.109... connected >>> * Connected to 192.168.0.109 (192.168.0.109) port 80 (#0) >>> > PUT /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1 >>> > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/ >>> 3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 >>> > Host: 192.168.0.109 >>> > Accept: */* >>> > Content-Length: 301027 >>> > Expect: 100-continue >>> > >>> < HTTP/1.1 100 Continue >>> >>> and it just hangs there >>> >>> >>> And these are the debug logs for the PUT request: >>> >>> 2013/06/17 17:06:08 [debug] 12417#0: accept on 192.168.0.109:80, ready: >>> 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: posix_memalign: >>> 0000000002639F80:256 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 accept: 192.168.0.109 fd:3 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 3: >>> 60000:1371481628599 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 1 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add event: fd:3 op:1 >>> ev:80000001 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http wait request handler >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >>> 000000000263A0E0:256 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 000000000266B1D0:1024 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 263 of 1024 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >>> 0000000002646430:4096 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http process request line >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request line: "PUT >>> /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http uri: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http args: "" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http exten: "jpg" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http process request header line >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "User-Agent: >>> curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0zlib/1.2.3 libidn/1.18 libssh2/1.2.2" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Host: >>> 192.168.0.109" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Accept: */*" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Content-Length: >>> 301027" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header: "Expect: >>> 100-continue" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http header done >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 3: 1371481628599 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >>> "mogstored_spare_40237552/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >>> "mogstored_spare_40262152/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "robots.txt" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: ~ >>> "^/download/(?\w.+)/(?\w.+)/(?.+)$" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: ~ >>> "^/upload/(?\w.+)/(?\w.+)/(?.+)$" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $class to >>> "defaultclass" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $domain to >>> "defaultdomain" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http regex set $key to >>> "schwarzwald.jpg" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 using configuration >>> "^/upload/(?\w.+)/(?\w.+)/(?.+)$" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http cl:301027 max:10485760 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 post rewrite phase: 3 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 4 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 5 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 access phase: 6 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 access: 6D00A8C0 00FFFFFF >>> 0000A8C0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 access phase: 7 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 post access phase: 8 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -5, >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" a:1, c:1 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 content phase: 9 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >>> 000000000263E530:4096 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: >>> "schwarzwald.jpg" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 send 100 Continue >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 send: fd:3 25 of 25 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request body content length >>> filter >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 000000000263F540:8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource >>> temporarily unavailable) >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest >>> 301027 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 3: >>> 60000:1371481628603 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" a:1, c:2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:2 blk:0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E698 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 add cleanup: 000000000263E7D0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 hashed path: >>> /usr/local/nginx/client_body_temp/0000000001 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 temp fd:10 >>> 2013/06/17 17:06:08 [warn] 12417#0: *1 a client request body is buffered >>> to a temporary file /usr/local/nginx/client_body_temp/0000000001, client: >>> 192.168.0.109, server: , request: "PUT >>> /upload/defaultdomain/defaultclass/schwarzwald.jpg HTTP/1.1", host: >>> "192.168.0.109" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E800 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E810 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 16384 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E820 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 24576 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E830 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 32768 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E840 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 40960 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E850 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 49152 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E860 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 57344 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E870 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 65536 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E880 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 73728 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E890 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 81920 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E8A0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 90112 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E8B0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 98304 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E8C0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 106496 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E8D0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 114688 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E8E0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 122880 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E8F0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 131072 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E900 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 139264 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource >>> temporarily unavailable) >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest >>> 153571 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer: 3, old: >>> 1371481628603, new: 1371481628627 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E910 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 147456 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E920 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 155648 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E930 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 163840 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E940 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 172032 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E950 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 180224 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E960 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 188416 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E970 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 196608 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E980 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 204800 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E990 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 212992 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E9A0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 221184 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 -1 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv() not ready (11: Resource >>> temporarily unavailable) >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv -2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest >>> 71651 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer: 3, old: >>> 1371481628603, new: 1371481628646 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http read client request body >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E9B0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 229376 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E9C0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 237568 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E9D0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 245760 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E9E0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 253952 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263E9F0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 262144 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263EA00 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 270336 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263EA10 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 278528 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 8192 of 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 8192 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 8192 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263EA20 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 8192, 286720 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:3 6115 of 6115 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body recv >>> 6115 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http body new buf t:1 f:0 >>> 000000000263F540, pos 000000000263F540, size: 6115 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http client request body rest 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 3: 1371481628603 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write client request body, >>> bufs 000000000263EA30 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write: 10, 000000000263F540, >>> 6115, 294912 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs body handler >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs put handler state: 0, >>> status: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http subrequest >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http posted request: >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: "/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >>> "mogstored_spare_40237552/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >>> "mogstored_spare_40262152/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >>> "mogstored_spare_40256728/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 test location: >>> "mogstored_spare_40251304/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 using configuration >>> "/mogstored_spare_40251304/" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http cl:301027 max:10485760 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 rewrite phase: 2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 post rewrite phase: 3 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 4 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 generic phase: 5 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >>> 0000000002641550:4096 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http init upstream, client >>> timer: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add event: fd:3 op:3 >>> ev:80000005 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "defaultdomain" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http script var: "defaultclass" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs request: "create_open >>> key=schwarzwald.jpg&domain=defaultdomain&class=defaultclass" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http cleanup add: >>> 0000000002641B40 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 get rr peer, try: 1 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 socket 11 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add connection: fd:11 >>> ev:80000005 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 connect to 192.168.0.109:6001, >>> fd:11 #2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream connect: -2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >>> 000000000263A1F0:128 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: >>> 60000:1371481628674 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, >>> "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:3 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:3 blk:0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream check client, >>> write event:1, "/mogstored_spare_40251304/schwarzwald.jpg" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 epoll add connection: fd:11 >>> ev:80000005 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 connect to 192.168.0.109:6001, >>> fd:11 #2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream connect: -2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 posix_memalign: >>> 000000000263A1F0:128 @16 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: >>> 60000:1371481628674 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: -4, >>> "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:3 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request count:3 blk:0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http run request: >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream check client, >>> write event:1, "/mogstored_spare_40251304/schwarzwald.jpg" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream recv(): -1 (11: >>> Resource temporarily unavailable) >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream request: >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream send request >>> handler >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream send request >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer buf fl:0 s:73 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer in: 0000000002641B78 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 writev: 73 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 chain writer out: >>> 0000000000000000 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 11: >>> 1371481628674 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer add: 11: >>> 60000:1371481628676 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream request: >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream process header >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 malloc: 00000000026A59F0:4096 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 recv: fd:11 80 of 4096 >>> "013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs: "OK >>> devid=2&fid=50&path= >>> http://192.168.0.108:7500/dev2/0/000/000/0000000050.fid >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "devid"="2" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "fid"="50" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs param: "path"=" >>> http://192.168.0.108:7500/dev2/0/000/000/0000000050.fid" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 tcp_nodelay >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http upstream process non >>> buffered downstream >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 finalize http upstream request: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 finalize mogilefs request >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 free rr peer 1 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 close http upstream connection: >>> 11 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 free: 000000000263A1F0, unused: >>> 48 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 event timer del: 11: >>> 1371481628676 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 reusable connection: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http output filter >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http copy filter: >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http postpone filter >>> "/mogstored_spare_40251304/schwarzwald.jpg?" 00007FFFC19595A0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 write new buf t:0 f:0 >>> 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http write filter: l:0 f:0 s:0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http copy filter: 0 >>> "/mogstored_spare_40251304/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http finalize request: 0, >>> "/mogstored_spare_40251304/schwarzwald.jpg?" a:1, c:2 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 mogilefs finish phase handler: >>> state=1, status=0 >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http wake parent request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http posted request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:08 [debug] 12417#0: *1 http request empty handler >>> 2013/06/17 17:06:28 [debug] 12417#0: *1 http run request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:28 [debug] 12417#0: *1 http reading blocked >>> 2013/06/17 17:06:28 [debug] 12417#0: *1 http run request: >>> "/upload/defaultdomain/defaultclass/schwarzwald.jpg?" >>> 2013/06/17 17:06:28 [debug] 12417#0: *1 http request empty handler >>> >>> -- >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "mogile" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to mogile+unsubscribe at googlegroups.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "mogile" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to mogile+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > > --- > You received this message because you are subscribed to the Google Groups > "mogile" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mogile+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Jun 19 04:03:35 2013 From: nginx-forum at nginx.us (angelochen960) Date: Wed, 19 Jun 2013 00:03:35 -0400 Subject: adding expires but not show up in headers Message-ID: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> Hi, I added a expires as follow: location ~ ^/images/ { root /var/www expires max; } if I do a curl -I http://localhost/images/sample.jpg, I got following headers, but can not find the "Expires" in the headers, what I did wrong here? Thanks. HTTP/1.1 200 OK Server: nginx/1.4.1 Date: Wed, 19 Jun 2013 03:52:13 GMT Content-Type: image/jpeg Content-Length: 17584 Last-Modified: Wed, 19 Jun 2013 02:12:31 GMT Connection: keep-alive ETag: "51c1138f-44b0" Accept-Ranges: bytes Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240201,240201#msg-240201 From francis at daoine.org Wed Jun 19 08:05:15 2013 From: francis at daoine.org (Francis Daly) Date: Wed, 19 Jun 2013 09:05:15 +0100 Subject: adding expires but not show up in headers In-Reply-To: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> References: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130619080515.GB27406@craic.sysops.org> On Wed, Jun 19, 2013 at 12:03:35AM -0400, angelochen960 wrote: Hi there, > location ~ ^/images/ { > root /var/www > expires max; > } > > if I do a curl -I http://localhost/images/sample.jpg, I got following > headers, but can not find the "Expires" in the headers, what I did wrong > here? Thanks. What other "location" lines do you have for this server? Only one of them will be used for the request /images/sample.jpg. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Wed Jun 19 09:28:51 2013 From: nginx-forum at nginx.us (angelochen960) Date: Wed, 19 Jun 2013 05:28:51 -0400 Subject: adding expires but not show up in headers In-Reply-To: <20130619080515.GB27406@craic.sysops.org> References: <20130619080515.GB27406@craic.sysops.org> Message-ID: <34e862c143421d55f883309751dcecb5.NginxMailingListEnglish@forum.nginx.org> there is another one, but more specific, but it comes before location ~ ^/images/: location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" { } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240201,240205#msg-240205 From nginx-forum at nginx.us Wed Jun 19 09:31:39 2013 From: nginx-forum at nginx.us (angelochen960) Date: Wed, 19 Jun 2013 05:31:39 -0400 Subject: adding expires but not show up in headers In-Reply-To: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> References: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> Message-ID: there is one before that: location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" { } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240201,240206#msg-240206 From mdounin at mdounin.ru Wed Jun 19 10:18:43 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 19 Jun 2013 14:18:43 +0400 Subject: adding expires but not show up in headers In-Reply-To: <34e862c143421d55f883309751dcecb5.NginxMailingListEnglish@forum.nginx.org> References: <20130619080515.GB27406@craic.sysops.org> <34e862c143421d55f883309751dcecb5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130619101842.GA49779@mdounin.ru> Hello! On Wed, Jun 19, 2013 at 05:28:51AM -0400, angelochen960 wrote: > there is another one, but more specific, but it comes before location ~ > ^/images/: > > location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" { > } There is no such thing as "more specific" when you are talking about regular expressions. First match wins. See here for details: http://nginx.org/r/location -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Wed Jun 19 10:40:04 2013 From: nginx-forum at nginx.us (angelochen960) Date: Wed, 19 Jun 2013 06:40:04 -0400 Subject: adding expires but not show up in headers (SOLVED) In-Reply-To: <20130619101842.GA49779@mdounin.ru> References: <20130619101842.GA49779@mdounin.ru> Message-ID: <0fc6be0d85ad25e7bcc731830a21be3d.NginxMailingListEnglish@forum.nginx.org> You are right, thanks to Francis too for giving me the right direction to look for the problem, it's really the other location that should have the expires set as well, thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240201,240208#msg-240208 From francis at daoine.org Wed Jun 19 11:03:40 2013 From: francis at daoine.org (Francis Daly) Date: Wed, 19 Jun 2013 12:03:40 +0100 Subject: adding expires but not show up in headers In-Reply-To: <34e862c143421d55f883309751dcecb5.NginxMailingListEnglish@forum.nginx.org> References: <20130619080515.GB27406@craic.sysops.org> <34e862c143421d55f883309751dcecb5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130619110340.GC27406@craic.sysops.org> On Wed, Jun 19, 2013 at 05:28:51AM -0400, angelochen960 wrote: Hi there, > there is another one, but more specific, but it comes before location ~ > ^/images/: > > location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" { > } If the only two "location" blocks in your server are: location ~ "^(/images/)(\d{1})/(\d{2})/(.*\.jpg$)" { location ~ ^/images/ { then the request for /images/sample.jpg will be handled in the second one. Which is not what you reported seeing. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Wed Jun 19 12:52:14 2013 From: nginx-forum at nginx.us (Fleshgrinder) Date: Wed, 19 Jun 2013 08:52:14 -0400 Subject: Possible gzip_vary bug? (v1.5.1) Message-ID: <2cf94ec1c695070d63601f4da1e17864.NginxMailingListEnglish@forum.nginx.org> I'm running the latest development version of nginx and gzipping is working. But no Vary Accept-Encoding header is added to any gzip response. The gzip_http_version isn't affecting the behavior, no matter if I set it to 1.0 or 1.1 no header is sent. Even if I add the header myself via the add_header directive, nothing. If I use PHP to add the header it's there. Any ideas what the problem could be? My configure options: https://github.com/MovLib/www/blob/master/conf/install-scripts/nginx.sh My configuration: https://github.com/MovLib/www/tree/master/conf/nginx Specifically the gzip configuration: https://github.com/MovLib/www/blob/master/conf/nginx/conf/gzip.conf Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240214,240214#msg-240214 From nginx-forum at nginx.us Wed Jun 19 13:19:22 2013 From: nginx-forum at nginx.us (solitaryr) Date: Wed, 19 Jun 2013 09:19:22 -0400 Subject: nginx proxy vs apache proxy In-Reply-To: References: Message-ID: Thanks, Lucas. We looked at the headers being passed back (that's what the jsp was for). Even with http completely disabled and https only available, they were still passed as http:80 by nGinx...but Apache passed them through. We tried this on two separate environments. I looked at the ajp module. Unfortunately, it's not in any repository and custom builds are frowned upon for our systems. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239872,240215#msg-240215 From contact at jpluscplusm.com Wed Jun 19 13:28:47 2013 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 19 Jun 2013 14:28:47 +0100 Subject: nginx proxy vs apache proxy In-Reply-To: References: Message-ID: On 19 June 2013 14:19, solitaryr wrote: > Thanks, Lucas. We looked at the headers being passed back (that's what the > jsp was for). Even with http completely disabled and https only available, > they were still passed as http:80 by nGinx...but Apache passed them through. I don't understand what you mean by "passed as http:80", but I think your problem will be fixable if you can provide more detailed information. Please post ascii dumps (tcpdump -nnn -A -s0 -i port 8080) of a request/response under nginx and then under apache, showing all HTTP headers in both directions. In that tcpdump example, I'm assuming your backend is listening for HTTP traffic on port 8080 - you may need to change that. Of course, redact anything you like, but please indicate where you've redacted something rather than just removing it. Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html From mdounin at mdounin.ru Wed Jun 19 13:48:28 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 19 Jun 2013 17:48:28 +0400 Subject: Possible gzip_vary bug? (v1.5.1) In-Reply-To: <2cf94ec1c695070d63601f4da1e17864.NginxMailingListEnglish@forum.nginx.org> References: <2cf94ec1c695070d63601f4da1e17864.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130619134828.GD49779@mdounin.ru> Hello! On Wed, Jun 19, 2013 at 08:52:14AM -0400, Fleshgrinder wrote: > I'm running the latest development version of nginx and gzipping is working. > But no Vary Accept-Encoding header is added to any gzip response. The > gzip_http_version isn't affecting the behavior, no matter if I set it to 1.0 > or 1.1 no header is sent. Even if I add the header myself via the add_header > directive, nothing. > > If I use PHP to add the header it's there. Any ideas what the problem could > be? > > My configure options: > https://github.com/MovLib/www/blob/master/conf/install-scripts/nginx.sh > My configuration: https://github.com/MovLib/www/tree/master/conf/nginx > Specifically the gzip configuration: > https://github.com/MovLib/www/blob/master/conf/nginx/conf/gzip.conf Works fine here: : GET / HTTP/1.1 : Host: foo : Accept-Encoding: gzip : : HTTP/1.1 200 OK : Server: nginx/1.5.2 : Date: Wed, 19 Jun 2013 13:23:39 GMT : Content-Type: text/html : Last-Modified: Mon, 27 Apr 2009 14:40:49 GMT : Transfer-Encoding: chunked : Connection: keep-alive : Vary: Accept-Encoding : Content-Encoding: gzip Best guess that in your case gzipping happens not in nginx (in php?), and add_header doesn't work for you due to other add_header directives used on more specific levels. Alternatively, you might be testing with spdy, where gzip_vary does nothing as all clients are required to support gzip. If you still think there is a bug, you may want to provide a simple configuration to reproduce the problem. -- Maxim Dounin http://nginx.org/en/donation.html From mailinglisten at simonhoenscheid.de Wed Jun 19 16:44:55 2013 From: mailinglisten at simonhoenscheid.de (mailinglisten at simonhoenscheid.de) Date: Wed, 19 Jun 2013 18:44:55 +0200 Subject: Need some help with rewrite rule translation In-Reply-To: References: <51B8F2D1.8000602@simonhoenscheid.de> <9a58e16240d3b1c755947b82acae57ba@simonhoenscheid.de> Message-ID: <48c1dab8470c43834e3940009e58f1bc@simonhoenscheid.de> Am 14.06.2013 14:11, schrieb mailinglisten at simonhoenscheid.de: > I have found the point where my rules break, > > I've had the following location on top, to enable browser caching for > images, for one month: > > #images give caching response for 1 month, browser will request after > this period of time again > location ~* \.(png|jpg|jpeg|gif)$ { > expires 30d; > log_not_found off; > } > This prevented the Rules to run. > Is there a chance to get this functionality without breaking other > rules? > > Simon > This is still driving me mad. We need the expire header for images, but if we add the location above, our rules arent processed anymore. If we add the expire-header to the locations with the rewrite rules, the headers are ignored. I would realy appreciate some help. config: server { listen 1.2.3.4:80; index index.php; server_name static.examplecompany.com access_log /var/log/nginx/static.examplecompany.com-access.log combined; error_log /var/log/nginx/static.examplecompany.com-error.log notice; root /usr/share/examplecompany/static; #deny access to hidden files location ~ /\. { deny all; access_log off; log_not_found off; } #this breaks the rewrite rules, need to fix this soon, due to traffic # location ~* \.(png|jpg|jpeg|gif)$ { # expires 30d; # log_not_found off; # } #images get caching response for 1 month, browser will request after this period of time again #return 204 if favicon is requested, there is none, so we turn off logging too location = /favicon.ico { log_not_found off; access_log off; return 204; } # resized trailer images location /image { rewrite "^/image/resized/(\d+)/([0-9a-fA-F]{6}/|)(.+)_(\d+)(|m)x(\d+)(|m)(_.+|).(jpg|jpeg|png|gif)" /resized/getBySize.php?domainid=$1&objectid=$3&width=$4&height=$6&format=$9&random=$8&color=$2&maxwidth=$5&maxheight=$7 last; rewrite "^/image/logo_examplecompany_(|black_|lightgray_)([0-9a-fA-F]{6})(|_alpha)(|_big).gif" /images/pics/logo_examplecompany.php?color=$2&transparency=$3&picversion=$1&size=$4 last; rewrite "^/image/logo_examplecompany_(small|big)_([0-9a-fA-F]{6}).png" /images/pics/logo_examplecompany_png.php?color=$2&size=$1 last; rewrite "^/image/(trailer|pcd)hints(|2)/([0-9a-fA-F]{6})_([a-z]{2}).(png|gif)" /images/trailerhints/trailerhint.php?what=$1&suffix=$2&color=$3&lang=$4&format=$5 last; # images for intext border } location /images { rewrite "^/images/popup/colored/([0-9a-fA-F]{6})/bg_([a-z0-9_]+).(png|gif)" /images/popup/colored.php?color=$1&image=$2&format=$3 last; rewrite "^/images/popup/(ppp[0-9]?)_([0-9a-fA-F]{6}).css" /images/popup/ppp_css.php?file=$1.css&color=$2 last; } location /media { rewrite "^/media/(\d+)/(\d+)/(.+)\.(.{2,})$" /media/get.php?domainid=$1&objectid=$3&randomcachekey=$2 last; } # if file does not exist, assume its in the pattern somewhere #this is almost ugly, there might be a better solution with try_file location / { try_files $uri @missing; } location @missing { rewrite ^/(.*)\.(.*)$ /fullexamplecompany.php?file=$1.$2 last; } # for partners who configure their widgets on their own. location /retargeting_v1 { rewrite ^/retargeting_v1.js /jscollections.php?name=retargeting last; } location /recommendations_v1 { rewrite ^/recommendations_v1.js /jscollections.php?name=recommendations last; } # to get single javascript modules location /jsmodule { rewrite ^/jsmodule/([_0-9A-Za-z\.,]+)/?([_A-Za-z0-9\[\]]+)?$ /jscollections.php?name=module&modules=$1&callback=$2 last; } # tinyexamplecompany integrations. # publickey and optional file name extension .js location /tiny { rewrite ^/tiny/([a-zA-Z0-9]+)(\.js)?$ /tinyexamplecompany.php?publickey=$1&widgetname=belowArticle last; rewrite ^/tiny/([a-zA-Z0-9]+)/([a-z][a-zA-Z_0-9]+)\.js$ /tinyexamplecompany.php?publickey=$1&widgetname=$2 last; } location /picturetrailers { rewrite ^/picturetrailers/([a-zA-Z0-9]+)(\.js)?$ /tinyexamplecompany_picturetrailers.php?publickey=$1 last; } location /flytrailer { rewrite ^/flytrailer/([a-zA-Z0-9]+)(\.js)?$ /fullexamplecompany.php?publickey=$1&widgetname=flytrailer&autoinit=1&file=x.js last; } location /fullexamplecompany { rewrite ^/fullexamplecompany/([a-zA-Z0-9]+)\.js$ /fullexamplecompany.php?publickey=$1&file=x.js last; rewrite ^/fullexamplecompany/([a-zA-Z0-9]+)/([a-z][a-zA-Z_0-9]+)\.js$ /fullexamplecompany.php?publickey=$1&widgetname=$2&file=x.js last; } location /async { rewrite ^/async.js /async.php last; } location /demo { rewrite ^/demo/([a-zA-Z0-9]+)\.js$ /demo.php?type=$1 last; rewrite ^/demo/([a-zA-Z0-9]+)\/([a-z]+)\.js$ /demo.php?type=$1&lang=$2 last; } location ~* \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $request_filename; } } Kind Regards Simon From nginx-forum at nginx.us Wed Jun 19 17:53:02 2013 From: nginx-forum at nginx.us (Fleshgrinder) Date: Wed, 19 Jun 2013 13:53:02 -0400 Subject: Possible gzip_vary bug? (v1.5.1) In-Reply-To: <20130619134828.GD49779@mdounin.ru> References: <20130619134828.GD49779@mdounin.ru> Message-ID: Many thanks Maxim, sometimes the solution is so easy. I was using SPDY and only checked with latest Firefox and Chrome. And one shouldn't trust Page Speed, it keeps telling me about the vary headers, although it's using SPDY. Again, many thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240214,240223#msg-240223 From moseleymark at gmail.com Wed Jun 19 18:06:19 2013 From: moseleymark at gmail.com (Mark Moseley) Date: Wed, 19 Jun 2013 11:06:19 -0700 Subject: Ignore broken SSL servers in config Message-ID: TL;DR: Any nginx setting to say 'if a vhost's ssl settings are broken, skip it and don't fail to start' ? I've certainly RTFM'd this and peered at the source, but I figured I might as well throw it out there, in case there's some hidden setting I've missed. I'm building a reverse proxy config for thousands of SSL virtual hosts, to replace an apache solution. It very often happens that someone in support will make a mistake with regards to certs/keys. E.g. updating someone's SSL cert but actually putting the CSR there instead. In apache, since the config is being generated out of mod_perl, I can get around this situation by having mod_perl do a modulus check on the cert and key and skip the vhost if they don't match. In my case, I'd far prefer to have a missing vhost and have the other 1000 sites working, than all down. And, yes, I realize in default apache, it'd just fail to load. And also, yes, I realize asking something to ignore broken configs is a bit non-standard :) Since I don't have mod_perl at my fingertips in nginx to perform a similar trick, the startup will just fail. So I was curious if there's some obscure setting to tell nginx "if a vhost fails to loads its cert properly (or potentially any other vhost setting), skip it and continue loading the rest"? If such a thing did exist, I imagine that the configtest would have to turn errors for that vhost into warnings as well. My guess is obviously 'no', but I figured asking woud only cost me the time it takes to compose an email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From artemrts at ukr.net Wed Jun 19 18:22:11 2013 From: artemrts at ukr.net (wishmaster) Date: Wed, 19 Jun 2013 21:22:11 +0300 Subject: server name rewrite Message-ID: <78920.1371666131.1564673495790583808@ffe15.ukr.net> Hi, guys! E.g. I have server new_server_name.com and want to rewrite requests to www.new_server_name.com and old_server_name.com to present server. >From http://wiki.nginx.org/Pitfalls I use two server's {} directives for this instead if(). server { server_name www.new_server_name.com old_server_name.com; return 301 $scheme://new_server_name.com$request_uri; } server { listen 10.15.1.2:80; server_name new_server_name.com; ... server staff... } But this doesn't work and first server {} directive MUST have listen directive as well. So, or I am do something wrong or wiki-page doesn't clear describe this situation? -- Cheers, w From aweber at comcast.net Wed Jun 19 19:04:28 2013 From: aweber at comcast.net (AJ Weber) Date: Wed, 19 Jun 2013 15:04:28 -0400 Subject: question about nginx/modsecurity In-Reply-To: <78920.1371666131.1564673495790583808@ffe15.ukr.net> References: <78920.1371666131.1564673495790583808@ffe15.ukr.net> Message-ID: <51C200BC.4050205@comcast.net> Is anyone maintaining a "current" version of nginx with mod-security linked-in? I realize this is a bit lazy on my part -- the instructions seem relatively straightforward to build -- but I didn't want to "re-invent the wheel" if I didn't have to. Thanks, AJ From rainer at ultra-secure.de Wed Jun 19 19:12:26 2013 From: rainer at ultra-secure.de (Rainer Duffner) Date: Wed, 19 Jun 2013 21:12:26 +0200 Subject: question about nginx/modsecurity In-Reply-To: <51C200BC.4050205@comcast.net> References: <78920.1371666131.1564673495790583808@ffe15.ukr.net> <51C200BC.4050205@comcast.net> Message-ID: Am 19.06.2013 um 21:04 schrieb AJ Weber : > Is anyone maintaining a "current" version of nginx with mod-security linked-in? > > I realize this is a bit lazy on my part -- the instructions seem relatively straightforward to build -- but I didn't want to "re-invent the wheel" if I didn't have to. The FreeBSD port recently gained support for mod_security. http://www.freshports.org/www/nginx/ You can even build the dev-version: http://www.freshports.org/www/nginx-devel/ FreeBSD + nginx works super-smooth. I do a custom-build for our own servers (in private pkg-ng repository) with a handful of useful modules included. Because the truth is: only you know what modules you want or need. From aweber at comcast.net Wed Jun 19 19:24:07 2013 From: aweber at comcast.net (AJ Weber) Date: Wed, 19 Jun 2013 15:24:07 -0400 Subject: question about nginx/modsecurity In-Reply-To: References: <78920.1371666131.1564673495790583808@ffe15.ukr.net> <51C200BC.4050205@comcast.net> Message-ID: <51C20557.3070903@comcast.net> I do a custom-build for our own servers (in private pkg-ng repository) with a handful of useful modules included. Because the truth is: only you know what modules you want or need. This is absolutely true. (And I'm running CentOS and have been very happy as well.) Thanks. From francis at daoine.org Wed Jun 19 21:27:40 2013 From: francis at daoine.org (Francis Daly) Date: Wed, 19 Jun 2013 22:27:40 +0100 Subject: server name rewrite In-Reply-To: <78920.1371666131.1564673495790583808@ffe15.ukr.net> References: <78920.1371666131.1564673495790583808@ffe15.ukr.net> Message-ID: <20130619212740.GE27406@craic.sysops.org> On Wed, Jun 19, 2013 at 09:22:11PM +0300, wishmaster wrote: Hi there, > From http://wiki.nginx.org/Pitfalls I use two server's {} directives for this instead if(). > But this doesn't work and first server {} directive MUST have listen directive as well. http://nginx.org/en/docs/http/request_processing.html A request comes to an ip:port. nginx chooses the set of best-match servers for that ip:port. A request indicates which Host: it cares about. nginx chooses the one matching server from that set of servers. Which means (approximately): if you want all possible server{} blocks to be available to match a request, they should all have the same "listen" directives. > So, or I am do something wrong or wiki-page doesn't clear describe this situation? That wiki page section doesn't any "listen" directives. I imagine the author thought that that aspect was out of scope for that document. f -- Francis Daly francis at daoine.org From francis at daoine.org Wed Jun 19 21:39:04 2013 From: francis at daoine.org (Francis Daly) Date: Wed, 19 Jun 2013 22:39:04 +0100 Subject: Need some help with rewrite rule translation In-Reply-To: <48c1dab8470c43834e3940009e58f1bc@simonhoenscheid.de> References: <51B8F2D1.8000602@simonhoenscheid.de> <9a58e16240d3b1c755947b82acae57ba@simonhoenscheid.de> <48c1dab8470c43834e3940009e58f1bc@simonhoenscheid.de> Message-ID: <20130619213904.GF27406@craic.sysops.org> On Wed, Jun 19, 2013 at 06:44:55PM +0200, mailinglisten at simonhoenscheid.de wrote: Hi there, > This is still driving me mad. We need the expire header for images, but > if we add the location above, our rules arent processed anymore. If we > add the expire-header to the locations with the rewrite rules, the > headers are ignored. > I would realy appreciate some help. This is nginx. One request is handled in one location. Look at all of the (top-level) "location" directives. Look at the request that you are making. See which one location will handle it. Be aware of any rewrites or internal redirects that might happen. In the one location that handles the final request, put all of the configuration that you want for that request. http://nginx.org/r/location for details. So, you have: > location ~ /\. { > # location ~* \.(png|jpg|jpeg|gif)$ { > location = /favicon.ico { > location /image { > location /images { > location /media { > location / { > location @missing { > location /retargeting_v1 { > location /recommendations_v1 { > location /jsmodule { > location /tiny { > location /picturetrailers { > location /flytrailer { > location /fullexamplecompany { > location /async { > location /demo { > location ~* \.php$ { What one request do you make that does not return what you want? What does it return instead? Testing using "curl -i" is probably best, since you will see exactly what is returned. Enable the debug log and you might see why that is returned. f -- Francis Daly francis at daoine.org From artemrts at ukr.net Thu Jun 20 05:01:17 2013 From: artemrts at ukr.net (wishmaster) Date: Thu, 20 Jun 2013 08:01:17 +0300 Subject: server name rewrite In-Reply-To: <20130619212740.GE27406@craic.sysops.org> References: <78920.1371666131.1564673495790583808@ffe15.ukr.net> <20130619212740.GE27406@craic.sysops.org> Message-ID: <34616.1371704477.15736897447813840896@ffe11.ukr.net> Thank you Francis, your answer is exhaustive, as always. --- Original message --- From: "Francis Daly" Date: 20 June 2013, 00:27:48 > On Wed, Jun 19, 2013 at 09:22:11PM +0300, wishmaster wrote: > > Hi there, > > > From http://wiki.nginx.org/Pitfalls I use two server's {} directives for this instead if(). > > > But this doesn't work and first server {} directive MUST have listen directive as well. > > http://nginx.org/en/docs/http/request_processing.html > > A request comes to an ip:port. nginx chooses the set of best-match servers > for that ip:port. A request indicates which Host: it cares about. nginx > chooses the one matching server from that set of servers. > > Which means (approximately): if you want all possible server{} blocks to > be available to match a request, they should all have the same "listen" > directives. > > > So, or I am do something wrong or wiki-page doesn't clear describe this situation? > > That wiki page section doesn't any "listen" directives. I imagine the > author thought that that aspect was out of scope for that document. > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Thu Jun 20 09:00:54 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 20 Jun 2013 13:00:54 +0400 Subject: Ignore broken SSL servers in config In-Reply-To: References: Message-ID: <20130620090054.GJ49779@mdounin.ru> Hello! On Wed, Jun 19, 2013 at 11:06:19AM -0700, Mark Moseley wrote: > TL;DR: > Any nginx setting to say 'if a vhost's ssl settings are broken, skip it and > don't fail to start' ? > > I've certainly RTFM'd this and peered at the source, but I figured I might > as well throw it out there, in case there's some hidden setting I've missed. > > I'm building a reverse proxy config for thousands of SSL virtual hosts, to > replace an apache solution. > > It very often happens that someone in support will make a mistake with > regards to certs/keys. E.g. updating someone's SSL cert but actually > putting the CSR there instead. > > In apache, since the config is being generated out of mod_perl, I can get > around this situation by having mod_perl do a modulus check on the cert and > key and skip the vhost if they don't match. In my case, I'd far prefer to > have a missing vhost and have the other 1000 sites working, than all down. > > And, yes, I realize in default apache, it'd just fail to load. And also, > yes, I realize asking something to ignore broken configs is a bit > non-standard :) > > Since I don't have mod_perl at my fingertips in nginx to perform a similar > trick, the startup will just fail. > > So I was curious if there's some obscure setting to tell nginx "if a vhost > fails to loads its cert properly (or potentially any other vhost setting), > skip it and continue loading the rest"? > > If such a thing did exist, I imagine that the configtest would have to turn > errors for that vhost into warnings as well. > > My guess is obviously 'no', but I figured asking woud only cost me the time > it takes to compose an email. In nginx, there are two mechanism to deal with configuration errors: 1) On configuration reload nginx refuses to load a new configuration if there are errors (and continues to work with previously loaded correct configuration). 2) There is "nginx -t" to test configs. By using the two you are safe from a situation when a typo in configuration takes a service down (well, mostly: one always can take it down with a valid config). There is no kludge to magically apply only parts of a configuration though. -- Maxim Dounin http://nginx.org/en/donation.html From julien at pwal.fr Thu Jun 20 12:48:18 2013 From: julien at pwal.fr (Julien Decrouy) Date: Thu, 20 Jun 2013 14:48:18 +0200 Subject: Server Status ? Message-ID: Hi Nginx Team, I used nginx for a few years and until now, i used to deploy it for static content. Right now, i 'd like to deploy it for dynamic content using php-fpm. It works fine and performances are good. But according to me and my team (and many other admins as far as i can see), something important is really missing to push it in production. This is the "extended status" (i mean something like the apache server-status) There is a 3rd party module that is supposed to do that but it is buggy and nginx core has to be patched. So my question is: Do you think that nginx dev team could do something in that way? i think it will be a much better improvment than getting stuff like SPDY or other experimental things. Best regards, Julien -------------- next part -------------- An HTML attachment was scrubbed... URL: From r at roze.lv Thu Jun 20 14:13:02 2013 From: r at roze.lv (Reinis Rozitis) Date: Thu, 20 Jun 2013 17:13:02 +0300 Subject: Server Status ? In-Reply-To: References: Message-ID: > But according to me and my team (and many other admins as far as i can > see), something important is really missing to push it in production. This > is the "extended status" (i mean something like the apache server-status) What are the "important" things in the "extended status" that you miss for the production use? Combined with the php-fpm own status ( pm.status_path ) you can get pretty much all the vital metrics the only exception being the list of current active request URLs and even then the problematic ones can be logged with the php-fpm's slow log (request_slowlog_timeout). > So my question is: Do you think that nginx dev team could do something in > that way? i think it will be a much better improvment than getting stuff > like SPDY or other experimental things. So to answer your question - while the dev team of nginx could probably work on more visually appealing status page (as far as I know it's on TODO list and you can always speed up theese things by either contributing the code yourself or using the nginx commercial support (nginx.com)) these "experimental things" are what have made nginx one of the fastest and feature richest webserver. rr rr From ben at indietorrent.org Thu Jun 20 14:25:35 2013 From: ben at indietorrent.org (Ben Johnson) Date: Thu, 20 Jun 2013 10:25:35 -0400 Subject: Using try_files while forcing a trailing-slash in the URL In-Reply-To: <20130618215500.GA27406@craic.sysops.org> References: <51C0B35C.90107@indietorrent.org> <20130618215500.GA27406@craic.sysops.org> Message-ID: <51C310DF.7040108@indietorrent.org> On 6/18/2013 5:55 PM, Francis Daly wrote: > On Tue, Jun 18, 2013 at 03:22:04PM -0400, Ben Johnson wrote: > > Hi there, Hi, Francis! I really appreciate your help and your time. Thanks for replying in such detail. >> The try_files directive is brilliant. The only problem I'm having is >> that I would like to be able to force a trailing-slash, a la "rewrite", >> on the fallback URL. > >> This works well, but I have a need to eliminate duplicate URLs (for SEO >> ["duplicate-content penalty"] reasons) by forcing a trailing slash on >> all virtual URLs (that is, URLs that do not point to a real file or >> directory). >> >> Am I missing something obvious? > > try_files decides which file to serve, with a single fallback option. If > that fallback option is something complicated, it is probably best to > use a named location and put the complications in there. This makes fine sense. >> I was able to cook-up a "working solution", but it will probably bristle >> a few peoples' hair: > > If it works, it works. If you can measure the load on your test server, > you may be interested in trying other things too and comparing. > > For example: > > location / { > try_files $uri $uri/ @virtual; > } > location @virtual { > if ($uri !~ '/$') { > return 301 $uri/$is_args$args; > } > fastcgi_pass unix:php.sock; > fastcgi_param SCRIPT_FILENAME $document_root/index.php; > include fastcgi_params; > } > > as well as a location for handling /index.php or any similar things > directly. > > (Depending on what exactly your php script does, you may also want to > set QUERY_STRING explicitly.) Your example is a true stroke of genius as compared to the garbage that I put together. The end-result is the same and your example is far more elegant. > >> Ultimately, I'm wondering if there's a means by which to achieve the >> above with try_files, and if not, if there's a better means than what >> I've employed on my own. > > The above uses try_files, and uses "if" within "location" with only > "return", which is a safe thing to do. http://wiki.nginx.org/IfIsEvil Yes, I have read the IfIsEvil article a few times over. I would certainly prefer to avoid using "if". =) >> A related "problem" (more an inconvenience, really) is that using >> try_files in the manner described in the cited documentation causes the >> trailing ampersand ("&") to be appended to "q" even when there are no >> $args. Is this behavior intentional? Maybe there's an RFC of which I"m >> unaware that lead to this decision. > > You asked for $uri, then &, then $args. > > You should be surprised if you get anything other than $uri, then &, > then $args. Haha... fairly-stated. Ask and ye shall receive. And receive I did. > I suspect it was done because the php script it feeds is known to ignore > the unnecessary &. Ah, I see; the implication is that Drupal 6 ignores the superfluous ampersand, hence its inclusion in the example that I used. I've made the adjustments necessary for my PHP script to ignore it, too. I'm happy with the result, as-is, but I appreciate the below suggestions nonetheless. > nginx does provide the variable $is_args, but that is intended for other > circumstances where it is more useful. You could do more "if" things on > $is_args or on $args to decide whether to add the &, if you want to. > > Good luck with it, > > f > Thanks again! -Ben From potxoka at gmail.com Thu Jun 20 14:37:15 2013 From: potxoka at gmail.com (Anto) Date: Thu, 20 Jun 2013 16:37:15 +0200 Subject: Optimize rewrite In-Reply-To: <8DEE41783A264DDDA593F8F2BB2682AB@MasterPC> References: <8DEE41783A264DDDA593F8F2BB2682AB@MasterPC> Message-ID: Ok, thanks !!! ;-) 2013/4/4 Reinis Rozitis > >> location / { >> rewrite ^/(.*)/(.*)$ /$1/index.php?url=$2; >> } >> > > I would suggest to use try_files: > > location / { > try_files $uri $uri/ /index.php?url=$uri&$args; > } > > > Personally instead of pasing the uri in the 'url' param I like to use > try_files $uri $uri/ /index.php?$args; and then in the php code have the > url in $_SERVER['REQUEST_URI'] (or $_SERVER['DOCUMENT_URI']) that way there > is no possibility to accidentaly mess with the GET variables. > > > rr > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien at pwal.fr Thu Jun 20 15:58:18 2013 From: julien at pwal.fr (Julien Decrouy) Date: Thu, 20 Jun 2013 17:58:18 +0200 Subject: Server Status ? In-Reply-To: References: Message-ID: Thanks for the feed back Reinis I agree that the extended module ( http://wiki.nginx.org/Extended_status_module) is doing things right but it is no more supported with nginx 1.3 or later and i think that patching nginx core is not a good thing. This way, the php-fpm status is a good alternative but we miss some metrics like the client ip,Vhost (i can get it with the script path but i won't get it if it's an alias), the status (reading, writting...) and as you said the list of current active request URLs. This is pretty important to debug and apache serverstatus helped us several times so it will be great to have the same on nginx. Finally, i know that many admins (friends) don't use nginx for dynamic content because of this miss and getting it will be a way to gain some more percentage points of market share. I will be interested to contribute but i haven't found anything about a TODO list, do you have a link or something like this please? regards 2013/6/20 Reinis Rozitis > But according to me and my team (and many other admins as far as i can >> see), something important is really missing to push it in production. This >> is the "extended status" (i mean something like the apache server-status) >> > > What are the "important" things in the "extended status" that you miss for > the production use? > > Combined with the php-fpm own status ( pm.status_path ) you can get pretty > much all the vital metrics the only exception being the list of current > active request URLs and even then the problematic ones can be logged with > the php-fpm's slow log (request_slowlog_timeout). > > > > > So my question is: Do you think that nginx dev team could do something in >> that way? i think it will be a much better improvment than getting stuff >> like SPDY or other experimental things. >> > > So to answer your question - while the dev team of nginx could probably > work on more visually appealing status page (as far as I know it's on TODO > list and you can always speed up theese things by either contributing the > code yourself or using the nginx commercial support (nginx.com)) these > "experimental things" are what have made nginx one of the fastest and > feature richest webserver. > > > rr > > > > rr > ______________________________**_________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From moseleymark at gmail.com Thu Jun 20 16:46:35 2013 From: moseleymark at gmail.com (Mark Moseley) Date: Thu, 20 Jun 2013 09:46:35 -0700 Subject: Ignore broken SSL servers in config In-Reply-To: <20130620090054.GJ49779@mdounin.ru> References: <20130620090054.GJ49779@mdounin.ru> Message-ID: On Thu, Jun 20, 2013 at 2:00 AM, Maxim Dounin wrote: > Hello! > > On Wed, Jun 19, 2013 at 11:06:19AM -0700, Mark Moseley wrote: > > > TL;DR: > > Any nginx setting to say 'if a vhost's ssl settings are broken, skip it > and > > don't fail to start' ? > > > > I've certainly RTFM'd this and peered at the source, but I figured I > might > > as well throw it out there, in case there's some hidden setting I've > missed. > > > > I'm building a reverse proxy config for thousands of SSL virtual hosts, > to > > replace an apache solution. > > > > It very often happens that someone in support will make a mistake with > > regards to certs/keys. E.g. updating someone's SSL cert but actually > > putting the CSR there instead. > > > > In apache, since the config is being generated out of mod_perl, I can get > > around this situation by having mod_perl do a modulus check on the cert > and > > key and skip the vhost if they don't match. In my case, I'd far prefer to > > have a missing vhost and have the other 1000 sites working, than all > down. > > > > And, yes, I realize in default apache, it'd just fail to load. And also, > > yes, I realize asking something to ignore broken configs is a bit > > non-standard :) > > > > Since I don't have mod_perl at my fingertips in nginx to perform a > similar > > trick, the startup will just fail. > > > > So I was curious if there's some obscure setting to tell nginx "if a > vhost > > fails to loads its cert properly (or potentially any other vhost > setting), > > skip it and continue loading the rest"? > > > > If such a thing did exist, I imagine that the configtest would have to > turn > > errors for that vhost into warnings as well. > > > > My guess is obviously 'no', but I figured asking woud only cost me the > time > > it takes to compose an email. > > In nginx, there are two mechanism to deal with configuration > errors: > > 1) On configuration reload nginx refuses to load a new > configuration if there are errors (and continues to work with > previously loaded correct configuration). > > 2) There is "nginx -t" to test configs. > > By using the two you are safe from a situation when a typo > in configuration takes a service down (well, mostly: one always > can take it down with a valid config). There is no kludge to > magically apply only parts of a configuration though. > > Yup, that's what I figured. Thanks for confirming. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hostdl at gmail.com Thu Jun 20 17:26:32 2013 From: hostdl at gmail.com (Host DL) Date: Thu, 20 Jun 2013 21:56:32 +0430 Subject: Server Status ? In-Reply-To: References: Message-ID: Me too, I am looking forward for this extension for 1.4.x current branch which is not working for recent versions: https://github.com/zealot83/ngx_http_extended_status_module it would be greatly appreciated if one of geeks to do it Regards ============================================ On Thu, Jun 20, 2013 at 8:28 PM, Julien Decrouy wrote: > Thanks for the feed back Reinis > > I agree that the extended module ( > http://wiki.nginx.org/Extended_status_module) is doing things right but > it is no more supported with nginx 1.3 or later and i think that patching > nginx core is not a good thing. > > This way, the php-fpm status is a good alternative but we miss some > metrics like the client ip,Vhost (i can get it with the script path but i > won't get it if it's an alias), the status (reading, writting...) and as > you said the list of current active request URLs. This is pretty important > to debug and apache serverstatus helped us several times so it will be > great to have the same on nginx. > > Finally, i know that many admins (friends) don't use nginx for dynamic > content because of this miss and getting it will be a way to gain some more > percentage points of market share. > > I will be interested to contribute but i haven't found anything about a > TODO list, do you have a link or something like this please? > > regards > > > > 2013/6/20 Reinis Rozitis > >> But according to me and my team (and many other admins as far as i can >>> see), something important is really missing to push it in production. This >>> is the "extended status" (i mean something like the apache server-status) >>> >> >> What are the "important" things in the "extended status" that you miss >> for the production use? >> >> Combined with the php-fpm own status ( pm.status_path ) you can get >> pretty much all the vital metrics the only exception being the list of >> current active request URLs and even then the problematic ones can be >> logged with the php-fpm's slow log (request_slowlog_timeout). >> >> >> >> >> So my question is: Do you think that nginx dev team could do something >>> in that way? i think it will be a much better improvment than getting stuff >>> like SPDY or other experimental things. >>> >> >> So to answer your question - while the dev team of nginx could probably >> work on more visually appealing status page (as far as I know it's on TODO >> list and you can always speed up theese things by either contributing the >> code yourself or using the nginx commercial support (nginx.com)) these >> "experimental things" are what have made nginx one of the fastest and >> feature richest webserver. >> >> >> rr >> >> >> >> rr >> ______________________________**_________________ >> 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 schiz0phrenic21 at gmail.com Fri Jun 21 02:31:23 2013 From: schiz0phrenic21 at gmail.com (Schiz0) Date: Thu, 20 Jun 2013 22:31:23 -0400 Subject: Accessing PHP-FPM's Status Page Message-ID: Hello list, I use php-fpm via fastcgi to handle my PHP scripts. I have that working successfully. PHP-FPM has a feature where it displays a status page, as mentioned here: http://php.net/manual/en/install.fpm.configuration.php#pm.status-path I'd like to be able to access this through nginx. I tried setting my configuration to what I would expect to work, but, alas, it does not. Here's my configuration: http://p.ngx.cc/042567f732ada334 The error I get when I try to browse to domain.com/fpm-status is: "File not found." in my browser, and in the nginx error log: 2013/06/20 22:29:51 [error] 85006#0: *13 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: x.x.x.132, server: domain.com, request: "GET /fpm-status HTTP/1.1", upstream: "fastcgi://unix:/var/run/phpfpm.sock:", host: "domain.com" Nothing shows up in php-fpm's error log. Thanks for any help/suggestions on getting this working! -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at greengecko.co.nz Fri Jun 21 02:41:53 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Fri, 21 Jun 2013 14:41:53 +1200 Subject: Accessing PHP-FPM's Status Page In-Reply-To: References: Message-ID: <1371782513.25974.565.camel@steve-new> On Thu, 2013-06-20 at 22:31 -0400, Schiz0 wrote: > Hello list, > > > I use php-fpm via fastcgi to handle my PHP scripts. I have that > working successfully. PHP-FPM has a feature where it displays a status > page, as mentioned here: > http://php.net/manual/en/install.fpm.configuration.php#pm.status-path > > > I'd like to be able to access this through nginx. I tried setting my > configuration to what I would expect to work, but, alas, it does not. > > Here's my configuration: > http://p.ngx.cc/042567f732ada334 > > > The error I get when I try to browse to domain.com/fpm-status is: > "File not found." > > in my browser, and in the nginx error log: > > 2013/06/20 22:29:51 [error] 85006#0: *13 FastCGI sent in stderr: > "Primary script unknown" while reading response header from upstream, > client: x.x.x.132, server: domain.com, request: "GET /fpm-status > HTTP/1.1", upstream: "fastcgi://unix:/var/run/phpfpm.sock:", host: > "domain.com" > > > Nothing shows up in php-fpm's error log. > > Thanks for any help/suggestions on getting this working! For me, location ~ ^/(status|ping|apc_info.php)$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass backend; allow 127.0.0.1; deny all; } with pm.status_path = /status in the pool definition works fine. I use a stub config just to manage 127.0.0.1 access, which include a load of monitoring stuff. hth, Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From schiz0phrenic21 at gmail.com Fri Jun 21 02:50:28 2013 From: schiz0phrenic21 at gmail.com (Schiz0) Date: Thu, 20 Jun 2013 22:50:28 -0400 Subject: Accessing PHP-FPM's Status Page In-Reply-To: <1371782513.25974.565.camel@steve-new> References: <1371782513.25974.565.camel@steve-new> Message-ID: I don't know why, but it is simply not working for me. I tried changing my SCRIPT_FILENAME to match yours exactly, and I changed my location block to "location ~ ^/fpm-status$ {}" - as opposed to using "=". Same problems. I also tried toggling fastcgi_intercept_errors to see if that did anything. May I ask to see your fastcgi_params file? On Thu, Jun 20, 2013 at 10:41 PM, Steve Holdoway wrote: > On Thu, 2013-06-20 at 22:31 -0400, Schiz0 wrote: > > Hello list, > > > > > > I use php-fpm via fastcgi to handle my PHP scripts. I have that > > working successfully. PHP-FPM has a feature where it displays a status > > page, as mentioned here: > > http://php.net/manual/en/install.fpm.configuration.php#pm.status-path > > > > > > I'd like to be able to access this through nginx. I tried setting my > > configuration to what I would expect to work, but, alas, it does not. > > > > Here's my configuration: > > http://p.ngx.cc/042567f732ada334 > > > > > > The error I get when I try to browse to domain.com/fpm-status is: > > "File not found." > > > > in my browser, and in the nginx error log: > > > > 2013/06/20 22:29:51 [error] 85006#0: *13 FastCGI sent in stderr: > > "Primary script unknown" while reading response header from upstream, > > client: x.x.x.132, server: domain.com, request: "GET /fpm-status > > HTTP/1.1", upstream: "fastcgi://unix:/var/run/phpfpm.sock:", host: > > "domain.com" > > > > > > Nothing shows up in php-fpm's error log. > > > > Thanks for any help/suggestions on getting this working! > > For me, > location ~ ^/(status|ping|apc_info.php)$ { > include fastcgi_params; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > fastcgi_pass backend; > allow 127.0.0.1; > deny all; > } > > with > pm.status_path = /status > > in the pool definition works fine. > > I use a stub config just to manage 127.0.0.1 access, which include a > load of monitoring stuff. > > hth, > > Steve > > > > > -- > Steve Holdoway BSc(Hons) MNZCS > http://www.greengecko.co.nz > Linkedin: http://www.linkedin.com/in/steveholdoway > Skype: sholdowa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at greengecko.co.nz Fri Jun 21 03:02:26 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Fri, 21 Jun 2013 15:02:26 +1200 Subject: Accessing PHP-FPM's Status Page In-Reply-To: References: <1371782513.25974.565.camel@steve-new> Message-ID: <1371783746.25974.579.camel@steve-new> fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # GeoIP - just country at the moment. fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; fastcgi_connect_timeout 60; fastcgi_send_timeout 1800; fastcgi_read_timeout 1800; fastcgi_buffer_size 128k; fastcgi_buffers 8 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; On Thu, 2013-06-20 at 22:50 -0400, Schiz0 wrote: > I don't know why, but it is simply not working for me. I tried > changing my SCRIPT_FILENAME to match yours exactly, and I changed my > location block to "location ~ ^/fpm-status$ {}" - as opposed to using > "=". Same problems. > > > I also tried toggling fastcgi_intercept_errors to see if that did > anything. > > > > May I ask to see your fastcgi_params file? > > > > On Thu, Jun 20, 2013 at 10:41 PM, Steve Holdoway > wrote: > On Thu, 2013-06-20 at 22:31 -0400, Schiz0 wrote: > > Hello list, > > > > > > I use php-fpm via fastcgi to handle my PHP scripts. I have > that > > working successfully. PHP-FPM has a feature where it > displays a status > > page, as mentioned here: > > > http://php.net/manual/en/install.fpm.configuration.php#pm.status-path > > > > > > I'd like to be able to access this through nginx. I tried > setting my > > configuration to what I would expect to work, but, alas, it > does not. > > > > Here's my configuration: > > http://p.ngx.cc/042567f732ada334 > > > > > > The error I get when I try to browse to > domain.com/fpm-status is: > > "File not found." > > > > in my browser, and in the nginx error log: > > > > 2013/06/20 22:29:51 [error] 85006#0: *13 FastCGI sent in > stderr: > > "Primary script unknown" while reading response header from > upstream, > > client: x.x.x.132, server: domain.com, request: > "GET /fpm-status > > HTTP/1.1", upstream: "fastcgi://unix:/var/run/phpfpm.sock:", > host: > > "domain.com" > > > > > > Nothing shows up in php-fpm's error log. > > > > Thanks for any help/suggestions on getting this working! > > > For me, > location ~ ^/(status|ping|apc_info.php)$ { > include fastcgi_params; > fastcgi_param SCRIPT_FILENAME $document_root > $fastcgi_script_name; > fastcgi_pass backend; > allow 127.0.0.1; > deny all; > } > > with > pm.status_path = /status > > in the pool definition works fine. > > I use a stub config just to manage 127.0.0.1 access, which > include a > load of monitoring stuff. > > hth, > > Steve > > > > > -- > Steve Holdoway BSc(Hons) MNZCS > http://www.greengecko.co.nz > Linkedin: http://www.linkedin.com/in/steveholdoway > Skype: sholdowa > > _______________________________________________ > 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 -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From schiz0phrenic21 at gmail.com Fri Jun 21 03:21:25 2013 From: schiz0phrenic21 at gmail.com (Schiz0) Date: Thu, 20 Jun 2013 23:21:25 -0400 Subject: Accessing PHP-FPM's Status Page In-Reply-To: <1371783746.25974.579.camel@steve-new> References: <1371782513.25974.565.camel@steve-new> <1371783746.25974.579.camel@steve-new> Message-ID: Thank you! I got it working. It seemed to be an issue with using $document_root$fastcgi_script_name as my SCRIPT_FILENAME. I changed it to: $request_filename, and it works fine now. Thanks! On Thu, Jun 20, 2013 at 11:02 PM, Steve Holdoway wrote: > fastcgi_param QUERY_STRING $query_string; > fastcgi_param REQUEST_METHOD $request_method; > fastcgi_param CONTENT_TYPE $content_type; > fastcgi_param CONTENT_LENGTH $content_length; > > fastcgi_param SCRIPT_FILENAME $request_filename; > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > fastcgi_param REQUEST_URI $request_uri; > fastcgi_param DOCUMENT_URI $document_uri; > fastcgi_param DOCUMENT_ROOT $document_root; > fastcgi_param SERVER_PROTOCOL $server_protocol; > > fastcgi_param GATEWAY_INTERFACE CGI/1.1; > fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; > > fastcgi_param REMOTE_ADDR $remote_addr; > fastcgi_param REMOTE_PORT $remote_port; > fastcgi_param SERVER_ADDR $server_addr; > fastcgi_param SERVER_PORT $server_port; > fastcgi_param SERVER_NAME $server_name; > > # GeoIP - just country at the moment. > fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code; > > # PHP only, required if PHP was built with --enable-force-cgi-redirect > fastcgi_param REDIRECT_STATUS 200; > > fastcgi_connect_timeout 60; > fastcgi_send_timeout 1800; > fastcgi_read_timeout 1800; > fastcgi_buffer_size 128k; > fastcgi_buffers 8 256k; > fastcgi_busy_buffers_size 256k; > fastcgi_temp_file_write_size 256k; > fastcgi_intercept_errors on; > > > On Thu, 2013-06-20 at 22:50 -0400, Schiz0 wrote: > > I don't know why, but it is simply not working for me. I tried > > changing my SCRIPT_FILENAME to match yours exactly, and I changed my > > location block to "location ~ ^/fpm-status$ {}" - as opposed to using > > "=". Same problems. > > > > > > I also tried toggling fastcgi_intercept_errors to see if that did > > anything. > > > > > > > > May I ask to see your fastcgi_params file? > > > > > > > > On Thu, Jun 20, 2013 at 10:41 PM, Steve Holdoway > > wrote: > > On Thu, 2013-06-20 at 22:31 -0400, Schiz0 wrote: > > > Hello list, > > > > > > > > > I use php-fpm via fastcgi to handle my PHP scripts. I have > > that > > > working successfully. PHP-FPM has a feature where it > > displays a status > > > page, as mentioned here: > > > > > > http://php.net/manual/en/install.fpm.configuration.php#pm.status-path > > > > > > > > > I'd like to be able to access this through nginx. I tried > > setting my > > > configuration to what I would expect to work, but, alas, it > > does not. > > > > > > Here's my configuration: > > > http://p.ngx.cc/042567f732ada334 > > > > > > > > > The error I get when I try to browse to > > domain.com/fpm-status is: > > > "File not found." > > > > > > in my browser, and in the nginx error log: > > > > > > 2013/06/20 22:29:51 [error] 85006#0: *13 FastCGI sent in > > stderr: > > > "Primary script unknown" while reading response header from > > upstream, > > > client: x.x.x.132, server: domain.com, request: > > "GET /fpm-status > > > HTTP/1.1", upstream: "fastcgi://unix:/var/run/phpfpm.sock:", > > host: > > > "domain.com" > > > > > > > > > Nothing shows up in php-fpm's error log. > > > > > > Thanks for any help/suggestions on getting this working! > > > > > > For me, > > location ~ ^/(status|ping|apc_info.php)$ { > > include fastcgi_params; > > fastcgi_param SCRIPT_FILENAME $document_root > > $fastcgi_script_name; > > fastcgi_pass backend; > > allow 127.0.0.1; > > deny all; > > } > > > > with > > pm.status_path = /status > > > > in the pool definition works fine. > > > > I use a stub config just to manage 127.0.0.1 access, which > > include a > > load of monitoring stuff. > > > > hth, > > > > Steve > > > > > > > > > > -- > > Steve Holdoway BSc(Hons) MNZCS > > http://www.greengecko.co.nz > > Linkedin: http://www.linkedin.com/in/steveholdoway > > Skype: sholdowa > > > > _______________________________________________ > > 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 > > -- > Steve Holdoway BSc(Hons) MNZCS > http://www.greengecko.co.nz > Linkedin: http://www.linkedin.com/in/steveholdoway > Skype: sholdowa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bk7749 at gmail.com Fri Jun 21 10:21:55 2013 From: bk7749 at gmail.com (=?EUC-KR?B?sO25/LHU?=) Date: Fri, 21 Jun 2013 19:21:55 +0900 Subject: question about running on multiprocessor Message-ID: Hi, I'm a beginner on this field. I want just to do some simulation about multiprocessor programming. What I'm trying to do is to test performance of nginx by using Apache Benchmark. So, I added "server.max-worker = 8" to default "nginx.conf" and ran Apache Bench through a command, "ab -n 100000 -c 1000 xxx.xxx.xx.xx". However, server computer's max CPU utilization showed 30% as if it had just 2 cores. Without "max-worker=8", max CPU utilization is 15%, so it is sure that there was some change. How can I increase the CPU utilization to 100%, which is 8 core?? Followings are running environment, O/S: Ubuntu 12.04 (in VIrtualbox4.2) CPU: Intel, i7-3610QM (which has physical 4 cores, but virtually 8 cores considering hyperthreading) RAM: 4096MB nginx: 1.4.1 Apache: 2.2 notes-I checked that CPU utilization can be 100% with another application. If anyone has idea on this or needs more information about my setting, please let me know. Thanks in advance. -- With regards, Jason Koh (???) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Jun 22 07:15:30 2013 From: nginx-forum at nginx.us (Peleke) Date: Sat, 22 Jun 2013 03:15:30 -0400 Subject: No MIME types Message-ID: I have just set up a Debian Wheezy nginx web server with PHP-FPM and while it shows the hosted websites it doesn't analyse the MIME types and without CSS or JS modern websites are not working. The problem is the second domain.tld entry: error.log: 2013/06/22 09:10:46 [error] 7806#0: *1 open() "/var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css" failed (2: No such file or directory), client: 5.6.7.8, server: localhost, request: "GET /domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1 HTTP/1.1", host: "1.2.3.4", referrer: "http://1.2.3.4/wordpress/" 2013/06/22 09:10:46 [error] 7806#0: *1 open() "/var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/js/navigation.js" failed (2: No such file or directory), client: 5.6.7.8, server: localhost, request: "GET /domain.tld/wordpress/wp-content/themes/twentytwelve/js/navigation.js?ver=1.0 HTTP/1.1", host: "1.2.3.4", referrer: "http://1.2.3.4/wordpress/" How can I fix this? Thanks nginx.conf: user nginx; worker_processes 4; 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; include /etc/nginx/conf.d/*.conf; } default.conf server { listen 80; server_name localhost; root /var/www/domain.tld/htdocs; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { index index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } ## # Pass PHP-Files To Socket ## location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_intercept_errors off; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240262,240262#msg-240262 From nic at ferrier.me.uk Sat Jun 22 09:10:25 2013 From: nic at ferrier.me.uk (Nic Ferrier) Date: Sat, 22 Jun 2013 10:10:25 +0100 Subject: internal, redirects and proxy_cache Message-ID: <87y5a2y0hq.fsf@ferrier.me.uk> A very related question was asked before here: http://forum.nginx.org/read.php?2,236720,236782#msg-236782 But I'm not sure that asked exactly what I want to do. I've got locations like this: location /packages/archive-contents { proxy_pass http://localhost:8005; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /packages/archive-contents/ { internal; proxy_pass http://localhost:8005; proxy_http_version 1.1; } The first one calls out to the app server which sends an X-Forwarded-For to the second one, something like: http://host/packages/archive-contents/38381632639138 I would like to cache that response so that nginx hit the app server from the first location which redirects to the 2nd location but that returns a cached response. When the redirect from the first location changes the second location would have to cache it. Is that possible? I've tried adding proxy_cache to the 2nd location, like so: location /packages/archive-contents/ { internal; proxy_pass http://localhost:8005; proxy_http_version 1.1; proxy_cache marmaladerepo-cache; proxy_cache_valid 200 302 1d; proxy_cache_valid 404 60m; } but this doesn't seem to have an effect. Nic Ferrier From rkearsley at blueyonder.co.uk Sat Jun 22 09:40:53 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Sat, 22 Jun 2013 10:40:53 +0100 Subject: start time is out mp4 Message-ID: <51C57125.8080406@blueyonder.co.uk> Hi I?m using the mp4 module quite heavily, and very occasionally (once every minute or so on a busy website) there is an error written to error.log and status 500 returned in the access log [error] 42078#0: *5510811 start time is out mp4 stts samples in ... (mostly this error) [error] 42072#0: *5524976 start time is out mp4 stsc chunks in ... (sometimes this error) It happens on different videos and only when ?start is after a certain time point (different for each video) Given that the mp4 module works remarkably well on the whole, where should I look to find the cause of these rare errors? (and what do they actually mean :)) nginx version: nginx/1.2.9 built by gcc 4.2.1 20070831 patched [FreeBSD] TLS SNI support enabled configure arguments: --with-debug --with-http_ssl_module --with-http_stub_status_module --with-file-aio --with-http_flv_module --with-http_mp4_module --with-http_geoip_module --add-module=../../../lua-nginx-module Many thanks From mdounin at mdounin.ru Sat Jun 22 09:47:46 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 22 Jun 2013 13:47:46 +0400 Subject: internal, redirects and proxy_cache In-Reply-To: <87y5a2y0hq.fsf@ferrier.me.uk> References: <87y5a2y0hq.fsf@ferrier.me.uk> Message-ID: <20130622094746.GG90537@mdounin.ru> Hello! On Sat, Jun 22, 2013 at 10:10:25AM +0100, Nic Ferrier wrote: > A very related question was asked before here: > > http://forum.nginx.org/read.php?2,236720,236782#msg-236782 > > But I'm not sure that asked exactly what I want to do. It's not. It's about caching of a response with an X-Accel-Redirect header, while your need to cache a response after an internal redirect. What you need is expected to work fine, see below. > I've got locations like this: > > location /packages/archive-contents { > proxy_pass http://localhost:8005; > proxy_http_version 1.1; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > location /packages/archive-contents/ { > internal; > proxy_pass http://localhost:8005; > proxy_http_version 1.1; > } > > > The first one calls out to the app server which sends an X-Forwarded-For > to the second one, something like: > > http://host/packages/archive-contents/38381632639138 Correct header name is X-Accel-Redirect. Correct value is "/packages/archive-contents/38381632639138". That is, header returned should look like: X-Accel-Redirect: /packages/archive-contents/38381632639138 > I would like to cache that response so that nginx hit the app server > from the first location which redirects to the 2nd location but that > returns a cached response. > > When the redirect from the first location changes the second location > would have to cache it. > > > Is that possible? I've tried adding proxy_cache to the 2nd location, > like so: > > location /packages/archive-contents/ { > internal; > proxy_pass http://localhost:8005; > proxy_http_version 1.1; > proxy_cache marmaladerepo-cache; > proxy_cache_valid 200 302 1d; > proxy_cache_valid 404 60m; > } > > but this doesn't seem to have an effect. This should work assuming you are using correct header to trigger internal redirect, and the response returned doesn't disable cache (there is more than one way to do it, see http://nginx.org/r/proxy_cache_valid). -- Maxim Dounin http://nginx.org/en/donation.html From luky-37 at hotmail.com Sat Jun 22 10:28:30 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sat, 22 Jun 2013 12:28:30 +0200 Subject: start time is out mp4 In-Reply-To: <51C57125.8080406@blueyonder.co.uk> References: <51C57125.8080406@blueyonder.co.uk> Message-ID: Hi Richard, > Given that the mp4 module works remarkably well on the whole, where > should I look to find the cause of these rare errors? (and what do they > actually mean :)) > > nginx version: nginx/1.2.9 I would suggest you upgrade nginx. Between nginx/1.2.9 and a recent releases there are 4 bugfixes in the mp4 module. Upgrade to nginx 1.4.1. Lukas From francis at daoine.org Sat Jun 22 11:57:50 2013 From: francis at daoine.org (Francis Daly) Date: Sat, 22 Jun 2013 12:57:50 +0100 Subject: No MIME types In-Reply-To: References: Message-ID: <20130622115750.GJ27406@craic.sysops.org> On Sat, Jun 22, 2013 at 03:15:30AM -0400, Peleke wrote: Hi there, I'm not sure how your question matches the Subject: line you used. But anyway... > The problem is the second domain.tld entry: > 2013/06/22 09:10:46 [error] 7806#0: *1 open() > "/var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css" > failed (2: No such file or directory), client: 5.6.7.8, server: localhost, > request: "GET > /domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1 > HTTP/1.1", host: "1.2.3.4", referrer: "http://1.2.3.4/wordpress/" > How can I fix this? I suspect that the answer is going to be "fix your wordpress". Does the file /var/www/domain.tld/htdocs/wordpress/wp-content/themes/twentytwelve/style.css exist (without the second "/domain.tld")? What is the output of curl -i http://1.2.3.4/wordpress/ and does it include the string /domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1 anywhere? If so, what puts the "/domain.tld" at the start of it? My guess is that the file does exist, and that the extra /domain.tld is added by your wordpress. In which case, find where it your wordpress config it is added, and don't add it. Good luck with it, f -- Francis Daly francis at daoine.org From bk7749 at gmail.com Sat Jun 22 12:33:24 2013 From: bk7749 at gmail.com (=?EUC-KR?B?sO25/LHU?=) Date: Sat, 22 Jun 2013 21:33:24 +0900 Subject: Fwd: question about running on multiprocessor In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: ??? Date: 2013/6/21 Subject: question about running on multiprocessor To: nginx at nginx.org Hi, I'm a beginner on this field. I want just to do some simulation about multiprocessor programming. What I'm trying to do is to test performance of nginx by using Apache Benchmark. So, I added "server.max-worker = 8" to default "nginx.conf" and ran Apache Bench through a command, "ab -n 100000 -c 1000 xxx.xxx.xx.xx". However, server computer's max CPU utilization showed 30% as if it had just 2 cores. Without "max-worker=8", max CPU utilization is 15%, so it is sure that there was some change. How can I increase the CPU utilization to 100%, which is 8 core?? Followings are running environment, O/S: Ubuntu 12.04 (in VIrtualbox4.2) CPU: Intel, i7-3610QM (which has physical 4 cores, but virtually 8 cores considering hyperthreading) RAM: 4096MB nginx: 1.4.1 Apache: 2.2 notes-I checked that CPU utilization can be 100% with another application. If anyone has idea on this or needs more information about my setting, please let me know. Thanks in advance. -- With regards, Jason Koh (???) -- With regards, Jason Koh (???) -------------- next part -------------- An HTML attachment was scrubbed... URL: From rkearsley at blueyonder.co.uk Sat Jun 22 14:36:53 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Sat, 22 Jun 2013 15:36:53 +0100 Subject: start time is out mp4 In-Reply-To: References: <51C57125.8080406@blueyonder.co.uk> Message-ID: <51C5B685.3070108@blueyonder.co.uk> Hi nginx version: nginx/1.4.1 built by gcc 4.2.1 20070831 patched [FreeBSD] TLS SNI support enabled configure arguments: --with-debug --with-http_ssl_module --with-http_stub_status_module --with-file-aio --with-http_flv_module --with-http_mp4_module --with-http_geoip_module --add-module=../../../lua-nginx-module upgraded version, still have mp4 errors at the same frequency What do the stts and stsc errors mean? how can I find out what is causing them? Thanks On 22/06/13 11:28, Lukas Tribus wrote: > Hi Richard, > > >> Given that the mp4 module works remarkably well on the whole, where >> should I look to find the cause of these rare errors? (and what do they >> actually mean :)) >> >> nginx version: nginx/1.2.9 > I would suggest you upgrade nginx. Between nginx/1.2.9 and a recent releases > there are 4 bugfixes in the mp4 module. > > Upgrade to nginx 1.4.1. > > > Lukas > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Sat Jun 22 14:41:16 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 22 Jun 2013 18:41:16 +0400 Subject: start time is out mp4 In-Reply-To: <51C57125.8080406@blueyonder.co.uk> References: <51C57125.8080406@blueyonder.co.uk> Message-ID: <20130622144116.GH90537@mdounin.ru> Hello! On Sat, Jun 22, 2013 at 10:40:53AM +0100, Richard Kearsley wrote: > Hi > I?m using the mp4 module quite heavily, and very occasionally (once > every minute or so on a busy website) there is an error written to > error.log and status 500 returned in the access log > > [error] 42078#0: *5510811 start time is out mp4 stts samples in ... > (mostly this error) > [error] 42072#0: *5524976 start time is out mp4 stsc chunks in ... > (sometimes this error) > > It happens on different videos and only when ?start is after a > certain time point (different for each video) > > Given that the mp4 module works remarkably well on the whole, where > should I look to find the cause of these rare errors? (and what do > they actually mean :)) Messages suggest an attempt was made to seek to a time which isn't in media track metadata, thus seek isn't possible. This usually happens when time in "start=" is just too big. -- Maxim Dounin http://nginx.org/en/donation.html From rkearsley at blueyonder.co.uk Sat Jun 22 15:06:23 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Sat, 22 Jun 2013 16:06:23 +0100 Subject: start time is out mp4 In-Reply-To: <20130622144116.GH90537@mdounin.ru> References: <51C57125.8080406@blueyonder.co.uk> <20130622144116.GH90537@mdounin.ru> Message-ID: <51C5BD6F.60903@blueyonder.co.uk> Hi I've been able to test a few videos myself and can see it happening Just to be clear, 99%+ seem to be fine and can seek right up to the end But on very few, seeking is only possible up to X seconds (X could be at any point in the video) To seek after X, the error always happens However if I watch the video from start to end, it downloads the full thing and can be watched to the end (the file isn't truncated) At this point I suppose it's either an error while creating the metadata at the encoder software, or some odd circumstance which nginx doesn't like The question is, which? Thanks On 22/06/13 15:41, Maxim Dounin wrote: > Hello! > > On Sat, Jun 22, 2013 at 10:40:53AM +0100, Richard Kearsley wrote: > >> Hi >> I?m using the mp4 module quite heavily, and very occasionally (once >> every minute or so on a busy website) there is an error written to >> error.log and status 500 returned in the access log >> >> [error] 42078#0: *5510811 start time is out mp4 stts samples in ... >> (mostly this error) >> [error] 42072#0: *5524976 start time is out mp4 stsc chunks in ... >> (sometimes this error) >> >> It happens on different videos and only when ?start is after a >> certain time point (different for each video) >> >> Given that the mp4 module works remarkably well on the whole, where >> should I look to find the cause of these rare errors? (and what do >> they actually mean :)) > Messages suggest an attempt was made to seek to a time which isn't > in media track metadata, thus seek isn't possible. This usually > happens when time in "start=" is just too big. > From rkearsley at blueyonder.co.uk Sat Jun 22 15:33:47 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Sat, 22 Jun 2013 16:33:47 +0100 Subject: start time is out mp4 In-Reply-To: <51C5BD6F.60903@blueyonder.co.uk> References: <51C57125.8080406@blueyonder.co.uk> <20130622144116.GH90537@mdounin.ru> <51C5BD6F.60903@blueyonder.co.uk> Message-ID: <51C5C3DB.60104@blueyonder.co.uk> Hi I'm pretty sure I have found the cause, All the videos I see it happening on have short audio (Audio stops before the video) On 22/06/13 16:06, Richard Kearsley wrote: > Hi > I've been able to test a few videos myself and can see it happening > Just to be clear, 99%+ seem to be fine and can seek right up to the end > But on very few, seeking is only possible up to X seconds (X could be > at any point in the video) > To seek after X, the error always happens > However if I watch the video from start to end, it downloads the full > thing and can be watched to the end (the file isn't truncated) > > At this point I suppose it's either an error while creating the > metadata at the encoder software, or some odd circumstance which nginx > doesn't like > The question is, which? > > Thanks From nginx-forum at nginx.us Sun Jun 23 03:14:07 2013 From: nginx-forum at nginx.us (Peleke) Date: Sat, 22 Jun 2013 23:14:07 -0400 Subject: No MIME types In-Reply-To: <20130622115750.GJ27406@craic.sysops.org> References: <20130622115750.GJ27406@craic.sysops.org> Message-ID: <42c8de02ac42157a0b7a352ff0b986f5.NginxMailingListEnglish@forum.nginx.org> I have the same problem with other software (tested selfoss for example) even if I want to set it up completely from scratch. How can I find the root problem and fix it? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240262,240274#msg-240274 From dave at dave.cx Sun Jun 23 03:35:43 2013 From: dave at dave.cx (David Mohl) Date: Sun, 23 Jun 2013 12:35:43 +0900 Subject: Using SNI to route proxy_pass to upstream SSL host Message-ID: Hey guys, I am trying to get the following setup running: Nginx is listening to port 443. According to the users host (SNI), it should route the SSL requests to a upstream daemon / host which will take care of SSL certification, handshake and so on. Nginx should not touch the request, just pass it.? Since SSL also encrypts the header, it makes this setup a little bit more difficult than expected. A hint on serverfault indicated that SNI might be useful for this? My current experiment: server { listen 443; server_name example01.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8001; } } server { listen 443; server_name example02.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8002; } } server { listen 443; server_name example03.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8003; } } server { listen 443; server_name example04.com; location / { proxy_set_header Host $http_host; proxy_pass https://127.0.0.1:8004; } } However, this doesn't seem to work. Any ideas on this? Cheers, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Jun 23 05:31:25 2013 From: nginx-forum at nginx.us (justin) Date: Sun, 23 Jun 2013 01:31:25 -0400 Subject: bug in spdy - 499 response code on long running requests Message-ID: We sometimes have long running HTTPS requests, over 2 minutes, and occasionally would see 499 response codes, and duplicate (double run) transactions. After digging around and testing, it was discovered this only occurs with spdy support enabled. If we turn off spdy in the server block, the 499 response codes, and more importunately duplicate transactions stopped. Is this a known limitation of spdy, or perhaps a bug? If this is a limitation of spdy? Is it fixed in protocol version 3, since nginx only runs version 2. Would love to turn spdy support back on, but I can't have duplicate requests being fired. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240278,240278#msg-240278 From osa at FreeBSD.org.ru Sun Jun 23 07:42:47 2013 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Sun, 23 Jun 2013 11:42:47 +0400 Subject: build failed, ngx_http_ssl_module requires? Message-ID: <20130623074247.GA24529@FreeBSD.org.ru> Hi, I've tried to build nginx 1.4.1 under FreeBSD 9.1-STABLE and the build has been failed. Here is configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt=-I /usr/local/include --with-ld-opt=-L /usr/local/lib --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_flv_module --with-http_gzip_static_module --with-http_mp4_module --with-http_realip_module --with-http_stub_status_module --with-pcre --with-mail --with-mail_ssl_module Here is error message: cc -c -O2 -pipe -fno-strict-aliasing -I /usr/local/include -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -o objs/src/http/ngx_http_request.o src/http/ngx_http_request.c src/http/ngx_http_request.c: In function 'ngx_http_set_virtual_server': src/http/ngx_http_request.c:1992: error: 'ngx_http_ssl_srv_conf_t' undeclared (first use in this function) src/http/ngx_http_request.c:1992: error: (Each undeclared identifier is reported only once src/http/ngx_http_request.c:1992: error: for each function it appears in.) src/http/ngx_http_request.c:1992: error: 'sscf' undeclared (first use in this function) src/http/ngx_http_request.c:1999: error: 'ngx_http_ssl_module' undeclared (first use in this function) *** [objs/src/http/ngx_http_request.o] Error code 1 Could you investigate the issue. -- Sergey A. Osokin osa at FreeBSD.org.ru osa at FreeBSD.org From osa at FreeBSD.org.ru Sun Jun 23 08:13:58 2013 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Sun, 23 Jun 2013 12:13:58 +0400 Subject: build failed, ngx_http_ssl_module requires? In-Reply-To: <20130623074247.GA24529@FreeBSD.org.ru> References: <20130623074247.GA24529@FreeBSD.org.ru> Message-ID: <20130623081358.GA46821@FreeBSD.org.ru> Patch. On Sun, Jun 23, 2013 at 11:42:47AM +0400, Sergey A. Osokin wrote: > Hi, > > I've tried to build nginx 1.4.1 under FreeBSD 9.1-STABLE and the build has been failed. > > Here is configure arguments: > > --prefix=/usr/local/etc/nginx --with-cc-opt=-I /usr/local/include --with-ld-opt=-L /usr/local/lib --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_flv_module --with-http_gzip_static_module --with-http_mp4_module --with-http_realip_module --with-http_stub_status_module --with-pcre --with-mail --with-mail_ssl_module > > Here is error message: > > cc -c -O2 -pipe -fno-strict-aliasing -I /usr/local/include -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -o objs/src/http/ngx_http_request.o src/http/ngx_http_request.c > src/http/ngx_http_request.c: In function 'ngx_http_set_virtual_server': > src/http/ngx_http_request.c:1992: error: 'ngx_http_ssl_srv_conf_t' undeclared (first use in this function) > src/http/ngx_http_request.c:1992: error: (Each undeclared identifier is reported only once > src/http/ngx_http_request.c:1992: error: for each function it appears in.) > src/http/ngx_http_request.c:1992: error: 'sscf' undeclared (first use in this function) > src/http/ngx_http_request.c:1999: error: 'ngx_http_ssl_module' undeclared (first use in this function) > *** [objs/src/http/ngx_http_request.o] Error code 1 > > Could you investigate the issue. > > -- > Sergey A. Osokin > osa at FreeBSD.org.ru > osa at FreeBSD.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- --- src/http/ngx_http_request.c.orig 2013-06-23 11:44:31.000000000 +0400 +++ src/http/ngx_http_request.c 2013-06-23 11:48:57.000000000 +0400 @@ -1986,6 +1986,7 @@ return NGX_ERROR; } +#if (NGX_HTTP_SSL) #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME if (hc->ssl_servername) { @@ -2008,6 +2009,7 @@ } #endif +#endif if (rc == NGX_DECLINED) { return NGX_OK; From mdounin at mdounin.ru Sun Jun 23 09:17:03 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 23 Jun 2013 13:17:03 +0400 Subject: build failed, ngx_http_ssl_module requires? In-Reply-To: <20130623074247.GA24529@FreeBSD.org.ru> References: <20130623074247.GA24529@FreeBSD.org.ru> Message-ID: <20130623091703.GA20717@mdounin.ru> Hello! On Sun, Jun 23, 2013 at 11:42:47AM +0400, Sergey A. Osokin wrote: > Hi, > > I've tried to build nginx 1.4.1 under FreeBSD 9.1-STABLE and the build has been failed. > > Here is configure arguments: > > --prefix=/usr/local/etc/nginx --with-cc-opt=-I /usr/local/include --with-ld-opt=-L /usr/local/lib --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_flv_module --with-http_gzip_static_module --with-http_mp4_module --with-http_realip_module --with-http_stub_status_module --with-pcre --with-mail --with-mail_ssl_module > > Here is error message: > > cc -c -O2 -pipe -fno-strict-aliasing -I /usr/local/include -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -o objs/src/http/ngx_http_request.o src/http/ngx_http_request.c > src/http/ngx_http_request.c: In function 'ngx_http_set_virtual_server': > src/http/ngx_http_request.c:1992: error: 'ngx_http_ssl_srv_conf_t' undeclared (first use in this function) > src/http/ngx_http_request.c:1992: error: (Each undeclared identifier is reported only once > src/http/ngx_http_request.c:1992: error: for each function it appears in.) > src/http/ngx_http_request.c:1992: error: 'sscf' undeclared (first use in this function) > src/http/ngx_http_request.c:1999: error: 'ngx_http_ssl_module' undeclared (first use in this function) > *** [objs/src/http/ngx_http_request.o] Error code 1 > > Could you investigate the issue. This is fixed in 1.5.1, see this commit: http://hg.nginx.org/nginx/rev/9d83ec073c51 -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Sun Jun 23 12:24:30 2013 From: nginx-forum at nginx.us (Peleke) Date: Sun, 23 Jun 2013 08:24:30 -0400 Subject: No MIME types In-Reply-To: <20130622115750.GJ27406@craic.sysops.org> References: <20130622115750.GJ27406@craic.sysops.org> Message-ID: <27bcf8a09a8c4069a75bb45588ad3914.NginxMailingListEnglish@forum.nginx.org> Sorry, you were right, didn't see it in Selfoss because of SQLite. Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240262,240283#msg-240283 From nginx-forum at nginx.us Sun Jun 23 13:38:47 2013 From: nginx-forum at nginx.us (fakrulalam) Date: Sun, 23 Jun 2013 09:38:47 -0400 Subject: Nginx with Roboo Plugins Message-ID: Hi, I am looking for some installation guidiline of Nginx with Roboo module (https://github.com/yuri-gushin/Roboo). I have complie nginx with "with-http_perl_module". When every I run "perl Roboo.pm" getting the following error: # perl Roboo.pm Can't load '/usr/local/lib/perl/5.14.2/auto/nginx/nginx.so' for module nginx: /usr/local/lib/perl/5.14.2/auto/nginx/nginx.so: undefined symbol: ngx_http_perl_handle_request at /usr/local/lib/perl/5.14.2/XSLoader.pm line 68. at /usr/local/lib/perl/5.14.2/nginx.pm line 56 Compilation failed in require at Roboo.pm line 21. BEGIN failed--compilation aborted at Roboo.pm line 21. I can configure this plugins in Ubuntu 10.04 having nginx and nginx-extras. But when ever I try to do it in Ubuntu 12.04; I am having issue with nginx-extras Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240285,240285#msg-240285 From nginx-forum at nginx.us Sun Jun 23 17:14:41 2013 From: nginx-forum at nginx.us (escavern) Date: Sun, 23 Jun 2013 13:14:41 -0400 Subject: I really Need this htaccess url rewrite to Nginx rewrite Message-ID: <5ff8ace4047b4eb021eda138c61217fd.NginxMailingListEnglish@forum.nginx.org> Dear nginx forum members, im buying the script and it has only apache rules(htaccess) and i have difficulties convert the htaccess to nginx rewrite rules, the file is: ===================================================================== RewriteEngine On RewriteBase / RewriteRule ^login$ login.php RewriteRule ^logout$ logout.php RewriteRule ^log_out$ log_out.php RewriteRule ^welcome$ welcome.php RewriteRule ^getbutton$ getbutton.php RewriteRule ^lost$ lost.php RewriteRule ^invite$ invite.php RewriteRule ^invite_friends$ invite_friends.php RewriteRule ^add_pin$ add_pin.php RewriteRule ^signup$ signup.php RewriteRule ^invite_signup$ invite_signup.php RewriteRule ^confirmemail$ confirmemail.php RewriteRule ^createboard$ createboard.php RewriteRule ^createboard2$ createboard2.php RewriteRule ^pin_success$ pin_success.php RewriteRule ^pin_create_popup$ pin_create_popup.php RewriteRule ^report_popup$ report_popup.php RewriteRule ^gifts$ gifts.php RewriteRule ^videos$ videos.php RewriteRule ^more$ more.php RewriteRule ^more2$ more2.php RewriteRule ^more3$ more3.php RewriteRule ^more4$ more4.php RewriteRule ^more5$ more5.php RewriteRule ^more6$ more6.php RewriteRule ^more7$ more7.php RewriteRule ^more8$ more8.php RewriteRule ^more9$ more9.php RewriteRule ^more10$ more10.php RewriteRule ^more11$ more11.php RewriteRule ^more12$ more12.php RewriteRule ^popular$ popular.php RewriteRule ^all$ all.php RewriteRule ^search$ search.php RewriteRule ^add_popup$ add_popup.php RewriteRule ^pin_popup$ pin_popup.php RewriteRule ^upload_popup$ upload_popup.php RewriteRule ^board_popup$ board_popup.php RewriteRule ^about$ about.php RewriteRule ^pinit$ pinit.php RewriteRule ^rules$ rules.php RewriteRule ^help$ help.php RewriteRule ^tos$ tos.php RewriteRule ^privacy$ privacy.php RewriteRule ^contact$ contact.php RewriteRule ^myboards$ myboards.php RewriteRule ^mypins$ mypins.php RewriteRule ^mylikes$ mylikes.php RewriteRule ^settings$ settings.php RewriteRule ^edit_pin$ edit_pin.php RewriteRule ^edit_board$ edit_board.php RewriteRule ^edit_pass$ edit_pass.php RewriteRule ^delete_create_popup$ delete_create_popup.php RewriteRule ^delete_board_popup$ delete_board_popup.php RewriteRule ^source/(.*)?$ source.php?q=$1&%{QUERY_STRING} RewriteRule ^pin/([^/.]+)?$ pin.php?PID=$1&%{QUERY_STRING} RewriteRule ^([^/.]+)/pins?$ profilepins.php?uname=$1&%{QUERY_STRING} RewriteRule ^([^/.]+)/likes?$ profilelikes.php?uname=$1&%{QUERY_STRING} RewriteRule ^([^/.]+)/followers?$ followersprofile.php?uname=$1&%{QUERY_STRING} RewriteRule ^([^/.]+)/following?$ followingprofile.php?uname=$1&%{QUERY_STRING} RewriteRule ^([^/.]+)/([^/.]+)/followers?$ followers.php?uname=$1&bname=$2&%{QUERY_STRING} RewriteRule ^([^/.]+)/([^/.]+)?$ board.php?uname=$1&bname=$2&%{QUERY_STRING} RewriteRule ^([^/.]+)(\/)?$ profile.php?uname=$1 # Turn off mod_security filtering. SecFilterEngine Off # The below probably isn't needed, # but better safe than sorry. SecFilterScanPOST Off ===================================================================== any help will be appreciated :-) i'll buy a coffee. hope somebody help me to convert. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240287,240287#msg-240287 From dotjunior at gmail.com Sun Jun 23 17:39:23 2013 From: dotjunior at gmail.com (Francisco C Soares) Date: Sun, 23 Jun 2013 14:39:23 -0300 Subject: I really Need this htaccess url rewrite to Nginx rewrite In-Reply-To: <5ff8ace4047b4eb021eda138c61217fd.NginxMailingListEnglish@forum.nginx.org> References: <5ff8ace4047b4eb021eda138c61217fd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <51C732CB.7040306@gmail.com> On 06/23/2013 02:14 PM, escavern wrote: > Dear nginx forum members, im buying the script and it has only apache > rules(htaccess) and i have difficulties convert the htaccess to nginx > rewrite rules... Have you tried it? See: Voc? j? tentou isso? Veja: http://winginx.com/htaccess http://www.anilcetin.com/ Boa sorte! :-) Good luck! :-) ___________________________ Francisco C Soares ( *Junior* ) 403790c898466667cdbe5a262146de8fb93139c4 BLOG PESSOAL dotjunior.blogspot.com | TEL +55 11 4059 3046 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ianevans at digitalhit.com Mon Jun 24 07:45:33 2013 From: ianevans at digitalhit.com (Ian Evans) Date: Mon, 24 Jun 2013 03:45:33 -0400 Subject: Can nginx handle/cache this robot handling case? Message-ID: <51C7F91D.5020108@digitalhit.com> Hi everyone. First some background. I'm trying to integrate the method used by Pixabay to handle Google Image Search's new design which makes it very easy (one button click) for visitors to see an image outside of the site's context. This has greatly slammed many sites' traffic and income. This is how Pixabay got nginx to handle hijacking the button so the image can be seen in the site's context: "Hotlinking protection and watermarking for Google Images": (http://pixabay.com/en/blog/posts/hotlinking-protection-and-watermarking-for-google-32/) Part of the method is using what they call "trap URLs". i.e. adding "?i" to img URLs in the source when the page is seen by a human. Bots like googlebot don't see the ?i and so they get handled differently by nginx: if ($args = "i") { set $watermark 0; } if ($watermark = 1) { add_header Cache-Control "no-cache, must-revalidate"; // rewrite "IMAGE_URL_REGEX" WATERMARK_URL last; <-optional serving of a watermarked version of image. } Pixabay handles creating the "?i" addendum to the img tag in their templates. I was looking for a method that was a little more caching/performance friendly, so I suggested using jQuery to append the "?i" to browsers at the document ready stage so bots would not get the ?i and the page could still be cached because the "?i" was added on the client side. e.g. var img= $("img.myimg"); img.attr("src", img.attr("src")+"?i"); The only problem is that the page now hits the server twice. Once when loading /the/file/location/img.jpg and a second time after jQuery changes it to loading /the/file/location/img.jpg?i It was suggested that I could potentially add Varnish to my stack and strip out the ?i from the URLs for bots then but I didn't want to add something else to the stack Can nginx and, say, the fastcgi cache (which I use) handle this situation natively? Let's say all pages have the "?i" at the end of their image locations so they're already there for the majority (human traffic). Is there an efficient way for nginx, upon detecting a bot agent, to strip the ?i (perhaps with http://wiki.nginx.org/HttpSubsModule), serve and gzip and cache that version, while serving/caching the original version to browsers? It's a long post. (!) I just have an inkling that my fave server can handle this. Just don't have the experience to configure it. Thanks for any insight. From nginx-forum at nginx.us Mon Jun 24 12:58:29 2013 From: nginx-forum at nginx.us (TECK) Date: Mon, 24 Jun 2013 08:58:29 -0400 Subject: Redirection issues Message-ID: <0df79187155f297b982525e0d18e8ce5.NginxMailingListEnglish@forum.nginx.org> Hello everyone, I'm currently using Nginx 1.4.1 on CentOS 6.4 64bits and trying to perform a redirect of this type: location /alpha { location ~ ^/alpha/script.+([\d]+)$ { return 301 /beta/info/$1/; } } The originating location is /alpha/script.php?id=328. The redirected location is /beta/info/328/. For some reason, the above redirect returns a 404 with the URL: http://www.domain.com/beta/script.php Which does not exist anymore. It looks like the URI is not parsed from the regex? I also tried this format, without success: location ~ ^/alpha/script\.php?id=([\d]+)$ { Thank you for your help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240299,240299#msg-240299 From mdounin at mdounin.ru Mon Jun 24 13:13:59 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 24 Jun 2013 17:13:59 +0400 Subject: Redirection issues In-Reply-To: <0df79187155f297b982525e0d18e8ce5.NginxMailingListEnglish@forum.nginx.org> References: <0df79187155f297b982525e0d18e8ce5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130624131358.GG20717@mdounin.ru> Hello! On Mon, Jun 24, 2013 at 08:58:29AM -0400, TECK wrote: > Hello everyone, > > I'm currently using Nginx 1.4.1 on CentOS 6.4 64bits and trying to perform a > redirect of this type: > location /alpha { > location ~ ^/alpha/script.+([\d]+)$ { > return 301 /beta/info/$1/; > } > } > > The originating location is /alpha/script.php?id=328. > The redirected location is /beta/info/328/. > > For some reason, the above redirect returns a 404 with the URL: > http://www.domain.com/beta/script.php > Which does not exist anymore. It looks like the URI is not parsed from the > regex? > I also tried this format, without success: > location ~ ^/alpha/script\.php?id=([\d]+)$ { Query string isn't considered by location matching. If you want to test request arguments, you have to do it inside a location matched, like this: location = /alpha/script.php { if ($arg_id) { return 301 /beta/info/$arg_id/; } ... } In this particular case test is likely useless, and just a return will be enough. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Mon Jun 24 13:43:04 2013 From: nginx-forum at nginx.us (TECK) Date: Mon, 24 Jun 2013 09:43:04 -0400 Subject: Redirection issues In-Reply-To: <20130624131358.GG20717@mdounin.ru> References: <20130624131358.GG20717@mdounin.ru> Message-ID: <35a7e187f8aaf19cb1bf1fefc2718fbf.NginxMailingListEnglish@forum.nginx.org> Thank you Maxim. :) Is there a way to skip the IF with try_files and still having a 301 footprint? Something like: try_files /beta/info/$arg_id/ =404; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240299,240302#msg-240302 From vbart at nginx.com Mon Jun 24 14:21:10 2013 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 24 Jun 2013 18:21:10 +0400 Subject: bug in spdy - 499 response code on long running requests In-Reply-To: References: Message-ID: <201306241821.10051.vbart@nginx.com> On Sunday 23 June 2013 09:31:25 justin wrote: > We sometimes have long running HTTPS requests, over 2 minutes, and > occasionally would see 499 response codes, and duplicate (double run) > transactions. After digging around and testing, it was discovered this only > occurs with spdy support enabled. If we turn off spdy in the server block, > the 499 response codes, and more importunately duplicate transactions > stopped. > > Is this a known limitation of spdy, or perhaps a bug? If this is a > limitation of spdy? Is it fixed in protocol version 3, since nginx only > runs version 2. Would love to turn spdy support back on, but I can't have > duplicate requests being fired. > Could you provide a debug log? http://nginx.org/en/docs/debugging_log.html wbr, Valentin V. Bartenev -- http://nginx.org/en/donation.html From artemrts at ukr.net Mon Jun 24 19:18:07 2013 From: artemrts at ukr.net (wishmaster) Date: Mon, 24 Jun 2013 22:18:07 +0300 Subject: auth_basic 500 Internal Server Error Message-ID: <28836.1372101487.9980448590655913984@ffe10.ukr.net> Hi, guys! I am attempting to secure one subdirectory on the server with ngx_http_auth_basic_module. Unfortunately, without success. In log file error: 2013/06/24 22:03:05 [crit] 34189#0: *1 open() "/usr/local/etc/nginx/authpw" failed (13: Permission denied), client: 111.222.251.165, server: server.com.ua, request: "GET /private/ HTTP/1.1", host: "server.com.ua" Part of nginx.conf: location ^~ /private { auth_basic "Closed area, sorry..."; auth_basic_user_file /usr/local/etc/nginx/authpw; # ls -lo ./authpw -r--r----- 1 root www - 50 24 ??? 21:58 ./authpw # cat ./authpw #coments vv:$apr1$NhsePrJ/$MHMNGRoELdDfzcE/kGJpz1 What I have missed? From r at roze.lv Mon Jun 24 20:00:34 2013 From: r at roze.lv (Reinis Rozitis) Date: Mon, 24 Jun 2013 23:00:34 +0300 Subject: auth_basic 500 Internal Server Error In-Reply-To: <28836.1372101487.9980448590655913984@ffe10.ukr.net> References: <28836.1372101487.9980448590655913984@ffe10.ukr.net> Message-ID: <2BBC477DFDCC47B2ACC6BC2FD599DA7F@MezhRoze> > 2013/06/24 22:03:05 [crit] 34189#0: *1 open() > "/usr/local/etc/nginx/authpw" failed (13: Permission denied) > > # ls -lo ./authpw > -r--r----- 1 root www - 50 24 ??? 21:58 ./authpw > > What I have missed? The error log kind of explains - the auth file is not readable by nginx user. Do you have specified the 'www' group in the nginx config ( http://nginx.org/en/docs/ngx_core_module.html#user ) ? rr From artemrts at ukr.net Mon Jun 24 21:20:35 2013 From: artemrts at ukr.net (wishmaster) Date: Tue, 25 Jun 2013 00:20:35 +0300 Subject: auth_basic 500 Internal Server Error In-Reply-To: <2BBC477DFDCC47B2ACC6BC2FD599DA7F@MezhRoze> References: <28836.1372101487.9980448590655913984@ffe10.ukr.net> <2BBC477DFDCC47B2ACC6BC2FD599DA7F@MezhRoze> Message-ID: <95716.1372108835.871282015478349824@ffe8.ukr.net> --- Original message --- From: "Reinis Rozitis" Date: 24 June 2013, 23:00:48 > > 2013/06/24 22:03:05 [crit] 34189#0: *1 open() > > "/usr/local/etc/nginx/authpw" failed (13: Permission denied) > > > > # ls -lo ./authpw > > -r--r----- 1 root www - 50 24 ??? 21:58 ./authpw > > > > What I have missed? > > The error log kind of explains - the auth file is not readable by nginx > user. > > Do you have specified the 'www' group in the nginx config ( > http://nginx.org/en/docs/ngx_core_module.html#user ) ? Off course, user www www; worker_processes 1; ...... From steve at greengecko.co.nz Mon Jun 24 21:25:03 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Tue, 25 Jun 2013 09:25:03 +1200 Subject: auth_basic 500 Internal Server Error In-Reply-To: <95716.1372108835.871282015478349824@ffe8.ukr.net> References: <28836.1372101487.9980448590655913984@ffe10.ukr.net> <2BBC477DFDCC47B2ACC6BC2FD599DA7F@MezhRoze> <95716.1372108835.871282015478349824@ffe8.ukr.net> Message-ID: <1372109103.25974.712.camel@steve-new> On Tue, 2013-06-25 at 00:20 +0300, wishmaster wrote: > > --- Original message --- > From: "Reinis Rozitis" > Date: 24 June 2013, 23:00:48 > > > > > 2013/06/24 22:03:05 [crit] 34189#0: *1 open() > > > "/usr/local/etc/nginx/authpw" failed (13: Permission denied) > > > > > > # ls -lo ./authpw > > > -r--r----- 1 root www - 50 24 ??? 21:58 ./authpw > > > > > > What I have missed? > > > > The error log kind of explains - the auth file is not readable by nginx > > user. > > > > Do you have specified the 'www' group in the nginx config ( > > http://nginx.org/en/docs/ngx_core_module.html#user ) ? > > Off course, > user www www; > worker_processes 1; > ...... > The error is extremely specific. Look at permissions of file ( looks ok ), and all parent directories. www ( user and group ) doesn't have access to one of them. You only showed permissions of ./authpw. Can you confirm you were in /usr/local/etc/nginx at the time? Steve -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From jhaimson at MIT.EDU Mon Jun 24 21:25:21 2013 From: jhaimson at MIT.EDU (Josh Haimson) Date: Mon, 24 Jun 2013 17:25:21 -0400 Subject: Nginx + Uwsgi Error: unknown directive "uwsgi_pass" Message-ID: Hi all, I'm trying to configure nginx 1.1.19 on an ubuntu server with uwsgi. It works fine on my ubuntu dev machine with the same exact version of nginx, but for some reason I get the following error when I try to start nginx on my production server: Starting nginx: nginx: [emerg] unknown directive "uwsgi_pass" in /etc/nginx/sites-enabled/nginx.conf:31 nginx: configuration file /etc/nginx/nginx.conf test failed I had seen this in an earlier post, but the issue was that they were running an older version of nginx which didn't support uwsgi natively. Does anyone know why I'd be getting this error when I'm running a version that should support uwsgi natively? For reference, my nginx.conf file is below: Thanks, Josh nginx.conf: upstream django { server unix:/tmp/django.sock; } server { listen 8000; server_name 127.0.0.1; charset utf-8; client_max_body_size 75M; location / { uwsgi_pass django; include /home/django-server/uwsgi_params; } } -- Josh Haimson Massachusetts Institute of Technology 2016 Departments of Computer Science and Biology JHaimson at mit.edu | 516.640.6221 -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at greengecko.co.nz Mon Jun 24 21:29:29 2013 From: steve at greengecko.co.nz (Steve Holdoway) Date: Tue, 25 Jun 2013 09:29:29 +1200 Subject: Nginx + Uwsgi Error: unknown directive "uwsgi_pass" In-Reply-To: References: Message-ID: <1372109369.25974.715.camel@steve-new> Are you sure it's got uwsgi built in? If it's from a different repo / not up to date, then it may well not. nginx -V should answer that. On Mon, 2013-06-24 at 17:25 -0400, Josh Haimson wrote: > Hi all, > > > I'm trying to configure nginx 1.1.19 on an ubuntu server with uwsgi. > It works fine on my ubuntu dev machine with the same exact version of > nginx, but for some reason I get the following error when I try to > start nginx on my production server: > Starting nginx: nginx: [emerg] unknown directive "uwsgi_pass" > in /etc/nginx/sites-enabled/nginx.conf:31 > nginx: configuration file /etc/nginx/nginx.conf test failed > > > I had seen this in an earlier post, but the issue was that they were > running an older version of nginx which didn't support uwsgi > natively. Does anyone know why I'd be getting this error when I'm > running a version that should support uwsgi natively? > > > For reference, my nginx.conf file is below: > > > > Thanks, > Josh > > > nginx.conf: > > > upstream django { > server unix:/tmp/django.sock; > } > > > server { > listen 8000; > server_name 127.0.0.1; > charset utf-8; > client_max_body_size 75M; > > > location / { > uwsgi_pass django; > include /home/django-server/uwsgi_params; > } > } > > > > > -- > Josh Haimson > Massachusetts Institute of Technology 2016 > Departments of Computer Science and Biology > JHaimson at mit.edu | 516.640.6221 > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Steve Holdoway BSc(Hons) MNZCS http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa From artemrts at ukr.net Mon Jun 24 21:34:57 2013 From: artemrts at ukr.net (wishmaster) Date: Tue, 25 Jun 2013 00:34:57 +0300 Subject: auth_basic 500 Internal Server Error In-Reply-To: <1372109103.25974.712.camel@steve-new> References: <28836.1372101487.9980448590655913984@ffe10.ukr.net> <2BBC477DFDCC47B2ACC6BC2FD599DA7F@MezhRoze> <95716.1372108835.871282015478349824@ffe8.ukr.net> <1372109103.25974.712.camel@steve-new> Message-ID: <24971.1372109697.6286767397679398912@ffe15.ukr.net> Yeah, Steve! You're right. Thanks. nginx config dir had rwx for root:wheel only. Need to sleep :-). --- Original message --- From: "Steve Holdoway" Date: 25 June 2013, 00:25:26 > On Tue, 2013-06-25 at 00:20 +0300, wishmaster wrote: > > > > --- Original message --- > > From: "Reinis Rozitis" > > Date: 24 June 2013, 23:00:48 > > > > > > > > 2013/06/24 22:03:05 [crit] 34189#0: *1 open() > > > > "/usr/local/etc/nginx/authpw" failed (13: Permission denied) > > > > > > > > # ls -lo ./authpw > > > > -r--r----- 1 root www - 50 24 ??? 21:58 ./authpw > > > > > > > > What I have missed? > > > > > > The error log kind of explains - the auth file is not readable by nginx > > > user. > > > > > > Do you have specified the 'www' group in the nginx config ( > > > http://nginx.org/en/docs/ngx_core_module.html#user ) ? > > > > Off course, > > user www www; > > worker_processes 1; > > ...... > > > The error is extremely specific. Look at permissions of file ( looks ok > ), and all parent directories. www ( user and group ) doesn't have > access to one of them. > > You only showed permissions of ./authpw. Can you confirm you were > in /usr/local/etc/nginx at the time? > > Steve > -- > Steve Holdoway BSc(Hons) MNZCS > http://www.greengecko.co.nz > Linkedin: http://www.linkedin.com/in/steveholdoway > Skype: sholdowa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Jun 25 03:26:15 2013 From: nginx-forum at nginx.us (justin) Date: Mon, 24 Jun 2013 23:26:15 -0400 Subject: bug in spdy - 499 response code on long running requests In-Reply-To: <201306241821.10051.vbart@nginx.com> References: <201306241821.10051.vbart@nginx.com> Message-ID: Valentin, Unfortunately I did not build nginx --with-debug, additionally it would be somewhat tedious and hard to replicate the issue. However, if needed, I can recompile nginx on a development server and see if I can replicate this error condition with spdy enabled. However the setup would be tedious as it requires setting up SSL, etc. Can you think of an easier way to test this though? Maybe simply a PHP file that does something like: Then call that from nginx with spdy enabled and see if it writes twice to the file request.log. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240278,240318#msg-240318 From nginx-forum at nginx.us Tue Jun 25 06:52:02 2013 From: nginx-forum at nginx.us (philipp) Date: Tue, 25 Jun 2013 02:52:02 -0400 Subject: duplicate Vary: Accept-Encoding header Message-ID: <4d68a000c215fe98cebf2b4f7e5d1852.NginxMailingListEnglish@forum.nginx.org> I use nginx 1.4.1 with gunzip = on and gzip_vary = on. This leads to a duplicate Vary Header. gzip_vary should do nothing if the header is already present: user at aladin:~$ curl -I -A test http://192.168.56.249/ HTTP/1.1 302 Found Server: nginx Date: Tue, 25 Jun 2013 06:45:12 GMT Content-Type: text/html Connection: keep-alive Vary: Accept-Encoding Location: index.htm Vary: Accept-Encoding I have no control of the upstream server maybe it sends a Vary header or not, in order to be safe I would like to use gzip_vary = on in order to prevent any problems here. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240322,240322#msg-240322 From nginx-forum at nginx.us Tue Jun 25 11:28:40 2013 From: nginx-forum at nginx.us (0liver) Date: Tue, 25 Jun 2013 07:28:40 -0400 Subject: Handling nginx's too many open files even I have the correct ulimit In-Reply-To: References: Message-ID: <9f355b12ebf8ce26bf9fce704cc5bca9.NginxMailingListEnglish@forum.nginx.org> Thanks a lot, Jader. Your hint saved me hours of additional headache after our site was almost unusable due to NGINX throwing tens of thousands of "24: Too many open files" errors. I chose to set *worker_rlimit_nofile* to 65536 = 2^16 for peace of mind :-) It's important to note, that the *worker_connections* count needs to be adapted as well, so that connections now won't be dropped because of a too low value here. Since we're running on a VPS with only a single core, we set *worker_connections* to 65536, as well. >From the moment I reloaded those two changes into the NGINX process, I haven't had any of "too many open file errors. I've put together a short blog post on this here: ? http://shades-of-orange.com/post/2013/06/24/Setting-up-NGINX-as-Reverse-Proxy-for-CampingInfo. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,234191,240331#msg-240331 From shangtefa at gmail.com Tue Jun 25 14:02:44 2013 From: shangtefa at gmail.com (MCoder) Date: Tue, 25 Jun 2013 22:02:44 +0800 Subject: Nginx + Uwsgi Error: unknown directive "uwsgi_pass" In-Reply-To: References: Message-ID: you should use wsgi_pass, not uwsgi_pass 2013/6/25 Josh Haimson > Hi all, > > I'm trying to configure nginx 1.1.19 on an ubuntu server with uwsgi. It > works fine on my ubuntu dev machine with the same exact version of nginx, > but for some reason I get the following error when I try to start nginx on > my production server: > Starting nginx: nginx: [emerg] unknown directive "uwsgi_pass" in > /etc/nginx/sites-enabled/nginx.conf:31 > nginx: configuration file /etc/nginx/nginx.conf test failed > > I had seen this in an earlier post, > but the issue was that they were running an older version of nginx which > didn't support uwsgi natively. Does anyone know why I'd be getting this > error when I'm running a version that should support uwsgi natively? > > For reference, my nginx.conf file is below: > > Thanks, > Josh > > nginx.conf: > > upstream django { > server unix:/tmp/django.sock; > } > > server { > listen 8000; > server_name 127.0.0.1; > charset utf-8; > client_max_body_size 75M; > > location / { > uwsgi_pass django; > include /home/django-server/uwsgi_params; > } > } > > > -- > Josh Haimson > Massachusetts Institute of Technology 2016 > Departments of Computer Science and Biology > JHaimson at mit.edu | 516.640.6221 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stageline at gmail.com Tue Jun 25 15:48:26 2013 From: stageline at gmail.com (asd) Date: Tue, 25 Jun 2013 17:48:26 +0200 Subject: call http request from location Message-ID: Hy. It possible exec curl from location or call http request with other solution? I need request special url if user start playing mp4 video. thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at indietorrent.org Tue Jun 25 20:18:34 2013 From: ben at indietorrent.org (Ben Johnson) Date: Tue, 25 Jun 2013 16:18:34 -0400 Subject: Trouble adding /pma location to all virtual hosts Message-ID: <51C9FB1A.5030406@indietorrent.org> Hello, I'm trying to accomplish something that feels like it should be very simple, yet I'm struggling. I'm new to nginx, and I feel a bit lost as I try to "translate" everything that I've done in Apache over the years to nginx. So, please bear with me. I've done my research and asking this list for help is a last-resort. I have an application, phpMyAdmin, installed in /var/www/pma. I would like to modify the nginx configuration such that every virtual-host whose configuration file is located in /etc/nginx/sites-available/ has access to the files in this directory by browsing to the location /pma/, relative to the domain root. The filesystem information for /var/www/pma is as follows (the permissions are set recursively on the entire directory -- for now): # ls -lah /var/www | grep "pma" drwxrwxr-x 9 www-data www-data 4.0K Jun 17 16:37 pma I figured that it might be simpler to get phpMyAdmin working for a single vhost before attempting the same move server-wide. On the surface, it looks to be this simple: location /pma/ { alias /var/www/pma/; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } When I try this configuration, I have the following in error.log: 2013/06/25 14:04:07 [error] 29741#0: *21 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 1.2.3.4, server: example.com, request: "GET /pma/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "example.com" While researching the cause of this error, I have seen others state that SCRIPT_FILENAME has to be modified when using an alias in this way, e.g. fastcgi_param SCRIPT_FILENAME $request_filename; but the error messages are the same with this line, too. So, I tried to use the "root" directive, instead of "alias", as I have no particular reason for using one over the other in this scenario. location /pma/ { ##alias /var/www/pma/; root /var/www; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } This "kind of works". The index file at location /pma/index.php is parsed via PHP, but requests for all other resources on the page yield "403 Forbidden". The log states: 2013/06/25 14:21:46 [error] 30343#0: *12 FastCGI sent in stderr: "Access to the script '/var/www/pma/favicon.ico' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 1.2.3.4, server: example.com, request: "GET /pma/favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "example.com" Obviously, the aim here is not to execute '/var/www/pma/favicon.ico' as a PHP script. I found a thread at http://serverfault.com/questions/486368/nginx-and-php-fpm-403-forbidden which seems to address this intended behavior (the rationale is sound). So, I split my configuration up into the following sections, so that PHP scripts would be handled via php-fpm and static content would be handled directly: location ~ /pma/.*\.php$ { root /var/www; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } location /pma/ { root /var/www; # Adding the following line makes no difference: index index.php; } With this configuration, PMA's index page won't even load. The location /pma/ returns a 404, as does /pma/index.php. Nothing is written to the vhost's error.log when /pma/ or /pma/index.php is requested. Only the following (I've omitted the irrelevant bits) is written to access.log: "GET /pma/ HTTP/1.1" 404 200 "-" "GET /pma/index.php HTTP/1.1" 404 200 "-" I must be doing something completely asinine. Other misc. details: - PHP's open_basedir directive includes the path /var/www/pma. - nginx is executing the request as the user "web2" who is in the group "client2" (this is configured via ISPConfig). - The group "client2" is in the group "www-data", and /var/www/pma's user:group is www-data:www-data and the permissions on the directory are 0775, recursively. Thanks in advance for any help here, -Ben From artemrts at ukr.net Tue Jun 25 22:17:07 2013 From: artemrts at ukr.net (wishmaster) Date: Wed, 26 Jun 2013 01:17:07 +0300 Subject: call http request from location In-Reply-To: References: Message-ID: <23426.1372198627.15836809715718029312@ffe16.ukr.net> --- Original message --- From: "asd" Date: 25 June 2013, 18:48:37 > Hy. > > It possible exec curl from location or call http request with other solution? > > > I need request special url if user start playing mp4 video. > I think this is job for php or any other server-side application. Cheers, vv From stageline at gmail.com Wed Jun 26 06:53:39 2013 From: stageline at gmail.com (asd) Date: Wed, 26 Jun 2013 08:53:39 +0200 Subject: call http request from location In-Reply-To: <23426.1372198627.15836809715718029312@ffe16.ukr.net> References: <23426.1372198627.15836809715718029312@ffe16.ukr.net> Message-ID: Not sure. PHP not know mp4 video playing start. I can save time, filename, ip addr after called url by nginx. 2013/6/26 wishmaster > > > --- Original message --- > From: "asd" > Date: 25 June 2013, 18:48:37 > > > > Hy. > > > > It possible exec curl from location or call http request with other > solution? > > > > > > I need request special url if user start playing mp4 video. > > > > I think this is job for php or any other server-side application. > > Cheers, > vv > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed Jun 26 07:04:48 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 26 Jun 2013 11:04:48 +0400 Subject: call http request from location In-Reply-To: References: <23426.1372198627.15836809715718029312@ffe16.ukr.net> Message-ID: <20130626070448.GS20717@mdounin.ru> Hello! On Wed, Jun 26, 2013 at 08:53:39AM +0200, asd wrote: > Not sure. PHP not know mp4 video playing start. > I can save time, filename, ip addr after called url by nginx. Most obvious aproach would be to use a php script with X-Accel-Redirect to track playback start. Alternatively, you may use auth request module[1], it should be slightly easier from configuration point of view. [1] http://mdounin.ru/hg/ngx_http_auth_request_module -- Maxim Dounin http://nginx.org/en/donation.html From ben at indietorrent.org Wed Jun 26 14:22:21 2013 From: ben at indietorrent.org (Ben Johnson) Date: Wed, 26 Jun 2013 10:22:21 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51C9FB1A.5030406@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> Message-ID: <51CAF91D.5050200@indietorrent.org> I was able to accomplish my objective with some help from the tutorial at: http://www.howtoforge.com/running-phpmyadmin-on-nginx-lemp-on-debian-squeeze-ubuntu-11.04 location /pma { root /var/www/; index index.php index.html index.htm; location ~ ^/pma/(.+\.php)$ { try_files $uri =404; root /var/www/; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param HTTPS on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~* ^/pma/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /var/www/; } } location /PMA { rewrite ^/* /pma last; } I don't know if the key is the nested location block, or something else. If anyone is able to point-out the fundamental differences between the configuration snippet that I posted previously and the snippet above, which actually works, I would be most appreciative. Thank you! -Ben From jhaimson at MIT.EDU Wed Jun 26 14:55:24 2013 From: jhaimson at MIT.EDU (Josh Haimson) Date: Wed, 26 Jun 2013 10:55:24 -0400 Subject: Nginx + Uwsgi Error: unknown directive "uwsgi_pass" Message-ID: Thanks for the help! Unfortunately, changing uwsgi_pass to wsgi_pass did not solve the problem. Now I just get an error saying there's an unknown directive 'wsgi_pass' instead of an unknown directive 'uwsgi_pass'. The odd thing is that 'uwsgi_pass' works perfectly on a different machine running the same OS and the same version of nginx. Any ideas on why this might be? Thanks, Josh On Wed, Jun 26, 2013 at 8:00 AM, wrote: > > Date: Tue, 25 Jun 2013 22:02:44 +0800 > From: MCoder > To: nginx at nginx.org > Subject: Re: Nginx + Uwsgi Error: unknown directive "uwsgi_pass" > Message-ID: > < > CAAmqK6QG_Qpg_TPEGDXiF_kZobQCv26eyvhyGHAoEPZVAmSp3Q at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > you should use wsgi_pass, not uwsgi_pass > > > 2013/6/25 Josh Haimson > > > Hi all, > > > > I'm trying to configure nginx 1.1.19 on an ubuntu server with uwsgi. It > > works fine on my ubuntu dev machine with the same exact version of nginx, > > but for some reason I get the following error when I try to start nginx > on > > my production server: > > Starting nginx: nginx: [emerg] unknown directive "uwsgi_pass" in > > /etc/nginx/sites-enabled/nginx.conf:31 > > nginx: configuration file /etc/nginx/nginx.conf test failed > > > > I had seen this in an earlier post< > http://mailman.nginx.org/pipermail/nginx/2010-October/023165.html>, > > but the issue was that they were running an older version of nginx which > > didn't support uwsgi natively. Does anyone know why I'd be getting this > > error when I'm running a version that should support uwsgi natively? > > > > For reference, my nginx.conf file is below: > > > > Thanks, > > Josh > > > > nginx.conf: > > > > upstream django { > > server unix:/tmp/django.sock; > > } > > > > server { > > listen 8000; > > server_name 127.0.0.1; > > charset utf-8; > > client_max_body_size 75M; > > > > location / { > > uwsgi_pass django; > > include /home/django-server/uwsgi_params; > > } > > } > > > > > > -- > > Josh Haimson > > Massachusetts Institute of Technology 2016 > > Departments of Computer Science and Biology > > JHaimson at mit.edu | 516.640.6221 > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > -- Josh Haimson Massachusetts Institute of Technology 2016 Departments of Computer Science and Biology JHaimson at mit.edu | 516.640.6221 -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Wed Jun 26 20:50:10 2013 From: francis at daoine.org (Francis Daly) Date: Wed, 26 Jun 2013 21:50:10 +0100 Subject: Nginx + Uwsgi Error: unknown directive "uwsgi_pass" In-Reply-To: References: Message-ID: <20130626205010.GK27406@craic.sysops.org> On Wed, Jun 26, 2013 at 10:55:24AM -0400, Josh Haimson wrote: Hi there, > The odd thing is that 'uwsgi_pass' works perfectly on a different machine > running the same OS and the same version of nginx. Which file on the filesystem is the "works perfectly" nginx binary? /usr/sbin/nginx, /usr/local/sbin/nginx, /usr/local/nginx/sbin/nginx, something else? What is the output of that "nginx -V"? Which file on the filesystem is the "unknown directive" nginx binary? What is the output of that "nginx -V"? > Any ideas on why this might be? The nginx you run on the second system was not built the same way as the one on the first system. There aren't many other ways you can get the output that you report. (Might you have installed the distribution "nginx" on one machine, and "nginx-full" on the other, for example? Or did you build the binary yourself?) f -- Francis Daly francis at daoine.org From francis at daoine.org Wed Jun 26 21:33:30 2013 From: francis at daoine.org (Francis Daly) Date: Wed, 26 Jun 2013 22:33:30 +0100 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CAF91D.5050200@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> Message-ID: <20130626213330.GL27406@craic.sysops.org> On Wed, Jun 26, 2013 at 10:22:21AM -0400, Ben Johnson wrote: Hi there, > I was able to accomplish my objective with some help from the tutorial > at: It's good that you've got it working now. There are a few things that you might like to consider when deploying it across all vhosts. First: for a request, nginx picks one server and then one location to process things in. So for this configuration to be common across multiple servers, you either must copy-paste it into each; or else put it in an external file and "include" that file in each per-server config that matters. > location /pma { Next, you probably want this to become "location ^~ /pma" -- or maybe even "location ^~ /pma/", with a separate "location = /pma {return 301 /pma/;}" block. http://nginx.org/r/location for the details of why that is. (Hint: try to access /pmap, or /index.php, and you may see that things go wrong.) > root /var/www/; > index index.php index.html index.htm; > location ~ ^/pma/(.+\.php)$ { > try_files $uri =404; > root /var/www/; That line, because it is identical to the enclosing one, probably does nothing useful and can be removed. > fastcgi_pass unix:/var/run/php5-fpm.sock; > fastcgi_param HTTPS on; You may be able to use the $https variable there, if you want to share this config with both http and https servers *and* want to tell the php server the truth about the original connection. But that's not critical here. > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > include /etc/nginx/fastcgi_params; > } > location ~* ^/pma/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { > root /var/www/; > } That 3-line section, I don't think does anything useful as-is. With it, requests that match are served from the filesystem below /var/www/; while requests that don't match are served from the filesystem below /var/www/. Without it, requests won't match and so will be served from the filesystem below /var/www/. > } > location /PMA { > rewrite ^/* /pma last; > } That will match both /PMA and /PMA/, which are probably what you want. It will also match /PMAP, which may be unrelated; and it will match /PMA/file.png and rewrite it to just /pma, which may not be wanted. The rewrite itself could omit the "/*" part and have the same effect. I would suggest actively redirecting to the correct /pma/ url, rather than trying an internal rewrite -- but again, if what you have works for you, it's good enough. > I don't know if the key is the nested location block, or something else. > If anyone is able to point-out the fundamental differences between the > configuration snippet that I posted previously and the snippet above, > which actually works, I would be most appreciative. You posted a few snippets previously. That last ones where you reported 404s, I failed to reproduce the 404s. They worked for me. Possibly there was something else in the full configuration that meant that the location{}s you showed were not the chosen ones for the requests you made? f -- Francis Daly francis at daoine.org From lists at ruby-forum.com Thu Jun 27 02:46:13 2013 From: lists at ruby-forum.com (Lintao L.) Date: Thu, 27 Jun 2013 04:46:13 +0200 Subject: Dropped https client connection doesn't drop backend proxy_pass connection In-Reply-To: <1363321351.3854.140661204587653.70CC51E2@webmail.messagingengine.com> References: <1363321351.3854.140661204587653.70CC51E2@webmail.messagingengine.com> Message-ID: Hi everyone, I have the same problem. I really need this feature. how is this going? >> Maxim Dounin: > Valentin is already worked on this, and I believe he'll be able to > provide a little bit more generic patch. does this mean in the future we can use epoll to detect the client connection's abort? Best Regards, -- Lintao LI -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Thu Jun 27 07:22:46 2013 From: nginx-forum at nginx.us (nishalspace) Date: Thu, 27 Jun 2013 03:22:46 -0400 Subject: GPG error on Nginx repository - NO_PUBKEY In-Reply-To: <92184EC0-3F68-4E04-A1D9-325EC0046FAF@waeme.net> References: <92184EC0-3F68-4E04-A1D9-325EC0046FAF@waeme.net> Message-ID: <511d6d0264744ee9e24293b32268a695.NginxMailingListEnglish@forum.nginx.org> Even I was getting this error "W: GPG error: http://nginx.org lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62", so I started searching and landed here. And Yes, that mail thread reply really worked for me. $ wget http://nginx.org/packages/keys/nginx_signing.key $ cat nginx_signing.key | sudo apt-key add - OK $ apt-get update $apt-get install nginx It install version 1.4 which is latest I guess. Thanks, Prashant Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220381,240378#msg-240378 From reallfqq-nginx at yahoo.fr Thu Jun 27 15:41:48 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Thu, 27 Jun 2013 11:41:48 -0400 Subject: GPG error on Nginx repository - NO_PUBKEY In-Reply-To: <511d6d0264744ee9e24293b32268a695.NginxMailingListEnglish@forum.nginx.org> References: <92184EC0-3F68-4E04-A1D9-325EC0046FAF@waeme.net> <511d6d0264744ee9e24293b32268a695.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hello, VirtualBox website's instructionson how to install their Linux packages provides a great 1-line key adding command (key not stored in a file, simply piped to the standard input of apt-key): wget -q protocol://some.key -O- | sudo apt-key add - The Nginx website's page on Linux packages provides you with the key file address: http://nginx.org/en/linux_packages.html To sum-up, here is a quick how-to add the Nginx key to your keyring: wget -q http://nginx.org/en/linux_packages.html -O- | sudo apt-key add - Have a nice day, --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at indietorrent.org Thu Jun 27 16:42:34 2013 From: ben at indietorrent.org (Ben Johnson) Date: Thu, 27 Jun 2013 12:42:34 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <20130626213330.GL27406@craic.sysops.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> Message-ID: <51CC6B7A.9030906@indietorrent.org> On 6/26/2013 5:33 PM, Francis Daly wrote: > On Wed, Jun 26, 2013 at 10:22:21AM -0400, Ben Johnson wrote: > > Hi there, > >> I was able to accomplish my objective with some help from the tutorial >> at: > > It's good that you've got it working now. > > There are a few things that you might like to consider when deploying > it across all vhosts. > > First: for a request, nginx picks one server and then one location > to process things in. So for this configuration to be common across > multiple servers, you either must copy-paste it into each; or else put > it in an external file and "include" that file in each per-server config > that matters. > That's exactly what I've done; these directives reside within an include file that I include from within each vhost's main configuration. >> location /pma { > > Next, you probably want this to become "location ^~ /pma" -- or maybe > even "location ^~ /pma/", with a separate "location = /pma {return 301 > /pma/;}" block. > > http://nginx.org/r/location for the details of why that is. > > (Hint: try to access /pmap, or /index.php, and you may see that things > go wrong.) > Attempting to access /pmap yields a 404, and /index.php brings-up the site's primary index page (unrelated to PMA), but that may due to other "location {}" blocks that ISPConfig (which I'm using to create each vhost) includes in the nginx vhost configuration template. In any case, what you say makes sense, and I see how using a regular expression without a right-side anchor or a trailing slash could lead to unexpected results, as your examples describe. Do you happen to know if regular expressions in this context are anchored, implicitly, if a least one explicit anchor is not specified? >> root /var/www/; >> index index.php index.html index.htm; >> location ~ ^/pma/(.+\.php)$ { >> try_files $uri =404; >> root /var/www/; > > That line, because it is identical to the enclosing one, probably does > nothing useful and can be removed. > Are you referring to the two "root /var/www/" lines? If so, then what you say makes sense, and I'll remove the second/duplicate line. >> fastcgi_pass unix:/var/run/php5-fpm.sock; >> fastcgi_param HTTPS on; > > You may be able to use the $https variable there, if you want to share > this config with both http and https servers *and* want to tell the > php server the truth about the original connection. But that's not > critical here. > I don't want PMA (anything within the /pma/ location) to be accessible over a plaintext connection. In other words, I wish to force HTTPS. Do I need to add something something like this to the location block? rewrite ^ https://domain.com$request_uri? permanent; (Ideally, I would like the "domain.com" part to be dynamic, so it works for all vhosts; would I use $host, $server_name? Something else entirely?) >> fastcgi_index index.php; >> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; >> include /etc/nginx/fastcgi_params; >> } >> location ~* ^/pma/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { >> root /var/www/; >> } > > That 3-line section, I don't think does anything useful as-is. > > With it, requests that match are served from the filesystem below > /var/www/; while requests that don't match are served from the filesystem > below /var/www/. > > Without it, requests won't match and so will be served from the filesystem > below /var/www/. > I see; that makes sense, and I'll remove that location block. >> } >> location /PMA { >> rewrite ^/* /pma last; >> } > > That will match both /PMA and /PMA/, which are probably what you want. > > It will also match /PMAP, which may be unrelated; and it will match > /PMA/file.png and rewrite it to just /pma, which may not be wanted. > Ah! Right you are, sir. /PMAP and /PMA/file.png are matched, which is undesirable. > The rewrite itself could omit the "/*" part and have the same effect. > > I would suggest actively redirecting to the correct /pma/ url, rather > than trying an internal rewrite -- but again, if what you have works > for you, it's good enough. > I'm not the type to accept "good enough". I want it to be perfect :). What would be your preferred course of action to eliminate the internal rewrite and instead perform an external redirect for /pma, /PMA, and /PMA/ (all redirected to /pma/)? The documentation states, "There is no syntax for NOT matching a regular expression. Instead, match the target regular expression and assign an empty block, then use location / to match anything else." If I'm not mistaken, the location below would match all of the "incorrect" variants that I listed above: location ~* /pma { } But then I'm confused as to where the "return 301 /pma/;" needs to be placed, if anywhere. To be clear, I have a "normal website" running on this vhost (a customer's own site), so I had assumed that I can't use an empty location block, as the manual suggests, and fall-back to "location /". Somewhat surprisingly, including the above location block actually works to redirect /pma, /PMA, and /PMA/ to /pma, while still allowing the "normal site content" to function correctly. Is this because I have the following directive just before the PMA-related bit we've been discussing? location / { try_files $uri $uri/ @virtual; } location @virtual { if ($uri !~ '/$') { return 301 $uri/$is_args$args; } include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/lib/php5-fpm/web2.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; rewrite ^(.*)$ /index.php?q=$1 last; } >> I don't know if the key is the nested location block, or something else. >> If anyone is able to point-out the fundamental differences between the >> configuration snippet that I posted previously and the snippet above, >> which actually works, I would be most appreciative. > > You posted a few snippets previously. That last ones where you reported > 404s, I failed to reproduce the 404s. They worked for me. > > Possibly there was something else in the full configuration that meant > that the location{}s you showed were not the chosen ones for the requests > you made? > That is quite possible and very likely. I am adding my own directives to ISPConfig's nginx vhost configuration template, and at my limited level of experience with nginx, I probably failed to realize that my location blocks were being ignored in favor of another preferred match. > f > I really appreciate you sharing your time and expertise to get me off-the-ground. I am learning a lot from you and I am profoundly thankful for your detailed insights. Respectfully, -Ben From ben at indietorrent.org Thu Jun 27 16:55:22 2013 From: ben at indietorrent.org (Ben Johnson) Date: Thu, 27 Jun 2013 12:55:22 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC6B7A.9030906@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> Message-ID: <51CC6E7A.2070906@indietorrent.org> On 6/27/2013 12:42 PM, Ben Johnson wrote: > I'm not the type to accept "good enough". I want it to be perfect :). > > What would be your preferred course of action to eliminate the internal > rewrite and instead perform an external redirect for /pma, /PMA, and > /PMA/ (all redirected to /pma/)? > > The documentation states, "There is no syntax for NOT matching a regular > expression. Instead, match the target regular expression and assign an > empty block, then use location / to match anything else." > > If I'm not mistaken, the location below would match all of the > "incorrect" variants that I listed above: > > location ~* /pma { > > } > > But then I'm confused as to where the "return 301 /pma/;" needs to be > placed, if anywhere. > > To be clear, I have a "normal website" running on this vhost (a > customer's own site), so I had assumed that I can't use an empty > location block, as the manual suggests, and fall-back to "location /". > > Somewhat surprisingly, including the above location block actually works > to redirect /pma, /PMA, and /PMA/ to /pma, while still allowing the > "normal site content" to function correctly. > > Is this because I have the following directive just before the > PMA-related bit we've been discussing? > > location / { > try_files $uri $uri/ @virtual; > } > > location @virtual { > if ($uri !~ '/$') { > return 301 $uri/$is_args$args; > } > include /etc/nginx/fastcgi_params; > fastcgi_pass unix:/var/lib/php5-fpm/web2.sock; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > fastcgi_intercept_errors on; > rewrite ^(.*)$ /index.php?q=$1 last; > } A slight correction to part of my last reply. The location block that actually worked to redirect requests to incorrect variants of the /pma URL *did* contain the 301 redirect line: location ~* /pma { return 301 /pma/; } With this block, the "main site" seems to function as expected, and all of the redirects that I identified previously work as expected. Is this "incorrect" for any reason? Thanks again, -Ben From ben at indietorrent.org Thu Jun 27 17:02:30 2013 From: ben at indietorrent.org (Ben Johnson) Date: Thu, 27 Jun 2013 13:02:30 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC6B7A.9030906@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> Message-ID: <51CC7026.8040906@indietorrent.org> On 6/27/2013 12:42 PM, Ben Johnson wrote: > I don't want PMA (anything within the /pma/ location) to be accessible > over a plaintext connection. In other words, I wish to force HTTPS. > > Do I need to add something something like this to the location block? > > rewrite ^ https://domain.com$request_uri? permanent; > > (Ideally, I would like the "domain.com" part to be dynamic, so it works > for all vhosts; would I use $host, $server_name? Something else entirely?) I ended-up with this, and it seems to work as expected: location ^~ /pma/ { root /var/www/; if ($scheme = http) { return 301 https://$server_name$request_uri; } # ... } If there's a better way of achieving the same, I'd love to be informed. Thanks, -Ben From reallfqq-nginx at yahoo.fr Thu Jun 27 17:15:44 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Thu, 27 Jun 2013 13:15:44 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC7026.8040906@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> <51CC7026.8040906@indietorrent.org> Message-ID: Hello, On Thu, Jun 27, 2013 at 1:02 PM, Ben Johnson wrote: > > > On 6/27/2013 12:42 PM, Ben Johnson wrote: > > I don't want PMA (anything within the /pma/ location) to be accessible > > over a plaintext connection. In other words, I wish to force HTTPS. > > > > Do I need to add something something like this to the location block? > > > > rewrite ^ https://domain.com$request_uri? permanent; > > > > (Ideally, I would like the "domain.com" part to be dynamic, so it works > > for all vhosts; would I use $host, $server_name? Something else > entirely?) > > I ended-up with this, and it seems to work as expected: > > location ^~ /pma/ { > root /var/www/; > > if ($scheme = http) { > return 301 https://$server_name$request_uri; > } > > # ... > } > > If there's a better way of achieving the same, I'd love to be informed. > ? I would have kept the rewritestatement which was a good idea.? ?The produced redirect is always a 301 (not 302) when the replacement string starts with http(s) (check the doc page to which I provide the link).? Why would you replace it with a 'if' statement? http://wiki.nginx.org/IfIsEvil I guess you can use the variables in the rewrite directive aswell. > > Thanks, > > -Ben > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at indietorrent.org Thu Jun 27 18:08:24 2013 From: ben at indietorrent.org (Ben Johnson) Date: Thu, 27 Jun 2013 14:08:24 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> <51CC7026.8040906@indietorrent.org> Message-ID: <51CC7F98.1090306@indietorrent.org> On 6/27/2013 1:15 PM, B.R. wrote: > Hello, > > On Thu, Jun 27, 2013 at 1:02 PM, Ben Johnson > wrote: > > > > On 6/27/2013 12:42 PM, Ben Johnson wrote: > > I don't want PMA (anything within the /pma/ location) to be accessible > > over a plaintext connection. In other words, I wish to force HTTPS. > > > > Do I need to add something something like this to the location block? > > > > rewrite ^ https://domain.com$request_uri? permanent; > > > > (Ideally, I would like the "domain.com " part > to be dynamic, so it works > > for all vhosts; would I use $host, $server_name? Something else > entirely?) > > I ended-up with this, and it seems to work as expected: > > location ^~ /pma/ { > root /var/www/; > > if ($scheme = http) { > return 301 https://$server_name$request_uri; > } > > # ... > } > > If there's a better way of achieving the same, I'd love to be informed. > > ? > I would have kept the rewrite > > statement which was a good idea.? > > ?The produced redirect is always a 301 (not 302) when the replacement > string starts with http(s) (check the doc page to which I provide the > link).? > Why would you replace it with a 'if' statement? > http://wiki.nginx.org/IfIsEvil > > I guess you can use the variables in the rewrite directive aswell. > > > Thanks, > > -Ben > > --- > *B. R.* Thanks for the feedback, B. R. I resorted to the "if" control structure because, without it, the browser became stuck in a redirect-loop. (The reason for this is obvious.) Then again, I suppose that the redirect-loop would occur regardless of whether I use a "return 301" or "rewrite". How would you recommend avoiding the redirect-loop problem? I would really prefer no to have to define separate "server" blocks for ports 80 and 443, due to the complex nature of the hosting environment in which I'm working. Currently, all vhosts receive: server { listen *:80; listen *:443 ssl; } Without separating ports 80 and 443 into individual "server" blocks, I saw no way to avoid the loop without using an "if" structure. Am I missing something? Thanks again, -Ben From reallfqq-nginx at yahoo.fr Thu Jun 27 19:07:57 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Thu, 27 Jun 2013 15:07:57 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC7F98.1090306@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> <51CC7026.8040906@indietorrent.org> <51CC7F98.1090306@indietorrent.org> Message-ID: Hello again, I resorted to the "if" control structure because, without it, the > browser became stuck in a redirect-loop. (The reason for this is > obvious.) Then again, I suppose that the redirect-loop would occur > regardless of whether I use a "return 301" or "rewrite". > > How would you recommend avoiding the redirect-loop problem? > > ?To me, it seems that if you have an infinite llop problem, the redirect condition is not correct. I would redirect URI starting with 'http://' to the same starting with 'https://'. Once the 'https' location is requested, the redirect has no effect anymore... with the supplemental benefit of Nginx automatically? ?sending a permanent 301 redirection and not a temporary 302 one (which is the default, unless explicitly stated otherwise, if I remember well)?. I would really prefer no to have to define separate "server" blocks for > ports 80 and 443, due to the complex nature of the hosting environment > in which I'm working. > > Currently, all vhosts receive: > > server { > listen *:80; > > listen *:443 ssl; > } > > Without separating ports 80 and 443 into individual "server" blocks, I > saw no way to avoid the loop without using an "if" structure. > > ?IMHO, that's the sorrect way of doing things. You could also listen for IPv6 requests :o) ? > Am I missing something? > > Thanks again, > > -Ben > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at articatech.com Thu Jun 27 22:19:33 2013 From: david at articatech.com (David Touzeau) Date: Fri, 28 Jun 2013 00:19:33 +0200 Subject: JASIG CAS support/detection Message-ID: Dear I need to force Nginx to detect if client have a valid CAS ticket and be authentified to the CAS system. This to allow or ban access to websites. Is anybody have tried to build this infrastructure ? I have tried the CAS Module for nginx but is seems an old module that did not support latest nginx version. https://github.com/bnoordhuis/ngx_http_auth_cas_module Best regards From francis at daoine.org Thu Jun 27 23:04:35 2013 From: francis at daoine.org (Francis Daly) Date: Fri, 28 Jun 2013 00:04:35 +0100 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC6B7A.9030906@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> Message-ID: <20130627230435.GM27406@craic.sysops.org> On Thu, Jun 27, 2013 at 12:42:34PM -0400, Ben Johnson wrote: > On 6/26/2013 5:33 PM, Francis Daly wrote: > > On Wed, Jun 26, 2013 at 10:22:21AM -0400, Ben Johnson wrote: Hi there, > That's exactly what I've done; these directives reside within an include > file that I include from within each vhost's main configuration. Good stuff. Note that "include" is sort-of invisible to the rest of the nginx configuration, so the rules for selecting the one location{} which handles a request may lead to different results depending on where in the file the "include" line is, if you use any regex location blocks. (The easy way to avoid that is not to use any top-level regex locations.) > >> location /pma { > > > > Next, you probably want this to become "location ^~ /pma" -- or maybe > > even "location ^~ /pma/", with a separate "location = /pma {return 301 > > /pma/;}" block. > > > > http://nginx.org/r/location for the details of why that is. > > > > (Hint: try to access /pmap, or /index.php, and you may see that things > > go wrong.) > > > > Attempting to access /pmap yields a 404, That's what I expect. I suspect that even after you add the file $document_root/pmap, it will still yield a 404, which may not be what you expect. > and /index.php brings-up the > site's primary index page (unrelated to PMA), That is a bit of a surprise to me; but it does all depend on what top-level location definitions appear in the server block. > In any case, what you say makes sense, and I see how using a regular > expression without a right-side anchor or a trailing slash could lead to > unexpected results, as your examples describe. > > Do you happen to know if regular expressions in this context are > anchored, implicitly, if a least one explicit anchor is not specified? I do; they aren't; but these aren't regular expressions. The characters after the word "location" mean something. Check the docs if you're not clear on exactly which location is used for each request -- it'll make further configuration understanding much easier. > > That line, because it is identical to the enclosing one, probably does > > nothing useful and can be removed. > > Are you referring to the two "root /var/www/" lines? If so, then what > you say makes sense, and I'll remove the second/duplicate line. Correct. "root" is inherited, so setting it like this is unnecessary but not incorrect. It only becomes incorrect if you change one and expect the other to auto-change. > >> fastcgi_pass unix:/var/run/php5-fpm.sock; > >> fastcgi_param HTTPS on; > > > > You may be able to use the $https variable there, if you want to share > > this config with both http and https servers *and* want to tell the > > php server the truth about the original connection. But that's not > > critical here. > > I don't want PMA (anything within the /pma/ location) to be accessible > over a plaintext connection. In other words, I wish to force HTTPS. Ah, ok. That fastcgi_param line merely tells the php server that https was used to access this url. With $https, it would tell the php server whether https was used to access this url. > Do I need to add something something like this to the location block? Yes. You've got the right answer in another mail. > What would be your preferred course of action to eliminate the internal > rewrite and instead perform an external redirect for /pma, /PMA, and > /PMA/ (all redirected to /pma/)? Keep it simple. location = /pma { return 301 /pma/; } location = /PMA { return 301 /pma/; } location = /PMA/ { return 301 /pma/; } > If I'm not mistaken, the location below would match all of the > "incorrect" variants that I listed above: > > location ~* /pma { That location would match any url that contains the four character string, case insensitive, "/pma". Unless the url was already matched by another ^~ or ~ or ~* location. > To be clear, I have a "normal website" running on this vhost (a > customer's own site), so I had assumed that I can't use an empty > location block, as the manual suggests, and fall-back to "location /". The details matter. One request, one location. When you list all of the top-level locations in the server{}, then you should be able to say which one will match a particular request. (After considering rewrites.) "empty location block" usually means "serve from the filesystem". > Somewhat surprisingly, including the above location block actually works > to redirect /pma, /PMA, and /PMA/ to /pma, while still allowing the > "normal site content" to function correctly. Does it also allow you to get at /pma/index.php? That would surprise me -- but that's because I'm guessing what the rest of the configuration is. > Is this because I have the following directive just before the > PMA-related bit we've been discussing? Maybe. The full list of the top-level location lines should make it clear to you, along with any server-level rewrite module directives. > I really appreciate you sharing your time and expertise to get me > off-the-ground. I am learning a lot from you and I am profoundly > thankful for your detailed insights. You're welcome. Glad to be of help. f -- Francis Daly francis at daoine.org From francis at daoine.org Thu Jun 27 23:08:18 2013 From: francis at daoine.org (Francis Daly) Date: Fri, 28 Jun 2013 00:08:18 +0100 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC6E7A.2070906@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> <51CC6E7A.2070906@indietorrent.org> Message-ID: <20130627230818.GN27406@craic.sysops.org> On Thu, Jun 27, 2013 at 12:55:22PM -0400, Ben Johnson wrote: > On 6/27/2013 12:42 PM, Ben Johnson wrote: Hi there, > location ~* /pma { > return 301 /pma/; > } > > With this block, the "main site" seems to function as expected, and all > of the redirects that I identified previously work as expected. > > Is this "incorrect" for any reason? If what you have works, it is correct enough. Generally, the advice is that top-level (non-nested) regex locations are bad because they tend to need more thinking when adding yet more locations. If you don't intend to add more locations, then this badness is irrelevant. f -- Francis Daly francis at daoine.org From francis at daoine.org Thu Jun 27 23:13:35 2013 From: francis at daoine.org (Francis Daly) Date: Fri, 28 Jun 2013 00:13:35 +0100 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <51CC7026.8040906@indietorrent.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> <51CC7026.8040906@indietorrent.org> Message-ID: <20130627231335.GO27406@craic.sysops.org> On Thu, Jun 27, 2013 at 01:02:30PM -0400, Ben Johnson wrote: > On 6/27/2013 12:42 PM, Ben Johnson wrote: Hi there, > > I don't want PMA (anything within the /pma/ location) to be accessible > > over a plaintext connection. In other words, I wish to force HTTPS. > location ^~ /pma/ { > root /var/www/; > > if ($scheme = http) { > return 301 https://$server_name$request_uri; > } > > # ... > } > > If there's a better way of achieving the same, I'd love to be informed. The usual suggestion is that different server configurations best live in different server blocks. You have other reasons not to want to do that here -- including the repetition aspect. I'd say that what you have here is the best way. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Fri Jun 28 05:19:12 2013 From: nginx-forum at nginx.us (smith121) Date: Fri, 28 Jun 2013 01:19:12 -0400 Subject: adding expires but not show up in headers In-Reply-To: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> References: <89c41afb3f24852ebffa8c10db8e1999.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2099d108fc794dcd9a657b2227ecb336.NginxMailingListEnglish@forum.nginx.org> Read news update here daily. We introduce new gadgets. [URL="http://viktorix.com/"]Event Planning[/URL]. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240201,240401#msg-240401 From nginx+phil at spodhuis.org Fri Jun 28 06:15:08 2013 From: nginx+phil at spodhuis.org (Phil Pennock) Date: Fri, 28 Jun 2013 02:15:08 -0400 Subject: GPG error on Nginx repository - NO_PUBKEY In-Reply-To: References: <92184EC0-3F68-4E04-A1D9-325EC0046FAF@waeme.net> <511d6d0264744ee9e24293b32268a695.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130628061508.GA12850@redoubt.spodhuis.org> On 2013-06-27 at 11:41 -0400, B.R. wrote: > The Nginx website's page on Linux > packages provides you with the key file address: > http://nginx.org/en/linux_packages.html You mean: http://nginx.org/keys/nginx_signing.key (And if you import a file retrieved over plain http straight into your trust anchors with no further verification, you have other problems). -Phil From nginx-forum at nginx.us Fri Jun 28 10:21:08 2013 From: nginx-forum at nginx.us (Danack) Date: Fri, 28 Jun 2013 06:21:08 -0400 Subject: Nginx X-Accel-Redirect stripping Content-Encoding header Message-ID: <34b830887f1596bdf0d932777aa29870.NginxMailingListEnglish@forum.nginx.org> I have Nginx setup to allow requests to be served with the X-Accel-Redirect header. This works fine for images, but I'm trying to get it to work for Javascript files that are already gzip'ed on the disk. It appears Nginx is stripping off the 'Content-Encoding: gzip' header. This makes the browser not unzip the content when it receives it, which obviously makes it not work. Is it possible to make Nginx preserve the Content-Encoding header to allow pre-gzipped content through X-Accel-Redirect? Or is there another way to allow this work? The headers seen are: With Accel = doesn't work Accept-Ranges:bytes Cache-Control:max-age=1209600, s-maxage=120960 Connection:keep-alive Content-Length:125499 Content-Type:application/javascript Date:Fri, 28 Jun 2013 09:52:33 GMT ETag:"51c8efa3-1ea3b" Expires:Fri, 12 Jul 2013 09:52:33 GMT Last-Modified:Tue, 25 Jun 2013 01:17:23 GMT Server:nginx/1.4.1 No accel = works Cache-Control:max-age=1209600, s-maxage=120960 Connection:keep-alive Content-Encoding:gzip Content-Length:125499 Content-Type:application/javascript Date:Fri, 28 Jun 2013 09:53:04 GMT Expires:Fri, 12 Jul 2013 09:53:04 GMT HTTP1/0 200 Ok: Pragma:cache Server:nginx/1.4.1 X-Powered-By:PHP/5.4.9 In case it's relevant, the code that is serving the content is: [code] public static function proxyFile($fileNameToServe, $mimeType, $alreadyGzip = false){ $seconds_to_cache = 3600 * 24 * 7 * 2; if ($alreadyGzip) { header('Content-Encoding: gzip'); $filesize = filesize($fileNameToServe); header('Content-Length: '.$filesize); } if(defined('X-ACCEL-REDIRECT') == true && constant('X-ACCEL-REDIRECT') == true){ $filenameToProxy = str_replace(PATH_TO_ROOT."var/cache", '/protected_files', $fileNameToServe ); sendProxyHeaders($mimeType, $seconds_to_cache); header("X-Accel-Redirect: ".$filenameToProxy); exit(0); } else{ sendProxyHeaders($mimeType, $seconds_to_cache); $fileHandle = fopen($fileNameToServe, 'r'); if($fileHandle == false){ throw new \Exception("Failed to open file [$fileNameToServe] for serving."); } while (!feof($fileHandle)) { $contents = fread($fileHandle, 8192); echo $contents; } fclose($fileHandle); } exit(0); } function sendProxyHeaders($mimeType, $seconds_to_cache, $secondsForCDNToCache = false){ $currentTimeStamp = gmdate("D, d M Y H:i:s", time()) . " GMT"; $timeStamp = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT"; if($secondsForCDNToCache === false){ $secondsForCDNToCache = intval($seconds_to_cache / 10); } header("HTTP1/0 200 Ok"); header("Content-Type: $mimeType"); header("Date: $currentTimeStamp"); header("Expires: $timeStamp"); header("Pragma: cache"); //max-age = browser max age //s-maxage = intermediate (cache e.g. CDN) header("Cache-Control: max-age=$seconds_to_cache, s-maxage=$secondsForCDNToCache"); } [/code] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240406,240406#msg-240406 From mdounin at mdounin.ru Fri Jun 28 10:38:21 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 28 Jun 2013 14:38:21 +0400 Subject: Nginx X-Accel-Redirect stripping Content-Encoding header In-Reply-To: <34b830887f1596bdf0d932777aa29870.NginxMailingListEnglish@forum.nginx.org> References: <34b830887f1596bdf0d932777aa29870.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20130628103821.GK20717@mdounin.ru> Hello! On Fri, Jun 28, 2013 at 06:21:08AM -0400, Danack wrote: > I have Nginx setup to allow requests to be served with the X-Accel-Redirect > header. This works fine for images, but I'm trying to get it to work for > Javascript files that are already gzip'ed on the disk. > > It appears Nginx is stripping off the 'Content-Encoding: gzip' header. This > makes the browser not unzip the content when it receives it, which obviously > makes it not work. > > Is it possible to make Nginx preserve the Content-Encoding header to allow > pre-gzipped content through X-Accel-Redirect? Or is there another way to > allow this work? Any headers from the original response (the one with X-Accel-Redirect) might be preserved using the $upstream_http_* variables. Something like this should work: location /files/ { internal; add_header Content-Encoding $upstream_http_content_encoding; } This might not work well with nginx gzip filter though. Better solution might be to just return X-Accel-Redirect to an unrompressed file, and use gzip_static to serve precompressed files if they are available and supported by a client, see http://nginx.org/r/gzip_static. -- Maxim Dounin http://nginx.org/en/donation.html From nginx-forum at nginx.us Fri Jun 28 12:29:42 2013 From: nginx-forum at nginx.us (Danack) Date: Fri, 28 Jun 2013 08:29:42 -0400 Subject: Nginx X-Accel-Redirect stripping Content-Encoding header In-Reply-To: <20130628103821.GK20717@mdounin.ru> References: <20130628103821.GK20717@mdounin.ru> Message-ID: > Something like this should work: > > location /files/ { > internal; > add_header Content-Encoding $upstream_http_content_encoding; > } Thanks yep that worked. > This might not work well with nginx gzip filter though. And yes, I had to turn gzip off for the internal location used for x-accel-redirect, otherwise it was setting the Content-Encoding header twice. > Better solution might be to just return X-Accel-Redirect to an > uncompressed file, and use gzip_static to serve precompressed > files if they are available and supported by a client, see > http://nginx.org/r/gzip_static. Thanks for the tip. cheers Dan Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240406,240410#msg-240410 From nginx-forum at nginx.us Fri Jun 28 13:24:46 2013 From: nginx-forum at nginx.us (mex) Date: Fri, 28 Jun 2013 09:24:46 -0400 Subject: check_nginx_status - nagios-plugin to monitor nginx status Message-ID: check_nginx_status is (yet another) Nagios-Plugin to monitor nginx status and alerts on various values, based on HttpStubStatus it also creates, based on the returned values, a csv to store data docs&downloads: http://doxi-news.blogspot.de/2013/06/checknginxstatus-nagios-plugin-to.html (with screenshots) https://bitbucket.org/maresystem/dogtown-nagios-plugins Usage: check_nginx_status [-H|--HOST] [-p|--port] [-u|--url] [-a|--auth] [-s|--ssl] [-t|--test] [-w|--warning] [-c|--critical] [-o|--output] [-r|--resultfile] [-h|--help] [-v|--version] [-d|--debug] Options: --help|-h) print check_nginx_status help --HOST|-H) Sets nginx host Default: localhost --port|-p) Sets connection-port Default: 80/http, 443/https --ssl|-s) Turns on SSL Default: off --url|-u) Sets nginx status url path. Default: /nginx_status --auth|-a) Sets nginx status BasicAuth user:password. Default: off *** --test|-t) Sets the test(check)_value for w/c if used, -w/-c is mandatory Default: checktime possible Values: active_conns -> active connections accepts_err -> difference between accepted and handled requests (should be 0) requests -> check for requests/connection reading -> actual value for reading headers writing -> value for active requests waiting -> actual keep-alive-connections checktime -> checks if this check need more than given -w/-c milliseconds --calculated checks --------------- rps -> requests per seconds cps -> connections per second dreq -> delta requests to the previous one dcon -> delta connections to the previous one these checks are calculated at runtime with a timeframe between the latest and the current check; time is extracted from the timestamp of the result_file to disable calculation (no files are written) use -n; you cannot use -t [rps,cps,dreq,dcon] with -n; this will raise an error and the plugin returns UNKNOWN see -r - option for an alternate filepath for temporary results --warning|-w) Sets a warning level for selected test(check) Default: off --critical|-c) Sets a critical level for selected test(check) Default: off --debug|-d) turn on debugging - messages (use this for manual testing, never via nagios-checks; beware of the messy output Default: off --version|-v) display version and exit --output|-o) output only values from selected tests in perfdata; if used w/out -t the check returns the value for active connections --resultfile|-r) /path/to/check_nginx.results{.csv} please note, beside the values from the actual check (eg.g check_nginx.results) a second file is created, if not existent, and written on each plugin-run (check_nginx.results.csv), containign a historic view on all extracted values default: /tmp/check_nginx.results{.csv} --noresult|-n) never write a results-file; CANNOT be used with calculated checks -t [rps|cps|dreq|dcon] default: off *** ) -> please dont use this option, not implemented or not functional Examples: just get all perfdata, url is default (/nginx_status) ./check_nginx_status --HOST www.example.com just get active connections perfdata ./check_nginx_status -H www.example.com -o check for plugin_checktime, error > 10ms (warning) or 50ms (error) and output only perfdata for that values ./check_nginx_status -H www.example.com -u /status -w 10 -c 50 -o check for active connections, alert on > 500/2000 active connections ./check_nginx_status -H www.example.com -u /status -t active_conn -w 500 -c 2000 Check for accepts_errors ./check_nginx_status -H www.example.com -t accepts_err -w 1 -c 50 Performancedata: NginxStatus.Check OK | ac=1;acc=64; han=64; req=64; err=0; rpc=1; rps=0; cps=0; dreq=1; dcon=1; read=0; writ=1; wait=0; ct=6ms; ac -> active connections acc -> totally accepted connections han -> totally handled connections req -> total requests err -> diff between acc - han, thus errors rpc -> requests per connection (req/han) rps -> requests per second (calculated) from last checkrun vs actual values cps -> connections per (calculated) from last checkrun vs actual values dreq -> request-delta from last checkrun vs actual values dcon -> accepted-connection-delta from last checkrun vs actual values read -> reading requests from clients writ -> reading request body, processes request, or writes response to a client wait -> keep-alive connections, actually it is ac - (read + writ) ct -> checktime (connection time) for this check rpc/rps/dreq/dcon are always set to 0 if -n is used Nginx-Config be sure to have your nginx compiled with Status-Module (--with-http_stub_status_module), you might want to test your installation with nginx -V http://wiki.nginx.org/HttpStubStatusModule location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } Requirements: nginx compiled with HttpStubStatusModule (see Nginx-Config) python 2.x this plugin is not yet compatible with python 3.x, but it should be easy to convert, using 2to3 Docs & Download: https://bitbucket.org/maresystem/dogtown-nagios-plugins ------------------------------ comments appreciated regards, mex Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240412,240412#msg-240412 From sb at waeme.net Fri Jun 28 13:27:49 2013 From: sb at waeme.net (Sergey Budnevitch) Date: Fri, 28 Jun 2013 17:27:49 +0400 Subject: GPG error on Nginx repository - NO_PUBKEY In-Reply-To: <20130628061508.GA12850@redoubt.spodhuis.org> References: <92184EC0-3F68-4E04-A1D9-325EC0046FAF@waeme.net> <511d6d0264744ee9e24293b32268a695.NginxMailingListEnglish@forum.nginx.org> <20130628061508.GA12850@redoubt.spodhuis.org> Message-ID: On 28 Jun2013, at 10:15 , Phil Pennock wrote: > On 2013-06-27 at 11:41 -0400, B.R. wrote: >> The Nginx website's page on Linux >> packages provides you with the key file address: >> http://nginx.org/en/linux_packages.html > > You mean: > http://nginx.org/keys/nginx_signing.key > > (And if you import a file retrieved over plain http straight into your > trust anchors with no further verification, you have other problems). We've added short explanation with links to gpg docs about how and why pgp signatures should be checked: http://nginx.org/en/linux_packages.html#signatures From david at articatech.com Fri Jun 28 13:48:47 2013 From: david at articatech.com (David Touzeau) Date: Fri, 28 Jun 2013 15:48:47 +0200 Subject: C.A.S checking/detections Message-ID: <5221FF26048746AB8477A7626E5D3A38@fr.kaspersky.com> Dear I need to force Nginx to detect if client have a valid CAS ticket and be authentified to the CAS system. This to allow or ban access to websites. Is anybody have tried to build this infrastructure ? I have tried the CAS Module for nginx but is seems an old module that did not support latest nginx version. https://github.com/bnoordhuis/ngx_http_auth_cas_module Best regards From rkearsley at blueyonder.co.uk Fri Jun 28 16:11:01 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Fri, 28 Jun 2013 17:11:01 +0100 Subject: mp4 atom too large Message-ID: <51CDB595.70402@blueyonder.co.uk> Hi I use ngx_http_mp4_module quite heavily, and very occasionally I see this error for a few files: mp4 atom too large:723640794 With the number differing.. Is the number the size of the atom in bytes? If so, 723640794 is around 690MB and the mp4 file is only around 150MB The same file works with the "other" mp4 module What can we do to find the problem? Many thanks From rkearsley at blueyonder.co.uk Fri Jun 28 16:19:25 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Fri, 28 Jun 2013 17:19:25 +0100 Subject: mp4 atom too large In-Reply-To: <51CDB595.70402@blueyonder.co.uk> References: <51CDB595.70402@blueyonder.co.uk> Message-ID: <51CDB78D.3050906@blueyonder.co.uk> nginx version: nginx/1.4.1 built by gcc 4.2.1 20070831 patched [FreeBSD] TLS SNI support enabled configure arguments: --with-debug --with-http_ssl_module --with-http_stub_status_module --with-file-aio --with-http_flv_module --with-http_mp4_module --with-http_geoip_module --add-module=../../../lua-nginx-module before u ask :) On 28/06/13 17:11, Richard Kearsley wrote: > Hi > > I use ngx_http_mp4_module quite heavily, and very occasionally I see > this error for a few files: > > mp4 atom too large:723640794 > > With the number differing.. Is the number the size of the atom in bytes? > If so, 723640794 is around 690MB and the mp4 file is only around 150MB > > The same file works with the "other" mp4 module > > What can we do to find the problem? > > Many thanks > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From luky-37 at hotmail.com Fri Jun 28 16:57:42 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Fri, 28 Jun 2013 18:57:42 +0200 Subject: mp4 atom too large In-Reply-To: <51CDB595.70402@blueyonder.co.uk> References: <51CDB595.70402@blueyonder.co.uk> Message-ID: Hi! ---------------------------------------- > Date: Fri, 28 Jun 2013 17:11:01 +0100 > From: rkearsley at blueyonder.co.uk > To: nginx at nginx.org > Subject: mp4 atom too large > > Hi > > I use ngx_http_mp4_module quite heavily, and very occasionally I see > this error for a few files: > > mp4 atom too large:723640794 > > With the number differing.. Is the number the size of the atom in bytes? > If so, 723640794 is around 690MB and the mp4 file is only around 150MB Try increasing mp4_max_buffer_size: http://nginx.org/en/docs/http/ngx_http_mp4_module.html Also make sure the MP4 file has the atom at the beginning of the file. Regards, Lukas From reallfqq-nginx at yahoo.fr Fri Jun 28 17:09:00 2013 From: reallfqq-nginx at yahoo.fr (B.R.) Date: Fri, 28 Jun 2013 13:09:00 -0400 Subject: GPG error on Nginx repository - NO_PUBKEY In-Reply-To: References: <92184EC0-3F68-4E04-A1D9-325EC0046FAF@waeme.net> <511d6d0264744ee9e24293b32268a695.NginxMailingListEnglish@forum.nginx.org> <20130628061508.GA12850@redoubt.spodhuis.org> Message-ID: Hello, On Fri, Jun 28, 2013 at 9:27 AM, Sergey Budnevitch wrote: > > On 28 Jun2013, at 10:15 , Phil Pennock wrote: > > > On 2013-06-27 at 11:41 -0400, B.R. wrote: > >> The Nginx website's page on > Linux > >> packages provides you with the key file address: > >> http://nginx.org/en/linux_packages.html > > > > You mean: > > http://nginx.org/keys/nginx_signing.key > ?You are right... Copy-paste trouble... :o) ? > > > > (And if you import a file retrieved over plain http straight into your > > trust anchors with no further verification, you have other problems). > ?You are? right, that what people *shall* do (and they also shall not pass). However, I was merely summing up the steps provided before which were not mentioning that either. But you're right: there is one step missing. > We've added short explanation with links to gpg docs about how > and why pgp signatures should be checked: > > http://nginx.org/en/linux_packages.html#signatures > ?The link to Dewinter's website is broken. Maybe would you like to replace it with http://www.gnupg.org/documentation/howtos.en.html?? > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > --- *B. R.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at indietorrent.org Fri Jun 28 18:03:08 2013 From: ben at indietorrent.org (Ben Johnson) Date: Fri, 28 Jun 2013 14:03:08 -0400 Subject: Trouble adding /pma location to all virtual hosts In-Reply-To: <20130627231335.GO27406@craic.sysops.org> References: <51C9FB1A.5030406@indietorrent.org> <51CAF91D.5050200@indietorrent.org> <20130626213330.GL27406@craic.sysops.org> <51CC6B7A.9030906@indietorrent.org> <51CC7026.8040906@indietorrent.org> <20130627231335.GO27406@craic.sysops.org> Message-ID: <51CDCFDC.6030402@indietorrent.org> On 6/27/2013 7:13 PM, Francis Daly wrote: > On Thu, Jun 27, 2013 at 01:02:30PM -0400, Ben Johnson wrote: >> On 6/27/2013 12:42 PM, Ben Johnson wrote: > > Hi there, > >>> I don't want PMA (anything within the /pma/ location) to be accessible >>> over a plaintext connection. In other words, I wish to force HTTPS. > >> location ^~ /pma/ { >> root /var/www/; >> >> if ($scheme = http) { >> return 301 https://$server_name$request_uri; >> } >> >> # ... >> } >> >> If there's a better way of achieving the same, I'd love to be informed. > > The usual suggestion is that different server configurations best live > in different server blocks. > > You have other reasons not to want to do that here -- including the > repetition aspect. > > I'd say that what you have here is the best way. > > f > Hi, Francis, I've taken your good advice and swapped location ~* /webmail { return 301 /webmail/; } for location = /webmail { return 301 /pma/; } location = /WEBMAIL { return 301 /pma/; } location = /WEBMAIL/ { return 301 /pma/; } The latter form is simpler, its effect is obvious, and it seems less prone to cause unexpected results if new locations are ever added. On the whole, I've avoided top-level regex locations for the reason you mentioned. Again, sound advice. Everything else you say in your previous replies makes sense; you've answered all of my questions (and then some!). Excellent. Everything seems to be in good working order here. Thanks again, Francis, -Ben From rkearsley at blueyonder.co.uk Sat Jun 29 08:50:53 2013 From: rkearsley at blueyonder.co.uk (Richard Kearsley) Date: Sat, 29 Jun 2013 09:50:53 +0100 Subject: mp4 atom too large In-Reply-To: References: <51CDB595.70402@blueyonder.co.uk> Message-ID: <51CE9FED.9040908@blueyonder.co.uk> Hi I already checked there, I'm getting a different error ("mp4 atom too large" != "mp4 moov atom is too large") My error message seems to have been added in this patch http://nginx.org/download/patch.2012.mp4.txt In any case, the example given there gives a reasonable example, as '12583268' is around 12MB so increasing it by 2MB would not be an issue However in my case, the value given is '723640794' which is around 690MB which is bigger than the actual file! I believe nginx is reading this information wrong in some way, either by the mp4 file being invalid or a bug Either way, I would like help to understand the error Thanks On 28/06/13 17:57, Lukas Tribus wrote: > Hi! > > ---------------------------------------- >> Date: Fri, 28 Jun 2013 17:11:01 +0100 >> From: rkearsley at blueyonder.co.uk >> To: nginx at nginx.org >> Subject: mp4 atom too large >> >> Hi >> >> I use ngx_http_mp4_module quite heavily, and very occasionally I see >> this error for a few files: >> >> mp4 atom too large:723640794 >> >> With the number differing.. Is the number the size of the atom in bytes? >> If so, 723640794 is around 690MB and the mp4 file is only around 150MB > > > Try increasing mp4_max_buffer_size: > http://nginx.org/en/docs/http/ngx_http_mp4_module.html > > > Also make sure the MP4 file has the atom at the beginning of the file. > > > > > Regards, > > Lukas > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From luky-37 at hotmail.com Sat Jun 29 12:03:55 2013 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sat, 29 Jun 2013 14:03:55 +0200 Subject: mp4 atom too large In-Reply-To: <51CE9FED.9040908@blueyonder.co.uk> References: <51CDB595.70402@blueyonder.co.uk>, , <51CE9FED.9040908@blueyonder.co.uk> Message-ID: Hi Richard, > I already checked there, I'm getting a different error ("mp4 atom too > large" != "mp4 moov atom is too large") > My error message seems to have been added in this patch > http://nginx.org/download/patch.2012.mp4.txt > In any case, the example given there gives a reasonable example, as > '12583268' is around 12MB so increasing it by 2MB would not be an issue > However in my case, the value given is '723640794' which is around 690MB > which is bigger than the actual file! I see. Is this limited to certain files, and can you reliable reproduce this issue on those files? Can you rerun those files through a mp4 demuxer/muxer, so that the atom is rebuild? I believe there is a good possibility that the atom in the mp4 files is bogus, either due to a muxer bug or a truncated file. You can do this with mp4box [1]: ? MP4Box -inter 500 -out output.mp4 input.mp4 ? I looks like you are running on FreeBSD, can you clarify the release and what platform you are running (x64, i586, or else?). Also, reproducing this with fully enabled debugging will probably help the developers (if this is really a bug in the mp4 module): http://nginx.org/en/docs/debugging_log.html > The same file works with the "other" mp4 module That doesn't necessarly mean there is a bug in the nginx module, the "other" module could just ignore bogus atom for example. [1] http://gpac.wp.mines-telecom.fr/mp4box/ Regards, Lukas From nginx-forum at nginx.us Sun Jun 30 00:03:08 2013 From: nginx-forum at nginx.us (ctrlbrk) Date: Sat, 29 Jun 2013 20:03:08 -0400 Subject: 1.4.1 SPDY error FIXME: chain too big in spdy filter In-Reply-To: <9cf38281e8a60d8aff1f5a591afae5d6.NginxMailingListEnglish@forum.nginx.org> References: <201305301916.03455.vbart@nginx.com> <9cf38281e8a60d8aff1f5a591afae5d6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <38422f0d72a15b4b203000c802a5ac3f.NginxMailingListEnglish@forum.nginx.org> ctrlbrk Wrote: ------------------------------------------------------- > BTW, I use > > fastcgi_buffers 16 2048k; > fastcgi_buffer_size 2048k; > fastcgi_busy_buffers_size 2048k; > > So I am under the 16MB, unless you are applying it *16? Bump for suggestions please Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239647,240426#msg-240426 From nginx-forum at nginx.us Sun Jun 30 21:10:23 2013 From: nginx-forum at nginx.us (kgk) Date: Sun, 30 Jun 2013 17:10:23 -0400 Subject: How does FastCGI work under the covers? Message-ID: Hello Everybody, I have a simple question about the Nginx FastCGI implementation. Let's say that 1,000 web browsers are requesting pages from our server, and we're using FastCGI within Nginx. While the FastCGI specification permits sending little pieces of each request ("multiplexing" them), my understanding is that most (all?) implementations don't do this. Therefore, (1) does Nginx FastCGI provide exactly one complete HTTP request at a time? (2) does Nginx FastCGI want us to respond to that particular HTTP request before it gives us the next one? The reason that I ask is this: If my FastCGI server is high-latency, I'm wondering if it can get lots of requests to work on, or if it will have to finish one and only then get the next one, and only Nginx knows the answer to this question. :) Many thanks for your kind help, and I hope that I didn't miss the answer to this question in my search of the archives. kgk Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240429,240429#msg-240429 From mdounin at mdounin.ru Sun Jun 30 22:27:12 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 1 Jul 2013 02:27:12 +0400 Subject: mp4 atom too large In-Reply-To: <51CE9FED.9040908@blueyonder.co.uk> References: <51CDB595.70402@blueyonder.co.uk> <51CE9FED.9040908@blueyonder.co.uk> Message-ID: <20130630222711.GM20717@mdounin.ru> Hello! On Sat, Jun 29, 2013 at 09:50:53AM +0100, Richard Kearsley wrote: > Hi > > I already checked there, I'm getting a different error ("mp4 atom > too large" != "mp4 moov atom is too large") > My error message seems to have been added in this patch > http://nginx.org/download/patch.2012.mp4.txt > In any case, the example given there gives a reasonable example, as > '12583268' is around 12MB so increasing it by 2MB would not be an > issue > However in my case, the value given is '723640794' which is around > 690MB which is bigger than the actual file! > I believe nginx is reading this information wrong in some way, > either by the mp4 file being invalid or a bug > Either way, I would like help to understand the error The message in question means that the file is broken - the size of a mp4 atom recorded in the file is greater than the file size. If there are reasons to assume the file is ok, debug log should give you enough information to compare what nginx thinks with what is in the file. -- Maxim Dounin http://nginx.org/en/donation.html From mdounin at mdounin.ru Sun Jun 30 22:34:57 2013 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 1 Jul 2013 02:34:57 +0400 Subject: How does FastCGI work under the covers? In-Reply-To: References: Message-ID: <20130630223457.GN20717@mdounin.ru> Hello! On Sun, Jun 30, 2013 at 05:10:23PM -0400, kgk wrote: > Hello Everybody, > > I have a simple question about the Nginx FastCGI implementation. Let's say > that 1,000 web browsers are requesting pages from our server, and we're > using FastCGI within Nginx. > > While the FastCGI specification permits sending little pieces of each > request ("multiplexing" them), my understanding is that most (all?) > implementations don't do this. Therefore, > > (1) does Nginx FastCGI provide exactly one complete HTTP request at a > time? > > (2) does Nginx FastCGI want us to respond to that particular HTTP request > before it gives us the next one? > > The reason that I ask is this: If my FastCGI server is high-latency, I'm > wondering if it can get lots of requests to work on, or if it will have to > finish one and only then get the next one, and only Nginx knows the answer > to this question. :) FastCGI multiplexing isn't used by nginx. That is, within a single connection to a fastcgi application only one request is sent, and then nginx will wait for a response. More connections will be opened if there are multiple simulteneous requests. -- Maxim Dounin http://nginx.org/en/donation.html