From gelonida at gmail.com Thu Mar 1 01:47:40 2012 From: gelonida at gmail.com (Gelonida N) Date: Thu, 01 Mar 2012 02:47:40 +0100 Subject: dav module temp files In-Reply-To: <20120229142702.GG67687@mdounin.ru> References: <3C1C33B5FA39499B8C2AFF8FE27BF799@DD21> <20120229142702.GG67687@mdounin.ru> Message-ID: On 02/29/2012 03:27 PM, Maxim Dounin wrote: > Hello! > > On Wed, Feb 29, 2012 at 01:55:42PM +0200, Reinis Rozitis wrote: > >> Hello, >> is there a technical reason why the WebDAV module (for PUTs) always >> makes a temp file rather than use/honour memory buffer >> (client_body_buffer_size)? > > It will use memory buffer for intermediate data, but as it needs > file on disk anyway - data are always written to a file. > > Maxim Dounin Just a tiny idea. (but perhaps this is already the case) Ideally the temp file should be on the same file system than the target file) Otherwise the file has top be created twice. From zhuzhaoyuan at gmail.com Thu Mar 1 04:41:39 2012 From: zhuzhaoyuan at gmail.com (Joshua Zhu) Date: Thu, 1 Mar 2012 12:41:39 +0800 Subject: [ANNOUNCE] Tengine-1.2.3 In-Reply-To: References: Message-ID: Hi, On Wed, Feb 29, 2012 at 5:38 AM, Ryan Brown wrote: > > OT: > > Apache 2.4 is getting very hot these days. Some Apache guy even claimed > it's > > faster than Nginx. So I ran a simple benchmark. It turned out Nginx was > > still the winner. More detailed information: > > http://blog.zhuzhaoyuan.com/2012/02/apache-24-faster-than-nginx/ > > Does the benchmark change if you use the 1.1.x series? Also I was > looking at setting up a Ramdisk (serving static files) does using a > Ramdisk increase throughput? > I believe there is no performance difference between nginx-1.0.x and nginx-1.1.x when serving static files. Yet I think it worth a try. Theoretically, using Ramdisk will be faster. But stressing the same file should have the same effect, since most will be in the OS' vm cache. Regards, -- Joshua Zhu Senior Software Engineer Server Platforms Team at Taobao -------------- next part -------------- An HTML attachment was scrubbed... URL: From quintinpar at gmail.com Thu Mar 1 06:24:35 2012 From: quintinpar at gmail.com (Quintin Par) Date: Thu, 1 Mar 2012 11:54:35 +0530 Subject: Showing native 404 page and not the custom 404 in some circumstances Message-ID: I have a 404 page defined as follows. If I purposefully hit a non valid page I see the custom 404 page. But sometimes due to rate limiting and probably busy CPU I see the default nginx 404 page. I can?t narrow this down to the precise reason, but I keep seeing this every now and then. I don?t run a very powerful VM How do I show the custom 404 always? error_page 404 = @errorpages; location @errorpages { root /var/www/prod/cucumbertown/templates/; internal; proxy_pass http://localhost:82; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Accept-Encoding ""; proxy_ignore_headers Set-Cookie; proxy_ignore_headers Cache-Control; proxy_ignore_headers Expires; proxy_ignore_headers X-Accel-Expires; add_header X-Cache-Status $upstream_cache_status; proxy_cache jscss; proxy_cache_key $request_uri; proxy_cache_use_stale updating; } -Quintin -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Mar 1 09:05:47 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Mar 2012 13:05:47 +0400 Subject: dav module temp files In-Reply-To: References: <3C1C33B5FA39499B8C2AFF8FE27BF799@DD21> <20120229142702.GG67687@mdounin.ru> Message-ID: <20120301090547.GT67687@mdounin.ru> Hello! On Thu, Mar 01, 2012 at 02:47:40AM +0100, Gelonida N wrote: > On 02/29/2012 03:27 PM, Maxim Dounin wrote: > > Hello! > > > > On Wed, Feb 29, 2012 at 01:55:42PM +0200, Reinis Rozitis wrote: > > > >> Hello, > >> is there a technical reason why the WebDAV module (for PUTs) always > >> makes a temp file rather than use/honour memory buffer > >> (client_body_buffer_size)? > > > > It will use memory buffer for intermediate data, but as it needs > > file on disk anyway - data are always written to a file. > > > > Maxim Dounin > Just a tiny idea. (but perhaps this is already the case) > Ideally the temp file should be on the same file system than the target > file) > Otherwise the file has top be created twice. Yes, and that's why docs explicitly recommend using client_proxy_temp on the same file system: http://nginx.org/en/docs/http/ngx_http_dav_module.html#dav_methods Maxim Dounin From nginx-forum at nginx.us Thu Mar 1 10:18:48 2012 From: nginx-forum at nginx.us (kamalakarv) Date: Thu, 1 Mar 2012 05:18:48 -0500 (EST) Subject: Limit Available Methods Message-ID: Want to limit OPTIONS and TRACE method from nginx server Referred following post( section #11) Disable certain HTTP methods at global level, below article will help us to restrict at server block level * http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html We want to disable at global level because our configuration consist of so many server blocks Any help appreciated Regards Kamalakar Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223208,223208#msg-223208 From osa at FreeBSD.org.ru Thu Mar 1 10:39:30 2012 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Thu, 1 Mar 2012 14:39:30 +0400 Subject: Limit Available Methods In-Reply-To: References: Message-ID: <20120301103930.GA43875@FreeBSD.org.ru> On Thu, Mar 01, 2012 at 05:18:48AM -0500, kamalakarv wrote: > Want to limit OPTIONS and TRACE method from nginx server > > Referred following post( section #11) > Disable certain HTTP methods at global level, below article will help > us to restrict at server block level > * > http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html > > We want to disable at global level because our configuration consist of > so many server blocks The ngx_http_dav_module module processes HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY, and MOVE, i.e. no OPTIONS and TRACE methods. You may specify WebDAV methods with dav_methods directive, see http://nginx.org/en/docs/http/ngx_http_dav_module.html for details. AFAIK OPTIONS method available with dav_ext third-party module https://github.com/arut/nginx-dav-ext-module/ -- Sergey A. Osokin osa at FreeBSD.org osa at FreeBSD.org.ru From mdounin at mdounin.ru Thu Mar 1 11:02:00 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Mar 2012 15:02:00 +0400 Subject: Limit Available Methods In-Reply-To: References: Message-ID: <20120301110200.GZ67687@mdounin.ru> Hello! On Thu, Mar 01, 2012 at 05:18:48AM -0500, kamalakarv wrote: > Want to limit OPTIONS and TRACE method from nginx server > > Referred following post( section #11) > Disable certain HTTP methods at global level, below article will help > us to restrict at server block level > * > http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html > > We want to disable at global level because our configuration consist of > so many server blocks The TRACE method is always rejected with 405 since nginx 0.5.17. To disable other methods like OPTIONS (which currently isn't handled by nginx, but may be proxy_pass'ed somewhere else) you have to use either rewrite checks like in the article above or the "limit_expect" directive (http://nginx.org/r/limit_except). This isn't possible at global level, though you may use the "include" directive (http://nginx.org/r/include) to include common configuration block into all servers. Maxim Dounin From lists at ruby-forum.com Thu Mar 1 12:32:50 2012 From: lists at ruby-forum.com (umesh chaudhari) Date: Thu, 01 Mar 2012 13:32:50 +0100 Subject: nginx-1.0.3 In-Reply-To: <20110525152453.GY83054@sysoev.ru> References: <20110525152453.GY83054@sysoev.ru> Message-ID: <9ecdac0e2d7855f8418ea7de3f308c0b@ruby-forum.com> Hi Maxim, i am getting the same error on my (MAC os x lion),thanks for the reply but how do i apply above patch, i have never applied the patch before..please reply -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Mar 1 12:33:16 2012 From: lists at ruby-forum.com (umesh chaudhari) Date: Thu, 01 Mar 2012 13:33:16 +0100 Subject: nginx-1.0.3 In-Reply-To: <20110525152453.GY83054@sysoev.ru> References: <20110525152453.GY83054@sysoev.ru> Message-ID: Hi Maxim, i am getting the same error on my (MAC os x lion),thanks for the reply but how do i apply above patch, i have never applied the patch before..please reply -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Thu Mar 1 12:37:06 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Mar 2012 16:37:06 +0400 Subject: nginx-1.0.3 In-Reply-To: References: <20110525152453.GY83054@sysoev.ru> Message-ID: <20120301123706.GA67687@mdounin.ru> Hello! On Thu, Mar 01, 2012 at 01:33:16PM +0100, umesh chaudhari wrote: > Hi Maxim, > > i am getting the same error on my (MAC os x lion),thanks for the reply > but how do i apply above patch, i have never applied the patch > before..please reply Just upgrade to the latest version, the problem in question was fixed in nginx 1.0.4 and there is no need to apply the patch anymore. Maxim Dounin From lists at ruby-forum.com Thu Mar 1 13:29:45 2012 From: lists at ruby-forum.com (umesh chaudhari) Date: Thu, 01 Mar 2012 14:29:45 +0100 Subject: compile error for Nginx 1.1.2 Message-ID: <20ccadaca14d0ef47f76597e406e5180@ruby-forum.com> Hello all, I am trying to install Nginx-1.1.2 on mac os x-lion,but while doing make i am getting following error,i have searched through forums but didnt found clear steps to resolve the error, please help cc1: warnings being treated as errors src/core/ngx_crypt.c: In function ?ngx_crypt_apr1?: src/core/ngx_crypt.c:76: warning: ?MD5_Init? is deprecated (declared at /usr/include/openssl/md5.h:113) src/core/ngx_crypt.c:77: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:78: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:79: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:81: warning: ?MD5_Init? is deprecated (declared at /usr/include/openssl/md5.h:113) src/core/ngx_crypt.c:82: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:83: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:84: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:85: warning: ?MD5_Final? is deprecated (declared at /usr/include/openssl/md5.h:115) src/core/ngx_crypt.c:88: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:95: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:98: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:102: warning: ?MD5_Final? is deprecated (declared at /usr/include/openssl/md5.h:115) src/core/ngx_crypt.c:105: warning: ?MD5_Init? is deprecated (declared at /usr/include/openssl/md5.h:113) src/core/ngx_crypt.c:108: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:111: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:115: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:119: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:123: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:126: warning: ?MD5_Update? is deprecated (declared at /usr/include/openssl/md5.h:114) src/core/ngx_crypt.c:129: warning: ?MD5_Final? is deprecated (declared at /usr/include/openssl/md5.h:115) src/core/ngx_crypt.c: In function ?ngx_crypt_ssha?: src/core/ngx_crypt.c:215: warning: ?SHA1_Init? is deprecated (declared at /usr/include/openssl/sha.h:121) src/core/ngx_crypt.c:216: warning: ?SHA1_Update? is deprecated (declared at /usr/include/openssl/sha.h:122) src/core/ngx_crypt.c:217: warning: ?SHA1_Update? is deprecated (declared at /usr/include/openssl/sha.h:122) src/core/ngx_crypt.c:218: warning: ?SHA1_Final? is deprecated (declared at /usr/include/openssl/sha.h:123) make[1]: *** [objs/src/core/ngx_crypt.o] Error 1 make: *** [build] Error 2 -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Thu Mar 1 14:01:20 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 1 Mar 2012 18:01:20 +0400 Subject: compile error for Nginx 1.1.2 In-Reply-To: <20ccadaca14d0ef47f76597e406e5180@ruby-forum.com> References: <20ccadaca14d0ef47f76597e406e5180@ruby-forum.com> Message-ID: <20120301140119.GC67687@mdounin.ru> Hello! On Thu, Mar 01, 2012 at 02:29:45PM +0100, umesh chaudhari wrote: > Hello all, > > I am trying to install Nginx-1.1.2 on mac os x-lion,but while doing make > i am getting following error,i have searched through forums but didnt > found clear steps to resolve the error, > please help > > cc1: warnings being treated as errors > src/core/ngx_crypt.c: In function ?ngx_crypt_apr1?: > src/core/ngx_crypt.c:76: warning: ?MD5_Init? is deprecated (declared at > /usr/include/openssl/md5.h:113) Upgrade to nginx 1.1.16. There is a problem with openssl shipped with Mac OS X Lion, the workaround has been added in nginx 1.1.3. Maxim Dounin From nginxyz at mail.ru Fri Mar 2 01:46:40 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Fri, 02 Mar 2012 05:46:40 +0400 Subject: nginx load balancing Tomcat servers In-Reply-To: References: Message-ID: 01 ????? 2012, 02:39 ?? Ruslan Dautkhanov : > > What is the right way to setup a true load balancing of a few Tomcat > servers? > By word "true" I understand taking into account at least CPU load of those > nodes, not just round robining. > I've looked at 3rd party modules, but doesn't look there is the one. Hello, You may want to try my Lua based load balancer, it picks the least loaded backend server based on the latest load averages that it collects by polling backend servers using parallel subrequests. It's not optimized because I use it mainly for benchmarking, but if you spend some time tuning the parameters, you should be able to achieve better than standard load balancing performance. The following frontend server load balancer requires Agentzh's Lua module: http://wiki.nginx.org/HttpLuaModule # # NGiNXYZ Load Balancer - Frontend Server # Copyright (C) Max # http { # Set up a cache zone for storing backend server load averages. proxy_cache_path /var/tmp/nginx/load_average_cache levels=1 keys_zone=load_average_cache:64k inactive=5s; server { location / { set $backend_server ""; rewrite_by_lua ' --[[ Only for debugging. local start_time = ngx.now() --]] --[[ Replace these entries with your backend servers. ]] local backend_servers = { "192.168.2.1:8080", "192.168.2.2:8080", "192.168.2.3:8080" } local fallback_backend_server = "192.168.2.1:8080" local subrequests = {} for i, server in ipairs(backend_servers) do table.insert(subrequests, { "/poll_load_average/"..server, { method = ngx.HTTP_GET } }) end local responses = { ngx.location.capture_multi(subrequests) } local min_load_average = 1024 local min_index = 0 for i, response in ipairs(responses) do local body_length = #response.body if (body_length > 0 and body_length < 8) then local load_average = tonumber(response.body) --[[ Only for debugging. ngx.log(ngx.DEBUG, "backend server ", backend_servers[i], " load average: ", load_average) --]] if (load_average and load_average < min_load_average) then min_load_average = load_average min_index = i end end end if (min_index > 0) then ngx.var.backend_server = backend_servers[min_index] else ngx.var.backend_server = fallback_backend_server; end --[[ Only for debugging. ngx.log(ngx.DEBUG, "least loaded backend server ", ngx.var.backend_server) local total_time = ngx.now() - start_time ngx.log(ngx.DEBUG, "poll_load_average subrequest completion time: ", total_time) --]] '; # The least loaded backend server has been determined and # assigned to the $backend_server variable inside the # rewrite_by_lua block. proxy_pass http://$backend_server; } location ~ ^/poll_load_average/(.+)$ { # This is the subrequest location block used by the # rewrite_by_lua block to poll backend servers for # the load average. internal; proxy_pass_request_headers off; proxy_pass_request_body off; # Prevent subrequests from taking more time than we allow # them to. If a backend server is too slow to respond, it # will be skipped automatically. proxy_connect_timeout 30ms; proxy_send_timeout 20ms; proxy_read_timeout 60ms; # Do not cache load averages and do not read them from cache #proxy_no_cache 1; #proxy_cache_bypass 1; # Cache load averages and read them from cache proxy_cache load_average_cache; # $1 = backend_server:port proxy_cache_key $1; # Poll the backend server for its latest load average. proxy_pass http://$1/load_average/; } } } You should first replace the entries in the backend_servers array and the fallback_backend_server string with your backend server address:port values. Then you may want to turn debugging on by adding "]]" at the end of every "--[[ Only for debugging. " line in order to see what the Lua code does: 1) A subrequest for the /poll_average_load/ location is created for each of the backend servers. 2) All subrequests are initiated and executed simultaneously in parallel, so the total time / latency equals the completion time of the slowest request. ngx.location.capture_multi() waits for all the subrequests to complete and captures their responses (status, header and body). In order to prevent a slow subrequest / backend server from delaying the execution of the original request, proxy_*_timeout directives are used in the /poll_load_average/ location to skip any backend servers that are too slow to respond in time. 3) Subrequest response bodies are validated (they may contain only the load average and must be shorter than 8 characters), and the backend server with the lowest load average is then assigned to the $backend_server nginx variable that had been created before the rewrite_by_lua block. If none of the backend servers return a valid load average, the backend you assigned to fallback_backend_server is used. 4) The original request is passed on to the least loaded backend server by using the proxy_pass directive. Note that caching can be used inside the /poll_load_average/ subrequest location block to reduce the overhead of constantly polling all of the backend servers, but load averages should typically not be cached for more than a few seconds. Cache expiration time for load averages should be set individually on each of the backend servers in order to optimize performance. You should also experiment with the proxy_*_timeout values to find optimal values for your setup. The matching backend server load balancer configuration for this setup should be configured like this: # # NGiNXYZ Load Balancer - Backend Server # Copyright (C) Max # http { # Set up a limit request zone to prevent too frequent # load average requests. limit_req_zone $binary_remote_addr zone=load_average_limit_request_zone:256k rate=10r/s; # Extract the last minute load average from the /usr/bin/uptime # output and assign it to $load_average. # # The first alarm call sets up a 2 second timer and the 2nd call # cancels it. If the Perl subroutine is not completed within # 2 seconds, a return is forced to prevent Perl from holding up # further processing. perl_set $load_average ' sub { eval { local $SIG{ALRM} = sub { return ""; }; alarm 2; `/usr/bin/uptime` =~ /averages: (\d+\.\d+)/; alarm 0; return $1; } } '; server { location /load_average/ { # Prevent this load average from being cached for more # than 2 seconds by the frontend server. expires 2s; # Prevent too frequent load average requests. limit_req_log_level error; limit_req zone=load_average_limit_request_zone nodelay; # Return $load_average using Agentzh's Echo module echo $load_average; # Note that using "return 200 $load_average;" instead of # "echo $load_average;" to return $load_average makes # any limit_request directive useless inside this # location block because it prevents the limit_request # triggered error code 503 from being returned. #return 200 $load_average; } } } The backend servers would require the following additional modules for this configuration to work: Embedded Perl module http://wiki.nginx.org/EmbeddedPerlModule Agentzh's Echo module (optional - see the "return 200" comment above) http://wiki.nginx.org/HttpEchoModule My comments are extensive, so there's nothing to add, except that this could be done using Apache and a CGI script that does something like this to extract the load average from the uptime output: uptime | awk -F': |,' '{print $5}' You could also set up a shell script based netcat server to answer load average requests, but you'd have to set up additional firewall rules to prevent too frequent requests from degrading performance. You could also extend the load balancer to include other performance criteria, such as iostat, netstat values etc. The Stub Status module statistics could also be included: http://wiki.nginx.org/HttpStubStatusModule Note that if you decide to cache load averages on the frontend server, you should always make sure that your backend servers always set an appropriate expiration time (by using the "Cache-Control: max-age=$x" header, for example) in the response (typically, it should be no longer than a few seconds, but that really depends on your setup). I hope that helps, any benchmarks and comments will be appreciated. Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginxyz at mail.ru Fri Mar 2 01:52:31 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Fri, 02 Mar 2012 05:52:31 +0400 Subject: nginx load balancing Tomcat servers In-Reply-To: References: Message-ID: Apologies, mail.ru mangles my posts sometimes, unfortunately there is no option to turn HTML off. 01 ????? 2012, 02:39 ?? Ruslan Dautkhanov : > > What is the right way to setup a true load balancing of a few Tomcat > servers? > By word "true" I understand taking into account at least CPU load of those > nodes, not just round robining. > I've looked at 3rd party modules, but doesn't look there is the one. Hello, You may want to try my Lua based load balancer, it picks the least loaded backend server based on the latest load averages that it collects by polling backend servers using parallel subrequests. It's not optimized because I use it mainly for benchmarking, but if you spend some time tuning the parameters, you should be able to achieve better than standard load balancing performance. The following frontend server load balancer requires Agentzh's Lua module: http://wiki.nginx.org/HttpLuaModule # # NGiNXYZ Load Balancer - Frontend Server # Copyright (C) Max # http { # Set up a cache zone for storing backend server load averages. proxy_cache_path /var/tmp/nginx/load_average_cache levels=1 keys_zone=load_average_cache:64k inactive=5s; server { location / { set $backend_server ""; rewrite_by_lua ' --[[ Only for debugging. local start_time = ngx.now() --]] --[[ Replace these entries with your backend servers. ]] local backend_servers = { "192.168.2.1:8080", "192.168.2.2:8080", "192.168.2.3:8080" } local fallback_backend_server = "192.168.2.1:8080" local subrequests = {} for i, server in ipairs(backend_servers) do table.insert(subrequests, { "/poll_load_average/"..server, { method = ngx.HTTP_GET } }) end local responses = { ngx.location.capture_multi(subrequests) } local min_load_average = 1024 local min_index = 0 for i, response in ipairs(responses) do local body_length = #response.body if (body_length > 0 and body_length < 8) then local load_average = tonumber(response.body) --[[ Only for debugging. ngx.log(ngx.DEBUG, "backend server ", backend_servers[i], " load average: ", load_average) --]] if (load_average and load_average < min_load_average) then min_load_average = load_average min_index = i end end end if (min_index > 0) then ngx.var.backend_server = backend_servers[min_index] else ngx.var.backend_server = fallback_backend_server; end --[[ Only for debugging. ngx.log(ngx.DEBUG, "least loaded backend server ", ngx.var.backend_server) local total_time = ngx.now() - start_time ngx.log(ngx.DEBUG, "poll_load_average subrequest completion time: ", total_time) --]] '; # The least loaded backend server has been determined and # assigned to the $backend_server variable inside the # rewrite_by_lua block. proxy_pass http://$backend_server; } location ~ ^/poll_load_average/(.+)$ { # This is the subrequest location block used by the # rewrite_by_lua block to poll backend servers for # the load average. internal; proxy_pass_request_headers off; proxy_pass_request_body off; # Prevent subrequests from taking more time than we allow # them to. If a backend server is too slow to respond, it # will be skipped automatically. proxy_connect_timeout 30ms; proxy_send_timeout 20ms; proxy_read_timeout 60ms; # Do not cache load averages and do not read them from cache #proxy_no_cache 1; #proxy_cache_bypass 1; # Cache load averages and read them from cache proxy_cache load_average_cache; # $1 = backend_server:port proxy_cache_key $1; # Poll the backend server for its latest load average. proxy_pass http://$1/load_average/; } } } You should first replace the entries in the backend_servers array and the fallback_backend_server string with your backend server address:port values. Then you may want to turn debugging on by adding "]]" at the end of every "--[[ Only for debugging. " line in order to see what the Lua code does: 1) A subrequest for the /poll_average_load/ location is created for each of the backend servers. 2) All subrequests are initiated and executed simultaneously in parallel, so the total time / latency equals the completion time of the slowest request. ngx.location.capture_multi() waits for all the subrequests to complete and captures their responses (status, header and body). In order to prevent a slow subrequest / backend server from delaying the execution of the original request, proxy_*_timeout directives are used in the /poll_load_average/ location to skip any backend servers that are too slow to respond in time. 3) Subrequest response bodies are validated (they may contain only the load average and must be shorter than 8 characters), and the backend server with the lowest load average is then assigned to the $backend_server nginx variable that had been created before the rewrite_by_lua block. If none of the backend servers return a valid load average, the backend you assigned to fallback_backend_server is used. 4) The original request is passed on to the least loaded backend server by using the proxy_pass directive. Note that caching can be used inside the /poll_load_average/ subrequest location block to reduce the overhead of constantly polling all of the backend servers, but load averages should typically not be cached for more than a few seconds. Cache expiration time for load averages should be set individually on each of the backend servers in order to optimize performance. You should also experiment with the proxy_*_timeout values to find optimal values for your setup. The matching backend server load balancer configuration for this setup should be configured like this: # # NGiNXYZ Load Balancer - Backend Server # Copyright (C) Max # http { # Set up a limit request zone to prevent too frequent # load average requests. limit_req_zone $binary_remote_addr zone=load_average_limit_request_zone:256k rate=10r/s; # Extract the last minute load average from the /usr/bin/uptime # output and assign it to $load_average. # # The first alarm call sets up a 2 second timer and the 2nd call # cancels it. If the Perl subroutine is not completed within # 2 seconds, a return is forced to prevent Perl from holding up # further processing. perl_set $load_average ' sub { eval { local $SIG{ALRM} = sub { return ""; }; alarm 2; `/usr/bin/uptime` =~ /averages: (\d+\.\d+)/; alarm 0; return $1; } } '; server { location /load_average/ { # Prevent this load average from being cached for more # than 2 seconds by the frontend server. expires 2s; # Prevent too frequent load average requests. limit_req_log_level error; limit_req zone=load_average_limit_request_zone nodelay; # Return $load_average using Agentzh's Echo module echo $load_average; # Note that using "return 200 $load_average;" instead of # "echo $load_average;" to return $load_average makes # any limit_request directive useless inside this # location block because it prevents the limit_request # triggered error code 503 from being returned. #return 200 $load_average; } } } The backend servers would require the following additional modules for this configuration to work: Embedded Perl module http://wiki.nginx.org/EmbeddedPerlModule Agentzh's Echo module (optional - see the "return 200" comment above) http://wiki.nginx.org/HttpEchoModule My comments are extensive, so there's nothing to add, except that this could be done using Apache and a CGI script that does something like this to extract the load average from the uptime output: uptime | awk -F': |,' '{print $5}' You could also set up a shell script based netcat server to answer load average requests, but you'd have to set up additional firewall rules to prevent too frequent requests from degrading performance. You could also extend the load balancer to include other performance criteria, such as iostat, netstat values etc. The Stub Status module statistics could also be included: http://wiki.nginx.org/HttpStubStatusModule Note that if you decide to cache load averages on the frontend server, you should always make sure that your backend servers always set an appropriate expiration time (by using the "Cache-Control: max-age=$x" header, for example) in the response (typically, it should be no longer than a few seconds, but that really depends on your setup). I hope that helps, any benchmarks and comments will be appreciated. Max From lists at ruby-forum.com Fri Mar 2 04:58:07 2012 From: lists at ruby-forum.com (umesh chaudhari) Date: Fri, 02 Mar 2012 05:58:07 +0100 Subject: compile error for Nginx 1.1.2 In-Reply-To: <20ccadaca14d0ef47f76597e406e5180@ruby-forum.com> References: <20ccadaca14d0ef47f76597e406e5180@ruby-forum.com> Message-ID: Hi Maxim, thanks for the quick reply but i managed to install nginx using brew on my mac..which solved my problem temporarily..brew has installed nginx-1.0.11..i will keep in mind your suggestion while installing nginx from source..thanks again.. -- Posted via http://www.ruby-forum.com/. From edho at myconan.net Fri Mar 2 07:08:05 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 2 Mar 2012 14:08:05 +0700 Subject: gzip_disable doesn't disable gzip_vary Message-ID: I noticed that with this setting: gzip on; gzip_vary on; gzip_disable "msie6"; Header "Vary: Accept-Encoding" will always be returned even though the user agent is ie6 (and therefore not using gzip): # curl -I http://animebsd.net/about/feed -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" HTTP/1.1 200 OK Server: nginx/1.1.14 Date: Fri, 02 Mar 2012 07:04:25 GMT Content-Type: text/xml; charset=UTF-8 Connection: keep-alive Vary: Accept-Encoding X-Pingback: http://animebsd.net/xmlrpc.php Last-Modified: Fri, 02 Mar 2012 04:17:00 GMT ETag: "92a5989a0949b85e303228490256ebf2" X-Powered-By: W3 Total Cache/0.9.2.4 Link: ; rel=shortlink I don't think this is intentional as getting non-gzipped content doesn't return such header. (I've verified this is returned by nginx by running same test with disabled gzip_vary) (I don't see mention of this being fixed in .15 and .16 in the changelog so I haven't tested with them) From mdounin at mdounin.ru Fri Mar 2 09:59:37 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Mar 2012 13:59:37 +0400 Subject: gzip_disable doesn't disable gzip_vary In-Reply-To: References: Message-ID: <20120302095937.GF67687@mdounin.ru> Hello! On Fri, Mar 02, 2012 at 02:08:05PM +0700, Edho Arief wrote: > I noticed that with this setting: > > gzip on; > gzip_vary on; > gzip_disable "msie6"; > > Header "Vary: Accept-Encoding" will always be returned even though the > user agent is ie6 (and therefore not using gzip): > > # curl -I http://animebsd.net/about/feed -A "Mozilla/4.0 (compatible; > MSIE 6.0; Windows NT 5.0)" > HTTP/1.1 200 OK > Server: nginx/1.1.14 > Date: Fri, 02 Mar 2012 07:04:25 GMT > Content-Type: text/xml; charset=UTF-8 > Connection: keep-alive > Vary: Accept-Encoding > X-Pingback: http://animebsd.net/xmlrpc.php > Last-Modified: Fri, 02 Mar 2012 04:17:00 GMT > ETag: "92a5989a0949b85e303228490256ebf2" > X-Powered-By: W3 Total Cache/0.9.2.4 > Link: ; rel=shortlink > > I don't think this is intentional as getting non-gzipped content > doesn't return such header. (I've verified this is returned by nginx > by running same test with disabled gzip_vary) This is intentional, "Vary" is returned whenever gzip (and gzip_vary) is enabled, as response representation depends on header(s) listed. Strictly speaking, it should also include User-Agent in case of gzip_disable defined. Maxim Dounin From edho at myconan.net Fri Mar 2 10:15:07 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 2 Mar 2012 17:15:07 +0700 Subject: gzip_disable doesn't disable gzip_vary In-Reply-To: <20120302095937.GF67687@mdounin.ru> References: <20120302095937.GF67687@mdounin.ru> Message-ID: 2012/3/2 Maxim Dounin : > > This is intentional, "Vary" is returned whenever gzip (and > gzip_vary) is enabled, as response representation depends on > header(s) listed. > > Strictly speaking, it should also include User-Agent in case of > gzip_disable defined. > Shouldn't there be no change to header at all when client user agent matches the gzip_disabled (ie. just like with gzip off)? From nginx-forum at nginx.us Fri Mar 2 10:58:29 2012 From: nginx-forum at nginx.us (Tib1) Date: Fri, 2 Mar 2012 05:58:29 -0500 (EST) Subject: Log $http_x_forwarded_for behind Cisco ACE LB Message-ID: Hello ! I'm new to Nginx. I installed Nginx (on Gentoo) instead of Apache behind a Cisco LoadBalancer. My problem is that the directive $http_x_forwarded_for always write local IP of the LoadBalancer instead of Real IP. But I have the good IP in the header HTTP_X_FORWARD. I've tried lot of configurations but no one is good... Do you have any idea ? Thanks by advance, Tib1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223259,223259#msg-223259 From edho at myconan.net Fri Mar 2 11:00:15 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 2 Mar 2012 18:00:15 +0700 Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: 2012/3/2 Tib1 : > Hello ! > > I'm new to Nginx. > > I installed Nginx (on Gentoo) instead of Apache behind a Cisco > LoadBalancer. > > My problem is that the directive $http_x_forwarded_for always write > local IP of the LoadBalancer instead of Real IP. > > But I have the good IP in the header HTTP_X_FORWARD. > perhaps something like this: set_real_ip_from load_balancer_ip; real_ip_header X-Forwarded-For; ref: http://nginx.org/en/docs/http/ngx_http_realip_module.html From nginx-forum at nginx.us Fri Mar 2 11:06:59 2012 From: nginx-forum at nginx.us (Tib1) Date: Fri, 2 Mar 2012 06:06:59 -0500 (EST) Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: Nope, I've tried this but without success... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223259,223261#msg-223261 From edho at myconan.net Fri Mar 2 11:08:14 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 2 Mar 2012 18:08:14 +0700 Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: 2012/3/2 Tib1 : > Nope, I've tried this but without success... > I suggest posting the full request header sent by load balancer. From mdounin at mdounin.ru Fri Mar 2 11:20:47 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Mar 2012 15:20:47 +0400 Subject: gzip_disable doesn't disable gzip_vary In-Reply-To: References: <20120302095937.GF67687@mdounin.ru> Message-ID: <20120302112047.GI67687@mdounin.ru> Hello! On Fri, Mar 02, 2012 at 05:15:07PM +0700, Edho Arief wrote: > 2012/3/2 Maxim Dounin : > > > > This is intentional, "Vary" is returned whenever gzip (and > > gzip_vary) is enabled, as response representation depends on > > header(s) listed. > > > > Strictly speaking, it should also include User-Agent in case of > > gzip_disable defined. > > > > Shouldn't there be no change to header at all when client user agent > matches the gzip_disabled (ie. just like with gzip off)? http://tools.ietf.org/html/rfc2616#section-14.44 An HTTP/1.1 server SHOULD include a Vary header field with any cacheable response that is subject to server-driven negotiation. For sure with gzip enabled the response "is subject to server-driven negotiation". Maxim Dounin From edho at myconan.net Fri Mar 2 11:41:50 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 2 Mar 2012 18:41:50 +0700 Subject: gzip_disable doesn't disable gzip_vary In-Reply-To: <20120302112047.GI67687@mdounin.ru> References: <20120302095937.GF67687@mdounin.ru> <20120302112047.GI67687@mdounin.ru> Message-ID: 2012/3/2 Maxim Dounin : >> Shouldn't there be no change to header at all when client user agent >> matches the gzip_disabled (ie. just like with gzip off)? > > http://tools.ietf.org/html/rfc2616#section-14.44 > > ? An HTTP/1.1 server SHOULD include a Vary header field with any > ? cacheable response that is subject to server-driven negotiation. > > For sure with gzip enabled the response "is subject to server-driven > negotiation". > So, the "gzip enabled response" includes cases with non-gzip content as: - no "Accept-Encoding: gzip,deflate" - matches gzip_disabled and therefore "Vary: Accept-Encoding" will always be added even though the response isn't compressed? Or in other words, does "gzip on; gzip_vary on" means "add 'Vary: Accept-Encoding' header on any responses matching gzip_types regardless whether the response actually compressed or not"? From mdounin at mdounin.ru Fri Mar 2 12:33:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Mar 2012 16:33:41 +0400 Subject: gzip_disable doesn't disable gzip_vary In-Reply-To: References: <20120302095937.GF67687@mdounin.ru> <20120302112047.GI67687@mdounin.ru> Message-ID: <20120302123341.GJ67687@mdounin.ru> Hello! On Fri, Mar 02, 2012 at 06:41:50PM +0700, Edho Arief wrote: > 2012/3/2 Maxim Dounin : > >> Shouldn't there be no change to header at all when client user agent > >> matches the gzip_disabled (ie. just like with gzip off)? > > > > http://tools.ietf.org/html/rfc2616#section-14.44 > > > > ? An HTTP/1.1 server SHOULD include a Vary header field with any > > ? cacheable response that is subject to server-driven negotiation. > > > > For sure with gzip enabled the response "is subject to server-driven > > negotiation". > > > > So, the "gzip enabled response" includes cases with non-gzip content as: > - no "Accept-Encoding: gzip,deflate" > - matches gzip_disabled > and therefore "Vary: Accept-Encoding" will always be added even though > the response isn't compressed? > > Or in other words, does "gzip on; gzip_vary on" means "add 'Vary: > Accept-Encoding' header on any responses matching gzip_types > regardless whether the response actually compressed or not"? Yes. Maxim Dounin From soracchi at netbuilder.it Fri Mar 2 12:38:45 2012 From: soracchi at netbuilder.it (Andrea Soracchi) Date: Fri, 2 Mar 2012 13:38:45 +0100 (CET) Subject: Latency problem with one browser In-Reply-To: <813710c4-75b5-4b59-a674-6af0f0925847@sorry> Message-ID: <24d2977a-0ae6-41c4-8013-00e8cfb1f259@sorry> Hi, I installed nginx 1.05 and php-fpm 5.3.10 in Ubuntu 11.10. If I browse with explorer,firefox and chrome all works very well, all is fast! If I use my Playbook (with webkit) all is slow! With webinspector I noticed that the problem is latency. I get a very high latency (from 3 to 15 seconds random) for all the pages with php code. With the same playbook, I browse the SAME SITES inside other server (actually I've just copied it in it ): - nginx 0.84 - php 5.3.0 - ubuntu 9.10 and works very well and fast! It's incredible! I have attached the main nginx.conf, nginx-vs.conf, main php-fpm.conf, php-fpm-vs.conf and fastcgi_params_phpfpm. Any idea? Thanks a lot, Andrea -- Andrea Soracchi - Netbuilder S.r.l. Multidialogo : La storia e' fatta da chi sa comunicare System Engineer // t. +39 0521 247791 // f. +39 0521 7431140 // www.netbuilder.it -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-vs Type: application/octet-stream Size: 571 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: phpfpm-vs.conf Type: application/octet-stream Size: 650 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fastcgi_params_phpfpm Type: application/octet-stream Size: 1309 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx.conf Type: application/octet-stream Size: 1375 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: php-fpm.conf Type: application/octet-stream Size: 3488 bytes Desc: not available URL: From nginxyz at mail.ru Fri Mar 2 12:55:29 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Fri, 02 Mar 2012 16:55:29 +0400 Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: 02 ????? 2012, 15:01 ?? Edho Arief : > 2012/3/2 Tib1 : > > Hello ! > > > > I'm new to Nginx. > > > > I installed Nginx (on Gentoo) instead of Apache behind a Cisco > > LoadBalancer. > > > > My problem is that the directive $http_x_forwarded_for always write > > local IP of the LoadBalancer instead of Real IP. > > > > But I have the good IP in the header HTTP_X_FORWARD. > > > > perhaps something like this: > > set_real_ip_from load_balancer_ip; > real_ip_header X-Forwarded-For; Replace X-Forwarded-For with X-Forward and that shouldl work. You may want to update your Cisco ACE loadbalancing policy map configuration to insert the standard X-Forwarded-For instead of the X-Forward header by doing something like this in Exec mode: host1/Admin# show running-config policy-map You should see something like this: policy-map type loadbalance http first-match L7_LB_POLICY class L7_LB_CLASS serverfarm SERVER_FARM_1 insert-http x-forward header-value "%is" Then just replace the header: Host1/Admin# configure terminal Host1/Admin(config)# policy-map type loadbalance first-match L7_LB_POLICY host1/Admin(config-pmap-lb)# class L7_LB_CLASS host1/Admin(config-pmap-lb-c)# no insert-http X-Forward header-value "%is" host1/Admin(config-pmap-lb-c)# insert-http X-Forwarded-For header-value "%is" host1/Admin(config-pmap-lb-c)# exit host1/Admin(config)# exit If everything works as expected just save your configuration and that's it: host1/Admin# copy running-config startup-config Max From mdounin at mdounin.ru Fri Mar 2 13:09:20 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Mar 2012 17:09:20 +0400 Subject: Latency problem with one browser In-Reply-To: <24d2977a-0ae6-41c4-8013-00e8cfb1f259@sorry> References: <813710c4-75b5-4b59-a674-6af0f0925847@sorry> <24d2977a-0ae6-41c4-8013-00e8cfb1f259@sorry> Message-ID: <20120302130919.GK67687@mdounin.ru> Hello! On Fri, Mar 02, 2012 at 01:38:45PM +0100, Andrea Soracchi wrote: > Hi, > > I installed nginx 1.05 and php-fpm 5.3.10 in Ubuntu 11.10. > > If I browse with explorer,firefox and chrome all works very well, all is fast! > > If I use my Playbook (with webkit) all is slow! With webinspector I noticed that the problem is latency. I get a very high latency (from 3 to 15 seconds random) for all the pages with php code. > > With the same playbook, I browse the SAME SITES inside other server (actually I've just copied it in it ): > > - nginx 0.84 > - php 5.3.0 > - ubuntu 9.10 > > and works very well and fast! It's incredible! > > I have attached the main nginx.conf, nginx-vs.conf, main php-fpm.conf, php-fpm-vs.conf and fastcgi_params_phpfpm. > > Any idea? Try keepalive_disable msie6; http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable Maxim Dounin From nginxyz at mail.ru Fri Mar 2 13:15:54 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Fri, 02 Mar 2012 17:15:54 +0400 Subject: Latency problem with one browser In-Reply-To: <20120302130919.GK67687@mdounin.ru> References: <813710c4-75b5-4b59-a674-6af0f0925847@sorry> <24d2977a-0ae6-41c4-8013-00e8cfb1f259@sorry> <20120302130919.GK67687@mdounin.ru> Message-ID: 02 ????? 2012, 17:09 ?? Maxim Dounin : > Hello! > > On Fri, Mar 02, 2012 at 01:38:45PM +0100, Andrea Soracchi wrote: > > > Hi, > > > > I installed nginx 1.05 and php-fpm 5.3.10 in Ubuntu 11.10. > > > > If I browse with explorer,firefox and chrome all works very well, all is > fast! > > > > If I use my Playbook (with webkit) all is slow! With webinspector I noticed > that the problem is latency. I get a very high latency (from 3 to 15 seconds > random) for all the pages with php code. > > > > With the same playbook, I browse the SAME SITES inside other server > (actually I've just copied it in it ): > > > > - nginx 0.84 > > - php 5.3.0 > > - ubuntu 9.10 > > > > and works very well and fast! It's incredible! > > > > I have attached the main nginx.conf, nginx-vs.conf, main php-fpm.conf, > php-fpm-vs.conf and fastcgi_params_phpfpm. > > > > Any idea? > > Try > > keepalive_disable msie6; > > http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable This is WebKit related, so this is more likely to help: keepalive_disable safari; Max From mdounin at mdounin.ru Fri Mar 2 13:51:46 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Mar 2012 17:51:46 +0400 Subject: Latency problem with one browser In-Reply-To: References: <813710c4-75b5-4b59-a674-6af0f0925847@sorry> <24d2977a-0ae6-41c4-8013-00e8cfb1f259@sorry> <20120302130919.GK67687@mdounin.ru> Message-ID: <20120302135146.GL67687@mdounin.ru> Hello! On Fri, Mar 02, 2012 at 05:15:54PM +0400, Max wrote: > > 02 ????? 2012, 17:09 ?? Maxim Dounin : > > Hello! > > > > On Fri, Mar 02, 2012 at 01:38:45PM +0100, Andrea Soracchi wrote: > > > > > Hi, > > > > > > I installed nginx 1.05 and php-fpm 5.3.10 in Ubuntu 11.10. > > > > > > If I browse with explorer,firefox and chrome all works very well, all is > > fast! > > > > > > If I use my Playbook (with webkit) all is slow! With webinspector I noticed > > that the problem is latency. I get a very high latency (from 3 to 15 seconds > > random) for all the pages with php code. > > > > > > With the same playbook, I browse the SAME SITES inside other server > > (actually I've just copied it in it ): > > > > > > - nginx 0.84 > > > - php 5.3.0 > > > - ubuntu 9.10 > > > > > > and works very well and fast! It's incredible! > > > > > > I have attached the main nginx.conf, nginx-vs.conf, main php-fpm.conf, > > php-fpm-vs.conf and fastcgi_params_phpfpm. > > > > > > Any idea? > > > > Try > > > > keepalive_disable msie6; > > > > http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable > > This is WebKit related, so this is more likely to help: > > keepalive_disable safari; No. The problem is that keepalive is disabled by default for safari, and the "keepalive_disable msie6;" will re-enable it. Maxim Dounin From nginx-forum at nginx.us Fri Mar 2 14:31:05 2012 From: nginx-forum at nginx.us (delphixe2) Date: Fri, 2 Mar 2012 09:31:05 -0500 (EST) Subject: nginx load balancer with geoip? Message-ID: i wrote all geoip database in geo.conf, and i wrote these lines in http segment. geo $geo { include geo.conf; } and I set upstream in http segment like: upstream default { server folderfile.net; } upstream kr { server nixneo.com; } and added server segment and set proxy_pass. server { listen 80; server_name geotest.folderfile.net; location / { proxy_pass http://$geo; } work looks fine, request in korea perfectly proxied to nixneo.com and other requests go to folderfile.net BUT! the problem appeared. you can see the problem in this url : http://geotest.folderfile.net/index.php?mid=talkboard (original url:http://delphixe.folderfile.net/index.php?mid=talkboard) can't see the problem? let you explain it. see my image : http://img717.imageshack.us/img717/3426/gipp.png how can I solve this problem? please help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223278,223278#msg-223278 From soracchi at netbuilder.it Fri Mar 2 15:53:05 2012 From: soracchi at netbuilder.it (Andrea Soracchi) Date: Fri, 2 Mar 2012 16:53:05 +0100 (CET) Subject: Latency problem with one browser In-Reply-To: <20120302135146.GL67687@mdounin.ru> Message-ID: Yes, with "keepalive_disable none;" works fine! Thanks a lot, Andrea ----- Messaggio originale ----- Da: "Maxim Dounin" A: nginx at nginx.org Inviato: Venerd?, 2 marzo 2012 14:51:46 Oggetto: Re: Latency problem with one browser Hello! On Fri, Mar 02, 2012 at 05:15:54PM +0400, Max wrote: > > 02 ????? 2012, 17:09 ?? Maxim Dounin : > > Hello! > > > > On Fri, Mar 02, 2012 at 01:38:45PM +0100, Andrea Soracchi wrote: > > > > > Hi, > > > > > > I installed nginx 1.05 and php-fpm 5.3.10 in Ubuntu 11.10. > > > > > > If I browse with explorer,firefox and chrome all works very well, all is > > fast! > > > > > > If I use my Playbook (with webkit) all is slow! With webinspector I noticed > > that the problem is latency. I get a very high latency (from 3 to 15 seconds > > random) for all the pages with php code. > > > > > > With the same playbook, I browse the SAME SITES inside other server > > (actually I've just copied it in it ): > > > > > > - nginx 0.84 > > > - php 5.3.0 > > > - ubuntu 9.10 > > > > > > and works very well and fast! It's incredible! > > > > > > I have attached the main nginx.conf, nginx-vs.conf, main php-fpm.conf, > > php-fpm-vs.conf and fastcgi_params_phpfpm. > > > > > > Any idea? > > > > Try > > > > keepalive_disable msie6; > > > > http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable > > This is WebKit related, so this is more likely to help: > > keepalive_disable safari; No. The problem is that keepalive is disabled by default for safari, and the "keepalive_disable msie6;" will re-enable it. Maxim Dounin _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Fri Mar 2 16:26:52 2012 From: nginx-forum at nginx.us (Tib1) Date: Fri, 2 Mar 2012 11:26:52 -0500 (EST) Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: <436b6817aceb77d3f8d900a1aaab370e.NginxMailingListEnglish@forum.nginx.org> How can I get the full request header ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223259,223280#msg-223280 From nginxyz at mail.ru Fri Mar 2 16:28:32 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Fri, 02 Mar 2012 20:28:32 +0400 Subject: Latency problem with one browser In-Reply-To: <20120302135146.GL67687@mdounin.ru> References: <813710c4-75b5-4b59-a674-6af0f0925847@sorry> <20120302135146.GL67687@mdounin.ru> Message-ID: 02 ????? 2012, 17:52 ?? Maxim Dounin : > Hello! > > On Fri, Mar 02, 2012 at 05:15:54PM +0400, Max wrote: > > > > > 02 ????? 2012, 17:09 ?? Maxim Dounin : > > > Hello! > > > > > > On Fri, Mar 02, 2012 at 01:38:45PM +0100, Andrea Soracchi wrote: > > > > > > > Hi, > > > > > > > > I installed nginx 1.05 and php-fpm 5.3.10 in Ubuntu 11.10. > > > > > > > > If I browse with explorer,firefox and chrome all works very well, all is > > > fast! > > > > > > > > If I use my Playbook (with webkit) all is slow! With webinspector I noticed > > > that the problem is latency. I get a very high latency (from 3 to 15 seconds > > > random) for all the pages with php code. > > > > > > > > With the same playbook, I browse the SAME SITES inside other server > > > (actually I've just copied it in it ): > > > > > > > > - nginx 0.84 > > > > - php 5.3.0 > > > > - ubuntu 9.10 > > > > > > > > and works very well and fast! It's incredible! > > > > > > > > I have attached the main nginx.conf, nginx-vs.conf, main php-fpm.conf, > > > php-fpm-vs.conf and fastcgi_params_phpfpm. > > > > > > > > Any idea? > > > > > > Try > > > > > > keepalive_disable msie6; > > > > > > http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable > > > > This is WebKit related, so this is more likely to help: > > > > keepalive_disable safari; > > No. The problem is that keepalive is disabled by default for safari, > and the "keepalive_disable msie6;" will re-enable it. Just for the record - keepalive_disable is set to msie6 and safari by default, but using the keepalive_disable directive explicitly disables keepalive for the specified arguments and implicitly enables (by not disabling) keepalive for all the other possible arguments. So to enable keepalive for a browser that has keepalive disabled by default (which currently includes msie6 and safari) you have to use "keepalive_disable ID;", where ID is anything but the ID of the browser you want to enable keepalive for. This disables keepalive for msie6 and implicitly enables keepalive for safari and all the other browsers: keepalive_disable msie6; This disables keepalive for safari and implicitly enables keepalive for msie6 and all the other browsers: keepalive_disable safari; This disables keepalive for safari and browser "none", and implicitly enables keepalive for msie6, but not due to the "none" argument: keepalive_disable none safari; That's because "none" does not actually reset the keepalive_disable variable to zero, it's implemented as another browser (2nd bit in the keepalive_disable browser bitmap), so specifying "none" as a single argument disables keepalive only for browser "none" and implicitly enables it for all the other browsers. I know this directive is a workaround in the first place, but it would be nice if this were documented in the official documentation. Max From piotr.sikora at frickle.com Fri Mar 2 16:33:54 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Fri, 2 Mar 2012 17:33:54 +0100 Subject: Latency problem with one browser In-Reply-To: References: <813710c4-75b5-4b59-a674-6af0f0925847@sorry> <20120302135146.GL67687@mdounin.ru> Message-ID: <818B1A423A824C36B3D5F2D43A353415@Desktop> Hi, > Just for the record - keepalive_disable is set to msie6 and safari > by default, but using the keepalive_disable directive explicitly > disables keepalive for the specified arguments and implicitly > enables (by not disabling) keepalive for all the other possible > arguments. > > So to enable keepalive for a browser that has keepalive disabled > by default (which currently includes msie6 and safari) you have > to use "keepalive_disable ID;", where ID is anything but the ID > of the browser you want to enable keepalive for. > > This disables keepalive for msie6 and implicitly enables > keepalive for safari and all the other browsers: > > keepalive_disable msie6; > > This disables keepalive for safari and implicitly enables > keepalive for msie6 and all the other browsers: > > keepalive_disable safari; > > This disables keepalive for safari and browser "none", > and implicitly enables keepalive for msie6, but not > due to the "none" argument: > > keepalive_disable none safari; > > That's because "none" does not actually reset the keepalive_disable > variable to zero, it's implemented as another browser (2nd bit in the > keepalive_disable browser bitmap), so specifying "none" as a single > argument disables keepalive only for browser "none" and implicitly > enables it for all the other browsers. > > I know this directive is a workaround in the first place, but it would > be nice if this were documented in the official documentation. It is: http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable Best regards, Piotr Sikora < piotr.sikora at frickle.com > From nginx-forum at nginx.us Fri Mar 2 16:45:57 2012 From: nginx-forum at nginx.us (Tib1) Date: Fri, 2 Mar 2012 11:45:57 -0500 (EST) Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: <27d5634b52e3c8257e6c17284e80b620.NginxMailingListEnglish@forum.nginx.org> Problem solved. It's the name of real_ip_header that was wrong in my CISCO system. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223259,223283#msg-223283 From nginxyz at mail.ru Fri Mar 2 16:48:43 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Fri, 02 Mar 2012 20:48:43 +0400 Subject: Latency problem with one browser In-Reply-To: References: <20120302135146.GL67687@mdounin.ru> Message-ID: 02 ????? 2012, 19:53 ?? Andrea Soracchi : > Yes, > > with "keepalive_disable none;" works fine! Maxim, do you think the Playbook browser should be added as a separate browser (unsigned playbook:1 entry in ngx_http_headers_in_t) to prevent it from getting the Safari keepalive disabled treatment? Here's a typical Playbook browser User-Agent string, adding an if block for "Playbook" before the "Safari" if block in ngx_http_process_user_agent() should do the trick: Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) \ AppleWebKit/534.8+ (KHTML like Gecko) version/0.0.1 Safari/534.8+ Max From nginx-forum at nginx.us Fri Mar 2 16:49:27 2012 From: nginx-forum at nginx.us (Tib1) Date: Fri, 2 Mar 2012 11:49:27 -0500 (EST) Subject: Log $http_x_forwarded_for behind Cisco ACE LB In-Reply-To: References: Message-ID: <99f788cc50d3da218c6f8412337510fb.NginxMailingListEnglish@forum.nginx.org> Thank you very much Max ! In fact, it was the name of the header that was wrong. And I didn't make the connection between the value in the Cisco ACE and the value of the Nginx real_ip_header. I thought it was a constant. So thank you again :) Have a good day ! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223273,223284#msg-223284 From francis at daoine.org Fri Mar 2 19:49:58 2012 From: francis at daoine.org (Francis Daly) Date: Fri, 2 Mar 2012 19:49:58 +0000 Subject: nginx load balancer with geoip? In-Reply-To: References: Message-ID: <20120302194958.GE4114@craic.sysops.org> On Fri, Mar 02, 2012 at 09:31:05AM -0500, delphixe2 wrote: Hi there, > work looks fine, request in korea perfectly proxied to nixneo.com and > other requests go to folderfile.net BUT! the problem appeared. > you can see the problem in this url : I can't get to folderfile.net, so I can't test this directly. > http://geotest.folderfile.net/index.php?mid=talkboard (original > url:http://delphixe.folderfile.net/index.php?mid=talkboard) > can't see the problem? let you explain it. > see my image : http://img717.imageshack.us/img717/3426/gipp.png I *think* this says "the proxied server creates links to its local resources using http:// and whatever the client sent in the Host: header". You can try adding proxy_set_header Host $host; > location / { > proxy_pass http://$geo; > } inside that location, so that the Host: header used will probably be resolvable by the client. Good luck with it, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Fri Mar 2 20:17:31 2012 From: nginx-forum at nginx.us (tantrix) Date: Fri, 2 Mar 2012 15:17:31 -0500 (EST) Subject: vhost error_log ignored with passenger Message-ID: I'm using passenger and seeing that stdout & stderr are going to nginx's default error log, rather than what's specified in the server { error_log ... } directive. Is this a known bug in nginx or passenger? server { listen 8082; access_log logs/ruby-access.log main; error_log logs/ruby-error.log; ## nothing in here from ruby's $std{out,err}! root /Users/paulm/Code/nginx/public; location / { passenger_enabled on; } } Here's all the code & config; it's a trivial Sinatra server: https://gist.github.com/1960979 Phusion Passenger from here: http://www.modrails.com/install.html (seems to install nginx 1.0.10) (The workaround is to File#reopen in config.ru but I'd like to avoid this, if possible.) Many thanks! Paul Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223288,223288#msg-223288 From nginx-forum at nginx.us Fri Mar 2 22:04:00 2012 From: nginx-forum at nginx.us (dbanks) Date: Fri, 2 Mar 2012 17:04:00 -0500 (EST) Subject: client keep alive support under HTTP/1.0 Message-ID: Hi, We're working on a server-to-server integration effort, using nginx as our front end. The guys on the other side are using ab (ApacheBench) to perform initial testing. ApacheBench includes a switch to turn on keepalive request support, but it only sends HTTP/1.0 requests. Our research on keepalives using HTTP/1.0 is inconclusive. Some resources (http://en.wikipedia.org/wiki/HTTP_persistent_connection) state that it is loosely supported, while other sources don't make that claim. Question: Is it possible to enable support for keep-alive connections using HTTP/1.0? If it matters, gzip is disabled in our config (we were hoping that it would result in the content-length header being set). Cheers, Dean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223289,223289#msg-223289 From adrian at navarro.at Fri Mar 2 23:53:15 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Sat, 3 Mar 2012 00:53:15 +0100 Subject: Get connected IPs and request addresses In-Reply-To: References: Message-ID: Does anyone know anything relating to the original message? Please. Thank you, Adrian On Wed, Feb 29, 2012 at 10:03 PM, Adri?n Navarro wrote: > Hello, > > We are currently serving files using X-Accel-Redirect. Previously, we > used lighttpd and we parsed the server-status page to retrieve IPs > along with the request and GET query: > > 192.168.10.11 ? 0/0 ? ? 157998/150305212 ? ? ? ?write ? 7 ? ? ? host ? ?/get.php?reference=xxxx > > (We need to store the reference and the IP and track them as long as > it's still writing to the connection) > > Is there a similar way to do such thing in nginx? Modules and other > solutions with the same result are welcome. > > Thank you for your time! > > -Adri?n -- Adri?n Navarro / (+34) 608 831 094 From nginx-forum at nginx.us Sat Mar 3 03:46:20 2012 From: nginx-forum at nginx.us (delphixe2) Date: Fri, 2 Mar 2012 22:46:20 -0500 (EST) Subject: nginx load balancer with geoip? In-Reply-To: References: Message-ID: I tried that, and I get 500 Internal Server Error. and more lines what I tested : proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; in any case, dosen't worked. temporarily, I solved problem. upstream default.folderfile.net { server folderfile.net; } upstream kr.folderfile.net { server nixneo.com; } location / { proxy_pass http://$geo.folderfile.net; } and I added record for default.folderfile.net -> folderfile.net's server IP & kr.folderfile.net -> nixneo.com's IP so, that image appeared, the link was : http://default.folderfile.net/modules/document/tpl/icons/file.gif but.. It is incomplete solution. * now, you can see that site. I opened my server. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223278,223291#msg-223291 From nginx-forum at nginx.us Sat Mar 3 15:07:12 2012 From: nginx-forum at nginx.us (alexus) Date: Sat, 3 Mar 2012 10:07:12 -0500 (EST) Subject: NGINX - forbidden custom message Message-ID: <8bc8724cdb6c1cc26c923f1efcff3da3.NginxMailingListEnglish@forum.nginx.org> sorry for being so direct but this is what I need to do... in one of my virtual hosts I need to show a custom message based on user's IP. for example... if user comes from 1.0.0.0/8 or 12.0.0.0/8 it get a custom message/page yet if user comes from anywhere else he'll be able to use site normally how would I accomplish that? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223295,223295#msg-223295 From appa at perusio.net Sat Mar 3 17:36:24 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sat, 03 Mar 2012 18:36:24 +0100 Subject: NGINX - forbidden custom message In-Reply-To: <8bc8724cdb6c1cc26c923f1efcff3da3.NginxMailingListEnglish@forum.nginx.org> References: <8bc8724cdb6c1cc26c923f1efcff3da3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8762ellh7r.wl%appa@perusio.net> On 3 Mar 2012 16h07 CET, nginx-forum at nginx.us wrote: > sorry for being so direct but this is what I need to do... > > in one of my virtual hosts I need to show a custom message based on > user's IP. > > for example... > > if user comes from 1.0.0.0/8 or 12.0.0.0/8 it get a custom > message/page yet if user comes from anywhere else he'll be able to > use site normally > how would I accomplish that? + 1st option At the http level: geo $forbidden_client { default 0; 1.0.0.0/8 1; 12.0.0.0/8 1; } server { # ... error_page 418 /custom_message.html; if ($forbidden_client) { return 418; } } + 2nd option server { # ... error_page 403 /custom_message.html; deny 1.0.0.0/8; deny 12.0.0.0/8; allow all; } --- appa From nginx-forum at nginx.us Sat Mar 3 18:00:01 2012 From: nginx-forum at nginx.us (didip) Date: Sat, 3 Mar 2012 13:00:01 -0500 (EST) Subject: nginx 1.0.11 + upload module compile error. Message-ID: Hi all, This is my nginx setup: * nginx 1.0.11 * nginx-upload-module 2.2.0 (http://www.grid.net.ru/nginx/upload.en.html) I can compile from source with --add-module flag on: * OS X Snow Leopard (gcc version 4.2.1) * Ubuntu 10.10 (gcc version 4.4.3) But compilation failed on Kubuntu 11.10 (gcc version 4.6.1) It failed because the http upload module defined a variable but the compiler claimed it wasn't used and fails compilation. Below is snippet inside ngx_http_upload_module.c static ngx_int_t /* {{{ ngx_http_upload_merge_ranges */ ngx_http_upload_merge_ranges(ngx_http_upload_ctx_t *u, ngx_http_upload_range_t *range_n) { int result; /* Some more code .... */ // This is where it is being called. if(out_buf.file_pos < state_file->info.st_size) { result = ftruncate(state_file->fd, out_buf.file_pos); } } If I change objs/Makefile to ignore warning, compilation works just fine. But obviously nginx likes to compile with strict rules. Inside objs/Makefile: CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror So my questions are: * Is this the module's fault? * Different gcc versions works differently? (I'm a noob in C) * Is there a way to fix it without editing objs/Makefile? I prefer to keep nginx source code as-is. And I'm ok to change the source code of the module because it looks abandoned anyway. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223298,223298#msg-223298 From nginx-forum at nginx.us Sat Mar 3 19:47:05 2012 From: nginx-forum at nginx.us (arsen) Date: Sat, 3 Mar 2012 14:47:05 -0500 (EST) Subject: monitor traffic through nginx' reverse proxy. In-Reply-To: <8DBF842602617E4F849805960974E3CC01B2DDC6@tx-irv-exch-01.bellsports.sportsgroup.loc> References: <8DBF842602617E4F849805960974E3CC01B2DDC6@tx-irv-exch-01.bellsports.sportsgroup.loc> Message-ID: <43de8a48802cb5f2dc1566aadc358174.NginxMailingListEnglish@forum.nginx.org> Hi check here https://github.com/monitisexchange/Monitis-Linux-Scripts/tree/master/Nginx-Reverse-Proxy-Monitor hope this will help you. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,29685,223299#msg-223299 From wtymdjs at gmail.com Sun Mar 4 01:30:35 2012 From: wtymdjs at gmail.com (adam estes) Date: Sat, 3 Mar 2012 20:30:35 -0500 Subject: SEO Friendly Urls Message-ID: I'm attempting to use Nginx to server a CodeIgniter Script. Code Igniter uses SEO Friendly scripts (AKA, only uses / instead of ?) This works fine when I try and use it on Apache. Trying to setup my own VPS with Code Igniter through NGINX only leans to a pain. The server is setup with the base folder being a phpbb form, and a codeigniter script in the folder /fg152/ I'm trying to get the nginx to recognize that index.php/login is supposed to be a query for code igniter, not a file of its own. I tried every configuration on this link. http://codeigniter.com/forums/viewthread/90231/ My current Nginx conf looks like this. location /fg152/ { root /home/sites/domain/fg152/; index index.php; try_files $uri $uri/ /fg152/index.php; } location / { root /home/sites/domain/; index index.php index.html index.htm; # PHPBB SEO REWRITE RULES - ADVANCED # AUTHOR : dcz www.phpbb-seo.com # STARTED : 01/2006 rewrite ^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /viewforum.php?f=$2&start=$4 last; rewrite ^/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?f=$2&t=$4&start=$6 last; rewrite ^/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?forum_uri=$1&t=$3&start=$5 last; rewrite ^/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/file.php?id=$2&t=$1 last; rewrite ^/member/([^/]+)/?$ /memberlist.php?mode=viewprofile&un=$1 last; rewrite ^/member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /search.php?author=$1&sr=$2&start=$4 last; rewrite ^/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$2&start=$4 last; rewrite ^/post([0-9]+)\.html$ /viewtopic.php?p=$1 last; rewrite ^/active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics last; rewrite ^/unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics last; rewrite ^/newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics last; rewrite ^/unreadposts(-([0-9]+))?\.html$ /search.php?search_id=unreadposts&start=$2 last; rewrite ^/the-team\.html$ /memberlist.php?mode=leaders last; rewrite ^/([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 last; rewrite ^/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 last; if (!-e $request_filename) { rewrite ^/([a-z0-9_/-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 last; break; } # END PHPBB PAGES } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # A handy function that became available in 0.7.31 that breaks down # The path information based on the provided regex expression # This is handy for requests such as file.php/some/paths/here/ fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$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; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_pass unix:/etc/phpcgi/php-cgi.socket; fastcgi_index index.php; } Now. This lets the script work. Instead of giving 404 on /fg152/index.php/login it shows the login page. EXCEPT the images do not log. Huge problem there. The images are located at /fg152/application/views/images/ And the login.php that its calling is located at /fg152/application/controllers/ If I remove the location /fg152/ it will show up with the image files again (But the rest gets a 404 error I've tried using location /fg152r/ { if (-f $request_filename) { expires max; break; } if (!-e $request_filename) { rewrite ^/fg152/(.*)$ /fg152/index.php/$1 last; } } Still no luck. What can I do to resolve this issue and get both php and image files working? From cliff at develix.com Sun Mar 4 02:33:31 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 03 Mar 2012 18:33:31 -0800 Subject: SEO Friendly Urls In-Reply-To: References: Message-ID: <1330828411.2361.47.camel@portable-evil> On Sat, 2012-03-03 at 20:30 -0500, adam estes wrote: > I'm attempting to use Nginx to server a CodeIgniter Script. > > Code Igniter uses SEO Friendly scripts (AKA, only uses / instead of ?) > > This works fine when I try and use it on Apache. Trying to setup my > own VPS with Code Igniter through NGINX only leans to a pain. > > The server is setup with the base folder being a phpbb form, and a > codeigniter script in the folder /fg152/ > > I'm trying to get the nginx to recognize that index.php/login is > supposed to be a query for code igniter, not a file of its own. > > I tried every configuration on this link. > > http://codeigniter.com/forums/viewthread/90231/ > > My current Nginx conf looks like this. > > > location /fg152/ { > root /home/sites/domain/fg152/; > index index.php; > try_files $uri $uri/ /fg152/index.php; > > } > The images are located at /fg152/application/views/images/ Try this instead: location /fg152 { root /home/sites/domain; index index.php; try_files $uri $uri/ /fg152/index.php; } Remember that the location is appended to the root, so your configuration would lead to /home/sites/domain/fg152/fg152, which I don't think is what you intended. Regards, Cliff From wtymdjs at gmail.com Sun Mar 4 03:27:34 2012 From: wtymdjs at gmail.com (adam estes) Date: Sat, 3 Mar 2012 22:27:34 -0500 Subject: SEO Friendly Urls In-Reply-To: <1330828411.2361.47.camel@portable-evil> References: <1330828411.2361.47.camel@portable-evil> Message-ID: Aha! That did it :) Thank you. On Sat, Mar 3, 2012 at 9:33 PM, Cliff Wells wrote: > On Sat, 2012-03-03 at 20:30 -0500, adam estes wrote: >> I'm attempting to use Nginx to server a CodeIgniter Script. >> >> Code Igniter uses SEO Friendly scripts (AKA, only uses / instead of ?) >> >> This works fine when I try and use it on Apache. Trying to setup my >> own VPS with Code Igniter through NGINX only leans to a pain. >> >> The server is setup with the base folder being a phpbb form, and a >> codeigniter script in the folder /fg152/ >> >> I'm trying to get the nginx to recognize that index.php/login is >> supposed to be a query for code igniter, not a file of its own. >> >> I tried every configuration on this link. >> >> http://codeigniter.com/forums/viewthread/90231/ >> >> My current Nginx conf looks like this. >> >> >> ? ? ? ? ? ? ? ? location /fg152/ { >> ? ? ? ? ? ? ? ? ? ? ? ? root /home/sites/domain/fg152/; >> ? ? ? ? ? ? ? ? ? ? ? ? index index.php; >> ? ? ? ? ? ? ? ? ? ? ? ? try_files $uri $uri/ /fg152/index.php; >> >> ? ? ? ? ? ? ? ? } > > >> The images are located at /fg152/application/views/images/ > > > Try this instead: > > ? ? ? ? ? ? ? ?location /fg152 { > ? ? ? ? ? ? ? ? ? ? ? ? root /home/sites/domain; > ? ? ? ? ? ? ? ? ? ? ? ? index index.php; > ? ? ? ? ? ? ? ? ? ? ? ? try_files $uri $uri/ /fg152/index.php; > ? ? ? ? ? ? ? ? } > > Remember that the location is appended to the root, so your > configuration would lead to /home/sites/domain/fg152/fg152, which I > don't think is what you intended. > > Regards, > Cliff > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From apostols at gmail.com Sun Mar 4 05:11:13 2012 From: apostols at gmail.com (Juan Angulo Moreno) Date: Sun, 4 Mar 2012 00:41:13 -0430 Subject: nginx load balancing Message-ID: Hi, I try configure nginx load balancing with 3 nodes but never show images or ccs style from nodes and always obtain this error: 2012/03/03 22:36:43 [error] 11321#0: *7 open() "/usr/local/nginx/html/melchor.jpg" failed (2: No such file or directory), client: 181.XX.XX.XX, server: edge.lb.tld, request: "GET /melchor.jpg HTTP/1.1", host: "edge.lb.tld", referrer: "http://edge.lb.tld/" 2012/03/03 22:38:16 [error] 11321#0: *19 open() "/usr/local/nginx/html/css/style.css" failed (2: No such file or directory), client: 200.XX.XX.XX, server: edge.lb.tld, request: "GET /css/style.css HTTP/1.1", host: "edge.lb.tld", referrer: "http://edge.lb.tld/" This is my vhost config: upstream edge { server 72.XX.XX.XX:80; server 216.XX.XX.XX:80; server 184.XX.XX.XX:80; } server { server_name edge.lb.tld; error_log /var/log/nginx/EDGE.error_log warn; location / { proxy_set_header Host $http_host; proxy_pass http://edge; } } Thanks you! From edho at myconan.net Sun Mar 4 05:14:31 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 12:14:31 +0700 Subject: nginx load balancing In-Reply-To: References: Message-ID: 2012/3/4 Juan Angulo Moreno : > Hi, > > I try configure nginx load balancing with 3 nodes but never show > images or ccs style from nodes and always obtain this error: > > 2012/03/03 22:36:43 [error] 11321#0: *7 open() > "/usr/local/nginx/html/melchor.jpg" failed (2: No such file or > directory), client: 181.XX.XX.XX, server: edge.lb.tld, request: "GET > /melchor.jpg HTTP/1.1", host: "edge.lb.tld", referrer: > "http://edge.lb.tld/" > 2012/03/03 22:38:16 [error] 11321#0: *19 open() > "/usr/local/nginx/html/css/style.css" failed (2: No such file or > directory), client: 200.XX.XX.XX, server: edge.lb.tld, request: "GET > /css/style.css HTTP/1.1", host: "edge.lb.tld", referrer: > "http://edge.lb.tld/" > If this is the load balancer's error log, seems like the config hasn't been reloaded. Try `pkill -HUP nginx`. From wtymdjs at gmail.com Sun Mar 4 05:18:53 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 00:18:53 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: Actually, that fixed -most- of it. Butttt FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f Gives a 404 not found :( On Sat, Mar 3, 2012 at 10:27 PM, adam estes wrote: > Aha! That did it :) > > Thank you. > > On Sat, Mar 3, 2012 at 9:33 PM, Cliff Wells wrote: >> On Sat, 2012-03-03 at 20:30 -0500, adam estes wrote: >>> I'm attempting to use Nginx to server a CodeIgniter Script. >>> >>> Code Igniter uses SEO Friendly scripts (AKA, only uses / instead of ?) >>> >>> This works fine when I try and use it on Apache. Trying to setup my >>> own VPS with Code Igniter through NGINX only leans to a pain. >>> >>> The server is setup with the base folder being a phpbb form, and a >>> codeigniter script in the folder /fg152/ >>> >>> I'm trying to get the nginx to recognize that index.php/login is >>> supposed to be a query for code igniter, not a file of its own. >>> >>> I tried every configuration on this link. >>> >>> http://codeigniter.com/forums/viewthread/90231/ >>> >>> My current Nginx conf looks like this. >>> >>> >>> ? ? ? ? ? ? ? ? location /fg152/ { >>> ? ? ? ? ? ? ? ? ? ? ? ? root /home/sites/domain/fg152/; >>> ? ? ? ? ? ? ? ? ? ? ? ? index index.php; >>> ? ? ? ? ? ? ? ? ? ? ? ? try_files $uri $uri/ /fg152/index.php; >>> >>> ? ? ? ? ? ? ? ? } >> >> >>> The images are located at /fg152/application/views/images/ >> >> >> Try this instead: >> >> ? ? ? ? ? ? ? ?location /fg152 { >> ? ? ? ? ? ? ? ? ? ? ? ? root /home/sites/domain; >> ? ? ? ? ? ? ? ? ? ? ? ? index index.php; >> ? ? ? ? ? ? ? ? ? ? ? ? try_files $uri $uri/ /fg152/index.php; >> ? ? ? ? ? ? ? ? } >> >> Remember that the location is appended to the root, so your >> configuration would lead to /home/sites/domain/fg152/fg152, which I >> don't think is what you intended. >> >> Regards, >> Cliff >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 05:22:52 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 12:22:52 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > Actually, that fixed -most- of it. Butttt > > FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f > > Gives a 404 not found :( > location ~ \.php$ { should be: location ~ \.php($|/) { From wtymdjs at gmail.com Sun Mar 4 05:27:55 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 00:27:55 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: That just broke things. It provides No input file specified. when accessing any index.php links in the /fg152 folder. Including just going to /fg152/index.php On Sun, Mar 4, 2012 at 12:22 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> Actually, that fixed -most- of it. Butttt >> >> FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f >> >> Gives a 404 not found :( >> > > location ~ \.php$ { > > should be: > > location ~ \.php($|/) { > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 05:33:30 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 12:33:30 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > That just broke things. > > It provides No input file specified. when accessing any index.php > links in the /fg152 folder. Including just going to /fg152/index.php > Try this instead: location ~ \.php { From wtymdjs at gmail.com Sun Mar 4 05:38:21 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 00:38:21 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: Still giving the same thing :( On Sun, Mar 4, 2012 at 12:33 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> That just broke things. >> >> It provides No input file specified. when accessing any index.php >> links in the /fg152 folder. Including just going to /fg152/index.php >> > > Try this instead: > > location ~ \.php { > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From apostols at gmail.com Sun Mar 4 05:40:31 2012 From: apostols at gmail.com (Juan Angulo Moreno) Date: Sun, 4 Mar 2012 01:10:31 -0430 Subject: nginx load balancing In-Reply-To: References: Message-ID: Hi Edho, I ran the command you suggested but still does not show the images and ccs. thanks On Sun, Mar 4, 2012 at 12:44 AM, Edho Arief wrote: > 2012/3/4 Juan Angulo Moreno : >> Hi, >> >> I try configure nginx load balancing with 3 nodes but never show >> images or ccs style from nodes and always obtain this error: >> >> 2012/03/03 22:36:43 [error] 11321#0: *7 open() >> "/usr/local/nginx/html/melchor.jpg" failed (2: No such file or >> directory), client: 181.XX.XX.XX, server: edge.lb.tld, request: "GET >> /melchor.jpg HTTP/1.1", host: "edge.lb.tld", referrer: >> "http://edge.lb.tld/" >> 2012/03/03 22:38:16 [error] 11321#0: *19 open() >> "/usr/local/nginx/html/css/style.css" failed (2: No such file or >> directory), client: 200.XX.XX.XX, server: edge.lb.tld, request: "GET >> /css/style.css HTTP/1.1", host: "edge.lb.tld", referrer: >> "http://edge.lb.tld/" >> > > If this is the load balancer's error log, seems like the config hasn't > been reloaded. Try `pkill -HUP nginx`. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Juan A. Moreno http://apostols.net Fingerprint GPG: 0FEE E0BF 2904 FE77 1682 2171 C842 DBF1 34BC CD04 From edho at myconan.net Sun Mar 4 05:41:17 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 12:41:17 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > Still giving the same thing :( > Can you send your current config? In pastebin instead of email. From edho at myconan.net Sun Mar 4 05:41:45 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 12:41:45 +0700 Subject: nginx load balancing In-Reply-To: References: Message-ID: 2012/3/4 Juan Angulo Moreno : > Hi Edho, > > I ran the command you suggested but still does not show the images and ccs. > Still the same error? From apostols at gmail.com Sun Mar 4 05:43:19 2012 From: apostols at gmail.com (Juan Angulo Moreno) Date: Sun, 4 Mar 2012 01:13:19 -0430 Subject: nginx load balancing In-Reply-To: References: Message-ID: now not show erros but dont show the images and ccs files. On Sun, Mar 4, 2012 at 1:11 AM, Edho Arief wrote: > 2012/3/4 Juan Angulo Moreno : >> Hi Edho, >> >> I ran the command you suggested but still does not show the images and ccs. >> > > Still the same error? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Juan A. Moreno http://apostols.net Fingerprint GPG: 0FEE E0BF 2904 FE77 1682 2171 C842 DBF1 34BC CD04 From wtymdjs at gmail.com Sun Mar 4 05:47:49 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 00:47:49 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: http://pastebin.com/3uz4tCmd On Sun, Mar 4, 2012 at 12:41 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> Still giving the same thing :( >> > > Can you send your current config? In pastebin instead of email. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 05:56:02 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 12:56:02 +0700 Subject: nginx load balancing In-Reply-To: References: Message-ID: 2012/3/4 Juan Angulo Moreno : > now not show erros but dont show the images and ccs files. > Check the access log. From wtymdjs at gmail.com Sun Mar 4 06:04:06 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 01:04:06 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: To expand on this. /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f This link tells index.php to load cron.php which then run the graburls command which uses the cronkey (Which is the lost aug) This returns a 404 with the current config. On Sun, Mar 4, 2012 at 12:47 AM, adam estes wrote: > http://pastebin.com/3uz4tCmd > > On Sun, Mar 4, 2012 at 12:41 AM, Edho Arief wrote: >> 2012/3/4 adam estes : >>> Still giving the same thing :( >>> >> >> Can you send your current config? In pastebin instead of email. >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 06:06:03 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 13:06:03 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > To expand on this. > > /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f > > This link tells index.php to load cron.php which then run the graburls > command which uses the cronkey (Which is the lost aug) > > This returns a 404 with the current config. Does the /fg512/index.php work? The 404 comes from nginx or php? From wtymdjs at gmail.com Sun Mar 4 06:07:58 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 01:07:58 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: Yes. The index.php does work. It also works with anything that doesn't need multiple inputs Such as index.php/log index.php/keywords etc The error comes from nginx 404 Not Found nginx/1.0.5 On Sun, Mar 4, 2012 at 1:06 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> To expand on this. >> >> /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f >> >> This link tells index.php to load cron.php which then run the graburls >> command which uses the cronkey (Which is the lost aug) >> >> This returns a 404 with the current config. > > Does the /fg512/index.php work? The 404 comes from nginx or php? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 06:12:56 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 13:12:56 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > Yes. The index.php does work. It also works with anything that doesn't > need multiple inputs > > Such as > > index.php/log > index.php/keywords > > etc > > The error comes from nginx > What's in error log? From wtymdjs at gmail.com Sun Mar 4 06:17:03 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 01:17:03 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/03/04 01:15:30 [error] 7662#0: *36 open() "/home/sites/domain/FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f" failed (2: No such file or directory), client: 71.3.129.216, server: domain.us, request: "GET$ /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f HTTP/1.1", host: "domain.us" On Sun, Mar 4, 2012 at 1:04 AM, adam estes wrote: > To expand on this. > > /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f > > This link tells index.php to load cron.php which then run the graburls > command which uses the cronkey (Which is the lost aug) > > This returns a 404 with the current config. > On Sun, Mar 4, 2012 at 12:47 AM, adam estes wrote: >> http://pastebin.com/3uz4tCmd >> >> On Sun, Mar 4, 2012 at 12:41 AM, Edho Arief wrote: >>> 2012/3/4 adam estes : >>>> Still giving the same thing :( >>>> >>> >>> Can you send your current config? In pastebin instead of email. >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 06:26:09 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 13:26:09 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > 2012/03/04 01:15:30 [error] 7662#0: *36 open() > "/home/sites/domain/FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f" > failed (2: No such file or directory), client: 71.3.129.216, server: > domain.us, request: "GET$ > /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f > HTTP/1.1", host: "domain.us" > > Is it with location ~ \.php or location ~\.php$ ? From wtymdjs at gmail.com Sun Mar 4 06:27:46 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 01:27:46 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: Right now its \.php It had the $ before and still gave the error. On Sun, Mar 4, 2012 at 1:26 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> 2012/03/04 01:15:30 [error] 7662#0: *36 open() >> "/home/sites/domain/FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f" >> failed (2: No such file or directory), client: 71.3.129.216, server: >> domain.us, request: "GET$ >> /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f >> HTTP/1.1", host: "domain.us" >> >> > > Is it with location ~ \.php or location ~\.php$ ? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 06:36:40 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 13:36:40 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > Right now its \.php > > It had the $ before and still gave the error. > Try reverting to \.php$ and add one more location block: location ~ \.php/ { return 503; } From wtymdjs at gmail.com Sun Mar 4 06:40:27 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 01:40:27 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: returns 503 On Sun, Mar 4, 2012 at 1:36 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> Right now its \.php >> >> It had the $ before and still gave the error. >> > > Try reverting to \.php$ and add one more location block: > > location ~ \.php/ { > ?return 503; > } > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 06:57:59 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 13:57:59 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > returns 503 > Remove the php/ block and change php$ to php (location ~ \.php {) From wtymdjs at gmail.com Sun Mar 4 07:01:11 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 02:01:11 -0500 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: That puts us back to how we where before you had me add that block :P On Sun, Mar 4, 2012 at 1:57 AM, Edho Arief wrote: > 2012/3/4 adam estes : >> returns 503 >> > > Remove the php/ block and change php$ to php (location ~ \.php {) > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From n.sherlock at gmail.com Sun Mar 4 09:13:48 2012 From: n.sherlock at gmail.com (Nicholas Sherlock) Date: Sun, 4 Mar 2012 09:13:48 +0000 (UTC) Subject: Disable error page for one location? Message-ID: Hi everyone, I'm using Nginx to proxy to an Apache backend. The backend generates a wide variety of ugly 404- and 500-code error messages that I don't really want to show to the end-user, so in my server block I've got: proxy_intercept_errors on; error_page 500 502 503 504 /error/500.html; error_page 400 /error/404.html; The backend scripts in one of my locations generate useful 404 (but not 500) messages that I want to pass through to the client. How can I pass through just 404 errors in one particular location from my backend to the client? Thanks, Nicholas Sherlock From francis at daoine.org Sun Mar 4 09:23:06 2012 From: francis at daoine.org (Francis Daly) Date: Sun, 4 Mar 2012 09:23:06 +0000 Subject: nginx load balancer with geoip? In-Reply-To: References: Message-ID: <20120304092306.GF4114@craic.sysops.org> On Fri, Mar 02, 2012 at 10:46:20PM -0500, delphixe2 wrote: Hi there, you've found something that works for you, so you can stay with that configuration. However: > I tried that, and I get 500 Internal Server Error. I find that it is usually worth understanding *why* configurations fail, so it might be worth investigating happened there. > and more lines what I tested : > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; They can be useful if the proxied server is configured to care about them. > temporarily, I solved problem. > upstream default.folderfile.net { > server folderfile.net; > } > upstream kr.folderfile.net { > server nixneo.com; > } > > location / { > proxy_pass http://$geo.folderfile.net; > } > > and I added record for default.folderfile.net -> folderfile.net's server > IP & kr.folderfile.net -> nixneo.com's IP Perhaps nixneo.com responds differently based on the source address; but from where I am, it looks like you have a redirector, not a reverse proxy. When I access the IP address of nixneo.com, if I make a http request with anything other than a Host: header of "nixneo.com", I get a 302 redirect to http://nixneo.com/ So to get useful content back in a proxy_pass location, I'd need to set the correct Host header. All the best, f -- Francis Daly francis at daoine.org From francis at daoine.org Sun Mar 4 09:35:29 2012 From: francis at daoine.org (Francis Daly) Date: Sun, 4 Mar 2012 09:35:29 +0000 Subject: Disable error page for one location? In-Reply-To: References: Message-ID: <20120304093529.GG4114@craic.sysops.org> On Sun, Mar 04, 2012 at 09:13:48AM +0000, Nicholas Sherlock wrote: Hi there, > proxy_intercept_errors on; > error_page 500 502 503 504 /error/500.html; > error_page 400 /error/404.html; > > The backend scripts in one of my locations generate useful 404 (but not 500) > messages that I want to pass through to the client. How can I pass through > just 404 errors in one particular location from my backend to the client? Untested, but: "error_page" determines which response codes are *not* passed through as-is. And directive values between levels are generally inherited or replaced, but not added. So, in the location you care about, repeating your server-level error_page directives without the 404 one, should Just Work. f -- Francis Daly francis at daoine.org From n.sherlock at gmail.com Sun Mar 4 11:01:19 2012 From: n.sherlock at gmail.com (Nicholas Sherlock) Date: Sun, 04 Mar 2012 20:01:19 +0900 Subject: Disable error page for one location? In-Reply-To: <20120304093529.GG4114@craic.sysops.org> References: <20120304093529.GG4114@craic.sysops.org> Message-ID: On 4/03/2012 6:35 p.m., Francis Daly wrote: > "error_page" determines which response codes are *not* passed through as-is. > > And directive values between levels are generally inherited or replaced, > but not added. > > So, in the location you care about, repeating your server-level error_page > directives without the 404 one, should Just Work. That works, thanks! Cheers, Nicholas Sherlock From edho at myconan.net Sun Mar 4 12:07:14 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 19:07:14 +0700 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: 2012/3/4 adam estes : > That puts us back to how we where before you had me add that block :P > Since the error came from nginx, seems like you didn't reload the config properly. From mdounin at mdounin.ru Fri Mar 2 18:01:34 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 2 Mar 2012 22:01:34 +0400 Subject: Latency problem with one browser In-Reply-To: References: <20120302135146.GL67687@mdounin.ru> Message-ID: <20120302180134.GQ67687@mdounin.ru> Hello! On Fri, Mar 02, 2012 at 08:48:43PM +0400, Max wrote: > > 02 ????? 2012, 19:53 ?? Andrea Soracchi : > > Yes, > > > > with "keepalive_disable none;" works fine! > > Maxim, do you think the Playbook browser should be added as a > separate browser (unsigned playbook:1 entry in ngx_http_headers_in_t) > to prevent it from getting the Safari keepalive disabled treatment? > > Here's a typical Playbook browser User-Agent string, adding an if > block for "Playbook" before the "Safari" if block in > ngx_http_process_user_agent() should do the trick: > > Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) \ > AppleWebKit/534.8+ (KHTML like Gecko) version/0.0.1 Safari/534.8+ Detecting all browsers (thousands of them) which pretend to be Safari is not an option. And, after all, browsers use other's product token for reason, and workarounds for bugs is what they expect to get as a result. I'm planning to disable this Safari workaround by default instead, the following patch is already sitting in my queue: # HG changeset patch # User Maxim Dounin # Date 1330697796 -14400 # Node ID 88e257b4bd3d61e30d1421ab6f2e417a8baedb96 # Parent 277a1822fc5cf7ad83297c74839ca8c84a49680c Removed safari from keepalive_disable default. The bug in question is likely already fixed (though unfortunately we have no information available as Apple's bugtracker isn't open), and the workaround seems to be too pessimistic for modern versions of Safari as well as other webkit-based browsers pretending to be Safari. diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -3568,8 +3568,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t ngx_conf_merge_bitmask_value(conf->keepalive_disable, prev->keepalive_disable, (NGX_CONF_BITMASK_SET - |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 - |NGX_HTTP_KEEPALIVE_DISABLE_SAFARI)); + |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6)); ngx_conf_merge_uint_value(conf->satisfy, prev->satisfy, NGX_HTTP_SATISFY_ALL); ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since, Maxim Dounin From francis at daoine.org Sun Mar 4 13:13:48 2012 From: francis at daoine.org (Francis Daly) Date: Sun, 4 Mar 2012 13:13:48 +0000 Subject: SEO Friendly Urls In-Reply-To: References: <1330828411.2361.47.camel@portable-evil> Message-ID: <20120304131348.GH4114@craic.sysops.org> On Sun, Mar 04, 2012 at 12:47:49AM -0500, adam estes wrote: Hi there, > http://pastebin.com/3uz4tCmd If I've understood what you are trying to do, will === location ^~ /fg152 { root /usr/local/domain; index index.php index.html; try_files $uri $uri/ /fg152/index.php; location = /fg152/index.php { include fastcgi.conf; fastcgi_pass unix:/etc/phpcgi/php-cgi.socket; } } === fit the requirements? You can probably move "root", "index", and "include" to server level, if they are common to other locations. Be aware that this effectively *removes* the /.ht and /.svn protection config for this location hierarchy, so you'll want to either put them back in, or (better) not have readable files in the web space that you don't want served. And if you try to access /fg152a, you might be a bit surprised -- but that can be adjusted later if necessary. f -- Francis Daly francis at daoine.org From ne at vbart.ru Sun Mar 4 13:14:02 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Sun, 4 Mar 2012 17:14:02 +0400 Subject: SEO Friendly Urls In-Reply-To: References: Message-ID: <201203041714.03069.ne@vbart.ru> On Sunday 04 March 2012 10:17:03 adam estes wrote: > 2012/03/04 01:15:30 [error] 7662#0: *36 open() > "/home/sites/domain/FG152/index.php/cron/graburls/999182b003023a35c327db371 > a74a85f" failed (2: No such file or directory), client: 71.3.129.216, > server: domain.us, request: "GET$ > /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f > HTTP/1.1", host: "domain.us" > Just for your note, FG152 doesn't equal fg152. wbr, Valentin V. Bartenev From piotr.sikora at frickle.com Sun Mar 4 13:39:53 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Sun, 4 Mar 2012 14:39:53 +0100 Subject: Latency problem with one browser In-Reply-To: <20120302180134.GQ67687@mdounin.ru> References: <20120302135146.GL67687@mdounin.ru> <20120302180134.GQ67687@mdounin.ru> Message-ID: Hi Maxim, >> Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) \ >> AppleWebKit/534.8+ (KHTML like Gecko) version/0.0.1 Safari/534.8+ > > Detecting all browsers (thousands of them) which pretend to be > Safari is not an option. And, after all, browsers use other's > product token for reason, and workarounds for bugs is what they > expect to get as a result. Except that PlayBook isn't a browser, it's a device ;) > I'm planning to disable this Safari workaround by default instead, > the following patch is already sitting in my queue: > > # HG changeset patch > # User Maxim Dounin > # Date 1330697796 -14400 > # Node ID 88e257b4bd3d61e30d1421ab6f2e417a8baedb96 > # Parent 277a1822fc5cf7ad83297c74839ca8c84a49680c > Removed safari from keepalive_disable default. > > The bug in question is likely already fixed (though unfortunately we have > no information available as Apple's bugtracker isn't open), and the > workaround seems to be too pessimistic for modern versions of Safari > as well as other webkit-based browsers pretending to be Safari. > > diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c > --- a/src/http/ngx_http_core_module.c > +++ b/src/http/ngx_http_core_module.c > @@ -3568,8 +3568,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t > ngx_conf_merge_bitmask_value(conf->keepalive_disable, > prev->keepalive_disable, > (NGX_CONF_BITMASK_SET > - |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 > - |NGX_HTTP_KEEPALIVE_DISABLE_SAFARI)); > + |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6)); > ngx_conf_merge_uint_value(conf->satisfy, prev->satisfy, > NGX_HTTP_SATISFY_ALL); > ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since, I don't really agree with this, it's analogues to removing IE work-around instead of restricting it to versions older than IE6 SV1. I was looking at this issue over the weekend and the "keepalive_disable safari" option is simply too broad and that's what needs to be fixed. According to https://bugs.webkit.org/show_bug.cgi?id=5760#c38, the underlying issue was in the Foundation framework on iOS/OSX, not Safari, which means that Safari on Windows as well as everything else (Android, BlackBerry, etc.) that uses WebKit was never affected. I agree with you and I believe that it's fixed in the most recent releases of iOS/OSX, but I wouldn't bet that it's fixed in iOS 4.x, OSX 10.6.x or older releases, so why should we disable the work-around for them? Best regards, Piotr Sikora < piotr.sikora at frickle.com > From ne at vbart.ru Sun Mar 4 13:44:32 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Sun, 4 Mar 2012 17:44:32 +0400 Subject: client keep alive support under HTTP/1.0 In-Reply-To: References: Message-ID: <201203041744.32631.ne@vbart.ru> On Saturday 03 March 2012 02:04:00 dbanks wrote: > Hi, > > We're working on a server-to-server integration effort, using nginx as > our front end. The guys on the other side are using ab (ApacheBench) to > perform initial testing. ApacheBench includes a switch to turn on > keepalive request support, but it only sends HTTP/1.0 requests. I don't recommend to use it. "ab" is slow and buggy. > Our research on keepalives using HTTP/1.0 is inconclusive. Some > resources (http://en.wikipedia.org/wiki/HTTP_persistent_connection) > state that it is loosely supported, while other sources don't make that > claim. > > Question: Is it possible to enable support for keep-alive connections > using HTTP/1.0? > NGINX supports it by default. If you need to disable it, then set: keepalive_timeout 0; wbr, Valentin V. Bartenev From ne at vbart.ru Sun Mar 4 14:04:17 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Sun, 4 Mar 2012 18:04:17 +0400 Subject: nginx load balancing In-Reply-To: References: Message-ID: <201203041804.18023.ne@vbart.ru> On Sunday 04 March 2012 09:43:19 Juan Angulo Moreno wrote: > now not show erros but dont show the images and ccs files. > Do you clear your browser cache? wbr, Valentin V. Bartenev From apostols at gmail.com Sun Mar 4 14:08:18 2012 From: apostols at gmail.com (Juan Angulo Moreno) Date: Sun, 4 Mar 2012 09:38:18 -0430 Subject: nginx load balancing In-Reply-To: References: Message-ID: 181.17.XX.XX - - [04/Mar/2012:09:32:53 -0430] "GET /css/style.css HTTP/1.1" 200 3870 "http://edge.lb.tld" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" 181.17.XX.XX - - [04/Mar/2012:09:34:09 -0430] "GET /img/common/logo.gif HTTP/1.1" 404 257 "http://edge.lb.tld" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" 181.17.XX.XX - - [04/Mar/2012:09:34:09 -0430] "GET /img/common/top_bg.png HTTP/1.1" 404 1007 "http://edge.lb.tld" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" On Sun, Mar 4, 2012 at 1:26 AM, Edho Arief wrote: > 2012/3/4 Juan Angulo Moreno : >> now not show erros but dont show the images and ccs files. >> > > Check the access log. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From apostols at gmail.com Sun Mar 4 14:10:05 2012 From: apostols at gmail.com (Juan Angulo Moreno) Date: Sun, 4 Mar 2012 09:40:05 -0430 Subject: nginx load balancing In-Reply-To: <201203041804.18023.ne@vbart.ru> References: <201203041804.18023.ne@vbart.ru> Message-ID: I cleaned the cache and still images are not displayed. I am using 2 browsers for testing and always get the same result. On Sun, Mar 4, 2012 at 9:34 AM, Valentin V. Bartenev wrote: > On Sunday 04 March 2012 09:43:19 Juan Angulo Moreno wrote: >> now not show erros but dont show the images and ccs files. >> > > Do you clear your browser cache? > > ?wbr, Valentin V. Bartenev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From edho at myconan.net Sun Mar 4 14:10:39 2012 From: edho at myconan.net (Edho Arief) Date: Sun, 4 Mar 2012 21:10:39 +0700 Subject: nginx load balancing In-Reply-To: References: Message-ID: 2012/3/4 Juan Angulo Moreno : > 181.17.XX.XX - - [04/Mar/2012:09:32:53 -0430] "GET /css/style.css > HTTP/1.1" 200 3870 "http://edge.lb.tld" "Mozilla/5.0 (Macintosh; Intel > Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) > Chrome/17.0.963.56 Safari/535.11" > 181.17.XX.XX - - [04/Mar/2012:09:34:09 -0430] "GET > /img/common/logo.gif HTTP/1.1" 404 257 "http://edge.lb.tld" > "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 > (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" > 181.17.XX.XX - - [04/Mar/2012:09:34:09 -0430] "GET > /img/common/top_bg.png HTTP/1.1" 404 1007 "http://edge.lb.tld" > "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 > (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" > Are you sure your backends are configured properly? Have you tried accessing the backends directly? From appa at perusio.net Sun Mar 4 15:02:55 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sun, 04 Mar 2012 16:02:55 +0100 Subject: nginx load balancing In-Reply-To: References: Message-ID: <87wr704deo.wl%appa@perusio.net> On 4 Mar 2012 06h11 CET, apostols at gmail.com wrote: > Hi, > > I try configure nginx load balancing with 3 nodes but never show > images or ccs style from nodes and always obtain this error: > > 2012/03/03 22:36:43 [error] 11321#0: *7 open() > "/usr/local/nginx/html/melchor.jpg" failed (2: No such file or > directory), client: 181.XX.XX.XX, server: edge.lb.tld, request: "GET > /melchor.jpg HTTP/1.1", host: "edge.lb.tld", referrer: > "http://edge.lb.tld/" > 2012/03/03 22:38:16 [error] 11321#0: *19 open() > "/usr/local/nginx/html/css/style.css" failed (2: No such file or > directory), client: 200.XX.XX.XX, server: edge.lb.tld, request: "GET > /css/style.css HTTP/1.1", host: "edge.lb.tld", referrer: > "http://edge.lb.tld/" > > This is my vhost config: > > upstream edge { > server 72.XX.XX.XX:80; > server 216.XX.XX.XX:80; > server 184.XX.XX.XX:80; > } > > server { > server_name edge.lb.tld; > > error_log /var/log/nginx/EDGE.error_log warn; > > location / { > proxy_set_header Host $http_host; > proxy_pass http://edge; > } > } Perhaps the links in the site do not point to the proper location. With a config as simple as yours, the problem is either in the app or in the backend configuration. You have no root defined so Nginx is trying the open the files with the default root: /usr/local/nginx/html I suggest you enable the debug log and trace the request: http://nginx.org/en/docs/debugging_log.html --- appa From quintinpar at gmail.com Sun Mar 4 15:26:04 2012 From: quintinpar at gmail.com (Quintin Par) Date: Sun, 4 Mar 2012 20:56:04 +0530 Subject: Multiple caching solutions for anonymous and logged in users with SSI on Message-ID: Hi all, I currently have a good caching solution for non-logged in users as shown below location / { proxy_pass http://localhost:82; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding ""; proxy_ignore_headers Set-Cookie; proxy_ignore_headers Cache-Control; proxy_ignore_headers Expires; proxy_ignore_headers X-Accel-Expires; proxy_no_cache $cookie_sessionid; proxy_cache_bypass $cookie_sessionid; proxy_cache cache; proxy_cache_key $scheme$host$request_uri; proxy_cache_valid 200 302 5m; proxy_cache_valid 404 1m; proxy_cache_use_stale updating; } But this is proving to be a lot of load when accessed by logged-in users(with cookie). Typically situations like homepage (collection of a lot of snippets) So in the same location directive, *how can I apply an additional caching strategy with SSI on*(users name details which needs to be pulled up every time) for logged in users. Say cache pages for logged in users for a minute with caching for non logged in users at 15 minutes. I also want proxy_cache_bypass $cookie_sessionid; to refresh cache entries. I believe this is scenario for a lot of websites out there. Can someone help please? -Quintin -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Sun Mar 4 17:40:46 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 4 Mar 2012 21:40:46 +0400 Subject: Latency problem with one browser In-Reply-To: References: <20120302135146.GL67687@mdounin.ru> <20120302180134.GQ67687@mdounin.ru> Message-ID: <20120304174045.GW67687@mdounin.ru> Hello! On Sun, Mar 04, 2012 at 02:39:53PM +0100, Piotr Sikora wrote: > Hi Maxim, > > >>Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) \ > >>AppleWebKit/534.8+ (KHTML like Gecko) version/0.0.1 Safari/534.8+ > > > >Detecting all browsers (thousands of them) which pretend to be > >Safari is not an option. And, after all, browsers use other's > >product token for reason, and workarounds for bugs is what they > >expect to get as a result. > > Except that PlayBook isn't a browser, it's a device ;) > > >I'm planning to disable this Safari workaround by default instead, > >the following patch is already sitting in my queue: > > > ># HG changeset patch > ># User Maxim Dounin > ># Date 1330697796 -14400 > ># Node ID 88e257b4bd3d61e30d1421ab6f2e417a8baedb96 > ># Parent 277a1822fc5cf7ad83297c74839ca8c84a49680c > >Removed safari from keepalive_disable default. > > > >The bug in question is likely already fixed (though unfortunately we have > >no information available as Apple's bugtracker isn't open), and the > >workaround seems to be too pessimistic for modern versions of Safari > >as well as other webkit-based browsers pretending to be Safari. > > > >diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c > >--- a/src/http/ngx_http_core_module.c > >+++ b/src/http/ngx_http_core_module.c > >@@ -3568,8 +3568,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t > >ngx_conf_merge_bitmask_value(conf->keepalive_disable, > > prev->keepalive_disable, > > (NGX_CONF_BITMASK_SET > >- |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 > >- |NGX_HTTP_KEEPALIVE_DISABLE_SAFARI)); > >+ |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6)); > > ngx_conf_merge_uint_value(conf->satisfy, prev->satisfy, > > NGX_HTTP_SATISFY_ALL); > > ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since, > > I don't really agree with this, it's analogues to removing IE work-around > instead of restricting it to versions older than IE6 SV1. I was looking at > this issue over the weekend and the "keepalive_disable safari" option is > simply too broad and that's what needs to be fixed. > > According to https://bugs.webkit.org/show_bug.cgi?id=5760#c38, > the underlying issue was in the Foundation framework on iOS/OSX, not Safari, > which means that Safari on Windows as well as everything else (Android, > BlackBerry, etc.) that uses WebKit was never affected. > > I agree with you and I believe that it's fixed in the most recent releases > of iOS/OSX, but I wouldn't bet that it's fixed in iOS 4.x, OSX 10.6.x or > older releases, so why should we disable the work-around for them? I believe that the workaround is too pessimistic even for affected versions as it disables keepalive completely, while the problem will only manifest itself if there are POSTs. If someone will find itself affected and the cost of disabled keepalive is acceptable - it will be still possible to explicitly enable the workaround. Restricting the workaround to something like "Safari on Mac OS X" would be fine too, though it's mostly orthogonal to changing the default. Maxim Dounin From piotr.sikora at frickle.com Sun Mar 4 20:35:36 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Sun, 4 Mar 2012 21:35:36 +0100 Subject: Latency problem with one browser In-Reply-To: <20120304174045.GW67687@mdounin.ru> References: <20120302135146.GL67687@mdounin.ru> <20120302180134.GQ67687@mdounin.ru> <20120304174045.GW67687@mdounin.ru> Message-ID: Hi Maxim, > I believe that the workaround is too pessimistic even for affected > versions as it disables keepalive completely, while the problem > will only manifest itself if there are POSTs. > > If someone will find itself affected and the cost of disabled > keepalive is acceptable - it will be still possible to explicitly > enable the workaround. I'm aware of this and I still respectfully disagree with you, because changing the default is basically trading correctness for performance. > Restricting the workaround to something like "Safari on Mac OS X" > would be fine too, though it's mostly orthogonal to changing the > default. Agreed, but it makes changing the default much less appealing. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From om.brahmana at gmail.com Sun Mar 4 21:04:58 2012 From: om.brahmana at gmail.com (Srirang Doddihal) Date: Mon, 5 Mar 2012 02:34:58 +0530 Subject: Need feedback on a small change to the nginx-gridfs module Message-ID: Hi, I have made a small tweak to the nginx-gridfs module ( https://github.com/mdirolf/nginx-gridfs) to serve my requirement. I am not sure if it is generic enough to raise a pull request. So I thought of posting it here and asking for some feedback. The code changes are related more to MongoDB and GridFS but still it would be very helpful if the nginx gurus here can review the code from the nginx module angle and give me some feedback. Here is a description about my requirement and my change. Or you can skip right ahead and go look at the code at : https://github.com/brahmana/nginx-gridfs/commit/5f32a63678b9f997bcd4539b89f357dc98be65d4 Setup : - Rails app accepts user uploaded images and stores them in GridFS, with unique file names - Nginx uses the nginx-gridfs module to serve these files from GridFS directly. Requirement - Multiple versions (sizes) of every uploaded image needs to exist - each addressed by the same (or similar) url with a query parameter specifying the version. - Creating versions during the upload request results in bad user experience (too much time) and hence needs to be done by a background process - using a queuing server. This means additional versions are not available right away. - The clients would not know when these versions are available and would get 404 when they try to fetch a non-default version of the image. - So the nginx-gridfs module needs to be smart enough to fallback to the default version when the requested version is not available. i.e. Look for the specified version. If present serve it. Else fetch the default version and serve that. I have a very rudimentary implementation of this. It compiles and works fine - no crashes, doesn't seem to leak memory. I haven't done any benchmarking, but it seems do just fine under simple loads. Here is how the different versions of the image files are stored and addressed : The value of the 'type' query parameter is added as a suffix to the filename before searching. Ex : original filename - 'images/4f4292ff1d41c80be4000013' and is requested as 'http://hostname/files/images/4f4292ff1d41c80be4000013' Small version of the same image will be at : 'images/4f4292ff1d41c80be4000013_small' or 'images/4f4292ff1d41c80be4000013_s' and is requested as ' http://hostname/files/images/4f4292ff1d41c80be4000013?type=small' or ' http://hostname/files/images/4f4292ff1d41c80be4000013?type=s' If the requested version is not found, then we fallback to the default version, i.e. the one without any suffixes (a.k.a 'images/4f4292ff1d41c80be4000013') and serve that one. Few notes about the changed code : 1) It assumes that the field type to be queried against on a String type 2) It assumes that the gridfs and gridfile are reusable types - i.e same object can be used across multiple queries. 3) It is probably not super optimized, but that is ok for now. And here is the code commit on github.cm for this change - https://github.com/brahmana/nginx-gridfs/commit/5f32a63678b9f997bcd4539b89f357dc98be65d4 It would be very helpful to get some feedback from you guys. -- Regards, Srirang G Doddihal Brahmana. @sribrahmana - http://www.twitter.com/sribrahmana The LIGHT shows the way. The WISE see it. The BRAVE walk it. The PERSISTENT endure and complete it. I want to do it all ALONE. -------------- next part -------------- An HTML attachment was scrubbed... URL: From piotr.sikora at frickle.com Sun Mar 4 21:08:45 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Sun, 4 Mar 2012 22:08:45 +0100 Subject: Latency problem with one browser In-Reply-To: References: <20120302135146.GL67687@mdounin.ru> <20120302180134.GQ67687@mdounin.ru> <20120304174045.GW67687@mdounin.ru> Message-ID: Hi Maxim, > Restricting the workaround to something like "Safari on Mac OS X" > would be fine too, though it's mostly orthogonal to changing the > default. I believe this patch is sufficient. "Mac OS X" string is present in all affected devices, i.e.: - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8) ... - Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) ... - Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) ... - Mozilla/5.0 (iPod; CPU iPhone OS 5_0_1 like Mac OS X) ... --- src/http/ngx_http_request.c.orig Sun Mar 4 20:53:14 2012 +++ src/http/ngx_http_request.c Sun Mar 4 20:55:36 2012 @@ -1496,6 +1496,10 @@ ngx_http_process_user_agent(ngx_http_request_t *r, ngx } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) { r->headers_in.safari = 1; + if (ngx_strstrn(user_agent, "Mac OS X", 8 - 1)) { + r->headers_in.safari_osx = 1; + } + } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) { r->headers_in.konqueror = 1; } --- src/http/ngx_http_request.h.orig Sun Mar 4 20:55:38 2012 +++ src/http/ngx_http_request.h Sun Mar 4 20:56:04 2012 @@ -228,6 +228,7 @@ typedef struct { unsigned gecko:1; unsigned chrome:1; unsigned safari:1; + unsigned safari_osx:1; unsigned konqueror:1; } ngx_http_headers_in_t; --- src/http/ngx_http_core_module.c.orig Sun Mar 4 20:56:25 2012 +++ src/http/ngx_http_core_module.c Sun Mar 4 20:56:42 2012 @@ -1485,7 +1485,7 @@ ngx_http_update_location_config(ngx_http_request_t *r) */ r->keepalive = 0; - } else if (r->headers_in.safari + } else if (r->headers_in.safari_osx && (clcf->keepalive_disable & NGX_HTTP_KEEPALIVE_DISABLE_SAFARI)) { Best regards, Piotr Sikora < piotr.sikora at frickle.com > From nginx-forum at nginx.us Sun Mar 4 22:50:43 2012 From: nginx-forum at nginx.us (Sputnik) Date: Sun, 4 Mar 2012 17:50:43 -0500 (EST) Subject: How can add trailing slash if I have two or more subdirectories ? Message-ID: Problem to add trailing slash if I have two or more subdirectories rewrite ^/([^.]*[^/])$ $1/ permanent; //this is working example if I have one directory http://example.com/foo/ (with trailing slash, conventionally a directory) http://example.com/foo (without trailing slash, conventionally a file) How can add trailing slash if I have two or more subdirectories ? http://example.com/foo/foo2/ http://example.com/foo/foo2 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223360,223360#msg-223360 From ne at vbart.ru Mon Mar 5 00:06:20 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Mon, 5 Mar 2012 04:06:20 +0400 Subject: How can add trailing slash if I have two or more subdirectories ? In-Reply-To: References: Message-ID: <201203050406.21186.ne@vbart.ru> On Monday 05 March 2012 02:50:43 Sputnik wrote: > Problem to add trailing slash if I have two or more subdirectories > > rewrite ^/([^.]*[^/])$ $1/ permanent; //this is working example if I > have one directory > > http://example.com/foo/ (with trailing slash, conventionally a > directory) > http://example.com/foo (without trailing slash, conventionally a file) > > > How can add trailing slash if I have two or more subdirectories ? > > http://example.com/foo/foo2/ > http://example.com/foo/foo2 > location ~ [^/]+/[^/]+$ { return 301 $uri/; } wbr, Valentin V. Bartenev From nginx-forum at nginx.us Mon Mar 5 01:11:33 2012 From: nginx-forum at nginx.us (Sageth) Date: Sun, 4 Mar 2012 20:11:33 -0500 (EST) Subject: No Input File Specified Message-ID: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> Hi, I'm fairly new to Nginx (an Apache convert) and have run into an issue where my site works, but one particular POST function fails with "No Input File Specified." The POST is a port of an old IPBv2 script to submit scores into a database via the URL: http://www.example.com/game/123/index.php?act=Arcade&do=newscore I have verified permissions In Apache, the RewriteRule was: RewriteRule ^game/(.*)/(.*)\.php$ index.php?act=Arcade&do=newscore [L] In nginx, I have: rewrite ^/game/(.*)/(.*)\.php$ /index.php?act=Arcade&do=newscore last; Here's my site's .conf (some info masked). Can anyone help point me in a direction? I'm not sure what I'm missing and I've spent a solid 12 hours on it, so would greatly appreciate any help. server { listen 80; server_name www.example.com; root /var/www/example; location / { try_files $uri $uri/ @gss; } location ~ \.php$ { try_files $uri /index.php?$args =404; if ($uri !~ "^/uploads/") { fastcgi_pass unix:/var/run/php-fcgi.pid; } location ~ /arcade/gamedata/(.*)$ { alias /var/www/example/arcade/gamedata/$1; internal; break; } location @gss { #Rewrite the games rewrite ^/game/(.*)/(.*)\.php$ /index.php?act=Arcade&do=newscore last; rewrite ^/play/index.php$ /index.php?act=Arcade&do=newscore last; rewrite ^/game/(.*)/arcade/(.*)$ /arcade/$2 last; rewrite ^/play/arcade/(.*)$ /arcade/$1 last; rewrite ^/(.*).html$ /index.php?params=$1 last; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223362,223362#msg-223362 From edho at myconan.net Mon Mar 5 02:18:19 2012 From: edho at myconan.net (Edho Arief) Date: Mon, 5 Mar 2012 09:18:19 +0700 Subject: No Input File Specified In-Reply-To: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> References: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2012/3/5 Sageth : > Hi, I'm fairly new to Nginx (an Apache convert) and have run into an > issue where my site works, but one particular POST function fails with > "No Input File Specified." ?The POST is a port of an old IPBv2 script to > submit scores into a database via the URL: > http://www.example.com/game/123/index.php?act=Arcade&do=newscore > > I have verified permissions > > In Apache, the RewriteRule was: > RewriteRule ^game/(.*)/(.*)\.php$ index.php?act=Arcade&do=newscore [L] > > In nginx, I have: > rewrite ^/game/(.*)/(.*)\.php$ /index.php?act=Arcade&do=newscore last; > > Here's my site's .conf (some info masked). ?Can anyone help point me in > a direction? I'm not sure what I'm missing and I've spent a solid 12 > hours on it, so would greatly appreciate any help. > > server { > ? ? ? ?listen ? 80; > ? ? ? ?server_name ? ? www.example.com; > ? ? ? ?root ? ? ? ? ? ?/var/www/example; > ? ? ? ?location / { > ? ? ? ? ? ? ? ?try_files $uri $uri/ @gss; > ? ? ? ?} > ? ? ? ?location ~ \.php$ { > ? ? ? ? ?try_files $uri /index.php?$args =404; > ? ? ? ? ?if ($uri !~ "^/uploads/") { > ? ? ? ? ? ? ? ?fastcgi_pass ? unix:/var/run/php-fcgi.pid; > ? ? ? ? ?} You need more than this here. Also rather than checking whether than it starts with /uploads/ after entering uploads, you should create separate location block to handle this url. From cliff at develix.com Mon Mar 5 02:34:28 2012 From: cliff at develix.com (Cliff Wells) Date: Sun, 04 Mar 2012 18:34:28 -0800 Subject: No Input File Specified In-Reply-To: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> References: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1330914868.2361.61.camel@portable-evil> On Sun, 2012-03-04 at 20:11 -0500, Sageth wrote: > Hi, I'm fairly new to Nginx (an Apache convert) and have run into an > issue where my site works, but one particular POST function fails with > "No Input File Specified." The POST is a port of an old IPBv2 script to > submit scores into a database via the URL: > http://www.example.com/game/123/index.php?act=Arcade&do=newscore > > I have verified permissions > > In Apache, the RewriteRule was: > RewriteRule ^game/(.*)/(.*)\.php$ index.php?act=Arcade&do=newscore [L] > > In nginx, I have: > rewrite ^/game/(.*)/(.*)\.php$ /index.php?act=Arcade&do=newscore last; > > Here's my site's .conf (some info masked). Can anyone help point me in > a direction? I'm not sure what I'm missing and I've spent a solid 12 > hours on it, so would greatly appreciate any help. > > server { > listen 80; > server_name www.example.com; > root /var/www/example; > location / { > try_files $uri $uri/ @gss; > } > location ~ \.php$ { > try_files $uri /index.php?$args =404; > if ($uri !~ "^/uploads/") { > fastcgi_pass unix:/var/run/php-fcgi.pid; > } > location ~ /arcade/gamedata/(.*)$ { > alias /var/www/example/arcade/gamedata/$1; > internal; > break; > } > location @gss { > #Rewrite the games > rewrite ^/game/(.*)/(.*)\.php$ /index.php?act=Arcade&do=newscore > last; > rewrite ^/play/index.php$ /index.php?act=Arcade&do=newscore last; > rewrite ^/game/(.*)/arcade/(.*)$ /arcade/$2 last; > rewrite ^/play/arcade/(.*)$ /arcade/$1 last; > rewrite ^/(.*).html$ /index.php?params=$1 last; > } > } I believe that what is happening is the \.php$ location is matched first, so your rewrite rules are never called for PHP scripts. See here for the order Nginx processes locations: http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration Specifically, the sentence "The first matching expression stops the search and nginx will use this location." The / location is used as a fallback in case no specific regex location is matched. Instead, something like this might work (untested): location ~ \.php$ { rewrite ^/game/(.*)/(.*)\.php$ /index.php?act=Arcade&do=newscore break; rewrite ^/play/index.php$ /index.php?act=Arcade&do=newscore break; rewrite ^/(.*).html$ /index.php?params=$1 break; fastcgi_pass unix:/var/run/php-fcgi.pid; } location @gss { rewrite ^/game/(.*)/arcade/(.*)$ /arcade/$2 last; rewrite ^/play/arcade/(.*)$ /arcade/$1 last; } Regards, Cliff From edho at myconan.net Mon Mar 5 02:45:41 2012 From: edho at myconan.net (Edho Arief) Date: Mon, 5 Mar 2012 09:45:41 +0700 Subject: How can add trailing slash if I have two or more subdirectories ? In-Reply-To: <201203050406.21186.ne@vbart.ru> References: <201203050406.21186.ne@vbart.ru> Message-ID: 2012/3/5 Valentin V. Bartenev : >> > > ? ?location ~ [^/]+/[^/]+$ { > ? ? ? ?return 301 $uri/; > ? ?} > Or this: location ~ ^[^.]+[^/]$ { return 301 $uri/$is_args$args; } From wtymdjs at gmail.com Mon Mar 5 02:56:56 2012 From: wtymdjs at gmail.com (adam estes) Date: Sun, 4 Mar 2012 21:56:56 -0500 Subject: SEO Friendly Urls In-Reply-To: <201203041714.03069.ne@vbart.ru> References: <201203041714.03069.ne@vbart.ru> Message-ID: Now i feel kinda stupid. The project was named FG152 and the cron jobs where generated with that url. I changed this later because of too many issues with the pathing. I just didn't remember to change the cron jobs :P On Sun, Mar 4, 2012 at 8:14 AM, Valentin V. Bartenev wrote: > On Sunday 04 March 2012 10:17:03 adam estes wrote: >> 2012/03/04 01:15:30 [error] 7662#0: *36 open() >> "/home/sites/domain/FG152/index.php/cron/graburls/999182b003023a35c327db371 >> a74a85f" failed (2: No such file or directory), client: 71.3.129.216, >> server: domain.us, request: "GET$ >> /FG152/index.php/cron/graburls/999182b003023a35c327db371a74a85f >> HTTP/1.1", host: "domain.us" >> > > Just for your note, FG152 doesn't equal fg152. > > ?wbr, Valentin V. Bartenev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From quintinpar at gmail.com Mon Mar 5 03:20:15 2012 From: quintinpar at gmail.com (Quintin Par) Date: Mon, 5 Mar 2012 08:50:15 +0530 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: Message-ID: Hi all, I guess many people didn't understand my question. To make it simple, Can I have two caching strategies together: one for logged in users and one for non-logged in users in the same location directive? -Quintin On Sun, Mar 4, 2012 at 8:56 PM, Quintin Par wrote: > Hi all, > > I currently have a good caching solution for non-logged in users as shown > below > > location / { > > proxy_pass http://localhost:82; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > proxy_set_header Accept-Encoding ""; > > proxy_ignore_headers Set-Cookie; > > proxy_ignore_headers Cache-Control; > > proxy_ignore_headers Expires; > > proxy_ignore_headers X-Accel-Expires; > > proxy_no_cache $cookie_sessionid; > > proxy_cache_bypass $cookie_sessionid; > > proxy_cache cache; > > proxy_cache_key $scheme$host$request_uri; > > proxy_cache_valid 200 302 5m; > > proxy_cache_valid 404 1m; > > proxy_cache_use_stale updating; > > } > > But this is proving to be a lot of load when accessed by logged-in > users(with cookie). Typically situations like homepage (collection of a lot > of snippets) > > So in the same location directive, *how can I apply an additional caching > strategy with SSI on*(users name details which needs to be pulled up > every time) for logged in users. Say cache pages for logged in users for a > minute with caching for non logged in users at 15 minutes. I also want > > proxy_cache_bypass $cookie_sessionid; > > to refresh cache entries. > > I believe this is scenario for a lot of websites out there. > > Can someone help please? > > -Quintin > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henry at hjst.org Mon Mar 5 03:22:52 2012 From: henry at hjst.org (Henry) Date: Mon, 5 Mar 2012 11:22:52 +0800 Subject: Transfer-encoding chunked hex markers appearing in output? Message-ID: <20120305032252.GA25134@deck> I've written a very simple script which acts as a specific proxy for XML feeds, reading from a source URL and passing the content straight through. It's trivial and it's working fine when run as a standalone HTTP server (via node.js). However when I put nginx in front of it I get what appear to be the chunk hex markers in the output - which obviously renders the XML invalid. Here is an example of the output, note the "f32" at line 1, and the repeated "1000" on lines 53 & 85, the "58a" on lines 125 & 137 and so on. https://gist.github.com/1973377 Here is my (reduced) nginx conf: server { listen 80; server_name feeder; location / { proxy_pass http://127.0.0.1:8888; } } I've confirmed that the chunks themselves don't contain the spurious data (by dumping them to a file and checking with dhex), and apart from the expected Server: change the HTTP headers are the same with and without nginx: HTTP/1.1 200 Server: nginx/1.0.12 Date: Mon, 05 Mar 2012 02:02:38 GMT Content-Type: text/xml; charset=UTF-8 Connection: keep-alive etag: rM1jGkNUA9AzVj2iMQN9KWwLgcQ last-modified: Mon, 05 Mar 2012 02:07:53 GMT expires: Mon, 05 Mar 2012 02:08:03 GMT cache-control: private, max-age=0 x-content-type-options: nosniff x-xss-protection: 1; mode=block transfer-encoding: chunked I'm at a loss how to proceed and I'm hoping someone on the list recognises the problem. In case it's relevant, here is the code for the script, with the lines that do the proxying highlighted: https://github.com/hjst/feeder/blob/bd610bd981ab4b2184610775d3c6bf4b3f37d863/feeder.js#L45-47 From nginx-forum at nginx.us Mon Mar 5 03:29:14 2012 From: nginx-forum at nginx.us (Sageth) Date: Sun, 4 Mar 2012 22:29:14 -0500 (EST) Subject: No Input File Specified In-Reply-To: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> References: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> Message-ID: <60fe295b0dd8d6db2ebe29d0d4b50987.NginxMailingListEnglish@forum.nginx.org> @Cliff - I tried what you said and got 404's on any of the pages that were being rewritten to .html pages, so it does seem that the rewrites are being handled. Thanks for trying... I think that you might be onto something with the processing order. I'll have to take a look into it in more depth. Frustratingly, I restored my backup vhosts .conf file, and now it doesn't seem to want to load any objects in the /arcade/gamedata folder, which is preventing some of the games from loading. @Edho - What other information do you need? I didn't want to put too much for the sake of brevity, but I can post whatever you think might help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223362,223369#msg-223369 From nginx-forum at nginx.us Mon Mar 5 03:55:41 2012 From: nginx-forum at nginx.us (dbanks) Date: Sun, 4 Mar 2012 22:55:41 -0500 (EST) Subject: client keep alive support under HTTP/1.0 In-Reply-To: References: Message-ID: Hi Valentin, Thanks for your response. We've asked the other company if they might try something other than ab for their testing, but so far they seem to want to keep using it. As a result, we're stuck with supporting it. >From the testing that the other company has done, and from the testing that we've done to try to repeat their results, it does not appear that nginx is supporting keepalives on HTTP/1.0 requests. We see the request header go out with keepalives requested, but the response header contains Connection: Close. If nginx supports this by default, it implies that we have an incompatible config option. keepalive_timeout is 600 for this virtual server (tried it at 30s, also - same result). We aren't using any other keepalive configs. Any suggestions as to where else we might look? Cheers, Dean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223289,223370#msg-223370 From nginx-forum at nginx.us Mon Mar 5 04:06:31 2012 From: nginx-forum at nginx.us (Sageth) Date: Sun, 4 Mar 2012 23:06:31 -0500 (EST) Subject: No Input File Specified In-Reply-To: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> References: <79e7db817764ae98aa21237bdbcdf1dc.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8ec5bba4d4e38c0078246760f7f2e48a.NginxMailingListEnglish@forum.nginx.org> Ahh! It works! I made the php location too complex and realized where it was bombing after getting a 404 on submit. It was much, much more simple than what I had. Between the 404 and reading in the page that Cliff linked me to (or maybe one of the pages linked there), it said that most people try to do too much with index.php and that /index.php usually works. It most certainly did. I'm thrilled. location ~ \.php$ { try_files $uri /index.php =404; fastcgi_pass unix:/var/run/php-fcgi.pid; } Also, the "internal" reference worked before, but that had to be removed... maybe it was working due to my browser's cache? No idea. Now, time to tweak and optimize. Thank you for your help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223362,223371#msg-223371 From henry at hjst.org Mon Mar 5 05:20:01 2012 From: henry at hjst.org (Henry) Date: Mon, 5 Mar 2012 13:20:01 +0800 Subject: Transfer-encoding chunked hex markers appearing in output? In-Reply-To: <20120305032252.GA25134@deck> References: <20120305032252.GA25134@deck> Message-ID: <20120305052001.GB25491@deck> I should add that this is with nginx 1.0.12 and node 0.6.11. From cliff at develix.com Mon Mar 5 05:48:40 2012 From: cliff at develix.com (Cliff Wells) Date: Sun, 04 Mar 2012 21:48:40 -0800 Subject: Transfer-encoding chunked hex markers appearing in output? In-Reply-To: <20120305032252.GA25134@deck> References: <20120305032252.GA25134@deck> Message-ID: <1330926520.21401.5.camel@portable-evil> On Mon, 2012-03-05 at 11:22 +0800, Henry wrote: > However when I put nginx in front of it I get what appear to be the > chunk hex markers in the output - which obviously renders the XML > invalid. Here is an example of the output, note the "f32" at line 1, and > the repeated "1000" on lines 53 & 85, the > "58a" on lines 125 & 137 and so on. There is an experimental patch that allows Nginx to speak HTTP 1.1 to backends (including chunked responses): http://mailman.nginx.org/pipermail/nginx/2011-August/028324.html I'm afraid I don't know if it will apply against 1.0.12. Regards, Cliff > https://gist.github.com/1973377 > > Here is my (reduced) nginx conf: > > server { > listen 80; > server_name feeder; > location / { > proxy_pass http://127.0.0.1:8888; > } > } > > I've confirmed that the chunks themselves don't contain the spurious > data (by dumping them to a file and checking with dhex), and apart from > the expected Server: change the HTTP headers are the same with and > without nginx: > > HTTP/1.1 200 > Server: nginx/1.0.12 > Date: Mon, 05 Mar 2012 02:02:38 GMT > Content-Type: text/xml; charset=UTF-8 > Connection: keep-alive > etag: rM1jGkNUA9AzVj2iMQN9KWwLgcQ > last-modified: Mon, 05 Mar 2012 02:07:53 GMT > expires: Mon, 05 Mar 2012 02:08:03 GMT > cache-control: private, max-age=0 > x-content-type-options: nosniff > x-xss-protection: 1; mode=block > transfer-encoding: chunked > > I'm at a loss how to proceed and I'm hoping someone on the list > recognises the problem. > > In case it's relevant, here is the code for the script, with the lines > that do the proxying highlighted: > > https://github.com/hjst/feeder/blob/bd610bd981ab4b2184610775d3c6bf4b3f37d863/feeder.js#L45-47 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From henry at hjst.org Mon Mar 5 06:38:48 2012 From: henry at hjst.org (Henry) Date: Mon, 5 Mar 2012 14:38:48 +0800 Subject: Transfer-encoding chunked hex markers appearing in output? In-Reply-To: <1330926520.21401.5.camel@portable-evil> References: <20120305032252.GA25134@deck> <1330926520.21401.5.camel@portable-evil> Message-ID: <20120305063848.GC25491@deck> On 04/03/12 at 09:48pm, Cliff Wells wrote: > >There is an experimental patch that allows Nginx to speak HTTP 1.1 to >backends (including chunked responses): > >http://mailman.nginx.org/pipermail/nginx/2011-August/028324.html > >I'm afraid I don't know if it will apply against 1.0.12. Thanks Cliff - I'll see if I can get it to work with the patch. From nginx-forum at nginx.us Mon Mar 5 06:53:00 2012 From: nginx-forum at nginx.us (dagr) Date: Mon, 5 Mar 2012 01:53:00 -0500 (EST) Subject: MP4 pseudostreaming - seek delay Message-ID: <900fc6831d28ef600f5669c2e3b2fd9a.NginxMailingListEnglish@forum.nginx.org> Hi I configured streaming with ngx_http_mp4_module . I use optimized mp4 with moov atoms located at the beginning of the file. Streaming really works, BUT. In comparison with flv its takes much more time to seek through movie. For example i want to move to position - 00:05:00, it takes about half second or even 2 secs to finish. When i used flv - it was instant, also seeking mp4 videos on youtube is instant too. I noticed that player shows downloading status during this delay , so i checked tcpdump and found out, that nginx sends moov atom to player EVERY time. Moov data is about 300KB, so only after downloading it , player starts getting real video. I understand why player needs MOOV data, when send first GET without "start" parameter. But i really dont understand why it needs same MOOV data later, when sends request like GET /file.mp4?start=300 Can you clear out these issue for me? May be i misconfigured something ? nginx-1.0.12 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,223375#msg-223375 From igor at sysoev.ru Mon Mar 5 07:08:15 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 5 Mar 2012 11:08:15 +0400 Subject: MP4 pseudostreaming - seek delay In-Reply-To: <900fc6831d28ef600f5669c2e3b2fd9a.NginxMailingListEnglish@forum.nginx.org> References: <900fc6831d28ef600f5669c2e3b2fd9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120305070815.GA28715@nginx.com> On Mon, Mar 05, 2012 at 01:53:00AM -0500, dagr wrote: > Hi > > I configured streaming with ngx_http_mp4_module . > I use optimized mp4 with moov atoms located at the beginning of the > file. > Streaming really works, BUT. > In comparison with flv its takes much more time to seek through movie. > > For example i want to move to position - 00:05:00, it takes about half > second or even 2 secs to finish. > When i used flv - it was instant, also seeking mp4 videos on youtube is > instant too. > > I noticed that player shows downloading status during this delay , so i > checked tcpdump and found out, that > nginx sends moov atom to player EVERY time. Moov data is about 300KB, > so only after downloading it , player starts getting real video. > > I understand why player needs MOOV data, when send first GET without > "start" parameter. > > But i really dont understand why it needs same MOOV data later, when > sends request like GET /file.mp4?start=300 > > Can you clear out these issue for me? > May be i misconfigured something ? > > nginx-1.0.12 This is expected behaviour. This is the way, how Flash players work: they require complete MP3 stream with MOOV/MDAT on each request. This is the reason why ngx_http_mp4_module exists at all. If the players were able play without MOOV data on each request using MOOV data from the first request, there was no need in ngx_http_mp4_module. The module adjusts MOOV data for each request. If you seek MP4 file near the end, the MOOV data will be lesser. -- Igor Sysoev From nginx-forum at nginx.us Mon Mar 5 07:44:54 2012 From: nginx-forum at nginx.us (dagr) Date: Mon, 5 Mar 2012 02:44:54 -0500 (EST) Subject: MP4 pseudostreaming - seek delay In-Reply-To: <900fc6831d28ef600f5669c2e3b2fd9a.NginxMailingListEnglish@forum.nginx.org> References: <900fc6831d28ef600f5669c2e3b2fd9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: thanks, i suspected data less near the end. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223375,223377#msg-223377 From ne at vbart.ru Mon Mar 5 08:34:21 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Mon, 5 Mar 2012 12:34:21 +0400 Subject: client keep alive support under HTTP/1.0 In-Reply-To: References: Message-ID: <201203051234.21328.ne@vbart.ru> On Monday 05 March 2012 07:55:41 dbanks wrote: > Hi Valentin, > > Thanks for your response. We've asked the other company if they might > try something other than ab for their testing, but so far they seem to > want to keep using it. As a result, we're stuck with supporting it. > > From the testing that the other company has done, and from the testing > that we've done to try to repeat their results, it does not appear that > nginx is supporting keepalives on HTTP/1.0 requests. We see the request > header go out with keepalives requested, but the response header > contains Connection: Close. > > If nginx supports this by default, it implies that we have an > incompatible config option. keepalive_timeout is 600 for this virtual > server (tried it at 30s, also - same result). We aren't using any other > keepalive configs. > > Any suggestions as to where else we might look? > You may enable debug log, and look carefully for what happens. http://nginx.org/en/docs/debugging_log.html I cannot reproduce with my "ab -k" and nginx: Request: 2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "Connection: Keep-Alive" 2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "Host: localhost:8000" 2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "User-Agent: ApacheBench/2.3" 2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "Accept: */*" Response: 2012/03/04 17:32:34 [debug] 6990#0: *2 HTTP/1.1 200 OK Server: nginx/1.1.16 Date: Sun, 04 Mar 2012 13:32:34 GMT Content-Type: text/html Content-Length: 2440 Last-Modified: Mon, 27 Feb 2012 12:42:11 GMT Connection: keep-alive Accept-Ranges: bytes and connection is really keep-alive and reusable. My test.conf: error_log logs/error.log debug; events {} http { server { listen 8000; server_name localhost; location / { root ..; } } } wbr, Valentin V. Bartenev From mdounin at mdounin.ru Mon Mar 5 08:34:37 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Mar 2012 12:34:37 +0400 Subject: Transfer-encoding chunked hex markers appearing in output? In-Reply-To: <20120305032252.GA25134@deck> References: <20120305032252.GA25134@deck> Message-ID: <20120305083436.GZ67687@mdounin.ru> Hello! On Mon, Mar 05, 2012 at 11:22:52AM +0800, Henry wrote: > I've written a very simple script which acts as a specific proxy for > XML feeds, reading from a source URL and passing the content > straight through. It's trivial and it's working fine when run as a > standalone HTTP server (via node.js). > > However when I put nginx in front of it I get what appear to be the > chunk hex markers in the output - which obviously renders the XML > invalid. Here is an example of the output, note the "f32" at line 1, > and the repeated "1000" on lines 53 & 85, the "58a" on lines 125 & > 137 and so on. > > https://gist.github.com/1973377 > > Here is my (reduced) nginx conf: > > server { > listen 80; > server_name feeder; > location / { > proxy_pass http://127.0.0.1:8888; > } > } > > I've confirmed that the chunks themselves don't contain the spurious > data (by dumping them to a file and checking with dhex), and apart > from the expected Server: change the HTTP headers are the same with > and without nginx: > > HTTP/1.1 200 > Server: nginx/1.0.12 > Date: Mon, 05 Mar 2012 02:02:38 GMT > Content-Type: text/xml; charset=UTF-8 > Connection: keep-alive > etag: rM1jGkNUA9AzVj2iMQN9KWwLgcQ > last-modified: Mon, 05 Mar 2012 02:07:53 GMT > expires: Mon, 05 Mar 2012 02:08:03 GMT > cache-control: private, max-age=0 > x-content-type-options: nosniff > x-xss-protection: 1; mode=block > transfer-encoding: chunked > > I'm at a loss how to proceed and I'm hoping someone on the list > recognises the problem. According to RFC2616, "A server MUST NOT send transfer-codings to an HTTP/1.0 client." That is, correct solution is to fix your script - it must not return chunked data to nginx (as nginx uses HTTP/1.0 in requests to backends). Alternatively, you may upgrade to 1.1.x which has support for HTTP/1.1 to backends and is able to recognize and remove chunked encoding in such situations. Maxim Dounin From razinkov at gmail.com Mon Mar 5 15:29:50 2012 From: razinkov at gmail.com (Ilja Razinkov) Date: Mon, 5 Mar 2012 19:29:50 +0400 Subject: Openresty + socket + ssl question Message-ID: Hello! This question is for agentzh, one of OpenResty authors. i need some help or proper direction to look futher, please help... I`m using openresty 1.0.11.19 (nginx+lua, great mix btw) and wish to make calls to ssl-enabled third-party server (Apple Push Notifications server, specifically). For this i hoped to use recently added to openresty "ngx.socket.*" functionality with LuaSec module to enable ssl-protected communication. But seems it is not possible because LuaSec requires setfd/getfd methods (raw access to socket file descriptors) just as LuaSocket. Seems there is no other lua library that can do ssl exchange only with simple "send/receive" over already established connection anyway :( am i right? before that i tryed to use nginx build-in "upstream + proxy_pass https://" functionality, but in that case there is no way to specify custom key+cert for upstream call and there is no way to specify proper payload (apple APN servers are requiring direct message exchange over sll-protected connection) Thanks in advance for any help sincerely, Ilja Razinkov From nginx-forum at nginx.us Mon Mar 5 15:34:01 2012 From: nginx-forum at nginx.us (double) Date: Mon, 5 Mar 2012 10:34:01 -0500 (EST) Subject: bug in limit_req Message-ID: Hello, limit_req does not work with Nginx 1.1.16 - if used on different levels. `for a in `seq 300`; do wget -O /dev/null http://localhost:8081/; done` Exepected result: 503, result is always "502 bad gateway". Down below the config file. Thanks a lot error_log /tmp/nginx-error_log info; pid /tmp/nginx.pid; events { worker_connections 65535; } http { default_type application/octet-stream; limit_req_zone $binary_remote_addr zone=everything_ip:32m rate=50r/s; limit_req zone=everything_ip burst=50; limit_req_zone $binary_remote_addr zone=fastcgi_ip:32m rate=2r/s; server { listen *:8081; root /tmp/www; # fastcgi location @backend { limit_req zone=fastcgi_ip burst=10; fastcgi_pass unix:/tmp/nginx.dispatch.sock; } # static location / { try_files $uri @backend; expires max; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223426,223426#msg-223426 From mdounin at mdounin.ru Mon Mar 5 16:00:09 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Mar 2012 20:00:09 +0400 Subject: bug in limit_req In-Reply-To: References: Message-ID: <20120305160009.GF67687@mdounin.ru> Hello! On Mon, Mar 05, 2012 at 10:34:01AM -0500, double wrote: > limit_req does not work with Nginx 1.1.16 - if used on different > levels. > `for a in `seq 300`; do wget -O /dev/null http://localhost:8081/; done` > Exepected result: 503, result is always "502 bad gateway". > Down below the config file. [...] > http { [...] > limit_req_zone $binary_remote_addr zone=everything_ip:32m rate=50r/s; > limit_req zone=everything_ip burst=50; > > limit_req_zone $binary_remote_addr zone=fastcgi_ip:32m rate=2r/s; > > server { [...] > # fastcgi > location @backend { > limit_req zone=fastcgi_ip burst=10; > fastcgi_pass unix:/tmp/nginx.dispatch.sock; > } > > # static > location / { > try_files $uri @backend; > expires max; > } > } > } With such configuration the "limit_req zone=everything_ip burst=50;" as specified on http level will be used to limit requests (it's inherited into "location /" and checked there before try_file; the limit_req directive in @backend location isn't checked as we've already checked limit_req limits). Furthermore, as the directive doesn't have the "nodelay" argument, it's not expected to overflow the burst (and return 503) if there is only single process doing requests (as in the sh snippet above). That is, there is no bug here. Probably there is a room for improvement though, as currently separate limiting of a location after try_files is only possible if there were no limits in the location with try_files. Maxim Dounin From mdounin at mdounin.ru Mon Mar 5 16:10:40 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Mar 2012 20:10:40 +0400 Subject: nginx-1.0.13 Message-ID: <20120305161039.GG67687@mdounin.ru> Changes with nginx 1.0.13 05 Mar 2012 *) Feature: the "return" and "error_page" directives can now be used to return 307 redirections. *) Bugfix: a segmentation fault might occur in a worker process if the "resolver" directive was used and there was no "error_log" directive specified at global level. Thanks to Roman Arutyunyan. *) Bugfix: memory leaks. Thanks to Lanshun Zhou. *) Bugfix: nginx might log incorrect error "upstream prematurely closed connection" instead of correct "upstream sent too big header" one. Thanks to Feibo Li. *) Bugfix: on ZFS filesystem disk cache size might be calculated incorrectly; the bug had appeared in 1.0.1. *) Bugfix: the number of internal redirects to named locations was not limited. *) Bugfix: temporary files might be not removed if the "proxy_store" directive was used with SSI includes. *) Bugfix: in some cases non-cacheable variables (such as the $args variable) returned old empty cached value. *) Bugfix: the "proxy_redirect" directives might be inherited incorrectly. *) Bugfix: nginx could not be built with the ngx_http_perl_module if the --with-openssl option was used. *) Bugfix: nginx could not be built by the icc 12.1 compiler. Maxim Dounin From wtymdjs at gmail.com Mon Mar 5 16:11:46 2012 From: wtymdjs at gmail.com (adam estes) Date: Mon, 5 Mar 2012 11:11:46 -0500 Subject: nginx: [emerg] directive "rewrite" is not terminated by "; " in /usr/local/nginx/conf/nginx.conf:67 Message-ID: 63 rewrite ^/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /gymrss.php?channels&$2&$4&$6 last; 64 rewrite ^/(news|maps)/?(page([0-9]+)\.html)?$ /map.php?$1&start=$3 last; 66 rewrite ^/(news|maps)/([a-z0-9_-]+)(/([a-z0-9_-]+))?/?(page([0-9]+)\.html)?$ /map.php?$2=$4&$1&start=$6 last; 67 rewrite ^/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9_-]+))?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?$9=$8&$2&$4&$6&gzip=$10 last; 68 rewrite ^/[a-z0-9_-]*-[a-z]{1,2}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?$8=$1&$3&$5&$7&gzip=$9 last; 69 rewrite ^/([a-z0-9_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 last; 70 rewrite ^/sitemapindex\.xml(\.gz)?$ /sitemap.php?gzip=$1 last; 71 rewrite ^/[a-z0-9_-]+-([a-z]{1,2})([0-9]+)\.xml(\.gz)?$ /sitemap.php?module_sep=$1&module_sub=$2&gzip=$3 last; 72 rewrite ^/([a-z0-9_]+)-([a-z0-9_-]+)\.xml(\.gz)?$ /sitemap.php?$1=$2&gzip=$3 last; So what exactly am I missing? From mdounin at mdounin.ru Mon Mar 5 16:26:33 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 5 Mar 2012 20:26:33 +0400 Subject: nginx: [emerg] directive "rewrite" is not terminated by "; " in /usr/local/nginx/conf/nginx.conf:67 In-Reply-To: References: Message-ID: <20120305162633.GK67687@mdounin.ru> Hello! On Mon, Mar 05, 2012 at 11:11:46AM -0500, adam estes wrote: > 63 rewrite ^/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ > /gymrss.php?channels&$2&$4&$6 last; > 64 rewrite ^/(news|maps)/?(page([0-9]+)\.html)?$ /map.php?$1&start=$3 last; > 66 rewrite ^/(news|maps)/([a-z0-9_-]+)(/([a-z0-9_-]+))?/?(page([0-9]+)\.html)?$ > /map.php?$2=$4&$1&start=$6 last; > 67 rewrite ^/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9_-]+))?/([a-z0-9_]+)\.xml(\.gz)?$ > /gymrss.php?$9=$8&$2&$4&$6&gzip=$10 last; > 68 rewrite ^/[a-z0-9_-]*-[a-z]{1,2}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ > /gymrss.php?$8=$1&$3&$5&$7&gzip=$9 last; > 69 rewrite ^/([a-z0-9_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ > /gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 last; > 70 rewrite ^/sitemapindex\.xml(\.gz)?$ /sitemap.php?gzip=$1 last; > 71 rewrite ^/[a-z0-9_-]+-([a-z]{1,2})([0-9]+)\.xml(\.gz)?$ > /sitemap.php?module_sep=$1&module_sub=$2&gzip=$3 last; > 72 rewrite ^/([a-z0-9_]+)-([a-z0-9_-]+)\.xml(\.gz)?$ > /sitemap.php?$1=$2&gzip=$3 last; > > So what exactly am I missing? http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite If a regular expression includes the characters ?}? or ?;?, the whole expressions should be enclosed in single or double quotes. Line numbers provided above looks off-by-one for some reason, the problematic line is marked as "68". Maxim Dounin From nginx-forum at nginx.us Mon Mar 5 17:48:02 2012 From: nginx-forum at nginx.us (n1xman) Date: Mon, 5 Mar 2012 12:48:02 -0500 (EST) Subject: How to use srcache_store while proxy_pass use to connect backend Message-ID: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> Hi, I can't store data while I'm using proxy_pass to connect to the backend if we can't find data on the memcached. srcache_fetch probes the memcached but since no data, it connect to the backend and get the correct data but not executing the srcache_store. Here is my config. location /memc { internal; memc_connect_timeout 500ms; # 500 miliseconds memc_send_timeout 5000ms; # 5 seconds memc_read_timeout 500ms; # 500 miliseconds set $memc_key $query_string; set $memc_exptime 3600; memc_pass 127.0.0.1:11211; } location /webservice { set $key $http_host$request_uri; srcache_fetch GET /memc $key; add_header X-Cached-From srcache-memcached; # store the content! srcache_store_statuses 200 201 301 302 404 503 502; srcache_store PUT /memc $key; # if it is not found we go to the backend proxy_pass http://remoteserver; } I use nginx-1.0.10. and I should be able to use proxy_pass to get backend data while store data on the cache..? If I comment the proxy_pass, srcache_store triggered and stored the 502 status page as it can't connect to the backend. Please help me on how to use srcache_store and use proxy_pass to store data and connect to backend. Thanks in advance. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223438,223438#msg-223438 From nginx-forum at nginx.us Mon Mar 5 18:23:37 2012 From: nginx-forum at nginx.us (hira2) Date: Mon, 5 Mar 2012 13:23:37 -0500 (EST) Subject: How to use srcache_store while proxy_pass use to connect backend In-Reply-To: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> References: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8246c9d5d2dae88aad9aee6373b5e591.NginxMailingListEnglish@forum.nginx.org> Please help me on how to use srcache_store and use proxy_pass to store data and connect to backend. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223438,223443#msg-223443 From nginx-forum at nginx.us Mon Mar 5 22:00:06 2012 From: nginx-forum at nginx.us (dbanks) Date: Mon, 5 Mar 2012 17:00:06 -0500 (EST) Subject: client keep alive support under HTTP/1.0 In-Reply-To: References: Message-ID: <59ab18ebc26b6cc997cd295e17922144.NginxMailingListEnglish@forum.nginx.org> Hi Valentin, I can repeat your results with static files - keepalives work with HTTP/1.0 in that scenario. However, for responses via FCGI, a connection close is consistently sent. I found a post on the russian forum (thank you Google translate) that implies that the content-length header needs to be set on the application side. I had assumed that nginx would calculate the length and add the header, but this does not appear to be the case. http://forum.nginx.org/read.php?21,1301720319,older Thanks, Dean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223289,223450#msg-223450 From lists at ruby-forum.com Mon Mar 5 22:46:09 2012 From: lists at ruby-forum.com (Alex Alex) Date: Mon, 05 Mar 2012 23:46:09 +0100 Subject: proxy + rewrite Message-ID: <826b4913f410b47d33d25ecd30cb534b@ruby-forum.com> Hi all, I'm new with NGINX. What I want to do is a front reverse proxy server that rewrites URL. I actually can make it working with one site, but not with many sites. On my real server: https://srvabc:1234/mypath/ goes https://srvabc:1234/mypath/connexion.do?action=init and on my NGINX server: https://www.mynxinx/abc goes https://www.mynxinx/abc/connexion.do?action=init What is not working is to have https://www.mynxinx/def going on another server like https://srvdef:4567/anothermypath/ I tried many configurations and the most simple one seems to be the one using the request_uri without the / at the beginning (I also tried directly with proxy_pass https:/$request_uri;): upstream abc { server srvabc:1234 weight=10 max_fails=3 fail_timeout=30s; } upstream def { server srvdef:4567 weight=10 max_fails=3 fail_timeout=30s; } server { listen 443 ssl; server_name mynxinx; ssl on; ssl_certificate /etc/nginx/cert.pem; ssl_certificate_key /etc/nginx/cert.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { if ($request_uri ~* ^/(.*)$) { set $request_key $1; } rewrite /abc /mypath; rewrite /def /anothermypath; proxy_pass https://$request_key; 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; } } What's wrong my my configuration? -- Posted via http://www.ruby-forum.com/. From cliff at develix.com Mon Mar 5 23:29:31 2012 From: cliff at develix.com (Cliff Wells) Date: Mon, 05 Mar 2012 15:29:31 -0800 Subject: proxy + rewrite In-Reply-To: <826b4913f410b47d33d25ecd30cb534b@ruby-forum.com> References: <826b4913f410b47d33d25ecd30cb534b@ruby-forum.com> Message-ID: <4F554C5B.8040809@develix.com> On 03/05/2012 02:46 PM, Alex Alex wrote: > Hi all, > > I'm new with NGINX. What I want to do is a front reverse proxy server > that rewrites URL. > > I actually can make it working with one site, but not with many sites. > > > On my real server: > > https://srvabc:1234/mypath/ goes > https://srvabc:1234/mypath/connexion.do?action=init > > and on my NGINX server: > > https://www.mynxinx/abc goes > https://www.mynxinx/abc/connexion.do?action=init > > What is not working is to have https://www.mynxinx/def going on another > server like https://srvdef:4567/anothermypath/ > > I tried many configurations and the most simple one seems to be the one > using the request_uri without the / at the beginning (I also tried > directly with proxy_pass https:/$request_uri;): > > upstream abc { > server srvabc:1234 weight=10 max_fails=3 fail_timeout=30s; > } > > upstream def { > server srvdef:4567 weight=10 max_fails=3 fail_timeout=30s; > } > > server { > listen 443 ssl; > server_name mynxinx; > > ssl on; > ssl_certificate /etc/nginx/cert.pem; > ssl_certificate_key /etc/nginx/cert.key; > > ssl_session_timeout 5m; > > ssl_protocols SSLv2 SSLv3 TLSv1; > ssl_ciphers HIGH:!aNULL:!MD5; > ssl_prefer_server_ciphers on; > > location / { > > if ($request_uri ~* ^/(.*)$) { > set $request_key $1; > } > > > rewrite /abc /mypath; > rewrite /def /anothermypath; > > proxy_pass https://$request_key; > 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; > > } > } > > What's wrong my my configuration? > Instead of this way, consider using the map directive: http://wiki.nginx.org/HttpMapModule The example in the synopsis seems very similar to what you are trying to achieve. Regards, Cliff From appa at perusio.net Tue Mar 6 00:59:56 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 06 Mar 2012 01:59:56 +0100 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: Message-ID: <87obsa4k8j.wl%appa@perusio.net> On 5 Mar 2012 04h20 CET, quintinpar at gmail.com wrote: > Hi all, > > I guess many people didn't understand my question. > > To make it simple, Can I have two caching strategies together: > > one for logged in users and one for non-logged in users in the same > location directive? I think that you need two locations for each batch of users. Define two locations and use map to test for the session cookie. If Present return a 418 and use error_page to redirect to the logged in users setup. You probably can do more "dynamic" things using the embedded Lua module [1]. --- appa [1] http://wiki.nginx.org/HttpLuaModule From wtymdjs at gmail.com Tue Mar 6 01:49:32 2012 From: wtymdjs at gmail.com (adam estes) Date: Mon, 5 Mar 2012 20:49:32 -0500 Subject: Alias or Symlink help? Message-ID: I want to create a link so /video will pull from somewhere other then the document root. I would just move this over, but this have dynamic files of multiple gb that I need to load, so its easier to leave them there. First I tired using alias location /video/ { alias /home/documents/; } location ~ ^/video/(.+\.php)$ { alias /home/documents/$1; fastcgi_pass unix:/tmp/phpfpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; # From fastcgi_params fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT /home/documents; # <-- Changed 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; fastcgi_param REDIRECT_STATUS 200; } That only gives me a "No file specified" message when accessing php. I then tried a sym link instead (Obviously removing those lines from conf ls -s /home/documents/ /home/sites/domain/basketballiq/video/ Html file will load properly, but php gives me a 502. What do I do? :( From siberiano.delta at gmail.com Tue Mar 6 02:09:28 2012 From: siberiano.delta at gmail.com (Victor) Date: Tue, 6 Mar 2012 03:09:28 +0100 Subject: Alias or Symlink help? In-Reply-To: References: Message-ID: Maybe location /video/ { root /home/documents/; } ? 2012/3/6 adam estes > I want to create a link so /video will pull from somewhere other then > the document root. > > I would just move this over, but this have dynamic files of multiple > gb that I need to load, so its easier to leave them there. > > First I tired using alias > > location /video/ { > alias /home/documents/; > } > > location ~ ^/video/(.+\.php)$ { > alias /home/documents/$1; > fastcgi_pass unix:/tmp/phpfpm.sock; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $request_filename; > > # From fastcgi_params > fastcgi_param QUERY_STRING $query_string; > fastcgi_param REQUEST_METHOD $request_method; > fastcgi_param CONTENT_TYPE $content_type; > fastcgi_param CONTENT_LENGTH $content_length; > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > fastcgi_param REQUEST_URI $request_uri; > fastcgi_param DOCUMENT_URI $document_uri; > fastcgi_param DOCUMENT_ROOT /home/documents; # <-- Changed > 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; > fastcgi_param REDIRECT_STATUS 200; > } > > That only gives me a "No file specified" message when accessing php. > > I then tried a sym link instead (Obviously removing those lines from conf > > ls -s /home/documents/ /home/sites/domain/basketballiq/video/ > > Html file will load properly, but php gives me a 502. > > What do I do? :( > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kworthington at gmail.com Tue Mar 6 02:11:44 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Mon, 5 Mar 2012 21:11:44 -0500 Subject: nginx-1.0.13 In-Reply-To: <20120305161039.GG67687@mdounin.ru> References: <20120305161039.GG67687@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.0.13 For Windows http://goo.gl/42im0 (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On Mon, Mar 5, 2012 at 11:10 AM, Maxim Dounin wrote: > Changes with nginx 1.0.13 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?05 Mar 2012 > > ? ?*) Feature: the "return" and "error_page" directives can now be used to > ? ? ? return 307 redirections. > > ? ?*) Bugfix: a segmentation fault might occur in a worker process if the > ? ? ? "resolver" directive was used and there was no "error_log" directive > ? ? ? specified at global level. > ? ? ? Thanks to Roman Arutyunyan. > > ? ?*) Bugfix: memory leaks. > ? ? ? Thanks to Lanshun Zhou. > > ? ?*) Bugfix: nginx might log incorrect error "upstream prematurely closed > ? ? ? connection" instead of correct "upstream sent too big header" one. > ? ? ? Thanks to Feibo Li. > > ? ?*) Bugfix: on ZFS filesystem disk cache size might be calculated > ? ? ? incorrectly; the bug had appeared in 1.0.1. > > ? ?*) Bugfix: the number of internal redirects to named locations was not > ? ? ? limited. > > ? ?*) Bugfix: temporary files might be not removed if the "proxy_store" > ? ? ? directive was used with SSI includes. > > ? ?*) Bugfix: in some cases non-cacheable variables (such as the $args > ? ? ? variable) returned old empty cached value. > > ? ?*) Bugfix: the "proxy_redirect" directives might be inherited > ? ? ? incorrectly. > > ? ?*) Bugfix: nginx could not be built with the ngx_http_perl_module if the > ? ? ? --with-openssl option was used. > > ? ?*) Bugfix: nginx could not be built by the icc 12.1 compiler. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Mar 6 03:43:13 2012 From: nginx-forum at nginx.us (mokala) Date: Mon, 5 Mar 2012 22:43:13 -0500 (EST) Subject: rerwrite problem In-Reply-To: <20100113093154.GC40025@rambler-co.ru> References: <20100113093154.GC40025@rambler-co.ru> Message-ID: <50dc2fcfd5fd327ccb27c00f779eae31.NginxMailingListEnglish@forum.nginx.org> Yes There is a apace between if and ($host .....) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,40554,223466#msg-223466 From edho at myconan.net Tue Mar 6 04:13:31 2012 From: edho at myconan.net (Edho Arief) Date: Tue, 6 Mar 2012 11:13:31 +0700 Subject: Alias or Symlink help? In-Reply-To: References: Message-ID: 2012/3/6 adam estes : > I want to create a link so /video will pull from somewhere other then > the document root. > > I would just move this over, but this have dynamic files of multiple > gb that I need to load, so its easier to leave them there. > > First I tired using alias > > location /video/ { > ? ?alias /home/documents/; > } > > location ~ ^/video/(.+\.php)$ { > ? ?alias /home/documents/$1; > ? ?fastcgi_pass ? unix:/tmp/phpfpm.sock; > ? ?fastcgi_index ?index.php; > ? ?fastcgi_param ?SCRIPT_FILENAME ?$request_filename; > > ? ?# From fastcgi_params Try just including fastcgi_params. I never needed to change anything in that file even when using alias. From agentzh at gmail.com Tue Mar 6 04:32:22 2012 From: agentzh at gmail.com (agentzh) Date: Tue, 6 Mar 2012 12:32:22 +0800 Subject: Openresty + socket + ssl question In-Reply-To: References: Message-ID: On Mon, Mar 5, 2012 at 11:29 PM, Ilja Razinkov wrote: > ?i need some help or proper direction to look futher, please help... > I`m using openresty 1.0.11.19 (nginx+lua, great mix btw) and wish to > make calls to ssl-enabled third-party server (Apple Push Notifications > server, specifically). The SSL handshake support for ngx_lua cosocket is still a TODO :) I'll expose the underlying SSL handshake API provided by the Nginx core to the Lua land. You're very welcome to provide a patch for ngx_lua though :) > For this i hoped to use recently added to openresty "ngx.socket.*" > functionality with LuaSec module to enable ssl-protected > communication. But seems it is not possible because LuaSec requires > setfd/getfd methods (raw access to socket file descriptors) just as > LuaSocket. Seems there is no other lua library that can do ssl > exchange only with simple "send/receive" over already established > connection anyway :( ?am i right? > You must not use the LuaSec library in ngx_lua even if the cosocket provides the setfd/getfd methods. That's because it uses "poll" internally to do the network I/O, which will tragically block the Nginx main event loop (and thus the whole nginx worker process) and ruin Nginx's performance. > before that i tryed to use nginx build-in "upstream + proxy_pass > https://" functionality, but in that case there is no way to specify > custom key+cert for upstream call and there is no way to specify > proper payload (apple APN servers are requiring direct message > exchange over sll-protected connection) > Fair enough :) Best, -agentzh From henry at hjst.org Tue Mar 6 04:54:52 2012 From: henry at hjst.org (Henry) Date: Tue, 6 Mar 2012 12:54:52 +0800 Subject: Transfer-encoding chunked hex markers appearing in output? In-Reply-To: <20120305083436.GZ67687@mdounin.ru> References: <20120305032252.GA25134@deck> <20120305083436.GZ67687@mdounin.ru> Message-ID: <20120306045452.GA23176@deck> On 05/03/12 at 12:34pm, Maxim Dounin wrote: > >According to RFC2616, "A server MUST NOT send transfer-codings >to an HTTP/1.0 client." That is, correct solution is to fix your >script - it must not return chunked data to nginx (as nginx uses >HTTP/1.0 in requests to backends). > >Alternatively, you may upgrade to 1.1.x which has support for >HTTP/1.1 to backends and is able to recognize and remove chunked >encoding in such situations. Hi Maxim - thanks for clarifying this for me. I've tried the previously mentioned patch without success, I'll see if I can upgrade to 1.1.x but there are a lot of other sites on this server so that may not be wise just yet. Thanks again! Henry. From quintinpar at gmail.com Tue Mar 6 08:49:36 2012 From: quintinpar at gmail.com (Quintin Par) Date: Tue, 6 Mar 2012 14:19:36 +0530 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: <87obsa4k8j.wl%appa@perusio.net> References: <87obsa4k8j.wl%appa@perusio.net> Message-ID: Thanks Antonio. On a side note, if I craft a proxy cache key with cookie_sessionid and if the sessionid cookie does not exist, *will nginx take it as an empty value*? Can nginx do a try_files or ?if? on the existence of a cookie? This will help me deliver two caching strategies in the same location directive. -Quintin On Tue, Mar 6, 2012 at 6:29 AM, Ant?nio P. P. Almeida wrote: > On 5 Mar 2012 04h20 CET, quintinpar at gmail.com wrote: > > > Hi all, > > > > I guess many people didn't understand my question. > > > > To make it simple, Can I have two caching strategies together: > > > > one for logged in users and one for non-logged in users in the same > > location directive? > > I think that you need two locations for each batch of users. Define > two locations and use map to test for the session cookie. If Present > return a 418 and use error_page to redirect to the logged in users > setup. > > You probably can do more "dynamic" things using the embedded Lua > module [1]. > > --- appa > > [1] http://wiki.nginx.org/HttpLuaModule > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Mar 6 10:01:42 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 6 Mar 2012 11:01:42 +0100 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: <87obsa4k8j.wl%appa@perusio.net> Message-ID: > Thanks Antonio. > > On a side note, if I craft a proxy cache key with cookie_sessionid and if > the sessionid cookie does not exist, *will nginx take it as an empty > value*? Sure. Here's an example using map. map $http_cookie $cache_id { default nil; # hommage to Lisp :) ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; } When there's no SESS cookie then $cache_id is nil. > Can nginx do a try_files or 'if' on the existence of a cookie? This > will > help me deliver two caching strategies in the same location directive. Sure. Example. At the http level: map $http_cookie $cookie_exists { default 0; ~ 1; } On the "main" cache location: error_page 418 @other-cache-location; if ($cookie_exists) { return 418; } Something of this kind will work. --appa From ne at vbart.ru Tue Mar 6 10:39:19 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 6 Mar 2012 14:39:19 +0400 Subject: client keep alive support under HTTP/1.0 In-Reply-To: <59ab18ebc26b6cc997cd295e17922144.NginxMailingListEnglish@forum.nginx.org> References: <59ab18ebc26b6cc997cd295e17922144.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203061439.19957.ne@vbart.ru> On Tuesday 06 March 2012 02:00:06 dbanks wrote: [...] > I had assumed that nginx would calculate the length and add the header, but > this does not appear to be the case. This would lead to delay response until the entire body will be buffered by nginx. wbr, Valentin V. Bartenev From quintinpar at gmail.com Tue Mar 6 11:12:06 2012 From: quintinpar at gmail.com (Quintin Par) Date: Tue, 6 Mar 2012 16:42:06 +0530 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: <87obsa4k8j.wl%appa@perusio.net> Message-ID: Bird brain me :-) What does this mean? ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; Also ?if? is evil inside a location. Right ? On Tue, Mar 6, 2012 at 3:31 PM, Antonio P.P. Almeida wrote: > ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Mar 6 11:14:59 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 6 Mar 2012 12:14:59 +0100 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: <87obsa4k8j.wl%appa@perusio.net> Message-ID: <0900896f05ea338d6eb1abb136650c53.squirrel@damiao.org> > Bird brain me :-) > > What does this mean? > > ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; > > Also 'if'? is evil inside a location. Right ? Not really. Here it's a mere return. From the famous IfIsEvil wiki page: The only 100% safe things which may be done inside if in location context are: return ...; rewrite ... last; > On Tue, Mar 6, 2012 at 3:31 PM, Antonio P.P. Almeida > wrote: > >> ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; >> > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From appa at perusio.net Tue Mar 6 11:19:51 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 6 Mar 2012 12:19:51 +0100 Subject: Multiple caching solutions for anonymous and logged in users with SSI on Message-ID: > Bird brain me :-) > > What does this mean? > > ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; It means to grab the sub-token on the right-hand side of the session token. Using POSIX character classes for the regex: https://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes > Also 'if'? is evil inside a location. Right ? Not really. Here it's a mere return. From the famous IfIsEvil wiki page: The only 100% safe things which may be done inside if in location context are: return ...; rewrite ... last; --appa From lei8766 at gmail.com Tue Mar 6 11:26:01 2012 From: lei8766 at gmail.com (lei8766 lei8766) Date: Tue, 6 Mar 2012 19:26:01 +0800 Subject: how to debug the trunk code on windows? Message-ID: how to debug the trunk code on windows? -------------- next part -------------- An HTML attachment was scrubbed... URL: From quintinpar at gmail.com Tue Mar 6 11:55:00 2012 From: quintinpar at gmail.com (Quintin Par) Date: Tue, 6 Mar 2012 17:25:00 +0530 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: Message-ID: Thanks a lot! If I instruct nginx to cache a page and if it has ssi tags, will it still go to the back-end to retrieve? On Tue, Mar 6, 2012 at 4:49 PM, Antonio P.P. Almeida wrote: > > Bird brain me :-) > > > > What does this mean? > > > > ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; > > It means to grab the sub-token on the right-hand side of the session token. > Using POSIX character classes for the regex: > > https://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes > > > Also 'if' is evil inside a location. Right ? > > Not really. Here it's a mere return. From the famous IfIsEvil wiki page: > > The only 100% safe things which may be done inside > if in location context are: > > return ...; > rewrite ... last; > --appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Mar 6 12:11:56 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 6 Mar 2012 13:11:56 +0100 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: Message-ID: > Thanks a lot! > If I instruct nginx to cache a page and if it has ssi tags, will it still > go to the back-end to retrieve? AFAIK yes. That shouldn't introduce any issue. Nginx has support for SSI also and you can implement a caching system taking advantage of it. But it requires you to split your page in multiple parts. --appa From mdounin at mdounin.ru Tue Mar 6 12:39:04 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Mar 2012 16:39:04 +0400 Subject: how to debug the trunk code on windows? In-Reply-To: References: Message-ID: <20120306123903.GL67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 07:26:01PM +0800, lei8766 lei8766 wrote: > how to debug the trunk code on windows? Compilation procedure is outlined here: http://nginx.org/en/docs/howto_build_on_win32.html Maxim Dounin From razinkov at gmail.com Tue Mar 6 12:41:48 2012 From: razinkov at gmail.com (Ilja Razinkov) Date: Tue, 6 Mar 2012 16:41:48 +0400 Subject: Openresty + socket + ssl question In-Reply-To: References: Message-ID: I see, so there is no way to do this purely via ngx_lua, for now? :( I`ll try to use standalone server to send APNs first, this is just faster way to start testing our application. But i will be glad to test out ssl support in OpenResty when it will be available :) Thanks for great product! On Tue, Mar 6, 2012 at 8:32 AM, agentzh wrote: > On Mon, Mar 5, 2012 at 11:29 PM, Ilja Razinkov wrote: >> ?i need some help or proper direction to look futher, please help... >> I`m using openresty 1.0.11.19 (nginx+lua, great mix btw) and wish to >> make calls to ssl-enabled third-party server (Apple Push Notifications >> server, specifically). > > The SSL handshake support for ngx_lua cosocket is still a TODO :) I'll > expose the underlying SSL handshake API provided by the Nginx core to > the Lua land. > > You're very welcome to provide a patch for ngx_lua though :) > >> For this i hoped to use recently added to openresty "ngx.socket.*" >> functionality with LuaSec module to enable ssl-protected >> communication. But seems it is not possible because LuaSec requires >> setfd/getfd methods (raw access to socket file descriptors) just as >> LuaSocket. Seems there is no other lua library that can do ssl >> exchange only with simple "send/receive" over already established >> connection anyway :( ?am i right? >> > > You must not use the LuaSec library in ngx_lua even if the cosocket > provides the setfd/getfd methods. That's because it uses "poll" > internally to do the network I/O, which will tragically block the > Nginx main event loop (and thus the whole nginx worker process) and > ruin Nginx's performance. > >> before that i tryed to use nginx build-in "upstream + proxy_pass >> https://" functionality, but in that case there is no way to specify >> custom key+cert for upstream call and there is no way to specify >> proper payload (apple APN servers are requiring direct message >> exchange over sll-protected connection) >> > > Fair enough :) > > Best, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- ? ?????????, ???????? ???? From lists at wildgooses.com Tue Mar 6 16:37:41 2012 From: lists at wildgooses.com (Ed W) Date: Tue, 06 Mar 2012 16:37:41 +0000 Subject: Using error_page to a named location - possible? Message-ID: <4F563D55.6040500@wildgooses.com> Hi, as part of a larger problem I have a captive portal which grabs all incoming URLs and after evaluating a bunch of logic redirects the caller somewhere else. I use proxy_pass to pass the request to my cgi code. However, I would like to customise the error message in the event that the upstream daemon is unavailable. I can't figure out how to do that affecting part of the incoming URLs. Is it possible to do something like "error_page @502_error" in conjunction with proxy_pass? So, I have server { listen 8000 default_server; root /var/www/cp/htdocs/public; location / { proxy_read_timeout 5; proxy_pass http://127.0.0.1:3000; error_page 502 /502.html; proxy_set_header Host $http_host; proxy_set_header X-Server-Addr $server_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-HTTPS 0; proxy_set_header X-Captive-Portal-Redirect 1; } location /502.html { internal; } } However, if I visit "http://somewhere/502.html" I get a 404 response (presumably matching the location /502.html and the 404 is due to the "internal"?) I can't see that it's possible to use something like: location / { proxy_pass http://127.0.0.1:3000; error_page 502 @502; } location @502 { index /502.html; root /var/www; internal; } Does someone have a suggestion on how to customise the error response without affecting ANY incoming URLs (they must ALL be passed through the proxy under normal working situation) (Its occured to me that I could perhaps setup another "server { }" block listening on another port, then use a different proxy_pass in the "location @502 {}"? Seems ugly, but would that work?) Thanks for any thoughts Ed W From edho at myconan.net Tue Mar 6 16:40:43 2012 From: edho at myconan.net (Edho Arief) Date: Tue, 6 Mar 2012 23:40:43 +0700 Subject: Using error_page to a named location - possible? In-Reply-To: <4F563D55.6040500@wildgooses.com> References: <4F563D55.6040500@wildgooses.com> Message-ID: 2012/3/6 Ed W : > > Does someone have a suggestion on how to customise the error response > without affecting ANY incoming URLs (they must ALL be passed through the > proxy under normal working situation) > Try location = /502.html { } instead. From lists at wildgooses.com Tue Mar 6 16:46:03 2012 From: lists at wildgooses.com (Ed W) Date: Tue, 06 Mar 2012 16:46:03 +0000 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: Message-ID: <4F563F4B.20405@wildgooses.com> On 05/03/2012 03:20, Quintin Par wrote: > So in the same location directive, *how can I apply an additional > caching strategy with SSI on*(users name details which needs to be > pulled up every time) for logged in users. Say cache pages for logged > in users for a minute with caching for non logged in users at 15 > minutes. I also want > > proxy_cache_bypass $cookie_sessionid; > > to refresh cache entries. > > I believe this is scenario for a lot of websites out there. > In theory GET is designed to be idempotent, therefore whilst it's desirable to customise pages per user, you quickly get tied in knots, as here. Can you a) Make the URLs different for logged in and non logged in users? Then the problem goes away. eg user sees site at http://profile/myname or whatever b) Use client side features to customise the page, ie write the username to a cookie (sounds like it's done already). Then use client side javascript to customise the page for each request. In this way each page is absolutely identical, any modifications are done client side. Frequently it can be designed to fail gracefully in the case of disabled javascript, etc I think that whilst this has some compromises, if you can accept those then you end up with a MUCH simpler application and simpler caching? Good luck Ed W -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue Mar 6 17:04:35 2012 From: nginx-forum at nginx.us (chuda) Date: Tue, 6 Mar 2012 12:04:35 -0500 (EST) Subject: FastCGI and pipelining Message-ID: <7dfaea43ab257abd905e9b5917e5fc05.NginxMailingListEnglish@forum.nginx.org> Hi all, I'm recently start using NGINX in combination with my FastCGI service, it work quite good and effective. I decided to use pipeline as it works effectively utilizing one connection. According to NGINX logs pipelining is work, but I mentioned interesting thing - NGINX passes request to FCGI in synchronous mode, i.e. it'll send the next request only after the first one will complete. It's weired for me. Is such behavior is expected? Maybe I miss some critical parameter in configuration? PS. NGINX v1.1.14. Thanks, Denis. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223522,223522#msg-223522 From nginx-forum at nginx.us Tue Mar 6 17:25:16 2012 From: nginx-forum at nginx.us (dbanks) Date: Tue, 6 Mar 2012 12:25:16 -0500 (EST) Subject: client keep alive support under HTTP/1.0 In-Reply-To: <59ab18ebc26b6cc997cd295e17922144.NginxMailingListEnglish@forum.nginx.org> References: <59ab18ebc26b6cc997cd295e17922144.NginxMailingListEnglish@forum.nginx.org> Message-ID: <7a8182987faff208a9b4560875119a43.NginxMailingListEnglish@forum.nginx.org> >>This would lead to delay response until the entire body will be buffered by >>nginx. The body is small, so the buffering isn't an issue. But because nginx buffers the full response, I had expected nginx to calculate the response size and pass that back to the client. I'm sure there's an excellent reason that it doesn't do this...it just ended up being somewhat non-intuitive for me. Cheers, Dean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223289,223523#msg-223523 From mdounin at mdounin.ru Tue Mar 6 17:47:28 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Mar 2012 21:47:28 +0400 Subject: Using error_page to a named location - possible? In-Reply-To: <4F563D55.6040500@wildgooses.com> References: <4F563D55.6040500@wildgooses.com> Message-ID: <20120306174728.GP67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 04:37:41PM +0000, Ed W wrote: > Hi, as part of a larger problem I have a captive portal which grabs > all incoming URLs and after evaluating a bunch of logic redirects > the caller somewhere else. I use proxy_pass to pass the request to > my cgi code. > > However, I would like to customise the error message in the event > that the upstream daemon is unavailable. I can't figure out how to > do that affecting part of the incoming URLs. Is it possible to do > something like "error_page @502_error" in conjunction with > proxy_pass? Yes, see below. > > So, I have > > server { > listen 8000 default_server; > > root /var/www/cp/htdocs/public; > > location / { > proxy_read_timeout 5; > proxy_pass http://127.0.0.1:3000; > error_page 502 /502.html; > proxy_set_header Host $http_host; > proxy_set_header X-Server-Addr $server_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header X-Forwarded-HTTPS 0; > proxy_set_header X-Captive-Portal-Redirect 1; > } > location /502.html { > internal; > } > } > > > However, if I visit "http://somewhere/502.html" I get a 404 response > (presumably matching the location /502.html and the 404 is due to > the "internal"?) Yes. > I can't see that it's possible to use something like: > > location / { > proxy_pass http://127.0.0.1:3000; > error_page 502 @502; > } > > location @502 { > index /502.html; > root /var/www; > internal; > } Try something like: location @502 { internal; root /var/www; rewrite ^ /502.html break; } This should work at least for GET requests. > Does someone have a suggestion on how to customise the error > response without affecting ANY incoming URLs (they must ALL be > passed through the proxy under normal working situation) > > (Its occured to me that I could perhaps setup another "server { }" > block listening on another port, then use a different proxy_pass in > the "location @502 {}"? Seems ugly, but would that work?) This should work too. Maxim Dounin From mdounin at mdounin.ru Tue Mar 6 17:52:35 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Mar 2012 21:52:35 +0400 Subject: FastCGI and pipelining In-Reply-To: <7dfaea43ab257abd905e9b5917e5fc05.NginxMailingListEnglish@forum.nginx.org> References: <7dfaea43ab257abd905e9b5917e5fc05.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120306175235.GQ67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 12:04:35PM -0500, chuda wrote: > Hi all, > > I'm recently start using NGINX in combination with my FastCGI service, > it work quite good and effective. > I decided to use pipeline as it works effectively utilizing one > connection. > According to NGINX logs pipelining is work, but I mentioned interesting > thing - NGINX passes request to FCGI in synchronous mode, i.e. it'll > send the next request only after the first one will complete. > > It's weired for me. > > Is such behavior is expected? Yes. Pipelined requests from client are processed in order. That is, processing of next request starts only when previous requests was handled and response sent (at least to socket buffer). Maxim Dounin From nginxyz at mail.ru Tue Mar 6 17:54:01 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Tue, 06 Mar 2012 21:54:01 +0400 Subject: Multiple caching solutions for anonymous and logged in users withSSI on In-Reply-To: References: Message-ID: 06 ????? 2012, 14:02 ?? "Antonio P.P. Almeida" : > > Thanks Antonio. > > > > On a side note, if I craft a proxy cache key with cookie_sessionid and if > > the sessionid cookie does not exist, *will nginx take it as an empty > > value*? > > Sure. Here's an example using map. > > map $http_cookie $cache_id { > default nil; # hommage to Lisp :) > ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; > } > > When there's no SESS cookie then $cache_id is nil. > > > > Can nginx do a try_files or 'if' on the existence of a cookie? This > > will > > help me deliver two caching strategies in the same location directive. > > Sure. Example. At the http level: > > map $http_cookie $cookie_exists { > default 0; > ~ 1; > } > > On the "main" cache location: > > error_page 418 @other-cache-location; > > if ($cookie_exists) { > return 418; > } > > Something of this kind will work. > > --appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginxyz at mail.ru Tue Mar 6 18:05:03 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Tue, 06 Mar 2012 22:05:03 +0400 Subject: Using error_page to a named location - possible? In-Reply-To: <20120306174728.GP67687@mdounin.ru> References: <4F563D55.6040500@wildgooses.com> <20120306174728.GP67687@mdounin.ru> Message-ID: 06 ????? 2012, 21:47 ?? Maxim Dounin : > Hello! > > On Tue, Mar 06, 2012 at 04:37:41PM +0000, Ed W wrote: > > > Hi, as part of a larger problem I have a captive portal which grabs > > all incoming URLs and after evaluating a bunch of logic redirects > > the caller somewhere else. I use proxy_pass to pass the request to > > my cgi code. > > > > However, I would like to customise the error message in the event > > that the upstream daemon is unavailable. I can't figure out how to > > do that affecting part of the incoming URLs. Is it possible to do > > something like "error_page @502_error" in conjunction with > > proxy_pass? > > Yes, see below. > > > > > So, I have > > > > server { > > listen 8000 default_server; > > > > root /var/www/cp/htdocs/public; > > > > location / { > > proxy_read_timeout 5; > > proxy_pass http://127.0.0.1:3000; > > error_page 502 /502.html; > > proxy_set_header Host $http_host; > > proxy_set_header X-Server-Addr $server_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > proxy_set_header X-Forwarded-HTTPS 0; > > proxy_set_header X-Captive-Portal-Redirect 1; > > } > > location /502.html { > > internal; > > } > > } > > > > > > However, if I visit "http://somewhere/502.html" I get a 404 response > > (presumably matching the location /502.html and the 404 is due to > > the "internal"?) > > Yes. > > > I can't see that it's possible to use something like: > > > > location / { > > proxy_pass http://127.0.0.1:3000; > > error_page 502 @502; > > } It is possible, you should use the proxy_intercept_errors directive: location / { proxy_pass http://127.0.0.1:3000; proxy_intercept_errors on; error_page 502 @502; } location @502 { # all named locations are internal by default, hence no "internal;" return 502 "Gateway error while servicing $request_uri!\n"; } Max From nginxyz at mail.ru Tue Mar 6 18:14:24 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Tue, 06 Mar 2012 22:14:24 +0400 Subject: Multiple caching solutions for anonymous and logged in users with SSI on In-Reply-To: References: Message-ID: 06 ????? 2012, 14:02 ?? "Antonio P.P. Almeida" : > > Thanks Antonio. > > > > On a side note, if I craft a proxy cache key with cookie_sessionid and if > > the sessionid cookie does not exist, *will nginx take it as an empty > > value*? > > Sure. Here's an example using map. > > map $http_cookie $cache_id { > default nil; # hommage to Lisp :) > ~SESS[[:alnum:]]+=(?[[:graph:]]+) $session_id; > } > > When there's no SESS cookie then $cache_id is nil. > > > Can nginx do a try_files or 'if' on the existence of a cookie? This > > will > > help me deliver two caching strategies in the same location directive. > > Sure. Example. At the http level: > > map $http_cookie $cookie_exists { > default 0; > ~ 1; > } > > On the "main" cache location: > > error_page 418 @other-cache-location; > > if ($cookie_exists) { > return 418; > } What a load of... unnecessary directives! This does the job much more efficiently and cleanly: server { if ($cookie_sessionid) { rewrite ^ /logged_in$request_uri last; } location / { # Non-logged in clients #... } location /logged_in { # Logged in clients internal; proxy_cache_key $cookie_sessionid$scheme$host$request_uri; proxy_pass http://localhost:82/; # Note the trailing slash #... } } Max From mdounin at mdounin.ru Tue Mar 6 18:24:06 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 6 Mar 2012 22:24:06 +0400 Subject: Using error_page to a named location - possible? In-Reply-To: References: <4F563D55.6040500@wildgooses.com> <20120306174728.GP67687@mdounin.ru> Message-ID: <20120306182406.GR67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 10:05:03PM +0400, Max wrote: > > 06 ????? 2012, 21:47 ?? Maxim Dounin : > > Hello! > > > > On Tue, Mar 06, 2012 at 04:37:41PM +0000, Ed W wrote: > > > > > Hi, as part of a larger problem I have a captive portal which grabs > > > all incoming URLs and after evaluating a bunch of logic redirects > > > the caller somewhere else. I use proxy_pass to pass the request to > > > my cgi code. > > > > > > However, I would like to customise the error message in the event > > > that the upstream daemon is unavailable. I can't figure out how to > > > do that affecting part of the incoming URLs. Is it possible to do > > > something like "error_page @502_error" in conjunction with > > > proxy_pass? > > > > Yes, see below. > > > > > > > > So, I have > > > > > > server { > > > listen 8000 default_server; > > > > > > root /var/www/cp/htdocs/public; > > > > > > location / { > > > proxy_read_timeout 5; > > > proxy_pass http://127.0.0.1:3000; > > > error_page 502 /502.html; > > > proxy_set_header Host $http_host; > > > proxy_set_header X-Server-Addr $server_addr; > > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > > proxy_set_header X-Forwarded-HTTPS 0; > > > proxy_set_header X-Captive-Portal-Redirect 1; > > > } > > > location /502.html { > > > internal; > > > } > > > } > > > > > > > > > However, if I visit "http://somewhere/502.html" I get a 404 response > > > (presumably matching the location /502.html and the 404 is due to > > > the "internal"?) > > > > Yes. > > > > > I can't see that it's possible to use something like: > > > > > > location / { > > > proxy_pass http://127.0.0.1:3000; > > > error_page 502 @502; > > > } > > It is possible, you should use the proxy_intercept_errors directive: > > location / { > proxy_pass http://127.0.0.1:3000; > proxy_intercept_errors on; > error_page 502 @502; > } > > location @502 { > # all named locations are internal by default, hence no "internal;" > return 502 "Gateway error while servicing $request_uri!\n"; > } The proxy_intercept_errors isn't needed to handle 502's generated by nginx, it's only needed when backend returns the error in question and one want to override it. Maxim Dounin From nginxyz at mail.ru Tue Mar 6 18:39:28 2012 From: nginxyz at mail.ru (=?UTF-8?B?TWF4?=) Date: Tue, 06 Mar 2012 22:39:28 +0400 Subject: Using error_page to a named location - possible? In-Reply-To: <20120306182406.GR67687@mdounin.ru> References: <4F563D55.6040500@wildgooses.com> <20120306182406.GR67687@mdounin.ru> Message-ID: 06 ????? 2012, 22:24 ?? Maxim Dounin : > Hello! > > On Tue, Mar 06, 2012 at 10:05:03PM +0400, Max wrote: > > > > > 06 ????? 2012, 21:47 ?? Maxim Dounin : > > > Hello! > > > > > > On Tue, Mar 06, 2012 at 04:37:41PM +0000, Ed W wrote: > > > > > > > Hi, as part of a larger problem I have a captive portal which grabs > > > > all incoming URLs and after evaluating a bunch of logic redirects > > > > the caller somewhere else. I use proxy_pass to pass the request to > > > > my cgi code. > > > > > > > > However, I would like to customise the error message in the event > > > > that the upstream daemon is unavailable. I can't figure out how to > > > > do that affecting part of the incoming URLs. Is it possible to do > > > > something like "error_page @502_error" in conjunction with > > > > proxy_pass? > > > > > > Yes, see below. > > > > > > > > > > > So, I have > > > > > > > > server { > > > > listen 8000 default_server; > > > > > > > > root /var/www/cp/htdocs/public; > > > > > > > > location / { > > > > proxy_read_timeout 5; > > > > proxy_pass http://127.0.0.1:3000; > > > > error_page 502 /502.html; > > > > proxy_set_header Host $http_host; > > > > proxy_set_header X-Server-Addr $server_addr; > > > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > > > proxy_set_header X-Forwarded-HTTPS 0; > > > > proxy_set_header X-Captive-Portal-Redirect 1; > > > > } > > > > location /502.html { > > > > internal; > > > > } > > > > } > > > > > > > > > > > > However, if I visit "http://somewhere/502.html" I get a 404 response > > > > (presumably matching the location /502.html and the 404 is due to > > > > the "internal"?) > > > > > > Yes. > > > > > > > I can't see that it's possible to use something like: > > > > > > > > location / { > > > > proxy_pass http://127.0.0.1:3000; > > > > error_page 502 @502; > > > > } > > > > It is possible, you should use the proxy_intercept_errors directive: > > > > location / { > > proxy_pass http://127.0.0.1:3000; > > proxy_intercept_errors on; > > error_page 502 @502; > > } > > > > location @502 { > > # all named locations are internal by default, hence no "internal;" > > return 502 "Gateway error while servicing $request_uri!\n"; > > } > > The proxy_intercept_errors isn't needed to handle 502's generated > by nginx, it's only needed when backend returns the error in > question and one want to override it. Perhaps I misunderstood the OP, but he mentioned passing the request to his cgi code, but mentioned no fastcgi_pass directives, so it seems he wants to intercept 502 errors from the backend server. Max From nginx-forum at nginx.us Tue Mar 6 19:00:45 2012 From: nginx-forum at nginx.us (adamchal) Date: Tue, 6 Mar 2012 14:00:45 -0500 (EST) Subject: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter Message-ID: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> I'm noticing that Nginx's log module is "collapsing" empty log variables primarily when using a TAB (\t) as a delimiter in the access log. For example, if I use the following: log_format main '$server_name $msec $remote_addr $cookie_x $cookie_y $cookie_z $status'; And a request does not have any cookies set (so $cookie_x, $cookie_y, and $cookie_z would be empty), then I would get a log line like this: myserver.com 1331049809.478 10.10.15.50 - 200 I was expecting: myserver.com 1331049809.478 10.10.15.50 - - - 200 The same thing happens with the $http_referer (when not set by the UA) and $upstream_addr (when serving static files). Here's a link to my access log configuration: https://gist.github.com/1988173 I'm using Nginx v1.1.16. Has anyone experienced this before? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223532,223532#msg-223532 From nginx-forum at nginx.us Tue Mar 6 21:08:44 2012 From: nginx-forum at nginx.us (mevans336) Date: Tue, 6 Mar 2012 16:08:44 -0500 (EST) Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) Message-ID: <1c3d91be516c66854e893ecd708abc5e.NginxMailingListEnglish@forum.nginx.org> I have an Nginx reverse-proxy sitting in front of two JBoss servers. If I attempt to add the second JBoss server to the upstream directive, I receive an Error 310 (net::ERR_TOO_MANY_REDIRECTS) from Chrome, IE just displays an "Internet Explorer cannot display this webpage" error. If I comment the second upstream server out a kill -HUP the master process, everything works properly. I am attempting to use Nginx to rewrite all HTTP requests to HTTPS and upon first contact with our domain, the JBoss application redirects you to https://my.domain.com/home. Here is my default config file: upstream jboss_dev_servers { server 10.0.3.15:8080; server 10.0.3.16:8080; } server { listen 10.0.3.28:80; server_name my.domain.com; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_next_upstream error timeout invalid_header; rewrite ^ https://$server_name$request_uri? permanent; proxy_pass http://jboss_dev_servers; } } server { listen 10.0.3.28:443 default ssl; ssl on; ssl_certificate /srv/ssl/combined.crt; ssl_certificate_key /srv/ssl/combined.key; ssl_protocols SSLv3 TLSv1; server_name my.domain.com; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_next_upstream error timeout invalid_header; proxy_pass http://jboss_dev_servers; } } Any ideas what could be causing this? Is it bouncing the requests back and forth between the two upstream servers somehow? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223535,223535#msg-223535 From mdounin at mdounin.ru Tue Mar 6 21:17:46 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 01:17:46 +0400 Subject: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter In-Reply-To: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> References: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120306211746.GS67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 02:00:45PM -0500, adamchal wrote: > I'm noticing that Nginx's log module is "collapsing" empty log variables > primarily when using a TAB (\t) as a delimiter in the access log. > > For example, if I use the following: > > log_format main > '$server_name $msec $remote_addr $cookie_x $cookie_y $cookie_z $status'; > > And a request does not have any cookies set (so $cookie_x, $cookie_y, > and $cookie_z would be empty), then I would get a log line like this: > > myserver.com 1331049809.478 10.10.15.50 - 200 > > I was expecting: > > myserver.com 1331049809.478 10.10.15.50 - - - 200 > > The same thing happens with the $http_referer (when not set by the UA) > and $upstream_addr (when serving static files). > > Here's a link to my access log configuration: > https://gist.github.com/1988173 > > I'm using Nginx v1.1.16. > > Has anyone experienced this before? Number of tabs should match your log_format exactly, though some variables may be logged as empty string (""), not as a dash ("-"), if they are set but empty. This may happen e.g. if requests have empty cookies, i.e. "Cookie: x=; y=; z=" in request headers. This shouldn't happen with $upstream_addr though, and if you are sure you see this happening with $upstream_addr and/or there missing tabs - you may want to debug this further. Maxim Dounin From cliff at develix.com Tue Mar 6 21:46:55 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 06 Mar 2012 13:46:55 -0800 Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <1c3d91be516c66854e893ecd708abc5e.NginxMailingListEnglish@forum.nginx.org> References: <1c3d91be516c66854e893ecd708abc5e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F5685CF.50703@develix.com> On 03/06/2012 01:08 PM, mevans336 wrote: > I have an Nginx reverse-proxy sitting in front of two JBoss servers. If > I attempt to add the second JBoss server to the upstream directive, I > receive an Error 310 (net::ERR_TOO_MANY_REDIRECTS) from Chrome, IE just > displays an "Internet Explorer cannot display this webpage" error. If I > comment the second upstream server out a kill -HUP the master process, > everything works properly. > > I am attempting to use Nginx to rewrite all HTTP requests to HTTPS and > upon first contact with our domain, the JBoss application redirects you > to https://my.domain.com/home. > server { > listen 10.0.3.28:80; > server_name my.domain.com; > location / { > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_next_upstream error timeout invalid_header; > rewrite ^ https://$server_name$request_uri? permanent; > proxy_pass http://jboss_dev_servers; > } > } Why does the application do a redirect if you are already doing one in your Nginx config? It's not clear why you even bother with the proxy_pass in this location. Just redirect to the HTTPS location and be done. Also, be sure the application is properly detecting the scheme. In your config, Nginx is talking to JBoss via HTTP, not HTTPS, so you may have some issue there, something like proxy_set_header X-Scheme $scheme; would do the trick. I have no idea why this would work with a single backend and not two, unless you are somehow inadvertently running two different versions of the JBoss code (one with a redirect, one without). Regards, Cliff From nginx-forum at nginx.us Tue Mar 6 21:51:12 2012 From: nginx-forum at nginx.us (chuda) Date: Tue, 6 Mar 2012 16:51:12 -0500 (EST) Subject: FastCGI and pipelining In-Reply-To: <20120306175235.GQ67687@mdounin.ru> References: <20120306175235.GQ67687@mdounin.ru> Message-ID: <0217516209570e9e36bfb6c8599c2a61.NginxMailingListEnglish@forum.nginx.org> Maxim Dounin Wrote: > Yes. Pipelined requests from client are processed > in order. That is, processing of next request starts only when > previous requests was handled and response sent (at least to socket > buffer). Thank you for fast response. Is it common approach how NGINX serves pipelined requests to any upstream module or FCGI specific? Is there any technique to speed it up? Denis. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223522,223538#msg-223538 From francis at daoine.org Tue Mar 6 22:06:07 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 6 Mar 2012 22:06:07 +0000 Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <1c3d91be516c66854e893ecd708abc5e.NginxMailingListEnglish@forum.nginx.org> References: <1c3d91be516c66854e893ecd708abc5e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120306220607.GB18773@craic.sysops.org> On Tue, Mar 06, 2012 at 04:08:44PM -0500, mevans336 wrote: Hi there, > I have an Nginx reverse-proxy sitting in front of two JBoss servers. If > I attempt to add the second JBoss server to the upstream directive, I > receive an Error 310 (net::ERR_TOO_MANY_REDIRECTS) from Chrome, IE just > displays an "Internet Explorer cannot display this webpage" error. If you test using something like "curl", you'll see exactly what the response is, and you can compare it to what you expect it to be. That tends to make things easier to follow. > If I > comment the second upstream server out a kill -HUP the master process, > everything works properly. > > I am attempting to use Nginx to rewrite all HTTP requests to HTTPS and > upon first contact with our domain, the JBoss application redirects you > to https://my.domain.com/home. What does the JBoss application understand by the phrase "first contact"? I suspect that that's going to be related to the fix. > upstream jboss_dev_servers { > server 10.0.3.15:8080; > server 10.0.3.16:8080; > } > > server { > listen 10.0.3.28:80; > server_name my.domain.com; > location / { > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_next_upstream error timeout invalid_header; > rewrite ^ https://$server_name$request_uri? permanent; > proxy_pass http://jboss_dev_servers; The "rewrite" there means that the "proxy_pass" will never be used. curl -i http://my.domain.com/ should show a http 301 redirect to https://my.domain.com/, so that's what the client will ask for next. > server { > listen 10.0.3.28:443 default ssl; > location / { > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_next_upstream error timeout invalid_header; > proxy_pass http://jboss_dev_servers; curl -i https://my.domain.com/ should get to here, and be proxied to a jboss server. If that thinks that this is "first contact", it will issue a http redirect to https://my.domain.com/home. If you modify each jboss server to add a "I'm #1" header, you'll see which jboss server you just contacted. The next thing the client will do is curl -i https://my.domain.com/home which will be proxied to a jboss server. If that server thinks that this is "first contact", it will issue a http redirect to https://my.domain.com/home, at which point the client can reasonably think "redirect loop; this is broken". If that server thinks that this isn't "first contact", it will presumably return http 200 with some useful content. Which do you see when you test it like this? And in this second response, do you see an "I'm #1" or an "I'm #2" header? (You could look in logs to know which upstream server you were eventually talking to, but a header is more immediate.) > Any ideas what could be causing this? Is it bouncing the requests back > and forth between the two upstream servers somehow? My guess is that "first contact" information is not shared between the two jboss servers, so if serial requests from a single client don't always go to the same server, bad things happen. You should be able to see whether or not that is the case. With only one jboss server configured, all requests must go to it, and things should work, as you reported. All the best, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Tue Mar 6 22:07:39 2012 From: nginx-forum at nginx.us (mevans336) Date: Tue, 6 Mar 2012 17:07:39 -0500 (EST) Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <4F5685CF.50703@develix.com> References: <4F5685CF.50703@develix.com> Message-ID: Cliff, The application performs a redirect because that was the way it was originally designed. It uses the ACEGI security framework. I have turned the ACEGI HTTP -> HTTPS redirect off with the same behavior however. After my post, I stumbled across the ip_hash upstream variable and that has resolved the issue. Or at least, masked it and made things functional. I am aware that Nginx is talking to JBoss via HTTP, not HTTPS. Nginx is acting as our front-end SSL termination point, we don't have JBoss configured to answer SSL requests, although for security purposes, that is on my 'to-do' list. Right now, clients don't communicate directly with the JBoss servers, only Nginx, so communication over the internet is encrypted. I am confused by your statement, "It's not clear why you even bother with the proxy_pass in this location. Just redirect to the HTTPS location and be done." I am new to Nginx, so I followed the Nginx load balancing example (http://wiki.nginx.org/LoadBalanceExample). Is there an easier/better way to configure load balancing among multiple upstream servers? Thank you for your input, Matt Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223535,223539#msg-223539 From cabbar at gmail.com Tue Mar 6 22:21:06 2012 From: cabbar at gmail.com (Cabbar Duzayak) Date: Wed, 7 Mar 2012 00:21:06 +0200 Subject: Newbie Question: Sharing proxy_pass config between locations Message-ID: Hi, I have a basic configuration that points to a back-end server with proxy_pass and bunch of proxy_set_header call entries. And, I have multiple locations entries that keep doing the same thing, e.g. location / { proxy_pass http://127.0.0.1:5000 proxy_set_header X-Real-IP $remote_addr; ... more proxy_set headers } location /x/ { access_log off proxy_pass http://127.0.0.1:5000 proxy_set_header X-Real-IP $remote_addr; ... more proxy_set headers } Is it possible to define this proxy_pass & proxy_set_headers once, and share it between these locations? Or, do I need to keep doing this for all? Thanks. From lists at wildgooses.com Tue Mar 6 22:32:56 2012 From: lists at wildgooses.com (Ed W) Date: Tue, 06 Mar 2012 22:32:56 +0000 Subject: Using error_page to a named location - possible? In-Reply-To: <20120306174728.GP67687@mdounin.ru> References: <4F563D55.6040500@wildgooses.com> <20120306174728.GP67687@mdounin.ru> Message-ID: <4F569098.8080007@wildgooses.com> On 06/03/2012 17:47, Maxim Dounin wrote: >> I can't see that it's possible to use something like: >> >> location / { >> proxy_pass http://127.0.0.1:3000; >> error_page 502 @502; >> } >> >> location @502 { >> index /502.html; >> root /var/www; >> internal; >> } > Try something like: > > location @502 { > internal; > root /var/www; > rewrite ^ /502.html break; > } > > This should work at least for GET requests. Perfect - thanks! Now, I have thought about this a little while and I don't quite understand how it works...? The key seems to be the rewrite clause - near as I can see, without this the error request gets reprocessed by the "location /" section, but the rewrite is causing it to terminate that? Can you teach me to understand this please? Many thanks! Ed W From mdounin at mdounin.ru Tue Mar 6 22:38:11 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 02:38:11 +0400 Subject: FastCGI and pipelining In-Reply-To: <0217516209570e9e36bfb6c8599c2a61.NginxMailingListEnglish@forum.nginx.org> References: <20120306175235.GQ67687@mdounin.ru> <0217516209570e9e36bfb6c8599c2a61.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120306223811.GT67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 04:51:12PM -0500, chuda wrote: > Maxim Dounin Wrote: > > Yes. Pipelined requests from client are processed > > in order. That is, processing of next request starts only when > > previous requests was handled and response sent (at least to socket > > buffer). > > Thank you for fast response. > Is it common approach how NGINX serves pipelined requests to any > upstream module or FCGI specific? It's how nginx handles pipelined requests (regardless of any processing details). > Is there any technique to speed it up? Use multiple connections? Maxim Dounin From francis at daoine.org Tue Mar 6 22:38:39 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 6 Mar 2012 22:38:39 +0000 Subject: Newbie Question: Sharing proxy_pass config between locations In-Reply-To: References: Message-ID: <20120306223839.GC18773@craic.sysops.org> On Wed, Mar 07, 2012 at 12:21:06AM +0200, Cabbar Duzayak wrote: Hi there, > Is it possible to define this proxy_pass & proxy_set_headers once, and > share it between these locations? Or, do I need to keep doing this for > all? One option is to put some or all of the common configuration into an external file, and "include" it in the appropriate location blocks. Another option is to put all of the proxy_set_header lines directly in server{}, outside of any location{} so that they will be inherited into all of them. Then put the proxy_pass into the locations that matter. Be aware of what happens if you want things slightly different in one location{}, though -- if you wish to add an extra proxy_set_header, the two options have different requirements. f -- Francis Daly francis at daoine.org From adrian at navarro.at Tue Mar 6 22:56:32 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Tue, 6 Mar 2012 23:56:32 +0100 Subject: Disabling file resuming with X-Accel / Removing headers Message-ID: Hello, I have a config using fastcgi and different locations FastCGI is set as internal: location ~ \.php$ { internal; fastcgi_pass 127.0.0.1:9000; fastcgi_send_timeout 120; fastcgi_read_timeout 120; fastcgi_index index.php; include fastcgi_params; } Services (just two) are rewritten. location /get { rewrite ^ /get.php last; } I am using nginx's X-Accel headers, and I want to disable file resuming. That implies: - suppresing output header "Accept-Ranges: bytes" - suppresing input header "Range" I am now trying to do the first. Apparently, headers_more won't work when put in the location /get, or for location /get.php. (more_clear_headers 'Accept-Bytes';). There is no luck using Lua either, in many different ways. I even tried putting Lua before the fcgi, and it does allow adding headers, but not replacing or resetting them. As if this header was set a lot later in the process (I think so, because it's added when X-Accel is set internally, therefore after fcgi is done processing). Anyone have any pointers? I'm running out of ideas now. Thank you a lot for your time Adri?n From lists at wildgooses.com Tue Mar 6 22:58:49 2012 From: lists at wildgooses.com (Ed W) Date: Tue, 06 Mar 2012 22:58:49 +0000 Subject: How to sponsor a feature request? Message-ID: <4F5696A9.3090804@wildgooses.com> Hi, I have some interest in being able to use WebDAV in nginx with enough conformance to be able to use it for file sharing (I think this mainly means support for PROPFIND and OPTIONS ?) Is it affordable to either "encourage" development of this feature, or are their regular people who can pickup development jobs like this? I have had a brief look at what is required (mostly by comparing to the various PHP/Perl workarounds) and it mostly looks straightforward (especially if it's acceptable to cheat and assume that allprop is in effect and all properties are always returned) Is there a recommended way to progess? Just for reference, I'm not a huge business with big pockets, so please keep suggestions moderate? Thanks Ed W From wangsamp at gmail.com Tue Mar 6 23:12:54 2012 From: wangsamp at gmail.com (Oleksandr V. Typlyns'kyi) Date: Wed, 7 Mar 2012 01:12:54 +0200 (EET) Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: References: Message-ID: Yesterday Mar 6, 2012 at 23:56 Adri?n Navarro wrote: > I am using nginx's X-Accel headers, and I want to disable file > resuming. That implies: > - suppresing output header "Accept-Ranges: bytes" > - suppresing input header "Range" > > I am now trying to do the first. Apparently, headers_more won't work > when put in the location /get, or for location /get.php. > (more_clear_headers 'Accept-Bytes';). > > There is no luck using Lua either, in many different ways. I even > tried putting Lua before the fcgi, and it does allow adding headers, > but not replacing or resetting them. As if this header was set a lot > later in the process (I think so, because it's added when X-Accel is > set internally, therefore after fcgi is done processing). Just set max_ranges to zero: http://nginx.org/en/docs/http/ngx_http_core_module.html#max_ranges -- WNGS-RIPE From francis at daoine.org Tue Mar 6 23:24:21 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 6 Mar 2012 23:24:21 +0000 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: References: Message-ID: <20120306232421.GD18773@craic.sysops.org> On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: Hi there, > I am using nginx's X-Accel headers, and I want to disable file > resuming. That implies: > - suppresing output header "Accept-Ranges: bytes" > - suppresing input header "Range" > Anyone have any pointers? I'm running out of ideas now. Completely untested, and not a direct answer to "file resuming", but you asked for pointers, so maybe... If you want a response header from a fastcgi process not to be delivered to the client, see fastcgi_hide_header, for example at http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header If you want a request header not to be sent to a fastcgi process, set the matching parameter yourself to empty: fastcgi_param HTTP_RANGE ""; Good luck with it, f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Tue Mar 6 23:28:55 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 03:28:55 +0400 Subject: Using error_page to a named location - possible? In-Reply-To: <4F569098.8080007@wildgooses.com> References: <4F563D55.6040500@wildgooses.com> <20120306174728.GP67687@mdounin.ru> <4F569098.8080007@wildgooses.com> Message-ID: <20120306232854.GU67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 10:32:56PM +0000, Ed W wrote: > On 06/03/2012 17:47, Maxim Dounin wrote: > >>I can't see that it's possible to use something like: > >> > >> location / { > >> proxy_pass http://127.0.0.1:3000; > >> error_page 502 @502; > >> } > >> > >>location @502 { > >> index /502.html; > >> root /var/www; > >> internal; > >>} > >Try something like: > > > > location @502 { > > internal; > > root /var/www; > > rewrite ^ /502.html break; > > } > > > >This should work at least for GET requests. > > Perfect - thanks! > > > Now, I have thought about this a little while and I don't quite > understand how it works...? > > The key seems to be the rewrite clause - near as I can see, without > this the error request gets reprocessed by the "location /" section, > but the rewrite is causing it to terminate that? > > Can you teach me to understand this please? Under normal conditions location @502 { root /var/www; } will behave much like normal static location, as described here: http://nginx.org/en/docs/http/request_processing.html That is, request to a "/file", if it happens to hit his location, will be processed as follows: 1. It doesn't ends with '/', hence nginx will try to open a file for it, + . I.e. "/var/www/file" will be opened. 2. The (1) will likely fail (as there is no such file) and will generate 404. More importantly, request to a "/" will be processed as follows: 1. It ends with "/", so nginx will try to use index module to handle it. 2. Index module will test + + file, i.e. "/var/www/502.html" with your config. If it's found - nginx will do internal redirect to "/502.html". 3. The internal redirect will end up in "location /". This is obviously not what you want. With "rewrite ^ /502.html break;" the following two important things happen: a. Every request will be a request to a file (i.e. no internal redirects). Note that "break" is important, without "break" nginx will re-do location matching again after rewrite. b. Every request will be a request to the "/var/www/502.html" file. That is, every GET request which hits the @502 location will return the /var/www/502.html. Note well: For POSTs things won't be that easy, as error_page set to a named location won't change request method to GET (in contrast to error_page set to a uri), and the above will generate 405 Method Not Allowed. If you have to handle POSTs as well, I see the following options as of now: 1. Use proxy_pass to another server{} in location @502 and process it there. You may also use proxy_method/proxy_pass_request_body to simplify things. 2. Use some normally impossible location, like location / { proxy_pass http://backend; error_page 502 //502.html; } location = //502.html { root /var/www; } The (2) is more like a hack, but should work as //502.html isn't normally reachable via nginx due to merge_slashes being "on" by default (see http://nginx.org/r/merge_slashes). Maxim Dounin From adrian at navarro.at Tue Mar 6 23:45:02 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Wed, 7 Mar 2012 00:45:02 +0100 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: <20120306232421.GD18773@craic.sysops.org> References: <20120306232421.GD18773@craic.sysops.org> Message-ID: Thank you everyone for your answers. max_ranges 0; works great if set in the main server {} directive. Sadly, when put inside a location directive, it will not work. The same applies for more_clear_headers. The other thing I'm seeing is that while headers with max_range for the whole directive does return correct headers, chrome still allows pausing. I better get some sleep and keep digging tomorrow. Thank you, I'll follow up soon. On Wed, Mar 7, 2012 at 12:24 AM, Francis Daly wrote: > On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: > > Hi there, > >> I am using nginx's X-Accel headers, and I want to disable file >> resuming. That implies: >> - suppresing output header "Accept-Ranges: bytes" >> - suppresing input header "Range" > >> Anyone have any pointers? I'm running out of ideas now. > > Completely untested, and not a direct answer to "file resuming", but you > asked for pointers, so maybe... > > If you want a response header from a fastcgi process not to be > delivered to the client, see fastcgi_hide_header, for example at > http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header > > If you want a request header not to be sent to a fastcgi process, set > the matching parameter yourself to empty: > > ?fastcgi_param HTTP_RANGE ""; > > Good luck with it, > > ? ? ? ?f > -- > Francis Daly ? ? ? ?francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Adri?n Navarro / (+34) 608 831 094 From mdounin at mdounin.ru Tue Mar 6 23:47:25 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 03:47:25 +0400 Subject: How to sponsor a feature request? In-Reply-To: <4F5696A9.3090804@wildgooses.com> References: <4F5696A9.3090804@wildgooses.com> Message-ID: <20120306234725.GV67687@mdounin.ru> Hello! On Tue, Mar 06, 2012 at 10:58:49PM +0000, Ed W wrote: > Hi, I have some interest in being able to use WebDAV in nginx with > enough conformance to be able to use it for file sharing (I think > this mainly means support for PROPFIND and OPTIONS ?) > > Is it affordable to either "encourage" development of this feature, > or are their regular people who can pickup development jobs like > this? > > I have had a brief look at what is required (mostly by comparing to > the various PHP/Perl workarounds) and it mostly looks > straightforward (especially if it's acceptable to cheat and assume > that allprop is in effect and all properties are always returned) > > Is there a recommended way to progess? Just for reference, I'm not > a huge business with big pockets, so please keep suggestions > moderate? You may try Roman Arutyunyan's module: https://github.com/arut/nginx-dav-ext-module Maxim Dounin From cliff at develix.com Wed Mar 7 00:59:02 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 06 Mar 2012 16:59:02 -0800 Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: References: <4F5685CF.50703@develix.com> Message-ID: <4F56B2D6.7000006@develix.com> On 03/06/2012 02:07 PM, mevans336 wrote: > Cliff, > > The application performs a redirect because that was the way it was > originally designed. It uses the ACEGI security framework. I have turned > the ACEGI HTTP -> HTTPS redirect off with the same behavior however. > > After my post, I stumbled across the ip_hash upstream variable and that > has resolved the issue. Or at least, masked it and made things > functional. > > I am aware that Nginx is talking to JBoss via HTTP, not HTTPS. Nginx is > acting as our front-end SSL termination point, we don't have JBoss > configured to answer SSL requests, although for security purposes, that > is on my 'to-do' list. Right now, clients don't communicate directly > with the JBoss servers, only Nginx, so communication over the internet > is encrypted. I was just making sure that was considered. In any case I suspect Francis is right in his assessment, and that's why using the ip_hash directive solved your issue. Good work on that. I haven't personally encountered frameworks with this issue so it didn't occur to me. > I am confused by your statement, "It's not clear why you even bother > with the proxy_pass in this location. Just redirect to the HTTPS > location and be done." What I meant is that you are doing a "rewrite permanent", followed by the proxy_pass. This means that either the proxy_pass will never be executed. Sorry I wasn't clear. Regards, Cliff From cliff at develix.com Wed Mar 7 01:12:37 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 06 Mar 2012 17:12:37 -0800 Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <20120306220607.GB18773@craic.sysops.org> References: <1c3d91be516c66854e893ecd708abc5e.NginxMailingListEnglish@forum.nginx.org> <20120306220607.GB18773@craic.sysops.org> Message-ID: <4F56B605.8010504@develix.com> On 03/06/2012 02:06 PM, Francis Daly wrote: > My guess is that "first contact" information is not shared between the > two jboss servers, so if serial requests from a single client don't > always go to the same server, bad things happen. You should be able to > see whether or not that is the case. With only one jboss server > configured, all requests must go to it, and things should work, as you > reported. All the best, f Since the ip_hash worked, your assessment seems spot on. However, one thing that's still not making sense to me: in his reply, Matt states that he tested with the HTTPS redirect disabled in JBoss and still had the same issue. I'm a bit unsure of how that could be (unless it was still in effect, or the browser remembered the redirect). Regards, Cliff From agentzh at gmail.com Wed Mar 7 01:26:56 2012 From: agentzh at gmail.com (agentzh) Date: Wed, 7 Mar 2012 09:26:56 +0800 Subject: How to use srcache_store while proxy_pass use to connect backend In-Reply-To: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> References: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Tue, Mar 6, 2012 at 1:48 AM, n1xman wrote: > Hi, > > I can't store data while I'm using proxy_pass to connect to the backend > if we can't find data on the memcached. srcache_fetch probes the > memcached but since no data, it connect to the backend and get the > correct data but not executing the srcache_store. Can you enable the debug logs in your nginx build and paste the relevant logs here? To enable the debug logs, just re-compile your nginx with the --with-debug configure option, and also use the "debug" log level in your "error_log" config directive in your nginx.conf. Also telling me the outputs of the "/path/to/your/nginx -V" command and "uname -a" command on your side may also be helpful :) Thanks! -agentzh From lists at wildgooses.com Wed Mar 7 03:10:57 2012 From: lists at wildgooses.com (Ed W) Date: Wed, 07 Mar 2012 03:10:57 +0000 Subject: How to sponsor a feature request? In-Reply-To: <20120306234725.GV67687@mdounin.ru> References: <4F5696A9.3090804@wildgooses.com> <20120306234725.GV67687@mdounin.ru> Message-ID: <4F56D1C1.1010408@wildgooses.com> On 06/03/2012 23:47, Maxim Dounin wrote: > Hello! > > On Tue, Mar 06, 2012 at 10:58:49PM +0000, Ed W wrote: > >> Hi, I have some interest in being able to use WebDAV in nginx with >> enough conformance to be able to use it for file sharing (I think >> this mainly means support for PROPFIND and OPTIONS ?) >> >> Is it affordable to either "encourage" development of this feature, >> or are their regular people who can pickup development jobs like >> this? >> >> I have had a brief look at what is required (mostly by comparing to >> the various PHP/Perl workarounds) and it mostly looks >> straightforward (especially if it's acceptable to cheat and assume >> that allprop is in effect and all properties are always returned) >> >> Is there a recommended way to progess? Just for reference, I'm not >> a huge business with big pockets, so please keep suggestions >> moderate? > You may try Roman Arutyunyan's module: > https://github.com/arut/nginx-dav-ext-module > > Maxim Dounin > > Oh cool. Thanks Forgive me one more question: The documentation gives examples of webdav permissions such as: dav_access user:rw group:rw all:r; What do these groups actually refer to? Is this a straight mapping to unix groups/users? Ideally my users have login tokens which are their email addresses. Any suggestions on how to set auth access to users and groups of users given they don't have local unix accounts? Thanks Ed W -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 7 03:13:23 2012 From: nginx-forum at nginx.us (gcaplan) Date: Tue, 6 Mar 2012 22:13:23 -0500 (EST) Subject: Can anyone *really* explain opcode caching with PHP? Message-ID: Hi folks Thinking of abandoning mod_php for the wonderful world of nginx, but googling the issue of opcode caching with fastcgi is proving surprisingly confusing: there's a lot of conflicting information out there. My basic question is this: what is the most performant, memory-efficient, Slashdot resistant way to set up nginx for running a complex PHP app? More specifically: 1) Why cache? I understood that a fastcgi process compiles the app into memory, and serves it from there till it's recycled after max_requests. So what's the value of opcode caching? To speed up one request in 500? But I've seen benchmarks that claim an opcode cache with nginx offers 50% savings on memory and response time. Where would these savings be coming from? No one explains... 2) What cache? Nginx/PHP setup tutorials either omit opcode caching or recommend xcache, without explaining why. There's a lot of conflicting information about whether each process needs its own cache (very memory intensive?) or whether processes can share a cache. Some bloggers claim that Xcache handles this better than APC, but again, no one explains how or why. Can anyone offer an authoritative answer to this? So is opcode caching effective with fastcgi? If so, how does it work, and what setup plays best with nginx? I would be more than grateful if anyone can make sense of this. Also, can I please suggest this as a candidate for the nginx FAQs? Judging by what I've been reading, I'm not the only one who'se confused by this... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223556,223556#msg-223556 From cabbar at gmail.com Wed Mar 7 09:04:00 2012 From: cabbar at gmail.com (Cabbar Duzayak) Date: Wed, 7 Mar 2012 11:04:00 +0200 Subject: Newbie Question: Sharing proxy_pass config between locations In-Reply-To: <20120306223839.GC18773@craic.sysops.org> References: <20120306223839.GC18773@craic.sysops.org> Message-ID: This makes sense. Thanks. On Wed, Mar 7, 2012 at 12:38 AM, Francis Daly wrote: > On Wed, Mar 07, 2012 at 12:21:06AM +0200, Cabbar Duzayak wrote: > > Hi there, > >> Is it possible to define this proxy_pass & proxy_set_headers once, and >> share it between these locations? Or, do I need to keep doing this for >> all? > > One option is to put some or all of the common configuration into an > external file, and "include" it in the appropriate location blocks. > > Another option is to put all of the proxy_set_header lines directly in > server{}, outside of any location{} so that they will be inherited into > all of them. Then put the proxy_pass into the locations that matter. > > Be aware of what happens if you want things slightly different in one > location{}, though -- if you wish to add an extra proxy_set_header, > the two options have different requirements. > > ? ? ? ?f > -- > Francis Daly ? ? ? ?francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From c.kworr at gmail.com Wed Mar 7 08:57:34 2012 From: c.kworr at gmail.com (Volodymyr Kostyrko) Date: Wed, 07 Mar 2012 10:57:34 +0200 Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: References: Message-ID: <4F5722FE.9040704@gmail.com> gcaplan wrote: > Hi folks > > Thinking of abandoning mod_php for the wonderful world of nginx, but > googling the issue of opcode caching with fastcgi is proving > surprisingly confusing: there's a lot of conflicting information out > there. > > My basic question is this: what is the most performant, > memory-efficient, Slashdot resistant way to set up nginx for running a > complex PHP app? > > More specifically: > > 1) Why cache? I understood that a fastcgi process compiles the app into > memory, and serves it from there till it's recycled after max_requests. > So what's the value of opcode caching? To speed up one request in 500? > But I've seen benchmarks that claim an opcode cache with nginx offers > 50% savings on memory and response time. Where would these savings be > coming from? No one explains... As far as I know you are wrong here. FastCGI is just another way of running apps by making core process up, running and fully initialized. Everything this process runs is still subject to opcode caching. > 2) What cache? Nginx/PHP setup tutorials either omit opcode caching or > recommend xcache, without explaining why. There's a lot of conflicting > information about whether each process needs its own cache (very memory > intensive?) or whether processes can share a cache. Some bloggers claim > that Xcache handles this better than APC, but again, no one explains how > or why. Can anyone offer an authoritative answer to this? I don't like xcache much but for opcode caching it's my favorite choice: 1. Doesn't relies on IPC or file handlers by default. I seen installations with APC where caching was done to disk due to extreme size of files and that ruined whole caching thing. I also witnessed at least one time APC deadlock due to process crash and other processes stalling on IPC. IPC is very tricky thing, once you are in you should measure every step. I really don't know how postgres works with IPC but they are doing it well. I hadn't seen another app which can work with IPC without messing things. 2. Security. By default if I set up two different php-fpm pools they wouldn't share any cached code nor give access to any other. And I don't need to write a single line in config about that. 3. Faster. > So is opcode caching effective with fastcgi? If so, how does it work, > and what setup plays best with nginx? I would be more than grateful if > anyone can make sense of this. Also, can I please suggest this as a > candidate for the nginx FAQs? Judging by what I've been reading, I'm not > the only one who'se confused by this... Maybe you can look on uWSGI also? That one is better by desing then FastCGI. -- Sphinx of black quartz judge my vow. From mdounin at mdounin.ru Wed Mar 7 09:42:10 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 13:42:10 +0400 Subject: How to sponsor a feature request? In-Reply-To: <4F56D1C1.1010408@wildgooses.com> References: <4F5696A9.3090804@wildgooses.com> <20120306234725.GV67687@mdounin.ru> <4F56D1C1.1010408@wildgooses.com> Message-ID: <20120307094209.GW67687@mdounin.ru> Hello! On Wed, Mar 07, 2012 at 03:10:57AM +0000, Ed W wrote: > On 06/03/2012 23:47, Maxim Dounin wrote: > >Hello! > > > >On Tue, Mar 06, 2012 at 10:58:49PM +0000, Ed W wrote: > > > >>Hi, I have some interest in being able to use WebDAV in nginx with > >>enough conformance to be able to use it for file sharing (I think > >>this mainly means support for PROPFIND and OPTIONS ?) > >> > >>Is it affordable to either "encourage" development of this feature, > >>or are their regular people who can pickup development jobs like > >>this? > >> > >>I have had a brief look at what is required (mostly by comparing to > >>the various PHP/Perl workarounds) and it mostly looks > >>straightforward (especially if it's acceptable to cheat and assume > >>that allprop is in effect and all properties are always returned) > >> > >>Is there a recommended way to progess? Just for reference, I'm not > >>a huge business with big pockets, so please keep suggestions > >>moderate? > >You may try Roman Arutyunyan's module: > >https://github.com/arut/nginx-dav-ext-module > > > >Maxim Dounin > > > > > > Oh cool. Thanks > > Forgive me one more question: > > The documentation gives examples of webdav permissions such as: > dav_access user:rw group:rw all:r; > > What do these groups actually refer to? Is this a straight mapping > to unix groups/users? This is about chmod on files created (that is, the above means "chmod 0664"), it has nothing to do with particular user names. All created files will be owner by nginx user (the one set with "user" directive, see http://nginx.org/r/user). > Ideally my users have login tokens which are their email addresses. > Any suggestions on how to set auth access to users and groups of > users given they don't have local unix accounts? Simpliest solution is to use auth basic module, see http://nginx.org/r/auth_basic. Maxim Dounin From roberto at unbit.it Wed Mar 7 09:46:23 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Wed, 7 Mar 2012 10:46:23 +0100 Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: References: Message-ID: <827d70d6a3faa1df0cecb1b581ebea5a.squirrel@manage.unbit.it> > Hi folks > > Thinking of abandoning mod_php for the wonderful world of nginx, but > googling the issue of opcode caching with fastcgi is proving > surprisingly confusing: there's a lot of conflicting information out > there. > > My basic question is this: what is the most performant, > memory-efficient, Slashdot resistant way to set up nginx for running a > complex PHP app? You have to take in account one fundamental point: mod_php is often see as "easy" because it get the apache's adaptive process spawning. That means you have not to take in account how much processes to dedicate to php requests. Apache will spawn processes on demand. With nginx you have a proxy talking to a set of processes (via various protocols). The default php fastcgi server does not have adaptive process spawning, so you have to preallocate them, carefully choosing the number. This often smashes even experienced apache "sysadmin", used to not care that aspect. (i remember one guy working on one of fortune 500 company blaming nginx on that list). I still have customer (experienced php developers) that still not get the "multiprocess" concept. I answer your questions below > > More specifically: > > 1) Why cache? I understood that a fastcgi process compiles the app into > memory, and serves it from there till it's recycled after max_requests. > So what's the value of opcode caching? To speed up one request in 500? > But I've seen benchmarks that claim an opcode cache with nginx offers > 50% savings on memory and response time. Where would these savings be > coming from? No one explains... fastcgi is only a communication protocol from nginx to your app (the php server). I am not a big fan of opcode caching, but i can assure you that it works in php fastcgi server, php-fpm and uWSGI. It really works whenever your php processes are not recycled (that is why it will never works on CGI mode) > > 2) What cache? Nginx/PHP setup tutorials either omit opcode caching or > recommend xcache, without explaining why. There's a lot of conflicting > information about whether each process needs its own cache (very memory > intensive?) or whether processes can share a cache. Some bloggers claim > that Xcache handles this better than APC, but again, no one explains how > or why. Can anyone offer an authoritative answer to this? > > So is opcode caching effective with fastcgi? If so, how does it work, > and what setup plays best with nginx? I would be more than grateful if > anyone can make sense of this. Also, can I please suggest this as a > candidate for the nginx FAQs? Judging by what I've been reading, I'm not > the only one who'se confused by this... > again, caching fully works whenever you do not recycle your processes, so you will not have problems with that. I only suggest you to choose a more advanced server, like php-fpm or uWSGI (even if it is very new in the php world), as the old-style embedded php fastcgi-server has very few features (read: none) -- Roberto De Ioris http://unbit.it From lists at wildgooses.com Wed Mar 7 09:54:54 2012 From: lists at wildgooses.com (Ed W) Date: Wed, 07 Mar 2012 09:54:54 +0000 Subject: Using error_page to a named location - possible? In-Reply-To: <20120306232854.GU67687@mdounin.ru> References: <4F563D55.6040500@wildgooses.com> <20120306174728.GP67687@mdounin.ru> <4F569098.8080007@wildgooses.com> <20120306232854.GU67687@mdounin.ru> Message-ID: <4F57306E.3080800@wildgooses.com> On 06/03/2012 23:28, Maxim Dounin wrote: > Hello! > > On Tue, Mar 06, 2012 at 10:32:56PM +0000, Ed W wrote: > >> On 06/03/2012 17:47, Maxim Dounin wrote: >>>> I can't see that it's possible to use something like: >>>> >>>> location / { >>>> proxy_pass http://127.0.0.1:3000; >>>> error_page 502 @502; >>>> } >>>> >>>> location @502 { >>>> index /502.html; >>>> root /var/www; >>>> internal; >>>> } >>> Try something like: >>> >>> location @502 { >>> internal; >>> root /var/www; >>> rewrite ^ /502.html break; >>> } >>> >>> This should work at least for GET requests. >> Perfect - thanks! >> >> >> Now, I have thought about this a little while and I don't quite >> understand how it works...? >> >> The key seems to be the rewrite clause - near as I can see, without >> this the error request gets reprocessed by the "location /" section, >> but the rewrite is causing it to terminate that? >> >> Can you teach me to understand this please? > Under normal conditions > > location @502 { > root /var/www; > } > > will behave much like normal static location, as described here: > > http://nginx.org/en/docs/http/request_processing.html > > That is, request to a "/file", if it happens to hit his location, > will be processed as follows: > > 1. It doesn't ends with '/', hence nginx will try to open a file > for it, +. I.e. "/var/www/file" will be opened. > > 2. The (1) will likely fail (as there is no such file) and will > generate 404. > > More importantly, request to a "/" will be processed as > follows: > > 1. It ends with "/", so nginx will try to use index module to > handle it. > > 2. Index module will test + + file, i.e. > "/var/www/502.html" with your config. If it's found - nginx will > do internal redirect to "/502.html". > > 3. The internal redirect will end up in "location /". This is > obviously not what you want. > > With "rewrite ^ /502.html break;" the following two important > things happen: Hi, Thanks for this REALLY clear post. I wonder if there is somewhere sensible to record this on the wiki - it's very incisive on a subtle subject! Just to confirm my understanding, the point 2) above seems to the key - ie the "index" module is doing a "redirect" *without* a break, hence adding the explicit redirect WITH a break is what we need to prevent the cycle. This fits with my observations (of course) because when I added a location matching "location /502.html" this also prevents the cycle Thanks for investing quite some time answering this! Note, the background to this is that I want to bounce any incoming url to "http://portal/login?redirect_to=$encoded_incoming_url". I have tried to achieve this using only core nginx, but I can't handle the corner cases such as incoming url having multiple parameters. I have worked around using my cgi to generate the redirect. *IF* you believe that this should be possible using only nginx I would be interested to re-ask that question - however, I think you are going to confirm that it's not currently possible? Many thanks again! Ed W From grails at jmsd.co.uk Wed Mar 7 10:09:38 2012 From: grails at jmsd.co.uk (John Moore) Date: Wed, 07 Mar 2012 10:09:38 +0000 Subject: How many args in $args? Message-ID: <4tl6psuitybk.1gq09-3rtlsw33@elasticemail.com> Is there some means of determining how many query parameters are being passed, by looking $args, say? There's a kind of DOS attack which can bring down Java based webapps which do binding of request parameters to properties, and it seems to me that nginx used as a remote proxy server could probably prevent this simply by rejecting requests which had more than x query parameters. From rainer at ultra-secure.de Wed Mar 7 10:10:13 2012 From: rainer at ultra-secure.de (Rainer Duffner) Date: Wed, 7 Mar 2012 11:10:13 +0100 Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <827d70d6a3faa1df0cecb1b581ebea5a.squirrel@manage.unbit.it> References: <827d70d6a3faa1df0cecb1b581ebea5a.squirrel@manage.unbit.it> Message-ID: <20120307111013.7acd86f2@suse2.iptech.internal> Am Wed, 7 Mar 2012 10:46:23 +0100 schrieb "Roberto De Ioris" : > I only suggest you to choose a more advanced server, like php-fpm or > uWSGI (even if it is very new in the php world), > as the old-style embedded php fastcgi-server has very few features > (read: none) > Additionally, one has to take into account that opcode-caching and the like that zend, apc etc. do only usually gives you a couple of percents of increased performance. When you get "slashdotted", that is basically useless. What you have to do is aggressive output-caching via varnish or nginx (we haven't done this, yet, but I assume it's possible since some time, too). That will give you much (x-times) more performance than an opcode-cache will ever be able to. Rainer From nginx-forum at nginx.us Wed Mar 7 10:10:17 2012 From: nginx-forum at nginx.us (gcaplan) Date: Wed, 7 Mar 2012 05:10:17 -0500 (EST) Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <4F5722FE.9040704@gmail.com> References: <4F5722FE.9040704@gmail.com> Message-ID: <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> Hi Volodymyr Thanks for your helpful response. From what you say, opcode caching is essential and Xcache is the way to go. But just to understand - does a php-fpm pool access a single Xcache, or is there a separate cache set up for each process? I'm trying to get a handle on the memory implications. Thanks for the heads up on uWSGI. But my sysadmin skills are basic (I'm a developer really) and it looks a bit scary. There's not much info out there, while fastcgi is supported in the php core. For someone who is not a proper sysadmin, is uWSGI, in its present state of development, really a sensible way to go? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223556,223565#msg-223565 From nginx-forum at nginx.us Wed Mar 7 10:16:47 2012 From: nginx-forum at nginx.us (gcaplan) Date: Wed, 7 Mar 2012 05:16:47 -0500 (EST) Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> References: <4F5722FE.9040704@gmail.com> <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> Message-ID: <759726f70c76c6ff1c42a6365d480e67.NginxMailingListEnglish@forum.nginx.org> Roberto > I am not a big fan of opcode caching I'm interested in your reasons for this. My experience with mod_php is that I get huge performance improvements with opcode caching (my app loads a lot of code and libraries). If you don't use opcode caching, is there a better way to get the same benefits? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223556,223568#msg-223568 From mdounin at mdounin.ru Wed Mar 7 10:24:34 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 14:24:34 +0400 Subject: How many args in $args? In-Reply-To: <4tl6psuitybk.1gq09-3rtlsw33@elasticemail.com> References: <4tl6psuitybk.1gq09-3rtlsw33@elasticemail.com> Message-ID: <20120307102434.GX67687@mdounin.ru> Hello! On Wed, Mar 07, 2012 at 10:09:38AM +0000, John Moore wrote: > Is there some means of determining how many query parameters are being > passed, by looking $args, say? There's a kind of DOS attack which can > bring down Java based webapps which do binding of request parameters to > properties, and it seems to me that nginx used as a remote proxy server > could probably prevent this simply by rejecting requests which had more > than x query parameters. Something like if ($args ~ "(?:[&;][^&;]*){50,}") { return 403; } should do the trick. Maxim Dounin From ne at vbart.ru Wed Mar 7 10:30:58 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 7 Mar 2012 14:30:58 +0400 Subject: How many args in $args? In-Reply-To: <4tl6psuitybk.1gq09-3rtlsw33@elasticemail.com> References: <4tl6psuitybk.1gq09-3rtlsw33@elasticemail.com> Message-ID: <201203071430.58940.ne@vbart.ru> On Wednesday 07 March 2012 14:09:38 John Moore wrote: > Is there some means of determining how many query parameters are being > passed, by looking $args, say? There's a kind of DOS attack which can > bring down Java based webapps which do binding of request parameters to > properties, and it seems to me that nginx used as a remote proxy server > could probably prevent this simply by rejecting requests which had more > than x query parameters. You can simple utilize regexp functionality for such task, i.e.: if ($args ~ "^(?:[^&]+&){16}") { return 403; } http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if wbr, Valentin V. Bartenev From roberto at unbit.it Wed Mar 7 10:25:52 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Wed, 7 Mar 2012 11:25:52 +0100 Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <759726f70c76c6ff1c42a6365d480e67.NginxMailingListEnglish@forum.nginx.org> References: <4F5722FE.9040704@gmail.com> <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> <759726f70c76c6ff1c42a6365d480e67.NginxMailingListEnglish@forum.nginx.org> Message-ID: > Roberto > >> I am not a big fan of opcode caching > > I'm interested in your reasons for this. My experience with mod_php is > that I get huge performance improvements with opcode caching (my app > loads a lot of code and libraries). If you don't use opcode caching, is > there a better way to get the same benefits? > Your answer, is my reason :) It is app-dependent, so i never blindly suggest to someone using it, without a proper undestanding of the system. Often i have seen badly configured apache server exposing the cached files to all the users of the system and so on. I see it as a second step in building an infrastructure. Having said that, i prefer having an additional layer (like nginx caching or varnish, as already suggested) in front of the apps. ...But you can obviously have opcode and caching both working on the same app :) -- Roberto De Ioris http://unbit.it From roberto at unbit.it Wed Mar 7 10:29:48 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Wed, 7 Mar 2012 11:29:48 +0100 Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> References: <4F5722FE.9040704@gmail.com> <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> Message-ID: <52ca3fa5fcb3349f7a870ecc382ee189.squirrel@manage.unbit.it> > > Thanks for the heads up on uWSGI. But my sysadmin skills are basic (I'm > a developer really) and it looks a bit scary. There's not much info out > there, while fastcgi is supported in the php core. For someone who is > not a proper sysadmin, is uWSGI, in its present state of development, > really a sensible way to go? > php-fpm (far better that the fastcgi embedded server) is in the core from a couple of php releases (even if not compiled-in by default and somewhere marked as experimental) but you will find tons of users of it. uWSGI got proper php support from a couple of weeks, but it has the advantage in having years of python/perl/lua hosting, so it has a very solid core. Is its php plugin stable ? I would be a fool in saying that after only two weeks, but i suggest you to maintain an eye on it :) -- Roberto De Ioris http://unbit.it From edho at myconan.net Wed Mar 7 11:39:01 2012 From: edho at myconan.net (Edho Arief) Date: Wed, 7 Mar 2012 18:39:01 +0700 Subject: Using error_page to a named location - possible? In-Reply-To: <20120306232854.GU67687@mdounin.ru> References: <4F563D55.6040500@wildgooses.com> <20120306174728.GP67687@mdounin.ru> <4F569098.8080007@wildgooses.com> <20120306232854.GU67687@mdounin.ru> Message-ID: 2012/3/7 Maxim Dounin : >> > >> > ? ? location @502 { >> > ? ? ? ? internal; >> > ? ? ? ? root /var/www; >> > ? ? ? ? rewrite ^ /502.html break; >> > ? ? } This seems to be working, too: location @502 { root /var/www; try_files /502.html =404; } From nginx-forum at nginx.us Wed Mar 7 12:20:11 2012 From: nginx-forum at nginx.us (mevans336) Date: Wed, 7 Mar 2012 07:20:11 -0500 (EST) Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <4F56B605.8010504@develix.com> References: <4F56B605.8010504@develix.com> Message-ID: Cliff Wells Wrote: ------------------------------------------------------- > On 03/06/2012 02:06 PM, Francis Daly wrote: > > My guess is that "first contact" information is > not shared between the > > two jboss servers, so if serial requests from a > single client don't > > always go to the same server, bad things happen. > You should be able to > > see whether or not that is the case. With only > one jboss server > > configured, all requests must go to it, and > things should work, as you > > reported. All the best, f > > Since the ip_hash worked, your assessment seems > spot on. However, one > thing that's still not making sense to me: in his > reply, Matt states > that he tested with the HTTPS redirect disabled in > JBoss and still had > the same issue. I'm a bit unsure of how that > could be (unless it was > still in effect, or the browser remembered the > redirect). > > Regards, > Cliff > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Cliff, Thank you and Francis for your quick and detailed responses. Even though the HTTPS redirect was disabled, the application itself still sends a redirect to /home. For example, if you type in http://my.domain.com you were successfully redirected to https://my.domain.com/home. That initial redirect was happening and that is where the error 310 would occur, at the https://my.domain.com/home level. I see that Francis is in agreement with you that the proxy_pass directive is being negated by the permanent rewrite. Just for my edification, would you (or anyone else who would like to take a stab at it) mind confirming that if I remove the proxy_pass directive, I will still be able to achieve load balancing between the two upstream servers? If you could explain how load balancing works without that directive so I have a clearer understanding, I'd be even happier! I have searched the wiki and my Nginx book, but I'm either missing it, or this specific scenario is not addressed. Cheers, Matt Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223535,223576#msg-223576 From nginx-forum at nginx.us Wed Mar 7 12:23:22 2012 From: nginx-forum at nginx.us (mevans336) Date: Wed, 7 Mar 2012 07:23:22 -0500 (EST) Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <20120306220607.GB18773@craic.sysops.org> References: <20120306220607.GB18773@craic.sysops.org> Message-ID: <1e3721cc0997e5078b8acba3e9d7887a.NginxMailingListEnglish@forum.nginx.org> Francis, Thank you for the wonderfully detailed response. I have printed your reply to PDF for safekeeping as you covered many things I didn't know curl was even capable of. You also provided me a much deeper understanding of the HTTP redirect process. I am extremely thankful for both. Cheers, Matt Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223535,223577#msg-223577 From c.kworr at gmail.com Wed Mar 7 11:36:46 2012 From: c.kworr at gmail.com (Volodymyr Kostyrko) Date: Wed, 07 Mar 2012 13:36:46 +0200 Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> References: <4F5722FE.9040704@gmail.com> <28b49baefaa3743b4256f02289a86414.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F57484E.20408@gmail.com> gcaplan wrote: > Hi Volodymyr > > Thanks for your helpful response. From what you say, opcode caching is > essential and Xcache is the way to go. > > But just to understand - does a php-fpm pool access a single Xcache, or > is there a separate cache set up for each process? I'm trying to get a > handle on the memory implications. All processes in one php-fpm pool share a single cache. This is so because main process is started (thus starting new cache) and workers are forked (sharing most of memory). > Thanks for the heads up on uWSGI. But my sysadmin skills are basic (I'm > a developer really) and it looks a bit scary. There's not much info out > there, while fastcgi is supported in the php core. For someone who is > not a proper sysadmin, is uWSGI, in its present state of development, > really a sensible way to go? I'll second Roberto: keep an eye on it as it should give you better performance then php-fpm. It's unmature though so if you want to try it you are on your own. -- Sphinx of black quartz judge my vow. From cliff at develix.com Wed Mar 7 12:52:16 2012 From: cliff at develix.com (Cliff Wells) Date: Wed, 07 Mar 2012 04:52:16 -0800 Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: References: <4F56B605.8010504@develix.com> Message-ID: <1331124736.2285.4.camel@portable-evil> On Wed, 2012-03-07 at 07:20 -0500, mevans336 wrote: > Even though the HTTPS redirect was disabled, the application itself > still sends a redirect to /home. For example, if you type in > http://my.domain.com you were successfully redirected to > https://my.domain.com/home. That initial redirect was happening and that > is where the error 310 would occur, at the https://my.domain.com/home > level. Okay, I must have missed the redirect to /home. > I see that Francis is in agreement with you that the proxy_pass > directive is being negated by the permanent rewrite. Just for my > edification, would you (or anyone else who would like to take a stab at > it) mind confirming that if I remove the proxy_pass directive, I will > still be able to achieve load balancing between the two upstream > servers? If you could explain how load balancing works without that > directive so I have a clearer understanding, I'd be even happier! I have > searched the wiki and my Nginx book, but I'm either missing it, or this > specific scenario is not addressed. Because you are also doing proxy_pass in the https section. So the flow goes like this: 1. request visits http section and is redirected to https section 2. https section sends request via proxy_pass to load-balanced JBoss backends So you should remove the proxy_pass from the first (HTTP) server block, but leave the proxy_pass that exists in the second (HTTPS) server block. Regards, Cliff From nginx-forum at nginx.us Wed Mar 7 14:13:16 2012 From: nginx-forum at nginx.us (gcaplan) Date: Wed, 7 Mar 2012 09:13:16 -0500 (EST) Subject: Can anyone *really* explain opcode caching with PHP? In-Reply-To: <4F57484E.20408@gmail.com> References: <4F57484E.20408@gmail.com> Message-ID: <83325560f1dfa3aef5c87c6e3af8f001.NginxMailingListEnglish@forum.nginx.org> Hi guys You've been brilliant - so for now I go with php-fpm and xcache, and I actually understand what's happening! As I say, the community might consider adding this info to the FAQs, as there's a lot of misleading blogs and post out there on this whole issue of fastcgi and opcode caching... Thanks for all your help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223556,223583#msg-223583 From cyril.lavier at davromaniak.eu Wed Mar 7 15:38:10 2012 From: cyril.lavier at davromaniak.eu (Cyril LAVIER) Date: Wed, 07 Mar 2012 16:38:10 +0100 Subject: Big amount of RAM used when building 1.1.16 Message-ID: <5d63475a7b9a3cc592854cbeef10da29@davromaniak.eu> Hi. With the last release (1.1.16), I remarked the build process is taking a lot of RAM, ranging from 1800MB to 3500-4000MB. Thanks my main build machine has 16GB of RAM, but my mips and mipsel build machines (QEMU VMs) only have 256MB of RAM. So the systems went on to crash with an oomkiller. So to be able to build it, I added up to 4GB of swap space. I remarked this issue in the following architectures : x86 (32 and 64 bits), powerpc, armel, armhf, mips and mipsel (all the architectures I currently use). It occurs for every flavor of the Debian package (light, full and extras) and the memory usage starts to grow when building objs/ngx_modules.c like here with nginx-full : gcc -c -Wall -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -o objs/ngx_modules.o objs/ngx_modules.c A table summing up the modules present in every nginx flavour is available here : http://wiki.debian.org/Nginx So for the moment, this issue is blocking a build in the debian buildds, and may block many others. I'm available to do more tests and provide more information if needed. Thanks. -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu From kartik at debian.org Wed Mar 7 15:41:46 2012 From: kartik at debian.org (Kartik Mistry) Date: Wed, 7 Mar 2012 21:11:46 +0530 Subject: Big amount of RAM used when building 1.1.16 In-Reply-To: <5d63475a7b9a3cc592854cbeef10da29@davromaniak.eu> References: <5d63475a7b9a3cc592854cbeef10da29@davromaniak.eu> Message-ID: On Wed, Mar 7, 2012 at 9:08 PM, Cyril LAVIER wrote: > .. > It occurs for every flavor of the Debian package (light, full and extras) > and the memory usage starts to grow when building objs/ngx_modules.c like > here with nginx-full : gcc -c -Wall -g -O2 -I src/core -I src/event -I > src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -o > objs/ngx_modules.o objs/ngx_modules.c > .. Note that Logs from Debian buildd are available at: https://buildd.debian.org/status/fetch.php?pkg=nginx&arch=mipsel&ver=1.1.16-1&stamp=1330873573 -- Kartik Mistry | IRC: kart_ {0x1f1f, kartikm}.wordpress.com From sb at waeme.net Wed Mar 7 16:26:53 2012 From: sb at waeme.net (Sergey Budnevitch) Date: Wed, 7 Mar 2012 20:26:53 +0400 Subject: Big amount of RAM used when building 1.1.16 In-Reply-To: <5d63475a7b9a3cc592854cbeef10da29@davromaniak.eu> References: <5d63475a7b9a3cc592854cbeef10da29@davromaniak.eu> Message-ID: <0B7801A4-3E63-4CB0-AE10-D390322F4D9D@waeme.net> On 07.03.2012, at 19:38, Cyril LAVIER wrote: > Hi. > > With the last release (1.1.16), I remarked the build process is taking a lot of RAM, ranging from 1800MB to 3500-4000MB. Hi, In current version of rules you have added -j$(NUMJOBS) flag to make, but NUMJOBS is not defined. make -j without args do not limit number of jobs. So it looks like a fork bomb. http://anonscm.debian.org/viewvc/collab-maint/deb-maint/nginx/trunk/debian/rules?r1=19814&r2=19817 > > Thanks my main build machine has 16GB of RAM, but my mips and mipsel build machines (QEMU VMs) only have 256MB of RAM. So the systems went on to crash with an oomkiller. So to be able to build it, I added up to 4GB of swap space. > > I remarked this issue in the following architectures : x86 (32 and 64 bits), powerpc, armel, armhf, mips and mipsel (all the architectures I currently use). > > It occurs for every flavor of the Debian package (light, full and extras) and the memory usage starts to grow when building objs/ngx_modules.c like here with nginx-full : gcc -c -Wall -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -o objs/ngx_modules.o objs/ngx_modules.c > > A table summing up the modules present in every nginx flavour is available here : http://wiki.debian.org/Nginx > > So for the moment, this issue is blocking a build in the debian buildds, and may block many others. > > I'm available to do more tests and provide more information if needed. > > Thanks. > > -- > Cyril "Davromaniak" Lavier > KeyID 59E9A881 > http://www.davromaniak.eu > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From adrian at navarro.at Wed Mar 7 17:03:54 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Wed, 7 Mar 2012 18:03:54 +0100 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: References: <20120306232421.GD18773@craic.sysops.org> Message-ID: max_ranges 0; worked well but only at server directive. I have finally decided to use different server{} entries (subdomains) for the different cases. Thank you On Wed, Mar 7, 2012 at 12:45 AM, Adri?n Navarro wrote: > Thank you everyone for your answers. > > max_ranges 0; works great if set in the main server {} directive. > Sadly, when put inside a location directive, it will not work. The > same applies for more_clear_headers. > > The other thing I'm seeing is that while headers with max_range for > the whole directive does return correct headers, chrome still allows > pausing. > > I better get some sleep and keep digging tomorrow. > > Thank you, I'll follow up soon. > > On Wed, Mar 7, 2012 at 12:24 AM, Francis Daly wrote: >> On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: >> >> Hi there, >> >>> I am using nginx's X-Accel headers, and I want to disable file >>> resuming. That implies: >>> - suppresing output header "Accept-Ranges: bytes" >>> - suppresing input header "Range" >> >>> Anyone have any pointers? I'm running out of ideas now. >> >> Completely untested, and not a direct answer to "file resuming", but you >> asked for pointers, so maybe... >> >> If you want a response header from a fastcgi process not to be >> delivered to the client, see fastcgi_hide_header, for example at >> http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header >> >> If you want a request header not to be sent to a fastcgi process, set >> the matching parameter yourself to empty: >> >> ?fastcgi_param HTTP_RANGE ""; >> >> Good luck with it, >> >> ? ? ? ?f >> -- >> Francis Daly ? ? ? ?francis at daoine.org >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > > > -- > Adri?n Navarro / (+34) 608 831 094 -- Adri?n Navarro / (+34) 608 831 094 From nginx-forum at nginx.us Wed Mar 7 17:07:13 2012 From: nginx-forum at nginx.us (shivnamha) Date: Wed, 7 Mar 2012 12:07:13 -0500 (EST) Subject: Regarding setting ENV variable Message-ID: <53955d0bcc4015d218366e041f4b6521.NginxMailingListEnglish@forum.nginx.org> Hi Friends I want to set a env variable on nginx with perl whenever i am accessing site with https only. can anyone help how i can do this. I looked at post env variable in nginx.conf file it didnt help me.Is there any way that i can set environment variable using mod_perl. thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223590,223590#msg-223590 From zzz at zzz.org.ua Wed Mar 7 17:13:27 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Wed, 7 Mar 2012 19:13:27 +0200 Subject: Regarding setting ENV variable In-Reply-To: <53955d0bcc4015d218366e041f4b6521.NginxMailingListEnglish@forum.nginx.org> References: <53955d0bcc4015d218366e041f4b6521.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 3/7/12, shivnamha wrote: > Hi Friends > I want to set a env variable on nginx with perl whenever > i am accessing site with https only. can anyone help how i can do this. > I looked at post env variable in nginx.conf file it didnt help me.Is > there any way that i can set environment variable using mod_perl. Are you sure that's what you need? You can pass $https with fastcgi_param or access it with perl's variable method: $r->variable('https') and set $ENV{..} accordingly. From mdounin at mdounin.ru Wed Mar 7 17:36:48 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 21:36:48 +0400 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: References: <20120306232421.GD18773@craic.sysops.org> Message-ID: <20120307173648.GC67687@mdounin.ru> Hello! On Wed, Mar 07, 2012 at 06:03:54PM +0100, Adri?n Navarro wrote: > max_ranges 0; worked well but only at server directive. > > I have finally decided to use different server{} entries (subdomains) > for the different cases. It should work at location level as well, though please make sure to specify it in location where response is in fact returned, i.e. where your X-Accel-Redirect's are processed. Maxim Dounin > > Thank you > > On Wed, Mar 7, 2012 at 12:45 AM, Adri?n Navarro wrote: > > Thank you everyone for your answers. > > > > max_ranges 0; works great if set in the main server {} directive. > > Sadly, when put inside a location directive, it will not work. The > > same applies for more_clear_headers. > > > > The other thing I'm seeing is that while headers with max_range for > > the whole directive does return correct headers, chrome still allows > > pausing. > > > > I better get some sleep and keep digging tomorrow. > > > > Thank you, I'll follow up soon. > > > > On Wed, Mar 7, 2012 at 12:24 AM, Francis Daly wrote: > >> On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: > >> > >> Hi there, > >> > >>> I am using nginx's X-Accel headers, and I want to disable file > >>> resuming. That implies: > >>> - suppresing output header "Accept-Ranges: bytes" > >>> - suppresing input header "Range" > >> > >>> Anyone have any pointers? I'm running out of ideas now. > >> > >> Completely untested, and not a direct answer to "file resuming", but you > >> asked for pointers, so maybe... > >> > >> If you want a response header from a fastcgi process not to be > >> delivered to the client, see fastcgi_hide_header, for example at > >> http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header > >> > >> If you want a request header not to be sent to a fastcgi process, set > >> the matching parameter yourself to empty: > >> > >> ?fastcgi_param HTTP_RANGE ""; > >> > >> Good luck with it, > >> > >> ? ? ? ?f > >> -- > >> Francis Daly ? ? ? ?francis at daoine.org > >> > >> _______________________________________________ > >> nginx mailing list > >> nginx at nginx.org > >> http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > -- > > Adri?n Navarro / (+34) 608 831 094 > > > > -- > Adri?n Navarro / (+34) 608 831 094 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed Mar 7 18:07:37 2012 From: nginx-forum at nginx.us (catball123) Date: Wed, 7 Mar 2012 13:07:37 -0500 (EST) Subject: nginx big bug Message-ID: <408255862a43aa9dc0bd212f40a5b4a6.NginxMailingListEnglish@forum.nginx.org> we made two files 1.php and 2.php 1.php { } 2.php { } now you can see run http://127.0.0.1/1.php iis and apache work fine but nginx is dead why?????????? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223594#msg-223594 From nginx-forum at nginx.us Wed Mar 7 18:09:27 2012 From: nginx-forum at nginx.us (catball123) Date: Wed, 7 Mar 2012 13:09:27 -0500 (EST) Subject: nginx big bug In-Reply-To: <408255862a43aa9dc0bd212f40a5b4a6.NginxMailingListEnglish@forum.nginx.org> References: <408255862a43aa9dc0bd212f40a5b4a6.NginxMailingListEnglish@forum.nginx.org> Message-ID: i use Win 2003 fastcgi php 5.3.8 mysql 5.5.21 nginx 1.1.16 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223596#msg-223596 From cyril.lavier at davromaniak.eu Wed Mar 7 18:14:17 2012 From: cyril.lavier at davromaniak.eu (Cyril Lavier) Date: Wed, 07 Mar 2012 19:14:17 +0100 Subject: Big amount of RAM used when building 1.1.16 In-Reply-To: <0B7801A4-3E63-4CB0-AE10-D390322F4D9D@waeme.net> References: <5d63475a7b9a3cc592854cbeef10da29@davromaniak.eu> <0B7801A4-3E63-4CB0-AE10-D390322F4D9D@waeme.net> Message-ID: <4F57A579.5040101@davromaniak.eu> On 03/07/2012 05:26 PM, Sergey Budnevitch wrote: > On 07.03.2012, at 19:38, Cyril LAVIER wrote: > >> Hi. >> >> With the last release (1.1.16), I remarked the build process is taking a lot of RAM, ranging from 1800MB to 3500-4000MB. > Hi, Hi. > In current version of rules you have added -j$(NUMJOBS) flag to make, but NUMJOBS is not defined. make -j without args > do not limit number of jobs. So it looks like a fork bomb. > > http://anonscm.debian.org/viewvc/collab-maint/deb-maint/nginx/trunk/debian/rules?r1=19814&r2=19817 Thanks for pointing me this error, I didn't see it when I moved the "-j" out of the NUMJOBS variable. So now, if NUMJOBS is not defined, I set it to 1. Kartik, I will perform the needed commit in the next hours, time for me to write a clean solution :). Thanks. >> Thanks my main build machine has 16GB of RAM, but my mips and mipsel build machines (QEMU VMs) only have 256MB of RAM. So the systems went on to crash with an oomkiller. So to be able to build it, I added up to 4GB of swap space. >> >> I remarked this issue in the following architectures : x86 (32 and 64 bits), powerpc, armel, armhf, mips and mipsel (all the architectures I currently use). >> >> It occurs for every flavor of the Debian package (light, full and extras) and the memory usage starts to grow when building objs/ngx_modules.c like here with nginx-full : gcc -c -Wall -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -o objs/ngx_modules.o objs/ngx_modules.c >> >> A table summing up the modules present in every nginx flavour is available here : http://wiki.debian.org/Nginx >> >> So for the moment, this issue is blocking a build in the debian buildds, and may block many others. >> >> I'm available to do more tests and provide more information if needed. >> >> Thanks. >> >> -- >> Cyril "Davromaniak" Lavier >> KeyID 59E9A881 >> http://www.davromaniak.eu >> >> _______________________________________________ >> 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 -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu From cliff at develix.com Wed Mar 7 18:50:22 2012 From: cliff at develix.com (Cliff Wells) Date: Wed, 07 Mar 2012 10:50:22 -0800 Subject: nginx big bug In-Reply-To: <408255862a43aa9dc0bd212f40a5b4a6.NginxMailingListEnglish@forum.nginx.org> References: <408255862a43aa9dc0bd212f40a5b4a6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1331146222.2285.7.camel@portable-evil> On Wed, 2012-03-07 at 13:07 -0500, catball123 wrote: > we made two files > > 1.php and 2.php > > 1.php > > { } > > 2.php > > { } > > now you can see > > run http://127.0.0.1/1.php Actually, we cannot see. That is a local IP address that is not routable across the internet. > iis and apache work fine > > but nginx is dead > > why?????????? Please provide the following: 1) your Nginx config 2) some output from your nginx logs Regards, Cliff From nginx-forum at nginx.us Wed Mar 7 18:59:41 2012 From: nginx-forum at nginx.us (catball123) Date: Wed, 7 Mar 2012 13:59:41 -0500 (EST) Subject: nginx big bug In-Reply-To: <1331146222.2285.7.camel@portable-evil> References: <1331146222.2285.7.camel@portable-evil> Message-ID: <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> run http://127.0.0.1/1.php Actually, we cannot see. That is a local IP address that is not routable across the internet. =============================================================== no i mean example 127.0.0.1 ?it is not a real ip address.... you can try in your computer with win2003 + nginx the bug only in the windows os + nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223600#msg-223600 From nginx-forum at nginx.us Wed Mar 7 19:03:49 2012 From: nginx-forum at nginx.us (catball123) Date: Wed, 7 Mar 2012 14:03:49 -0500 (EST) Subject: nginx big bug In-Reply-To: <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> References: <1331146222.2285.7.camel@portable-evil> <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> Message-ID: error.log ========================================================================== 2012/03/07 22:53:35 [error] 9924#9964: *109 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 192.168.1.25, server: localhost, request: "GET /2.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.25" 2012/03/07 22:53:35 [error] 9924#9964: *111 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 192.168.1.215, server: localhost, request: "GET /phpMyAdmin/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.25" 2012/03/07 22:54:54 [error] 9924#9964: *114 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 192.168.1.215, server: localhost, request: "GET /1.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.25" 2012/03/07 22:54:54 [error] 9924#9964: *124 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 192.168.1.25, server: localhost, request: "GET /2.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.25" 2012/03/07 22:59:34 [error] 9924#9964: *193 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 192.168.1.215, server: localhost, request: "GET /1.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.25" 2012/03/07 22:59:34 [error] 9924#9964: *203 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 192.168.1.25, server: localhost, request: "GET /2.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.25" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223601#msg-223601 From cyril.lavier at davromaniak.eu Wed Mar 7 19:04:54 2012 From: cyril.lavier at davromaniak.eu (Cyril Lavier) Date: Wed, 07 Mar 2012 20:04:54 +0100 Subject: nginx big bug In-Reply-To: <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> References: <1331146222.2285.7.camel@portable-evil> <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F57B156.5020908@davromaniak.eu> On 03/07/2012 07:59 PM, catball123 wrote: > run http://127.0.0.1/1.php > > Actually, we cannot see. That is a local IP address that is not > routable across the internet. > > =============================================================== > > > no i mean example 127.0.0.1 ?it is not a real ip address.... > > you can try in your computer with win2003 + nginx > > the bug only in the windows os + nginx > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223600#msg-223600 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hi. Hmm, and if we don't have a windows server 2003 to test, how can we help you if you are not providing your configuration file, the modules you enabled and your nginx logs ? Thanks. -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu From nginx-forum at nginx.us Wed Mar 7 19:06:39 2012 From: nginx-forum at nginx.us (catball123) Date: Wed, 7 Mar 2012 14:06:39 -0500 (EST) Subject: nginx big bug In-Reply-To: References: <1331146222.2285.7.camel@portable-evil> <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3957c487818b1655ef2be019ae19867b.NginxMailingListEnglish@forum.nginx.org> access.log ====================================================================================== 192.168.1.215 - - [07/Mar/2012:22:53:26 +0800] "GET /1.php HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2" 192.168.1.25 - - [07/Mar/2012:22:53:35 +0800] "GET /2.php HTTP/1.0" 502 0 "-" "-" 192.168.1.215 - - [07/Mar/2012:22:54:54 +0800] "GET /1.php HTTP/1.1" 504 383 "-" "Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2" 192.168.1.25 - - [07/Mar/2012:22:54:54 +0800] "GET /2.php HTTP/1.0" 504 383 "-" "-" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223603#msg-223603 From mdounin at mdounin.ru Wed Mar 7 19:09:24 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 7 Mar 2012 23:09:24 +0400 Subject: nginx big bug In-Reply-To: <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> References: <1331146222.2285.7.camel@portable-evil> <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120307190924.GD67687@mdounin.ru> Hello! On Wed, Mar 07, 2012 at 01:59:41PM -0500, catball123 wrote: > run http://127.0.0.1/1.php > > Actually, we cannot see. That is a local IP address that is not > routable across the internet. > > =============================================================== > > > no i mean example 127.0.0.1 ?it is not a real ip address.... > > you can try in your computer with win2003 + nginx > > the bug only in the windows os + nginx Most likely you've only started only one php fastcgi process (used php-cgi and forgot to define PHP_FCGI_CHILDREN?). You have to start at least two for your example to work. Maxim Dounin From nginx-forum at nginx.us Wed Mar 7 19:11:21 2012 From: nginx-forum at nginx.us (catball123) Date: Wed, 7 Mar 2012 14:11:21 -0500 (EST) Subject: nginx big bug In-Reply-To: <3957c487818b1655ef2be019ae19867b.NginxMailingListEnglish@forum.nginx.org> References: <1331146222.2285.7.camel@portable-evil> <8915c5aaedd11120fba0211e44940b05.NginxMailingListEnglish@forum.nginx.org> <3957c487818b1655ef2be019ae19867b.NginxMailingListEnglish@forum.nginx.org> Message-ID: anyway, nginx is a good soft thx nginx thx Cliff , Cyril "Davromaniak" Lavier it is time to bed ,bye :) ======================================================================== nginx.conf ======================================================================== #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root v:/nginx/html; 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 html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root v:/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME v:/nginx/html$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223594,223605#msg-223605 From ru at nginx.com Wed Mar 7 19:52:25 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Wed, 7 Mar 2012 23:52:25 +0400 Subject: [doc] A short announce Message-ID: <20120307195225.GA82145@lo0.su> We've made an alphabetical index of nginx directives available at http://nginx.org/en/docs/dirindex.html And if you'd like to go straight to the description of a particular directive, here's a short way: http://nginx.org/r/proxy_http_version (Substitute any other directive instead of "proxy_http_version".) From nginx-forum at nginx.us Wed Mar 7 22:14:19 2012 From: nginx-forum at nginx.us (adamchal) Date: Wed, 7 Mar 2012 17:14:19 -0500 (EST) Subject: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter In-Reply-To: <20120306211746.GS67687@mdounin.ru> References: <20120306211746.GS67687@mdounin.ru> Message-ID: OK, I just knocked-out 50 push-ups as a punishment for this. There's absolutely nothing wrong with the logging module. Apparently, the Mac OS X Term was messing this up while I was copying and pasting into Textmate. I ran the logs through `cut` as well as a custom line parser and it's working perfectly fine. I apologize for the confusion, but trust me that I actually blew a day and a half wrestling with this before I figured-out that it was an issue with the copying and pasting from Term. On another note, it would be cool if we could set a default character for NULL/empty variables. For example, instead of the '-' character, I would prefer just an empty char to be written since I'm doing a TSV format. This way, I wouldn't have to preprocess the logs and strip-out the '-' when importing to a DB store, etc. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223532,223609#msg-223609 From rich at gun.io Wed Mar 7 22:35:17 2012 From: rich at gun.io (Rich Jones) Date: Wed, 7 Mar 2012 14:35:17 -0800 Subject: Quick Bounty for Nginx/Python Configuration File Message-ID: Hey all! This just popped up on our system, seems like an easy fifty bucks for someone from 'round these parts! http://gun.io/contracts/51/boilerplate-nginx-configuration-file-with-python Hope this is useful to somebody.. Thanks! -- Rich Jones Director, Gun.io -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian at navarro.at Thu Mar 8 00:03:42 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Thu, 8 Mar 2012 01:03:42 +0100 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: <20120307173648.GC67687@mdounin.ru> References: <20120306232421.GD18773@craic.sysops.org> <20120307173648.GC67687@mdounin.ru> Message-ID: Where should that be? I have a location for php scripts (all to fastcgi) figuring as internal. Another one (location /get) which rewrites to the PHP file (therefore only accessible via rewrite, as PHP is internal otherwise). A location /get.php won't work either. I tried using matches inside the fcgi directives to add a parameter but didn't work either, in any case? On Wed, Mar 7, 2012 at 6:36 PM, Maxim Dounin wrote: > Hello! > > On Wed, Mar 07, 2012 at 06:03:54PM +0100, Adri?n Navarro wrote: > >> max_ranges 0; worked well but only at server directive. >> >> I have finally decided to use different server{} entries (subdomains) >> for the different cases. > > It should work at location level as well, though please make sure > to specify it in location where response is in fact returned, i.e. > where your X-Accel-Redirect's are processed. > > Maxim Dounin > >> >> Thank you >> >> On Wed, Mar 7, 2012 at 12:45 AM, Adri?n Navarro wrote: >> > Thank you everyone for your answers. >> > >> > max_ranges 0; works great if set in the main server {} directive. >> > Sadly, when put inside a location directive, it will not work. The >> > same applies for more_clear_headers. >> > >> > The other thing I'm seeing is that while headers with max_range for >> > the whole directive does return correct headers, chrome still allows >> > pausing. >> > >> > I better get some sleep and keep digging tomorrow. >> > >> > Thank you, I'll follow up soon. >> > >> > On Wed, Mar 7, 2012 at 12:24 AM, Francis Daly wrote: >> >> On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: >> >> >> >> Hi there, >> >> >> >>> I am using nginx's X-Accel headers, and I want to disable file >> >>> resuming. That implies: >> >>> - suppresing output header "Accept-Ranges: bytes" >> >>> - suppresing input header "Range" >> >> >> >>> Anyone have any pointers? I'm running out of ideas now. >> >> >> >> Completely untested, and not a direct answer to "file resuming", but you >> >> asked for pointers, so maybe... >> >> >> >> If you want a response header from a fastcgi process not to be >> >> delivered to the client, see fastcgi_hide_header, for example at >> >> http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header >> >> >> >> If you want a request header not to be sent to a fastcgi process, set >> >> the matching parameter yourself to empty: >> >> >> >> ?fastcgi_param HTTP_RANGE ""; >> >> >> >> Good luck with it, >> >> >> >> ? ? ? ?f >> >> -- >> >> Francis Daly ? ? ? ?francis at daoine.org >> >> >> >> _______________________________________________ >> >> nginx mailing list >> >> nginx at nginx.org >> >> http://mailman.nginx.org/mailman/listinfo/nginx >> > >> > >> > >> > -- >> > Adri?n Navarro / (+34) 608 831 094 >> >> >> >> -- >> Adri?n Navarro / (+34) 608 831 094 >> >> _______________________________________________ >> 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 -- Adri?n Navarro / (+34) 608 831 094 From matthieu.tourne at gmail.com Thu Mar 8 01:35:56 2012 From: matthieu.tourne at gmail.com (Matthieu Tourne) Date: Wed, 7 Mar 2012 17:35:56 -0800 Subject: [PATCH] ipv6 support for proxy_pass Message-ID: Hi, Attached is a simple patch to proxy_pass to an IPv6 upstream. It currently works only with a variable. proxy_pass ::1; wont' work for instance. but this will : set $addr "[::1]:8080"; proxy_pass http://$addr; You also need to add --with-ipv6 to your configure line. Happy hacking, Matthieu. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ipv6.patch Type: application/octet-stream Size: 1866 bytes Desc: not available URL: From nginx-forum at nginx.us Thu Mar 8 05:51:08 2012 From: nginx-forum at nginx.us (n1xman) Date: Thu, 8 Mar 2012 00:51:08 -0500 (EST) Subject: How to use srcache_store while proxy_pass use to connect backend In-Reply-To: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> References: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi agentzh, Thanks for helping me out. I build a fresh setup and enabled the debug and followings are the details. nginx.debug -V nginx: nginx version: nginx/1.0.9 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48) nginx: TLS SNI support disabled nginx: 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_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-debug --with-cc-opt='-O2 -g -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --add-module=/usr/local/n1xman/rpmbuild/BUILD/nginx-1.0.9/contrib/memc-nginx-module-4007350 --add-module=/usr/local/n1xman/rpmbuild/BUILD/nginx-1.0.9/contrib/echo-nginx-module-6c1f553 --add-module=/usr/local/n1xman/rpmbuild/BUILD/nginx-1.0.9/contrib/simpl-ngx_devel_kit-24202b4 --add-module=/usr/local/n1xman/rpmbuild/BUILD/nginx-1.0.9/contrib/set-misc-nginx-module-e6a54ab --add-module=/usr/local/n1xman/rpmbuild/BUILD/nginx-1.0.9/contrib/srcache-nginx-module-86e7a18 uname -a Linux abmx-test 2.6.18-194.el5PAE #1 SMP Tue Mar 16 22:00:21 EDT 2010 i686 i686 i386 GNU/Linux cat /etc/nginx/nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; } cat /etc/nginx/conf.d/default.conf upstream my_mem { server 127.0.0.1:11211; } server { listen 80; server_name localhost; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log debug; default_type application/json; location = /memc { internal; memc_connect_timeout 100ms; memc_send_timeout 100ms; memc_read_timeout 100ms; set $memc_key $query_string; set $memc_exptime 300; memc_pass my_mem; } location /mix2 { proxy_pass http://data.directfn.com; set $key $args; srcache_fetch GET /memc $key; srcache_store PUT /memc $key; srcache_store_statuses 200 301 302 404; } location / { root /usr/share/nginx/html; index index.html index.htm; } # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } /var/log/nginx/error.log http://pastebin.com/W7Jk3sq8 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223438,223618#msg-223618 From agentzh at gmail.com Thu Mar 8 06:01:52 2012 From: agentzh at gmail.com (agentzh) Date: Thu, 8 Mar 2012 14:01:52 +0800 Subject: How to use srcache_store while proxy_pass use to connect backend In-Reply-To: References: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Mar 8, 2012 at 1:51 PM, n1xman wrote: > /var/log/nginx/error.log > http://pastebin.com/W7Jk3sq8 > The line 182 in your error.log snippet gives you the answer: 2012/03/08 10:49:10 [debug] 20521#0: *11 srcache_store skipped due to response header Cache-Control That is, the response from your backend server explicitly prohibits caching via the Cache-Control response header. And the line 191 in your error.log snippet confirms this: Cache-Control: no-cache If you want to enforce caching in this very case, just turn on the srcache_store_no_cache config directive, like srcache_store_no_cache on; See http://wiki.nginx.org/HttpSRCacheModule#srcache_store_no_cache for more details. Or turn off the srcache_response_cache_control config directive to make ngx_srcache ignore the Cache-Control response header altogether: srcache_response_cache_control off; See http://wiki.nginx.org/HttpSRCacheModule#srcache_response_cache_control for more details. Best regards, -agentzh From nginx-forum at nginx.us Thu Mar 8 06:07:35 2012 From: nginx-forum at nginx.us (shivnamha) Date: Thu, 8 Mar 2012 01:07:35 -0500 (EST) Subject: Regarding setting ENV variable In-Reply-To: <53955d0bcc4015d218366e041f4b6521.NginxMailingListEnglish@forum.nginx.org> References: <53955d0bcc4015d218366e041f4b6521.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2fa79eca113557dec02299ac30a88746.NginxMailingListEnglish@forum.nginx.org> Hi Alexandr Thanks Alexander.But I didnt get u completly. I tried by adding a 'fastcgi_param HTTPS on;' but this variable is getting set for http request as well for https request. But i need to set for https request. Can u please elaborate ur statement so that i can easily understand it. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223590,223620#msg-223620 From nginx-forum at nginx.us Thu Mar 8 06:31:23 2012 From: nginx-forum at nginx.us (n1xman) Date: Thu, 8 Mar 2012 01:31:23 -0500 (EST) Subject: How to use srcache_store while proxy_pass use to connect backend In-Reply-To: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> References: <38b15037a2af01c5217e5d7f37a28a9a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <792b6fb29af8fd7c57373b06cbd0ccc0.NginxMailingListEnglish@forum.nginx.org> Thanks agentzh, you rock! It is working now :) Thanks for the quick support, it is really appreciated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223438,223621#msg-223621 From ashishs.dev at gmail.com Thu Mar 8 09:19:21 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Thu, 8 Mar 2012 01:19:21 -0800 Subject: Pointers on writing an Nginx module/application which needs to talk to multiple backends (sometimes sequentially, sometimes parallel) to serve a single request Message-ID: Hi, I am trying to do something similar to what is described in this older thread: http://nginx.2469901.n2.nabble.com/How-can-a-content-handler-block-on-certain-events-before-sending-a-response-td5764856.html Below is what i am trying to achieve (my use-case): When my nginx process gets a request, i want to do the following things in order: 1. Connect to a postgres database, retrieve some information based on a subset of the original request args 2. Connect to a memcache server with subset of info from request. If possible, do 1) and 2) in parallel. 3. Construct an "upstream request" to one of my (http based) backend service with info from original request + memcache + postgres ( I wrote this upstream service by modifying the "upstream proxy" standard module) 4. Do some additional processing (filtering, ranking etc) on the response from my backend 5. Send final response to the caller. 6. Update cache if needed. Is there some sample code for modules that might have similarities to the above, that i can follow and learn? For #1 above, I am playing around with postgres module code http://labs.frickle.com/nginx_ngx_postgres/ to communicate with postgres DB. Currently, for the sake of learning/experiments, i defined a separate upstream block for postgres in my config, and also defined a separate location block for db query, with the above postgres module hooked up to it, and in my own module i just do a subrequest to this postgres block. I followed the eval module code to do the subrequest (based on suggestions in this older thread http://forum.nginx.org/read.php?29,114237), but figured that eval does an in-memory subrequest, while Piotr's postgres module above doesn't support in-memory subrequest. Has anyone modified postgres module code to work with in-memory sub-requests? I also experimented with a simple case of firing in-memory subrequests from my module, to fetch a static file (instead of calling postgres location above), before i do my upstream backend call. Similar to the code in eval module (https://github.com/vkholodkov/nginx-eval-module/blob/master/ngx_http_eval_module.c), in my ctx object, i have a "done", and "in_progress" flags. During the initial call to my handler, ctx->done is not set, and i create and fire a in-memory subrequest to a url that points to the static file, and return NGX_DONE. And in my sub-request handler, i set the ctx->done, and return NGX_OK. In my main request handler, if ctx->done is set, i have code which will do a call to my upstream backend (step #3 in my list) . However, the call never returns from sub-request handler to my main handler. What might i be doing wrong? I am currently not looking into nginx_lua and other extensions, until i have a certain level of comfort with stock nginx module development. I've also tried suggestions and code from Piotr and Shaun, from the following thread: http://www.ruby-forum.com/topic/199392 (Parallel subrequests for multi-source long polling) for creating independent sub-requests for step #1, Basically, i create an independent subrequest during the content phase of my module's handler, and was hoping that i could (when i get response), setup the hooks for upstream functionality (create request etc) for my own module. (maybe i was wrong here) I had to call the ngx_indep_subreq_postconf in the sample code, during the post-configuration phase of MY module, to get around some initial segfaults. But now i am stuck at another sigsegv, with backtrace below: Program received signal SIGSEGV, Segmentation fault. 0x080607a6 in ngx_event_connect_peer (pc=0x9fbf1c4) at src/event/ngx_event_connect.c:30 30 s = ngx_socket(pc->sockaddr->sa_family, SOCK_STREAM, 0); (gdb) where #0 0x080607a6 in ngx_event_connect_peer (pc=0x9fbf1c4) at src/event/ngx_event_connect.c:30 #1 0x08080333 in ngx_http_upstream_connect (r=0x9fd0eac, u=0x9fbf1bc) at src/http/ngx_http_upstream.c:1104 #2 0x08080da4 in ngx_http_upstream_init_request (r=0x9fd0eac) at src/http/ngx_http_upstream.c:632 #3 0x0808116b in ngx_http_upstream_init (r=0x9fd0eac) at src/http/ngx_http_upstream.c:433 #4 0x080aa4c5 in ngx_indep_subreq_init_upstream (r=0x9fd0eac, url=0xbf965e60, callback=0x80a34cb , callback_data=0x9fd0360, upstream_extensions=0xbf965d88) #5 0x080aa57f in ngx_indep_subreq_fetch (r=0x9fc9698, pool=0x9fcfe30, url=0xbf965e60, callback=0x80a34cb , callback_data=0x9fd0360, upstream_extensions=0xbf965d88) #6 0x080a51d3 in ngx_http_my_broker_handler (r=0x9fc9698) #7 0x0806e4c4 in ngx_http_core_content_phase (r=0x9fc9698, ph=0x9fd846c) at src/http/ngx_http_core_module.c:1367 #8 0x0806a075 in ngx_http_core_run_phases (r=0x9fc9698) at src/http/ngx_http_core_module.c:862 ...... I am trying to see if either sub-requests, or independent subrequests (with some modifications to the postgres module code) will suffice for my use-case, or will i need to work directly with nginx events/nginx_event_connect_peer etc. Any help is appreciated. Thanks! Ashish From mdounin at mdounin.ru Thu Mar 8 10:14:52 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 8 Mar 2012 14:14:52 +0400 Subject: [PATCH] ipv6 support for proxy_pass In-Reply-To: References: Message-ID: <20120308101452.GE67687@mdounin.ru> Hello! On Wed, Mar 07, 2012 at 05:35:56PM -0800, Matthieu Tourne wrote: > Hi, > > Attached is a simple patch to proxy_pass to an IPv6 upstream. > It currently works only with a variable. proxy_pass ::1; wont' work for > instance. > > but this will : > > set $addr "[::1]:8080"; > proxy_pass http://$addr; > > You also need to add --with-ipv6 to your configure line. This should be addressed in ngx_parse_url(). The ipv6 cleanup is planned somewhere after 1.1.x become stable. Maxim Dounin From ne at vbart.ru Thu Mar 8 11:46:46 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 8 Mar 2012 15:46:46 +0400 Subject: Regarding setting ENV variable In-Reply-To: <2fa79eca113557dec02299ac30a88746.NginxMailingListEnglish@forum.nginx.org> References: <53955d0bcc4015d218366e041f4b6521.NginxMailingListEnglish@forum.nginx.org> <2fa79eca113557dec02299ac30a88746.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203081546.46912.ne@vbart.ru> On Thursday 08 March 2012 10:07:35 shivnamha wrote: > Hi Alexandr > Thanks Alexander.But I didnt get u completly. I tried > by adding a 'fastcgi_param HTTPS on;' but this variable is getting > set for http request as well for https request. But i need to set for > https request. Can u please elaborate ur statement so that i can easily > understand it. > http://nginx.org/en/docs/http/ngx_http_core_module.html#variables fastcgi_param HTTPS $https if_not_empty; # for NGINX >= 1.1.11 For NGINX < 1.1.11: map $scheme $https_on { default ''; https on; } fastcgi_param HTTPS $https_on; http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param http://wiki.nginx.org/HttpMapModule wbr, Valentin V. Bartenev From nginx-forum at nginx.us Thu Mar 8 11:52:34 2012 From: nginx-forum at nginx.us (redgoals) Date: Thu, 8 Mar 2012 06:52:34 -0500 (EST) Subject: Nginx slow connect Message-ID: <034dfa2a0ddc4142bc65df71e98628f8.NginxMailingListEnglish@forum.nginx.org> Im trying to diagnose a connection issue with nginx on debian. there is an delay of anything from 2-10 seconds on the connection, im using curl to test: curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" -s http://example.com/forumhome.css Connect: 0.657 TTFB: 1.183 Total time: 7.150 Here is a pastebin of the tcpdump output for the curl request above: http://pastebin.com/2tdZHqFr Server load averages 0.5 and never goes above 0.10 I have also tested using webpagetest.org from different locations and the same connection issue exists. the files are served from an ssd mounted on another machine. Linux main 2.6.32-5-amd64 #1 SMP Wed May 18 23:13:22 UTC 2011 x86_64 GNU/Linux nginx conf: user www-data; worker_processes 4; worker_rlimit_nofile 802768; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { use epoll; worker_connections 60000; multi_accept on; } http { include /etc/nginx/mime.types; # access_log /var/log/nginx/access.log; access_log off; sendfile off; keepalive_timeout 75; tcp_nodelay on; keepalive_requests 2000; connection_pool_size 8192; client_body_buffer_size 1024K; client_header_buffer_size 8k; client_max_body_size 10M; fastcgi_buffers 4 256k; fastcgi_buffer_size 128k; fastcgi_busy_buffers_size 256k; large_client_header_buffers 8 8k; ignore_invalid_headers on; client_header_timeout 60; client_body_timeout 60; send_timeout 60; output_buffers 8 32k; postpone_output 0; server_name_in_redirect off; server_tokens off; tcp_nopush on; gzip on; gzip_min_length 1100; gzip_buffers 32 8k; gzip_comp_level 2; gzip_types text/plain text/html application/x-javascript text/xml text/css text/javascript; gzip_vary on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } sysctl here -> http://pastebin.com/iYEfv9xc site.conf: open_file_cache max=5000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; server { listen 80 ; ## listen for ipv4 server_name example.com; root /mnt/ssd/www/static; location ~* \.(css|js)$ { expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } } ifconfig eth0: eth0 Link encap:Ethernet HWaddr 00:15:17:26:b4:bd inet addr:x.x.x.x Bcast:x.x.x.x Mask:255.255.254.0 inet6 addr: fe80::215:17ff:fe26:b4bd/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1 RX packets:1136534270 errors:0 dropped:0 overruns:0 frame:0 TX packets:623191419 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:174357516836 (162.3 GiB) TX bytes:323522620298 (301.3 GiB) Memory:e1a00000-e1a20000 cat /proc/cpuinfo: model name : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz cat /proc/meminfo: MemTotal: 4058884 kB MemFree: 3366684 kB Buffers: 117632 kB Cached: 288320 kB Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223627,223627#msg-223627 From lists at wildgooses.com Thu Mar 8 13:14:27 2012 From: lists at wildgooses.com (Ed W) Date: Thu, 08 Mar 2012 13:14:27 +0000 Subject: Pointers on writing an Nginx module/application which needs to talk to multiple backends (sometimes sequentially, sometimes parallel) to serve a single request In-Reply-To: References: Message-ID: <4F58B0B3.3050003@wildgooses.com> On 08/03/2012 09:19, Ashish S wrote: > Hi, > > I am trying to do something similar to what is described in this older > thread: http://nginx.2469901.n2.nabble.com/How-can-a-content-handler-block-on-certain-events-before-sending-a-response-td5764856.html > > Below is what i am trying to achieve (my use-case): > Does it need to be an nginx module, or could you use CGI of some sort? eg you could knock this up in your favourite scripting language very easily? Good luck Ed W From piotr.sikora at frickle.com Thu Mar 8 13:30:42 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Thu, 8 Mar 2012 14:30:42 +0100 Subject: Pointers on writing an Nginx module/application which needs to talk to multiple backends (sometimes sequentially, sometimes parallel) to serve a single request In-Reply-To: References: Message-ID: <72F1AF36E5BB412689091C328E425C14@Desktop> Hi, > but figured that eval does > an in-memory subrequest, while Piotr's postgres module above doesn't > support in-memory subrequest. Has anyone modified postgres module > code to work with in-memory sub-requests? agentzh forked eval module and made it work with regular subrequests (so also with ngx_postgres): https://github.com/agentzh/nginx-eval-module Alternatively, you could use ngx.location.capture() feature from ngx_lua module to make the subrequests to PostgreSQL location. I also believe that the first test case from https://github.com/FRiCKLE/ngx_postgres/blob/master/t/eval.t might be of interest to you. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From nginx-forum at nginx.us Thu Mar 8 14:15:41 2012 From: nginx-forum at nginx.us (mevans336) Date: Thu, 8 Mar 2012 09:15:41 -0500 (EST) Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <1331124736.2285.4.camel@portable-evil> References: <1331124736.2285.4.camel@portable-evil> Message-ID: That makes perfect sense, thank you Cliff. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223535,223632#msg-223632 From nginx-forum at nginx.us Thu Mar 8 14:30:13 2012 From: nginx-forum at nginx.us (alexscott) Date: Thu, 8 Mar 2012 09:30:13 -0500 (EST) Subject: upstream keepalive - call for testing In-Reply-To: <20110801160725.GH1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> Message-ID: <73a29a8343d5b3761367f01ac9eaf5f4.NginxMailingListEnglish@forum.nginx.org> Hi Maxim, when is it possible to use this module for a proxy server like keeping the connection persistent for proxy_pass "http://google.com"; ? Br., Alex. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,223633#msg-223633 From iqbal at aroussi.name Thu Mar 8 14:37:37 2012 From: iqbal at aroussi.name (Iqbal Aroussi) Date: Thu, 8 Mar 2012 14:37:37 +0000 Subject: nginx status active connections Message-ID: Hi, We do have a few high load web servers behind two load balancers running * nginx/1.0.0* I upgraded two of them to *nginx/1.0.12* all servers are running well despite the version of nginx However I've noticed that there is a big difference in active connections between the old version and the new version. What do you think about it, is it bad or good. *nginx/1.0.12* *Linux 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:50:31 EDT 2010 x86_64 GNU/Linux* *CentOS release 5.7 (Final)* *Active connections: 117 * *server accepts handled requests* * 12710947 12710947 12710947 * *Reading: 0 Writing: 117 Waiting: 0 * * * *nginx/1.0.12* *Linux 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64 GNU/Linux* *CentOS release 5.7 (Final)* *Active connections: 74 * *server accepts handled requests* * 31879742 31879742 31879741 * *Reading: 0 Writing: 74 Waiting: 0 * *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 1 server accepts handled requests 1745405552 1745405552 1745405549 Reading: 0 Writing: 1 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 1 server accepts handled requests 1777800935 1777800935 1777800935 Reading: 0 Writing: 1 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 6 server accepts handled requests 638878235 638878235 638878235 Reading: 0 Writing: 6 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 5 server accepts handled requests 1785279854 1785279854 1785279852 Reading: 0 Writing: 5 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 4 server accepts handled requests 1795180194 1795180194 1795180190 Reading: 0 Writing: 4 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 4 server accepts handled requests 1792770090 1792770090 1792770085 Reading: 0 Writing: 4 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64 GNU/Linux CentOS release 5.7 (Final) Active connections: 6 server accepts handled requests 1374777486 1374777486 1374777465 Reading: 0 Writing: 6 Waiting: 0 Best Regards * -- * *Iqbal Aroussi* *+212 665 025 032* *iqbal at aroussi.name* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 8 17:19:21 2012 From: nginx-forum at nginx.us (shivnamha) Date: Thu, 8 Mar 2012 12:19:21 -0500 (EST) Subject: Regarding setting ENV variable In-Reply-To: <201203081546.46912.ne@vbart.ru> References: <201203081546.46912.ne@vbart.ru> Message-ID: thanks allot Valentin and Alexandr . It really helpful for me... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223590,223637#msg-223637 From nginx-forum at nginx.us Thu Mar 8 17:55:15 2012 From: nginx-forum at nginx.us (Kaimei) Date: Thu, 8 Mar 2012 12:55:15 -0500 (EST) Subject: Possible bug in value of $server_name variable Message-ID: <1f37ac78bc80a78273252a2573d6fc54.NginxMailingListEnglish@forum.nginx.org> I have "server_name *.domain.tld" in my config file and tried to get the correct virtual host the user connected to with the help of a php script but "$_SERVER['SERVER_NAME']" returned "*.domain.tld" instead of "something.domain.tld" when I connect to it. When I use ".domain.tld" instead of "*.domain.tld" I get "domain.tld" as the hostname. Is this is bug or how to get the real hostname the user connect to ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223642,223642#msg-223642 From francis at daoine.org Thu Mar 8 18:40:56 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 8 Mar 2012 18:40:56 +0000 Subject: Possible bug in value of $server_name variable In-Reply-To: <1f37ac78bc80a78273252a2573d6fc54.NginxMailingListEnglish@forum.nginx.org> References: <1f37ac78bc80a78273252a2573d6fc54.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120308184056.GE18773@craic.sysops.org> On Thu, Mar 08, 2012 at 12:55:15PM -0500, Kaimei wrote: Hi there, > Is this is bug or how to get the real hostname the user connect to ? The nginx variable $server_name is the first name in the server_name directive list. The nginx variable $http_host is the Host: header sent by the client. The nginx variable $host is $http_host if it is defined, and $server_name if not. The typical nginx fastcgi configuration will set SERVER_NAME to $server_name (within fastcgi.conf) and HTTP_HOST to http_host (because that's what happens to client headers). So you can check those in your script. If you wish, you can add your own "fastcgi_param HOST $host" setting and check that, or you could set SERVER_NAME to be $host and continue checking that one. f -- Francis Daly francis at daoine.org From francis at daoine.org Thu Mar 8 18:50:51 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 8 Mar 2012 18:50:51 +0000 Subject: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS) In-Reply-To: <1e3721cc0997e5078b8acba3e9d7887a.NginxMailingListEnglish@forum.nginx.org> References: <20120306220607.GB18773@craic.sysops.org> <1e3721cc0997e5078b8acba3e9d7887a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120308185051.GF18773@craic.sysops.org> On Wed, Mar 07, 2012 at 07:23:22AM -0500, mevans336 wrote: Hi Matt, > I am extremely thankful for both. You're welcome. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Thu Mar 8 20:53:04 2012 From: nginx-forum at nginx.us (Jiff) Date: Thu, 8 Mar 2012 15:53:04 -0500 (EST) Subject: Translation from apache2 to nginx Message-ID: <6b6085320e1ae72242c6e08ef4ca9c91.NginxMailingListEnglish@forum.nginx.org> Hi forumers, I don't know how to translate the following .htaccess to nginx rules (from bluebox): # Turn on URL rewriting RewriteEngine On # Installation directory ###RewriteBase /kohana/ # If the request is for a modules assets directory allow it RewriteRule ^modules/.*/assets/.*$ - [L] # Protect application and system files from being viewed ###RewriteRule ^(bluebox|modules|system|upload)/ - [F,L] # Catch requests for XML or JSON and send them through an alternate entry point RewriteRule ^(.+)\.json$ json.php/$1 [T=application/json,L] RewriteRule ^(.+)\.xml$ xml.php/$1 [T=text/xml,L] # Allow any files or directories that exist to be displayed directly RewriteCond %{REQUEST_FILENAME} installer\.html [OR] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT,L] # Limits the file size that a user can upload php_value upload_max_filesize 25M # Max execution time. Is here for the media module # After X seconds, the file upload will stop php_value max_execution_time 300 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223648,223648#msg-223648 From nginx-forum at nginx.us Thu Mar 8 21:30:24 2012 From: nginx-forum at nginx.us (ezak) Date: Thu, 8 Mar 2012 16:30:24 -0500 (EST) Subject: server with 400 sites, all visitor have same IP (my server IP) Message-ID: hi support, I have pig problem here I tried to install nginx admin manytimes but NO Luck all my websites (400 website), all visitors in that websites have my dedicated IP address that make all members have login problem in there forum coz the same IP dedection some information for that same IP when run # netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 15 41.238.235.138 16 41.254.2.253 18 197.122.191.18 18 41.191.61.76 20 41.35.96.40 21 41.237.206.115 34 217.55.196.72 40 188.48.101.225 140 188.48.49.204 1556 xx.xx.xx.xx (my main server dedicated ip address) nginx.conf user nobody; # no need for more workers in the proxy mode worker_processes 2; error_log /var/log/nginx/error.log info; worker_rlimit_nofile 20480; events { worker_connections 5120; # increase for busier servers use epoll; # you should use epoll here for Linux kernels 2.6.x } http { server_name_in_redirect off; server_names_hash_max_size 10240; server_names_hash_bucket_size 1024; include mime.types; default_type application/octet-stream; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 5; gzip on; gzip_vary on; gzip_disable "MSIE [1-6]\."; gzip_proxied any; gzip_http_version 1.1; gzip_min_length 1000; gzip_comp_level 6; gzip_buffers 16 8k; # You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml; ignore_invalid_headers on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; reset_timedout_connection on; connection_pool_size 256; client_header_buffer_size 256k; large_client_header_buffers 4 256k; client_max_body_size 200M; client_body_buffer_size 128k; request_pool_size 32k; output_buffers 4 32k; postpone_output 1460; proxy_temp_path /tmp/nginx_proxy/; client_body_in_file_only on; log_format bytes_log "$msec $bytes_sent ."; include "/etc/nginx/vhosts/*"; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223649,223649#msg-223649 From nginx-forum at nginx.us Thu Mar 8 22:14:52 2012 From: nginx-forum at nginx.us (adamchal) Date: Thu, 8 Mar 2012 17:14:52 -0500 (EST) Subject: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter In-Reply-To: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> References: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6845fca665a6caee1aedd31f8664efdc.NginxMailingListEnglish@forum.nginx.org> Yeah, it would be awesome if I could replace the '-' with just an empty string. Does anyone have a good idea of how to implement? The line that currently sets the '-' as the NULL character in the logs is: src/http/modules/ngx_http_log_module.c:675 I thought about just writing a patch for it, but I'm not sure if that would mess things up in the future. Even still, what's the best way of doing this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223532,223651#msg-223651 From nginx-forum at nginx.us Thu Mar 8 23:34:40 2012 From: nginx-forum at nginx.us (wilhelmn) Date: Thu, 8 Mar 2012 18:34:40 -0500 (EST) Subject: Dynamically define upstream Message-ID: <30978367f3dcf3c7939d0daa7b08997f.NginxMailingListEnglish@forum.nginx.org> Hey there, Is there a way to dynamically configure nginx upstreams - with API or via Lua? Much appreciated! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223652,223652#msg-223652 From nginx-forum at nginx.us Thu Mar 8 23:38:04 2012 From: nginx-forum at nginx.us (wilhelmn) Date: Thu, 8 Mar 2012 18:38:04 -0500 (EST) Subject: load balancer - add nodes dynamically to upstream In-Reply-To: <4E2C5BA2.2070708@gmail.com> References: <4E2C5BA2.2070708@gmail.com> Message-ID: Is there any news on dynamically adding / removing upstreams? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212899,223653#msg-223653 From nginx-forum at nginx.us Fri Mar 9 01:02:07 2012 From: nginx-forum at nginx.us (biguniverse) Date: Thu, 8 Mar 2012 20:02:07 -0500 (EST) Subject: Timeout Issues In-Reply-To: References: Message-ID: <390460b9ca2fe64ce7333530ff657123.NginxMailingListEnglish@forum.nginx.org> Hi, Shaun. Did you ever find a solution to this? I'm having the same 10 minute issue and I've tried every timeout setting nginx has; e.g.: send_timeout 30m; proxy_read_timeout 30m; proxy_connect_timeout 30m; client_header_timeout 30m; client_body_timeout 30m; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215628,223654#msg-223654 From nginx-forum at nginx.us Fri Mar 9 01:09:14 2012 From: nginx-forum at nginx.us (openclinica) Date: Thu, 8 Mar 2012 20:09:14 -0500 (EST) Subject: Timeout Issues In-Reply-To: <390460b9ca2fe64ce7333530ff657123.NginxMailingListEnglish@forum.nginx.org> References: <390460b9ca2fe64ce7333530ff657123.NginxMailingListEnglish@forum.nginx.org> Message-ID: <7df59e53b24abfc9fcc82ffc333f5525.NginxMailingListEnglish@forum.nginx.org> No I did not find any setting that would accomodate a request over 10 minutes. I tried every setting imaginable with ever method of displaying time available and I have not found any solution. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,215628,223655#msg-223655 From lists at ruby-forum.com Fri Mar 9 02:12:35 2012 From: lists at ruby-forum.com (Ashish S Dev) Date: Fri, 09 Mar 2012 03:12:35 +0100 Subject: further "Hacking" the event model of Nginx In-Reply-To: <84016b4f6525bb9ec741e8d266cf9d16@ruby-forum.com> References: <84016b4f6525bb9ec741e8d266cf9d16@ruby-forum.com> Message-ID: Hi vincent, Were you able to get to do what you wanted in comment #1? I was wondering if you would happen to have some sample code or pointers, that you wouldn't mind sharing? Thanks, Suhas -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 9 02:15:07 2012 From: lists at ruby-forum.com (Ashish S Dev) Date: Fri, 09 Mar 2012 03:15:07 +0100 Subject: further "Hacking" the event model of Nginx In-Reply-To: <84016b4f6525bb9ec741e8d266cf9d16@ruby-forum.com> References: <84016b4f6525bb9ec741e8d266cf9d16@ruby-forum.com> Message-ID: <58ba62f72d5b4e2a10d228639b9a8e56@ruby-forum.com> Hi vincent, Were you able to get to do what you wanted in comment #1? I was wondering if you would happen to have some sample code or pointers, that you wouldn't mind sharing? I have a similar requirement, and have asked about the same here: http://www.ruby-forum.com/topic/3809975 Thanks, Ashish -- Posted via http://www.ruby-forum.com/. From ashishs.dev at gmail.com Fri Mar 9 02:26:57 2012 From: ashishs.dev at gmail.com (Ashish S) Date: Thu, 8 Mar 2012 18:26:57 -0800 Subject: Pointers on writing an Nginx module/application which needs to talk to multiple backends (sometimes sequentially, sometimes parallel) to serve a single request In-Reply-To: <72F1AF36E5BB412689091C328E425C14@Desktop> References: <72F1AF36E5BB412689091C328E425C14@Desktop> Message-ID: Thank you Piotr. Agentzh's fork of eval module works for me. I am now trying to implement #2 - #6 now. Are there sample 3rd party modules which parallely talk to postgres and some other backend service (rather, more than one backend services in parallel), then merge results from the two, followed by an upstream call to another backend service? Thanks, Ashish On Thu, Mar 8, 2012 at 5:30 AM, Piotr Sikora wrote: > Hi, > > >> but figured that eval does >> an in-memory subrequest, while Piotr's postgres module above doesn't >> support in-memory subrequest. ?Has anyone modified postgres module >> code to work with in-memory sub-requests? > > > agentzh forked eval module and made it work with regular subrequests (so > also with ngx_postgres): > https://github.com/agentzh/nginx-eval-module > > Alternatively, you could use ngx.location.capture() feature from ngx_lua > module to make the subrequests to PostgreSQL location. > > I also believe that the first test case from > https://github.com/FRiCKLE/ngx_postgres/blob/master/t/eval.t might be of > interest to you. > > Best regards, > Piotr Sikora < piotr.sikora at frickle.com > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Fri Mar 9 02:48:30 2012 From: nginx-forum at nginx.us (morganwang) Date: Thu, 8 Mar 2012 21:48:30 -0500 (EST) Subject: who can help me to solve running .pl (perl) in nginx Message-ID: <10b4ddff3f17ff1f353523512498bb4f.NginxMailingListEnglish@forum.nginx.org> my os is ubuntu, and I follow the http://wiki.nginx.org/SimpleCGI but when I visit the pl(perl) file, the pl(perl) file will be a defunct process. And the cpu will reache the 100% by the cgiwrap-fcgi.pl .. how can I fix this problem? And how can run the perl file in nginx? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223660,223660#msg-223660 From andrew at nginx.com Fri Mar 9 06:18:27 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Fri, 9 Mar 2012 10:18:27 +0400 Subject: upstream keepalive - call for testing In-Reply-To: <73a29a8343d5b3761367f01ac9eaf5f4.NginxMailingListEnglish@forum.nginx.org> References: <20110801160725.GH1137@mdounin.ru> <73a29a8343d5b3761367f01ac9eaf5f4.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3AEC3E6A-E6AC-446C-8882-C025709F7490@nginx.com> Alex, It's been several months since it got integrated into the main branch, check the docs http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive On Mar 8, 2012, at 6:30 PM, alexscott wrote: > Hi Maxim, > when is it possible to use this module for a proxy server like keeping > the connection persistent for proxy_pass "http://google.com"; ? > > Br., > Alex. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,223633#msg-223633 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From iqbal at aroussi.name Fri Mar 9 10:50:26 2012 From: iqbal at aroussi.name (Iqbal Aroussi) Date: Fri, 9 Mar 2012 10:50:26 +0000 Subject: nginx status active connections Message-ID: Hi, We do have a few high load web servers behind two load balancers running * nginx/1.0.0* I upgraded two of them to *nginx/1.0.12* all servers are running well despite the version of nginx However I've noticed that there is a big difference in active connections between the old version and the new version. What do you think about it, is it bad or good. *nginx/1.0.12* *Linux 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:50:31 EDT 2010 x86_64 GNU/Linux* *CentOS release 5.7 (Final)* *Active connections: 117 * *server accepts handled requests* * 12710947 12710947 12710947 * *Reading: 0 Writing: 117 Waiting: 0 * * * *nginx/1.0.12* *Linux 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64 GNU/Linux* *CentOS release 5.7 (Final)* *Active connections: 74 * *server accepts handled requests* * 31879742 31879742 31879741 * *Reading: 0 Writing: 74 Waiting: 0 * *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 1 server accepts handled requests 1745405552 1745405552 1745405549 Reading: 0 Writing: 1 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 1 server accepts handled requests 1777800935 1777800935 1777800935 Reading: 0 Writing: 1 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 6 server accepts handled requests 638878235 638878235 638878235 Reading: 0 Writing: 6 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 5 server accepts handled requests 1785279854 1785279854 1785279852 Reading: 0 Writing: 5 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 4 server accepts handled requests 1795180194 1795180194 1795180190 Reading: 0 Writing: 4 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 GNU/Linux CentOS release 5.6 (Final) Active connections: 4 server accepts handled requests 1792770090 1792770090 1792770085 Reading: 0 Writing: 4 Waiting: 0 *nginx/1.0.0* Linux 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64 GNU/Linux CentOS release 5.7 (Final) Active connections: 6 server accepts handled requests 1374777486 1374777486 1374777465 Reading: 0 Writing: 6 Waiting: 0 * Best Regards -- * *Iqbal Aroussi* *+212 665 025 032* *iqbal at aroussi.name* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Fri Mar 9 15:27:44 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 9 Mar 2012 19:27:44 +0400 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: References: <20120306232421.GD18773@craic.sysops.org> <20120307173648.GC67687@mdounin.ru> Message-ID: <20120309152744.GK67687@mdounin.ru> Hello! On Thu, Mar 08, 2012 at 01:03:42AM +0100, Adri?n Navarro wrote: > Where should that be? > > I have a location for php scripts (all to fastcgi) figuring as internal. > > Another one (location /get) which rewrites to the PHP file (therefore > only accessible via rewrite, as PHP is internal otherwise). > > A location /get.php won't work either. I tried using matches inside > the fcgi directives to add a parameter but didn't work either, in any > case? Unless you have anything more specific, this would be "location /". If you don't have "location /" either (which is not recommended), this would be implicit location with a settings set on server level. >From what you say I tend to assume you don't have "location /", and that's why it only works at server level for you. See docs here for details: http://nginx.org/en/docs/http/request_processing.html http://nginx.org/en/docs/http/ngx_http_core_module.html#location Maxim Dounin > > On Wed, Mar 7, 2012 at 6:36 PM, Maxim Dounin wrote: > > Hello! > > > > On Wed, Mar 07, 2012 at 06:03:54PM +0100, Adri?n Navarro wrote: > > > >> max_ranges 0; worked well but only at server directive. > >> > >> I have finally decided to use different server{} entries (subdomains) > >> for the different cases. > > > > It should work at location level as well, though please make sure > > to specify it in location where response is in fact returned, i.e. > > where your X-Accel-Redirect's are processed. > > > > Maxim Dounin > > > >> > >> Thank you > >> > >> On Wed, Mar 7, 2012 at 12:45 AM, Adri?n Navarro wrote: > >> > Thank you everyone for your answers. > >> > > >> > max_ranges 0; works great if set in the main server {} directive. > >> > Sadly, when put inside a location directive, it will not work. The > >> > same applies for more_clear_headers. > >> > > >> > The other thing I'm seeing is that while headers with max_range for > >> > the whole directive does return correct headers, chrome still allows > >> > pausing. > >> > > >> > I better get some sleep and keep digging tomorrow. > >> > > >> > Thank you, I'll follow up soon. > >> > > >> > On Wed, Mar 7, 2012 at 12:24 AM, Francis Daly wrote: > >> >> On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: > >> >> > >> >> Hi there, > >> >> > >> >>> I am using nginx's X-Accel headers, and I want to disable file > >> >>> resuming. That implies: > >> >>> - suppresing output header "Accept-Ranges: bytes" > >> >>> - suppresing input header "Range" > >> >> > >> >>> Anyone have any pointers? I'm running out of ideas now. > >> >> > >> >> Completely untested, and not a direct answer to "file resuming", but you > >> >> asked for pointers, so maybe... > >> >> > >> >> If you want a response header from a fastcgi process not to be > >> >> delivered to the client, see fastcgi_hide_header, for example at > >> >> http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header > >> >> > >> >> If you want a request header not to be sent to a fastcgi process, set > >> >> the matching parameter yourself to empty: > >> >> > >> >> ?fastcgi_param HTTP_RANGE ""; > >> >> > >> >> Good luck with it, > >> >> > >> >> ? ? ? ?f > >> >> -- > >> >> Francis Daly ? ? ? ?francis at daoine.org > >> >> > >> >> _______________________________________________ > >> >> nginx mailing list > >> >> nginx at nginx.org > >> >> http://mailman.nginx.org/mailman/listinfo/nginx > >> > > >> > > >> > > >> > -- > >> > Adri?n Navarro / (+34) 608 831 094 > >> > >> > >> > >> -- > >> Adri?n Navarro / (+34) 608 831 094 > >> > >> _______________________________________________ > >> 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 > > > > -- > Adri?n Navarro / (+34) 608 831 094 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Fri Mar 9 15:31:35 2012 From: nginx-forum at nginx.us (umen) Date: Fri, 9 Mar 2012 10:31:35 -0500 (EST) Subject: Nginx to recive json and update mysql (im newbe) Message-ID: Hello all im new to nginx , im thinking about testing the server to do the job of getting json requests from clients extract the json data and update mysql server . what shell i do and how should i configure the server? which module should i compile into the server to do this job ? Thanks for helping Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223678,223678#msg-223678 From cliff at develix.com Fri Mar 9 16:45:27 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 09 Mar 2012 08:45:27 -0800 Subject: Nginx to recive json and update mysql (im newbe) In-Reply-To: References: Message-ID: <1331311527.2132.28.camel@portable-evil> On Fri, 2012-03-09 at 10:31 -0500, umen wrote: > Hello all > im new to nginx , im thinking about testing the server to do the job of > getting json requests from clients > extract the json data and update mysql server . > what shell i do and how should i configure the server? which module > should i compile into the server to do this job ? > Thanks for helping This can't be done with plain Nginx. Typically you would utilize a backend server such as Tornado, node.js, Ruby on Rails, PHP, etc to parse the JSON and store it in MySQL. However, you may be able to leverage the lua module to do what you want. https://github.com/chaoslawful/lua-nginx-module Regards, Cliff From nginx-forum at nginx.us Fri Mar 9 17:23:28 2012 From: nginx-forum at nginx.us (adamchal) Date: Fri, 9 Mar 2012 12:23:28 -0500 (EST) Subject: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter In-Reply-To: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> References: <5501db1f52b751d6d6b21a3d075bcd50.NginxMailingListEnglish@forum.nginx.org> Message-ID: What I've done for now is replace the lines at 675 and 676 of (src/http/modules/ngx_http_log_module.c): 674: if (value == NULL || value->not_found) { 675: *buf = '-'; 676: return buf + 1; 677: } with: 674: if (value == NULL || value->not_found) { 675: *buf = 0; 676: return buf; 677: } I hope this won't cause any issues. It seems to be working very nicely. Here's a see one-liner if anyone is interested in doing the same thing: sed -n '1h;1!H;${;g;s/buf = \W-\W;\(\s*return buf\) + 1;/buf = 0;\1;/g;p;}' src/http/modules/ngx_http_log_module.c > src/http/modules/ngx_http_log_module.c.new && mv -f src/http/modules/ngx_http_log_module.c.new src/http/modules/ngx_http_log_module.c It would be nice in the future to be able to set the "NULL" character for the log module. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223532,223680#msg-223680 From nginx-forum at nginx.us Fri Mar 9 18:25:53 2012 From: nginx-forum at nginx.us (JennrCheng) Date: Fri, 9 Mar 2012 13:25:53 -0500 (EST) Subject: How to defy this url in nginx.conf Message-ID: <1b07944b994f306cb56f66df1e2daf37.NginxMailingListEnglish@forum.nginx.org> My server can't be run normal now,when I check the access.log I see there are lot of connections request my site url : /iclk/?zoneid=15&uid=1000 . I want to defy this url in nginx.conf. I just write the below code in the file but it can't work , can any kind man help me . lot of thanks. location ^~ uid\=1000$ { return 404; } The access log is below: 60.19.120.162 - - [10/Mar/2012:02:02:34 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 360SE)" - 220.181.106.221 - - [10/Mar/2012:02:02:34 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "http://www.333xo.com/view/index4442.html" "Opera/9.80 (Android; Opera Mini/6.5.28115/26.1507; U; zh) Presto/2.8.119 Version/10.54" 117.136.5.170 220.181.106.221 - - [10/Mar/2012:02:02:34 +0800] "GET /favicon.ico HTTP/1.1" 404 162 "http://www.xylmw.com/iclk/?zoneid=15&uid=1000" "Opera/9.80 (Android; Opera Mini/6.5.28115/26.1507; U; zh) Presto/2.8.119 Version/10.54" 117.136.5.170 180.121.215.77 - - [10/Mar/2012:02:02:34 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "http://www.segougou.cc/Film9/index2.html" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; BRI/2; MASP; SE 2.X MetaSr 1.0)" - 111.226.38.245 - - [10/Mar/2012:02:02:34 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; 360SE)" - 115.59.69.216 - - [10/Mar/2012:02:02:34 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET4.0C; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; 360SE)" - 61.186.41.150 - - [10/Mar/2012:02:02:35 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.55zy.info/list/index9.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; QQDownload 691; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; 360SE)" - 119.185.237.31 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)" - 218.92.176.98 - - [10/Mar/2012:02:02:35 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Microsoft Windows Media Center PC 6.0)" - 59.49.77.235 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.1; SE 2.x)" - 59.46.60.112 - - [10/Mar/2012:02:02:35 +0800] "GET /i.js HTTP/1.1" 304 0 "http://www.yusegu.com/movie/8481.htm" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE)" - 111.226.38.245 - - [10/Mar/2012:02:02:35 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 360SE)" - 1.195.126.32 - - [10/Mar/2012:02:02:35 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE)" - 218.26.104.251 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" - 171.36.35.110 - - [10/Mar/2012:02:02:35 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.sexhuzy.com/list/index43_3.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE)" - 115.51.157.180 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Trident/4.0)" - 180.113.86.115 - - [10/Mar/2012:02:02:35 +0800] "GET /i.js HTTP/1.1" 200 1828 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)" - 125.113.131.143 - - [10/Mar/2012:02:02:35 +0800] "GET /i.js HTTP/1.1" 304 0 "http://sexwo.info/Player.asp?11605,5,6,1.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 121.35.67.84 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; SV1; QQDownload 691; 360SE)" - 115.58.75.92 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 59.39.31.116 - - [10/Mar/2012:02:02:35 +0800] "GET /templates/index/default/image/top_logo.gif HTTP/1.1" 200 8145 "-" "-" - 59.39.31.116 - - [10/Mar/2012:02:02:35 +0800] "GET /templates/index/default/image/top_logo.gif HTTP/1.1" 200 8145 "-" "-" - 120.196.212.213 - - [10/Mar/2012:02:02:35 +0800] "GET / HTTP/1.1" 200 3912 "-" "DNSPod-monitor(http://www.dnspod.cn)" - 182.135.147.97 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)" - 175.147.18.108 - - [10/Mar/2012:02:02:35 +0800] "GET /show.php?z_uid=1014&zoneid=22&z_h_url=www.yusegu.com&z_uc_ks=1980&z_sh=1024&z_sw=1280&z_scd=32&u_a_type=1&z_c_url=http%3A//www.yusegu.com/list/G_17.htm&z_uref=http%3A//www.yusegu.com/list/G_18.htm&z_utz=8&z_uhis=65&z_ujava=1&z_ufv=11.1.102.62 HTTP/1.1" 200 1619 "http://www.yusegu.com/list/G_17.htm" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 116.228.85.98 - - [10/Mar/2012:02:02:35 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; 360SE)" - 122.239.219.240 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; SV1)" - 121.37.37.178 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" - 61.155.26.202 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" - 14.118.106.201 - - [10/Mar/2012:02:02:36 +0800] "GET /i.js HTTP/1.1" 200 1828 "http://www.12mv.info/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729)" - 113.81.97.79 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)" - 117.90.180.239 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; 360SE)" - 117.65.104.246 - - [10/Mar/2012:02:02:36 +0800] "GET /i.js HTTP/1.1" 200 1828 "http://www.66zy.info/view/index2884.html" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.2)" - 58.60.63.199 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE)" - 121.37.43.108 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" - 121.34.47.128 - - [10/Mar/2012:02:02:36 +0800] "GET /show.php?z_uid=1014&zoneid=22&z_h_url=www.yusegu.com&z_uc_ks=1765&z_sh=768&z_sw=1366&z_scd=24&u_a_type=1&z_c_url=http%3A//www.yusegu.com/list/B_22.htm&z_uref=http%3A//www.yusegu.com/list/B_18.htm&z_utz=8&z_uhis=6&z_ujava=1&z_ufv=11.1.102.63 HTTP/1.1" 200 904 "http://www.yusegu.com/list/B_22.htm" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" - 183.60.156.56 - - [10/Mar/2012:02:02:36 +0800] "GET /i.js HTTP/1.1" 200 1828 "http://www.12mv.info/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; TheWorld)" - 175.147.175.253 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0; QQPinyin 730; .NET CLR 2.0.50727; KuGooSoft; .NET CLR 2.0.50727; QQDownload 691; 360SE)" - 218.5.233.122 - - [10/Mar/2012:02:02:36 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 218.59.161.118 - - [10/Mar/2012:02:02:36 +0800] "GET /i.js HTTP/1.1" 304 0 "http://55av.info/Player.asp?11316,5,6,1.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQPinyinSetup 614; Sicent; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) )" - 182.135.147.97 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000&type=2 HTTP/1.1" 404 564 "http://www.xylmw.com/iclk/?zoneid=15&uid=1000" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)" - 112.248.161.69 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; TheWorld; Windows NT 5.1; Trident/4.0)" - 112.64.106.167 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "http://www.52ri.info/article/?233.html" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.4 (KHTML, like Gecko) Chrome/16.0.889.0 Safari/535.4" - 183.10.236.188 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; Trident/4.0)" - 112.248.161.69 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; TheWorld; Windows NT 5.1; Trident/4.0)" - 180.153.213.141 - - [10/Mar/2012:02:02:36 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0" - 118.253.71.8 - - [10/Mar/2012:02:02:36 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; Microsoft Windows Media Center PC 6.0)" - 112.64.106.167 - - [10/Mar/2012:02:02:36 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.4 (KHTML, like Gecko) Chrome/16.0.889.0 Safari/535.4" - 182.135.147.97 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000&type=2 HTTP/1.1" 404 564 "http://www.xylmw.com/iclk/?zoneid=15&uid=1000&type=2" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)" - 1.192.82.40 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; 360SE)" - 182.135.147.97 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000&type=2 HTTP/1.1" 404 564 "http://www.xylmw.com/iclk/?zoneid=15&uid=1000&type=2" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)" - 116.21.87.137 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; Trident/4.0)" - 116.207.108.147 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)" - 183.153.43.126 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1)" - 120.37.87.243 - - [10/Mar/2012:02:02:37 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" - 183.9.211.66 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE)" - 183.7.93.84 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" - 183.8.236.110 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 122.239.223.232 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1)" - 183.201.255.28 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; BOIE9;ZHCN)" - 112.64.235.249 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0" - 60.7.176.221 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "http://www.52ri.info/list/index4_11.html" "Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; lepad_001n Build/PQXU100.4.0073.021511) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" - 183.9.211.66 - - [10/Mar/2012:02:02:37 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE; 360SE)" - 222.187.197.3 - - [10/Mar/2012:02:02:37 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" - 218.71.99.11 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; SV1)" - 202.104.156.56 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; 360SE)" - 60.172.8.8 - - [10/Mar/2012:02:02:37 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Sicent)" - 59.46.60.62 - - [10/Mar/2012:02:02:37 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://55av.info/Player.asp?11620,5,6,1.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE; 360SE)" - 1.85.224.85 - - [10/Mar/2012:02:02:37 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; SV1)" - 183.9.211.66 - - [10/Mar/2012:02:02:37 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE; 360SE)" - 111.120.26.96 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1)" - 219.145.233.138 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; Trident/4.0)" - 61.134.28.2 - - [10/Mar/2012:02:02:38 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://www.yyy48.com/template/x_skin9_b/images/g_js/loading.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 219.145.232.86 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)" - 218.73.173.14 - - [10/Mar/2012:02:02:38 +0800] "GET /i.js HTTP/1.1" 200 4563 "http://sexhuzy.com/list/index46_2.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727)" - 112.248.161.69 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; TheWorld; Windows NT 5.1; Trident/4.0)" - 183.9.211.66 - - [10/Mar/2012:02:02:38 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE; 360SE)" - 123.185.181.97 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" - 218.71.99.53 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; SV1)" - 175.147.18.108 - - [10/Mar/2012:02:02:38 +0800] "GET /show.php?z_uid=1014&zoneid=22&z_h_url=www.yusegu.com&z_uc_ks=1980&z_sh=1024&z_sw=1280&z_scd=32&u_a_type=1&z_c_url=http%3A//www.yusegu.com/list/G_17.htm&z_uref=http%3A//www.yusegu.com/list/G_18.htm&z_utz=8&z_uhis=65&z_ujava=1&z_ufv=11.1.102.62 HTTP/1.1" 200 1653 "http://www.yusegu.com/list/G_17.htm" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" - 183.9.211.66 - - [10/Mar/2012:02:02:38 +0800] "GET /favicon.ico HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE; 360SE)" - 123.246.94.47 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 162 "-" "Mozilla/4.0 (compatible; 360SE; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)" - 119.185.233.75 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)" - 119.185.237.65 - - [10/Mar/2012:02:02:38 +0800] "GET /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0)" - Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223681,223681#msg-223681 From cliff at develix.com Fri Mar 9 18:46:08 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 09 Mar 2012 10:46:08 -0800 Subject: How to defy this url in nginx.conf In-Reply-To: <1b07944b994f306cb56f66df1e2daf37.NginxMailingListEnglish@forum.nginx.org> References: <1b07944b994f306cb56f66df1e2daf37.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1331318768.2132.40.camel@portable-evil> On Fri, 2012-03-09 at 13:25 -0500, JennrCheng wrote: > My server can't be run normal now,when I check the access.log I see > there are lot of connections request my site url : > /iclk/?zoneid=15&uid=1000 . > > I want to defy this url in nginx.conf. I just write the below code in > the file but it can't work , can any kind man help me . lot of thanks. First of all, Nginx is already rejecting the request, which is why Nginx returns a 404. > 60.19.120.162 - - [10/Mar/2012:02:02:34 +0800] "GET > /iclk/?zoneid=15&uid=1000 HTTP/1.1" 404 564 "-" "Mozilla/4.0 > location ^~ uid\=1000$ > { > return 404; > } Locations cannot be based off of the request arguments. You could catch the request by using something like this (assuming /iclk isn't valid for some other part of your site): location ^~ /iclk { return 404; } In any case, it isn't necessary since Nginx is already doing this for you. If these requests are hacking attempts, you could utilize a tool such as fail2ban that watched your Nginx logs for requests that match the pattern and blocked the IP addresses using your system's firewall. For future reference, if you are going to paste giant sections from log files, please use pastebin and just provide a link. Regards, Cliff From adrianhayter at gmail.com Fri Mar 9 22:12:45 2012 From: adrianhayter at gmail.com (Adrian Hayter) Date: Fri, 9 Mar 2012 22:12:45 +0000 Subject: Question about nested locations / PHP. Message-ID: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> Not sure if this is the right place to post this; apologies in advance if it is! I'm having a bit of trouble with nested locations and PHP. I have a setup where I want all PHP files to go through fastcgi, and have an expiry of epoch. However, one particular PHP file is used to generate CSS stylesheets, and I want this file to have an expiry of 30 days. My current code looks like this: location ~ \.php$ { location ~ /css.php { expires 30d; add_header Pragma public; add_header Cache-Control "public"; } expires epoch // Fastcgi stuff... } I've tried various combinations (having the nested location at the end, etc) but all that happens is the css.php file doesn't get sent through the fastcgi process, and the raw PHP code is sent to the client. I've messed up somewhere, and I'm new to nginx (just migrated from Apache) so if someone could point out my error / give a quick explanation of how nested locations work, it would be ideal! Thanks in advance! Adrian From adrian at navarro.at Fri Mar 9 22:36:00 2012 From: adrian at navarro.at (=?UTF-8?Q?Adri=C3=A1n_Navarro?=) Date: Fri, 9 Mar 2012 23:36:00 +0100 Subject: Disabling file resuming with X-Accel / Removing headers In-Reply-To: <20120309152744.GK67687@mdounin.ru> References: <20120306232421.GD18773@craic.sysops.org> <20120307173648.GC67687@mdounin.ru> <20120309152744.GK67687@mdounin.ru> Message-ID: Hmm, it's true that there is no location / directive (I think). In such case, does it mean that I must set one to have these options work at other /location (including rewrites) directives? Thank you On Fri, Mar 9, 2012 at 4:27 PM, Maxim Dounin wrote: > Hello! > > On Thu, Mar 08, 2012 at 01:03:42AM +0100, Adri?n Navarro wrote: > >> Where should that be? >> >> I have a location for php scripts (all to fastcgi) figuring as internal. >> >> Another one (location /get) which rewrites to the PHP file (therefore >> only accessible via rewrite, as PHP is internal otherwise). >> >> A location /get.php won't work either. I tried using matches inside >> the fcgi directives to add a parameter but didn't work either, in any >> case? > > Unless you have anything more specific, this would be "location /". > If you don't have "location /" either (which is not recommended), > this would be implicit location with a settings set on server level. > > From what you say I tend to assume you don't have "location /", > and that's why it only works at server level for you. > > See docs here for details: > > http://nginx.org/en/docs/http/request_processing.html > http://nginx.org/en/docs/http/ngx_http_core_module.html#location > > Maxim Dounin > >> >> On Wed, Mar 7, 2012 at 6:36 PM, Maxim Dounin wrote: >> > Hello! >> > >> > On Wed, Mar 07, 2012 at 06:03:54PM +0100, Adri?n Navarro wrote: >> > >> >> max_ranges 0; worked well but only at server directive. >> >> >> >> I have finally decided to use different server{} entries (subdomains) >> >> for the different cases. >> > >> > It should work at location level as well, though please make sure >> > to specify it in location where response is in fact returned, i.e. >> > where your X-Accel-Redirect's are processed. >> > >> > Maxim Dounin >> > >> >> >> >> Thank you >> >> >> >> On Wed, Mar 7, 2012 at 12:45 AM, Adri?n Navarro wrote: >> >> > Thank you everyone for your answers. >> >> > >> >> > max_ranges 0; works great if set in the main server {} directive. >> >> > Sadly, when put inside a location directive, it will not work. The >> >> > same applies for more_clear_headers. >> >> > >> >> > The other thing I'm seeing is that while headers with max_range for >> >> > the whole directive does return correct headers, chrome still allows >> >> > pausing. >> >> > >> >> > I better get some sleep and keep digging tomorrow. >> >> > >> >> > Thank you, I'll follow up soon. >> >> > >> >> > On Wed, Mar 7, 2012 at 12:24 AM, Francis Daly wrote: >> >> >> On Tue, Mar 06, 2012 at 11:56:32PM +0100, Adri?n Navarro wrote: >> >> >> >> >> >> Hi there, >> >> >> >> >> >>> I am using nginx's X-Accel headers, and I want to disable file >> >> >>> resuming. That implies: >> >> >>> - suppresing output header "Accept-Ranges: bytes" >> >> >>> - suppresing input header "Range" >> >> >> >> >> >>> Anyone have any pointers? I'm running out of ideas now. >> >> >> >> >> >> Completely untested, and not a direct answer to "file resuming", but you >> >> >> asked for pointers, so maybe... >> >> >> >> >> >> If you want a response header from a fastcgi process not to be >> >> >> delivered to the client, see fastcgi_hide_header, for example at >> >> >> http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_hide_header >> >> >> >> >> >> If you want a request header not to be sent to a fastcgi process, set >> >> >> the matching parameter yourself to empty: >> >> >> >> >> >> ?fastcgi_param HTTP_RANGE ""; >> >> >> >> >> >> Good luck with it, >> >> >> >> >> >> ? ? ? ?f >> >> >> -- >> >> >> Francis Daly ? ? ? ?francis at daoine.org >> >> >> >> >> >> _______________________________________________ >> >> >> nginx mailing list >> >> >> nginx at nginx.org >> >> >> http://mailman.nginx.org/mailman/listinfo/nginx >> >> > >> >> > >> >> > >> >> > -- >> >> > Adri?n Navarro / (+34) 608 831 094 >> >> >> >> >> >> >> >> -- >> >> Adri?n Navarro / (+34) 608 831 094 >> >> >> >> _______________________________________________ >> >> 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 >> >> >> >> -- >> Adri?n Navarro / (+34) 608 831 094 >> >> _______________________________________________ >> 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 -- Adri?n Navarro / (+34) 608 831 094 From nginx-forum at nginx.us Sat Mar 10 00:14:24 2012 From: nginx-forum at nginx.us (ggrensteiner) Date: Fri, 9 Mar 2012 19:14:24 -0500 (EST) Subject: Content-Length compared to actual size before caching Message-ID: <2bfaaf092e311932cda7ccec84d57cb8.NginxMailingListEnglish@forum.nginx.org> If my upstream goes away I get an error upstream prematurely closed connection while reading response header from upstream or recv() failed (104: Connection reset by peer) while reading response header from upstream unfortunately, this still gives me a 200 code and this return is entered incomplete into my memcache. Is there some way to get the size of the current request from proxy_pass so I can compare it to the Content_Length and discard it if it's mismatched? Ideally the system wouldn't tag incomplete responses as 200 OK, so they wouldn't end up as short returns in my memcache for their cache duration. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223690,223690#msg-223690 From cliff at develix.com Sat Mar 10 00:47:56 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 09 Mar 2012 16:47:56 -0800 Subject: Question about nested locations / PHP. In-Reply-To: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> References: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> Message-ID: <1331340476.2132.49.camel@portable-evil> On Fri, 2012-03-09 at 22:12 +0000, Adrian Hayter wrote: > Not sure if this is the right place to post this; apologies in advance if it is! > > I'm having a bit of trouble with nested locations and PHP. I have a > setup where I want all PHP files to go through fastcgi, and have an > expiry of epoch. However, one particular PHP file is used to generate > CSS stylesheets, and I want this file to have an expiry of 30 days. My > current code looks like this: > > location ~ \.php$ > { > location ~ /css.php > { > expires 30d; > add_header Pragma public; > add_header Cache-Control "public"; > } > > expires epoch > > // Fastcgi stuff... > } > You don't need nested locations. This should work: location = /css.php { expires 30d; add_header Pragma public; add_header Cache-Control "public"; include fastcgi_params; fastcgi_pass ... } location ~ \.php$ { expires epoch include fastcgi_params; fastcgi_pass ... } Information on the order of processing can be found here: http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration http://wiki.nginx.org/HttpCoreModule#location Regards, Cliff > Thanks in advance! > > Adrian > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From adrianhayter at gmail.com Sat Mar 10 01:40:33 2012 From: adrianhayter at gmail.com (Adrian Hayter) Date: Sat, 10 Mar 2012 01:40:33 +0000 Subject: Question about nested locations / PHP. In-Reply-To: <1331340476.2132.49.camel@portable-evil> References: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> <1331340476.2132.49.camel@portable-evil> Message-ID: Thanks. Could it be done with nested locations at all? Do I really have to include all the PHP config for each block? -Adrian On 10 Mar 2012, at 00:47, Cliff Wells wrote: > > You don't need nested locations. This should work: > > location = /css.php { > expires 30d; > add_header Pragma public; > add_header Cache-Control "public"; > include fastcgi_params; > fastcgi_pass ... > } > > location ~ \.php$ { > expires epoch > include fastcgi_params; > fastcgi_pass ... > } > > Information on the order of processing can be found here: > > http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration > http://wiki.nginx.org/HttpCoreModule#location > > > > Regards, > Cliff > > > >> Thanks in advance! >> >> Adrian >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Sat Mar 10 05:48:32 2012 From: nginx-forum at nginx.us (JennrCheng) Date: Sat, 10 Mar 2012 00:48:32 -0500 (EST) Subject: How to defy this url in nginx.conf In-Reply-To: <1331318768.2132.40.camel@portable-evil> References: <1331318768.2132.40.camel@portable-evil> Message-ID: <258f3571107a0d592d499e60e3aa9ca2.NginxMailingListEnglish@forum.nginx.org> Okay, Got it . Thanks a lot. Best Regards, Jennr Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223681,223693#msg-223693 From mdounin at mdounin.ru Sat Mar 10 20:49:24 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 11 Mar 2012 00:49:24 +0400 Subject: nginx status active connections In-Reply-To: References: Message-ID: <20120310204923.GM67687@mdounin.ru> Hello! On Thu, Mar 08, 2012 at 02:37:37PM +0000, Iqbal Aroussi wrote: > Hi, > > We do have a few high load web servers behind two load balancers running * > nginx/1.0.0* > I upgraded two of them to *nginx/1.0.12* all servers are running well > despite the version of nginx > However I've noticed that there is a big difference in active connections > between the old version > and the new version. > > What do you think about it, is it bad or good. This is likely due to lingering close changes in 1.0.6: *) Bugfix: in closing connection for pipelined requests. You may fine-tune the behaviour via lingering_close, lingering_time and lingering_timeout directives (see http://nginx.org/r/lingering_close), though I would rather recommend to keep the default. Maxim Dounin From mdounin at mdounin.ru Sat Mar 10 21:15:58 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 11 Mar 2012 01:15:58 +0400 Subject: Question about nested locations / PHP. In-Reply-To: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> References: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> Message-ID: <20120310211558.GO67687@mdounin.ru> Hello! On Fri, Mar 09, 2012 at 10:12:45PM +0000, Adrian Hayter wrote: > Not sure if this is the right place to post this; apologies in > advance if it is! > > I'm having a bit of trouble with nested locations and PHP. I > have a setup where I want all PHP files to go through fastcgi, > and have an expiry of epoch. However, one particular PHP file is > used to generate CSS stylesheets, and I want this file to have > an expiry of 30 days. My current code looks like this: > > location ~ \.php$ > { > location ~ /css.php > { > expires 30d; > add_header Pragma public; > add_header Cache-Control "public"; > } > > expires epoch > > // Fastcgi stuff... > } > > I've tried various combinations (having the nested location at > the end, etc) but all that happens is the css.php file doesn't > get sent through the fastcgi process, and the raw PHP code is > sent to the client. I've messed up somewhere, and I'm new to > nginx (just migrated from Apache) so if someone could point out > my error / give a quick explanation of how nested locations > work, it would be ideal! You have to define the "fastcgi_pass" directive in both locations for this to work. And, as Cliff already suggested, you don't really need nested locations here, it's better to define exact location for /css.php, i.e. something like this: location = /css.php { expires 30d; fastcgi_pass ... ... } location ~ \.php$ { expires epoch; fastcgi_pass ... ... } Maxim Dounin From cliff at develix.com Sat Mar 10 22:11:55 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 10 Mar 2012 14:11:55 -0800 Subject: Question about nested locations / PHP. In-Reply-To: <20120310211558.GO67687@mdounin.ru> References: <2D86C24D-6534-497C-A149-91DD6A3D8FBE@gmail.com> <20120310211558.GO67687@mdounin.ru> Message-ID: <1331417515.2132.55.camel@portable-evil> On Sun, 2012-03-11 at 01:15 +0400, Maxim Dounin wrote: > And, as Cliff already suggested, you don't really need nested > locations here, it's better to define exact location for > /css.php, i.e. something like this: > > location = /css.php { > expires 30d; > fastcgi_pass ... > ... > } I was concerned that using an absolute location might not be general enough, since I seem to see a lot of PHP apps that use URLS like "/css.php/these/are/args", which might cause this location to be skipped if css.php happened to use that scheme. Regards, Cliff From opensource at interflective.com Sun Mar 11 00:47:54 2012 From: opensource at interflective.com (Paul G Webster) Date: Sun, 11 Mar 2012 00:47:54 -0000 Subject: Difficulty configuring virtual host Message-ID: good day all I want to configure my virtual hosts based on the srcip of the client, so basically the ip of the connecting client determines what document root to set. Any ideas how this can be accomplished? -- Thank you for your time -- Paul G Webster -- Checkout Opera M2 @ http://www.opera.com/mail/ From opensource at interflective.com Sun Mar 11 00:57:27 2012 From: opensource at interflective.com (Paul G Webster) Date: Sun, 11 Mar 2012 00:57:27 -0000 Subject: Difficulty configuring virtual host In-Reply-To: References: Message-ID: Ideally doing this: if (srcip == 4.4.4.5) { server_name test1; root /usr/local/www/4.4.4.5; } elsif (srcip == 2.2.2.2) { server_name test2; root /usr/local/www/2.2.2.2; } On Sun, 11 Mar 2012 00:47:54 -0000, Paul G Webster wrote: > good day all I want to configure my virtual hosts based on the srcip of > the client, so basically the ip of the connecting client determines what > document root to set. > > Any ideas how this can be accomplished? > > > -- Thank you for your time > -- Paul G Webster > -- Checkout Opera M2 @ http://www.opera.com/mail/ > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- -- Thank you for your time -- Paul G Webster -- Checkout Opera M2 @ http://www.opera.com/mail/ From appa at perusio.net Sun Mar 11 01:13:38 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Sun, 11 Mar 2012 02:13:38 +0100 Subject: Difficulty configuring virtual host In-Reply-To: References: Message-ID: <87boo40wjh.wl%appa@perusio.net> On 11 Mar 2012 01h57 CET, opensource at interflective.com wrote: > Ideally doing this: > > if (srcip == 4.4.4.5) { > server_name test1; > root /usr/local/www/4.4.4.5; > } elsif (srcip == 2.2.2.2) { > server_name test2; > root /usr/local/www/2.2.2.2; > } Untested. Using the geo module [1]. At the http level. geo $root_dir { 4.4.4.5 /usr/local/www/4.4.4.5; 2.2.2.2 /usr/local/www/2.2.2.2; } At the server level (vhost). server { server_name test1 test2; root $root_dir; #... } --- appa [1] http://nginx.org/en/docs/http/ngx_http_geo_module.html From opensource at interflective.com Sun Mar 11 01:12:52 2012 From: opensource at interflective.com (Paul G Webster) Date: Sun, 11 Mar 2012 01:12:52 -0000 Subject: Difficulty configuring virtual host In-Reply-To: References: Message-ID: I should probably add as someone just pointed out to me on IRC .. if there is a way of doing this without ifs I would be more than happy to use it, it was an example only 8) On Sun, 11 Mar 2012 00:57:27 -0000, Paul G Webster wrote: > Ideally doing this: > > if (srcip == 4.4.4.5) { > server_name test1; > root /usr/local/www/4.4.4.5; > } elsif (srcip == 2.2.2.2) { > server_name test2; > root /usr/local/www/2.2.2.2; > } > > On Sun, 11 Mar 2012 00:47:54 -0000, Paul G Webster > wrote: > >> good day all I want to configure my virtual hosts based on the srcip of >> the client, so basically the ip of the connecting client determines >> what document root to set. >> >> Any ideas how this can be accomplished? >> >> >> -- Thank you for your time >> -- Paul G Webster >> -- Checkout Opera M2 @ http://www.opera.com/mail/ >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > -- -- Thank you for your time -- Paul G Webster -- Checkout Opera M2 @ http://www.opera.com/mail/ From opensource at interflective.com Sun Mar 11 01:13:49 2012 From: opensource at interflective.com (Paul G Webster) Date: Sun, 11 Mar 2012 01:13:49 -0000 Subject: Difficulty configuring virtual host In-Reply-To: <87boo40wjh.wl%appa@perusio.net> References: <87boo40wjh.wl%appa@perusio.net> Message-ID: Ahh smart it should work perfectly any way to set the server_name dynamically On Sun, 11 Mar 2012 01:13:38 -0000, Ant?nio P. P. Almeida wrote: > On 11 Mar 2012 01h57 CET, opensource at interflective.com wrote: > >> Ideally doing this: >> >> if (srcip == 4.4.4.5) { >> server_name test1; >> root /usr/local/www/4.4.4.5; >> } elsif (srcip == 2.2.2.2) { >> server_name test2; >> root /usr/local/www/2.2.2.2; >> } > > Untested. Using the geo module [1]. At the http level. > > geo $root_dir { > 4.4.4.5 /usr/local/www/4.4.4.5; > 2.2.2.2 /usr/local/www/2.2.2.2; > } > > At the server level (vhost). > > server { > server_name test1 test2; > root $root_dir; > #... > } > > --- appa > > [1] http://nginx.org/en/docs/http/ngx_http_geo_module.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- -- Thank you for your time -- Paul G Webster -- Checkout Opera M2 @ http://www.opera.com/mail/ From opensource at interflective.com Sun Mar 11 01:31:39 2012 From: opensource at interflective.com (Paul G Webster) Date: Sun, 11 Mar 2012 01:31:39 -0000 Subject: Difficulty configuring virtual host In-Reply-To: References: <87boo40wjh.wl%appa@perusio.net> Message-ID: Works perfectly thank you :) On Sun, 11 Mar 2012 01:13:49 -0000, Paul G Webster wrote: > Ahh smart it should work perfectly any way to set the server_name > dynamically > > On Sun, 11 Mar 2012 01:13:38 -0000, Ant?nio P. P. Almeida > wrote: > >> On 11 Mar 2012 01h57 CET, opensource at interflective.com wrote: >> >>> Ideally doing this: >>> >>> if (srcip == 4.4.4.5) { >>> server_name test1; >>> root /usr/local/www/4.4.4.5; >>> } elsif (srcip == 2.2.2.2) { >>> server_name test2; >>> root /usr/local/www/2.2.2.2; >>> } >> >> Untested. Using the geo module [1]. At the http level. >> >> geo $root_dir { >> 4.4.4.5 /usr/local/www/4.4.4.5; >> 2.2.2.2 /usr/local/www/2.2.2.2; >> } >> >> At the server level (vhost). >> >> server { >> server_name test1 test2; >> root $root_dir; >> #... >> } >> >> --- appa >> >> [1] http://nginx.org/en/docs/http/ngx_http_geo_module.html >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > -- -- Thank you for your time -- Paul G Webster -- Checkout Opera M2 @ http://www.opera.com/mail/ From qholloi at gmail.com Sun Mar 11 12:38:24 2012 From: qholloi at gmail.com (Lawrence Strydom) Date: Sun, 11 Mar 2012 14:38:24 +0200 Subject: ssl problems Message-ID: Hi List I inherited the following setup: nginx reverse caching proxy load balancing to two real servers. I am trying to get SSL working. Here is my config: ++++++++++++++++++++++++++++++++++++++++++++ upstream ssl-apache_cluster { server 10.0.0.3:443; server 10.0.0.6:443; fair; } server { listen 196.37.50.51:443; client_max_body_size 5M; client_body_buffer_size 128k; server_name######################; access_log /var/log/nginx/##########.access.log; ssl on; ssl_certificate /etc/nginx/ssl/#########.crt; ssl_certificate_key /etc/nginx/ssl/domain.key; ssl_session_cache shared:SSL:10m; location / { access_log off; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass https://ssl-apache_cluster; } location ~* \.(jpg|jpeg|peg|PEG|gif|png|bmp|flv|pdf|ps|doc|mp3|wmv|wma|wav|swf|JPG|BMP|GIF|PNG|JPEG|ogg|mpg|mpeg|mpg4|zip|bz2|rar|xls|docx|avi|djvu|mp4|rtf|ico)$ { root /var/www/jmredev; expires 60; slowfs_cache fastcache; slowfs_cache_key $uri; slowfs_cache_valid 7d; access_log off; } location ~* \.(css|js)$ { root /var/www/jmredev; expires 60; slowfs_cache fastcache; slowfs_cache_key $uri; slowfs_cache_valid 5m; access_log off; } location ~* \.(mjs|mcss)$ { set $domain www.j########; # Change this to your site's domain name set $root_fcgi /var/www/fastcache/; # Change this to the public root folder of your site set $root_cache /var/cache/nginx/minified; # Change this to a folder in which to cache the minified files set $min_dir /usr/local/nginx/minify/min; # Change this folder to wherever you put the Minify files include fastcgi_params; fastcgi_param SITE_ROOT $root_fcgi; fastcgi_param SCRIPT_FILENAME $min_dir/minifier.php; fastcgi_param PATH_INFO minifier.php; fastcgi_param SERVER_NAME $domain; fastcgi_param CACHE_DIR $root_cache; root $root_cache; expires max; gzip_static on; # You will need to have installed Nginx using the --with-http_gzip_static_module flag for this to work gzip_http_version 1.1; gzip_proxied expired no-cache no-store private auth; gzip_disable "MSIE [1-6]\."; gzip_vary on; # If there is not already a cached copy, create one if (!-f $request_filename) { root $root_fcgi; fastcgi_pass 127.0.0.1:9000; } } location ^~ /blog/sites/default/files/ { proxy_redirect off; access_log off; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass https://ssl-apache_cluster; } } =========================================================================== When I try and start NGINX I get the following error: reloading nginx configuration: nginx: [emerg] unknown directive "ssl" in /etc/nginx/sites-enabled/j#########l_ssl:21 And this error in the browser: SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long) I am running Ubuntu server 10.04.2 LTS and NGINX 10.0.3 Many thanks Lawrence -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at ohlste.in Sun Mar 11 12:42:45 2012 From: jim at ohlste.in (Jim Ohlstein) Date: Sun, 11 Mar 2012 08:42:45 -0400 Subject: ssl problems In-Reply-To: References: Message-ID: <4F5C9DC5.9060503@ohlste.in> On 3/11/12 8:38 AM, Lawrence Strydom wrote: > Hi List > > I inherited the following setup: > > nginx reverse caching proxy load balancing to two real servers. I am > trying to get SSL working. > > Here is my config: > > ++++++++++++++++++++++++++++++++++++++++++++ > upstream ssl-apache_cluster { > server 10.0.0.3:443 ; > server 10.0.0.6:443 ; > fair; > } > > server { > listen 196.37.50.51:443 ; > client_max_body_size 5M; > client_body_buffer_size 128k; > server_name######################; > access_log /var/log/nginx/##########.access.log; > > ssl on; > ssl_certificate /etc/nginx/ssl/#########.crt; > ssl_certificate_key /etc/nginx/ssl/domain.key; > ssl_session_cache shared:SSL:10m; > > > location / { > access_log off; > proxy_set_header X-Forwarded-Host $host; > proxy_set_header X-Forwarded-Server $host; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_pass https://ssl-apache_cluster; > } > location ~* > \.(jpg|jpeg|peg|PEG|gif|png|bmp|flv|pdf|ps|doc|mp3|wmv|wma|wav|swf|JPG|BMP|GIF|PNG|JPEG|ogg|mpg|mpeg|mpg4|zip|bz2|rar|xls|docx|avi|djvu|mp4|rtf|ico)$ > { > root /var/www/jmredev; > expires 60; > slowfs_cache fastcache; > slowfs_cache_key $uri; > slowfs_cache_valid 7d; > access_log off; > } > > location ~* \.(css|js)$ { > root /var/www/jmredev; > expires 60; > slowfs_cache fastcache; > slowfs_cache_key $uri; > slowfs_cache_valid 5m; > access_log off; > } > > > location ~* \.(mjs|mcss)$ { > set $domain www.j########; # Change this to your site's > domain name > set $root_fcgi /var/www/fastcache/; # Change this to the public > root folder of your site > set $root_cache /var/cache/nginx/minified; # Change this to a > folder in which to cache the minified files > set $min_dir /usr/local/nginx/minify/min; # Change this > folder to wherever you put the Minify files > > include fastcgi_params; > fastcgi_param SITE_ROOT $root_fcgi; > fastcgi_param SCRIPT_FILENAME $min_dir/minifier.php; > fastcgi_param PATH_INFO minifier.php; > fastcgi_param SERVER_NAME $domain; > fastcgi_param CACHE_DIR $root_cache; > > root $root_cache; > > expires max; > > gzip_static on; # You will need to have installed Nginx using the > --with-http_gzip_static_module flag for this to work > gzip_http_version 1.1; > gzip_proxied expired no-cache no-store private auth; > gzip_disable "MSIE [1-6]\."; > gzip_vary on; > > # If there is not already a cached copy, create one > if (!-f $request_filename) { > root $root_fcgi; > fastcgi_pass 127.0.0.1:9000 ; > } > } > > > location ^~ /blog/sites/default/files/ { > proxy_redirect off; > > access_log off; > proxy_set_header X-Forwarded-Host $host; > proxy_set_header X-Forwarded-Server $host; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_pass https://ssl-apache_cluster; > } > > > } > > > =========================================================================== > > When I try and start NGINX I get the following error: > > reloading nginx configuration: nginx: [emerg] unknown directive "ssl" in > /etc/nginx/sites-enabled/j#########l_ssl:21 > Most likely nginx is built without ssl. What's the output of nginx -V ? > And this error in the browser: > > SSL received a record that exceeded the maximum permissible length. > > (Error code: ssl_error_rx_record_too_long) > > > I am running Ubuntu server 10.04.2 LTS and NGINX 10.0.3 > > > Many thanks > > Lawrence > > > > -- Jim Ohlstein From nginx-forum at nginx.us Sun Mar 11 15:20:15 2012 From: nginx-forum at nginx.us (auxbuss) Date: Sun, 11 Mar 2012 11:20:15 -0400 (EDT) Subject: vhost error_log ignored with passenger In-Reply-To: References: Message-ID: <13cbc7bb600e8f00cf2d8ac1eb12c640.NginxMailingListEnglish@forum.nginx.org> I can confirm this. nginx version: nginx/1.0.12 Phusion Passenger version 3.0.11 In my case, I have error_log defined at all three levels, as described here: http://wiki.nginx.org/SeparateErrorLoggingPerVirtualHost Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223288,223729#msg-223729 From gpakosz at yahoo.fr Sun Mar 11 16:18:39 2012 From: gpakosz at yahoo.fr (=?ISO-8859-1?Q?Gr=E9gory_Pakosz?=) Date: Sun, 11 Mar 2012 17:18:39 +0100 Subject: access_log and error_log ownership Message-ID: Hello, I noticed the following behavior. 1) stop nginx (/etc/init.d/nginx stop on a debian box) 2) remove all logs in /var/log/nginx/ 3) start nginx now /var/log/nginx/access.log and /var/log/nginx/error.log are owned by root:root. in fact it's the same for all other vhosts log files. 4) issue kill -USR1 `cat /var/run/nginx.pid` now /var/log/nginx/access.log and /var/log/nginx/error.log are owned by www-data:root, where www-data is nginx's user as per /etc/nginx/nginx.conf configuration file. same for all vhosts log files. Why is it so? Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun Mar 11 16:33:23 2012 From: nginx-forum at nginx.us (auxbuss) Date: Sun, 11 Mar 2012 12:33:23 -0400 (EDT) Subject: vhost error_log ignored with passenger In-Reply-To: <13cbc7bb600e8f00cf2d8ac1eb12c640.NginxMailingListEnglish@forum.nginx.org> References: <13cbc7bb600e8f00cf2d8ac1eb12c640.NginxMailingListEnglish@forum.nginx.org> Message-ID: When reopening $stderr in "a" (append) mode, the file is not written to. However, when reopening with "w" (write) mode, things work as expected. Also, since I have the server error log set to debug, reopening $stderr also results in other messages being written. For example, info messages. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223288,223731#msg-223731 From mdounin at mdounin.ru Sun Mar 11 17:03:45 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 11 Mar 2012 21:03:45 +0400 Subject: access_log and error_log ownership In-Reply-To: References: Message-ID: <20120311170345.GU67687@mdounin.ru> Hello! On Sun, Mar 11, 2012 at 05:18:39PM +0100, Gr?gory Pakosz wrote: > Hello, > > I noticed the following behavior. > > 1) stop nginx (/etc/init.d/nginx stop on a debian box) > 2) remove all logs in /var/log/nginx/ > 3) start nginx > > now /var/log/nginx/access.log and /var/log/nginx/error.log are owned by > root:root. > > in fact it's the same for all other vhosts log files. > > 4) issue kill -USR1 `cat /var/run/nginx.pid` > > now /var/log/nginx/access.log and /var/log/nginx/error.log are owned by > www-data:root, where www-data is nginx's user as per /etc/nginx/nginx.conf > configuration file. > > same for all vhosts log files. > > Why is it so? When reopening log files nginx has to do this from inside worker processes, and to be able to do so it chown's them to a user under which nginx worker processes are running. Maxim Dounin From nginx-forum at nginx.us Mon Mar 12 03:02:57 2012 From: nginx-forum at nginx.us (cheneydeng) Date: Sun, 11 Mar 2012 23:02:57 -0400 (EDT) Subject: About FIN_WAIT2 status Message-ID: <3a57f8791850662f73c75416fec224c0.NginxMailingListEnglish@forum.nginx.org> Hi all, I used the nginx as reverse proxy to forward requests,and i found nginx soon get into FIN_WAIT2 status while the client was keeping send requests.How to delay the time to get into FIN_WAIT2 or totally avoid it? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223739,223739#msg-223739 From quintinpar at gmail.com Mon Mar 12 04:17:18 2012 From: quintinpar at gmail.com (Quintin Par) Date: Mon, 12 Mar 2012 09:47:18 +0530 Subject: Two type of rate limiting for based on IP address Message-ID: Hi all, How can I maintain two rate limit strategies?One for spiders and one for regular users? I can get the IP address list of spiders from http://www.iplists.com/ . Can I separate it by geo? Have people attempted this? My website is being pounded by some screen scrapers and I want to block them, but not at the risk of blocking search engine spiders. -Quintin -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Mar 12 05:23:30 2012 From: nginx-forum at nginx.us (Eagleye_Tiger) Date: Mon, 12 Mar 2012 01:23:30 -0400 (EDT) Subject: The problem about main thread and worker thread processing the same event Message-ID: <161b7ba03b56ede6102384337eee10f5.NginxMailingListEnglish@forum.nginx.org> In the case of work process is configured to support multi-threading in the following scene, there is an event at the same time will be handled by the main thread and worker thread. step1: in ngx_process_events_and_timers function, the main thread get the accept lock and set the ngx_accept_mutex_held to 1, at this time, the flags | = NGX_POST_EVENTS. And then enter ngx_process_events (epoll, under for ngx_epoll_process_events function) function, all received non-accept epoll events will be added to the the queue ngx_posted_events; step2: in the main thread of the work process handler function ngx_worker_process_cycle to, inform all the worker threads to process events in the queue ngx_posted_events . step3: the main thread to re-enter the event loop, try to grab the accept lock, no grab, ngx_accept_mutex_held be set to 0, then, the flags = 0. Then enter ngx_process_events, received all non-accept epoll events. The flag is not NGX_POST_EVENTS, Therefore, directly calling the event handler to handle the event. The problem lies here: If in step2 a worker thread is processing a connection event ev1 (c-> read or c-> write), while in step3 connection produced a similar event ev1 (c-> the read or c-> write), the main thread and worker thread handle the same event conflictly. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223741,223741#msg-223741 From mdounin at mdounin.ru Mon Mar 12 10:26:38 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 12 Mar 2012 14:26:38 +0400 Subject: The problem about main thread and worker thread processing the same event In-Reply-To: <161b7ba03b56ede6102384337eee10f5.NginxMailingListEnglish@forum.nginx.org> References: <161b7ba03b56ede6102384337eee10f5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120312102638.GX67687@mdounin.ru> Hello! On Mon, Mar 12, 2012 at 01:23:30AM -0400, Eagleye_Tiger wrote: > In the case of work process is configured to support multi-threading in > the following scene, there is an event at the same time will be handled > by the main thread and worker thread. Thread support is known to be broken and disabled for reason. Maxim Dounin From nbubingo at gmail.com Mon Mar 12 14:14:44 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Mon, 12 Mar 2012 22:14:44 +0800 Subject: [doc] A short announce In-Reply-To: <20120307195225.GA82145@lo0.su> References: <20120307195225.GA82145@lo0.su> Message-ID: Good, thanks for your hard work. 2012/3/8 Ruslan Ermilov : > We've made an alphabetical index of nginx directives available at > ? ? ? ?http://nginx.org/en/docs/dirindex.html > > And if you'd like to go straight to the description of a particular > directive, here's a short way: > ? ? ? ?http://nginx.org/r/proxy_http_version > (Substitute any other directive instead of "proxy_http_version".) > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From appa at perusio.net Mon Mar 12 14:34:11 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 12 Mar 2012 15:34:11 +0100 Subject: Two type of rate limiting for based on IP address In-Reply-To: References: Message-ID: > Hi all, > > How can I maintain two rate limit strategies?One for spiders and one for > regular users? > > I can get the IP address list of spiders from > > http://www.iplists.com/ . Can I separate it by geo? Have people attempted > this? > > My website is being pounded by some screen scrapers and I want to block > them, but not at the risk of blocking search engine spiders. Do you understand that by going that way, regular users will be subject to the same request limiting of the bad spiders? You can try to do further selection on UA, but bad spiders have the habit of providing bogus UA strings. At the http level: geo $good_spider { default 0; #list all good spider IPs } limit_req_zone $binary_remote_addr zone=bad_spiders:10m rate=1r/s; On the vhost (server level): location / { limit_req zone=bad_spiders burst=5; error_page 418 @good-spiders; if ($good_spider) { return 418; } #... } location @good-spiders { # no limits here #... } --appa From nginx-forum at nginx.us Mon Mar 12 14:35:03 2012 From: nginx-forum at nginx.us (alexscott) Date: Mon, 12 Mar 2012 10:35:03 -0400 (EDT) Subject: upstream keepalive - call for testing In-Reply-To: <20110801160725.GH1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> Message-ID: <88993bc7ea8e131e93e44110c6a27b7a.NginxMailingListEnglish@forum.nginx.org> Ahh, sorry for my stupidity!! Anyway - the patches that's attached to this topic - are they patched in the devel release of nginx as well? Also can the module support HTTP connections currently? Br., Alex. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,223759#msg-223759 From appa at perusio.net Mon Mar 12 14:46:52 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 12 Mar 2012 15:46:52 +0100 Subject: Two type of rate limiting for based on IP address In-Reply-To: References: Message-ID: <439e41813d09003fe63089d7a911f1a2.squirrel@damiao.org> > > location / { > limit_req zone=bad_spiders burst=5; > > error_page 418 @good-spiders; Oops. This should be: error_page 418 =200 @good-spiders; --appa From mdounin at mdounin.ru Mon Mar 12 14:54:12 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 12 Mar 2012 18:54:12 +0400 Subject: upstream keepalive - call for testing In-Reply-To: <88993bc7ea8e131e93e44110c6a27b7a.NginxMailingListEnglish@forum.nginx.org> References: <20110801160725.GH1137@mdounin.ru> <88993bc7ea8e131e93e44110c6a27b7a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120312145412.GH67687@mdounin.ru> Hello! On Mon, Mar 12, 2012 at 10:35:03AM -0400, alexscott wrote: > Ahh, sorry for my stupidity!! > > Anyway - the patches that's attached to this topic - are they patched in > the devel release of nginx as well? > Also can the module support HTTP connections currently? The patches and the upstream keepalive module are included in 1.1.x, instructions how configure nginx to use persistent connections with upstream servers are available here: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive Maxim Dounin From iqbal at aroussi.name Mon Mar 12 15:07:45 2012 From: iqbal at aroussi.name (Iqbal Aroussi) Date: Mon, 12 Mar 2012 15:07:45 +0000 Subject: nginx status active connections In-Reply-To: <20120310204923.GM67687@mdounin.ru> References: <20120310204923.GM67687@mdounin.ru> Message-ID: Hi Maxim, Thanks a lot for you help. Best Regards * -- * *Iqbal Aroussi* *+212 665 025 032* *iqbal at aroussi.name* On Sat, Mar 10, 2012 at 20:49, Maxim Dounin wrote: > Hello! > > On Thu, Mar 08, 2012 at 02:37:37PM +0000, Iqbal Aroussi wrote: > > > Hi, > > > > We do have a few high load web servers behind two load balancers running > * > > nginx/1.0.0* > > I upgraded two of them to *nginx/1.0.12* all servers are running well > > despite the version of nginx > > However I've noticed that there is a big difference in active connections > > between the old version > > and the new version. > > > > What do you think about it, is it bad or good. > > This is likely due to lingering close changes in 1.0.6: > > *) Bugfix: in closing connection for pipelined requests. > > You may fine-tune the behaviour via lingering_close, > lingering_time and lingering_timeout directives (see > http://nginx.org/r/lingering_close), though I would rather > recommend to keep the default. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Mar 12 17:40:17 2012 From: nginx-forum at nginx.us (alexscott) Date: Mon, 12 Mar 2012 13:40:17 -0400 (EDT) Subject: upstream keepalive - call for testing In-Reply-To: <20110801160725.GH1137@mdounin.ru> References: <20110801160725.GH1137@mdounin.ru> Message-ID: Hi Maxim, thank you very much. What would you suggest to set keepalive connections to, if I'm going to keep a persistent connection to a remote website, with Nginx being setup as a proxy caching server? Br., Alex. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,223767#msg-223767 From mdounin at mdounin.ru Mon Mar 12 17:59:38 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 12 Mar 2012 21:59:38 +0400 Subject: upstream keepalive - call for testing In-Reply-To: References: <20110801160725.GH1137@mdounin.ru> Message-ID: <20120312175938.GL67687@mdounin.ru> Hello! On Mon, Mar 12, 2012 at 01:40:17PM -0400, alexscott wrote: > Hi Maxim, > thank you very much. > > What would you suggest to set keepalive connections to, if I'm going to > keep a persistent connection to a remote website, with Nginx being setup > as a proxy caching server? This depends on expected load and a number of connections upstream server is able to handle. Usually keepalive 1; is a good starting point. Maxim Dounin From nginx-forum at nginx.us Mon Mar 12 18:38:08 2012 From: nginx-forum at nginx.us (Hates_) Date: Mon, 12 Mar 2012 14:38:08 -0400 (EDT) Subject: Cannot log a cookie with a dash in the name Message-ID: I am trying to log cookies but they have a dash in the name as such: "Member-v1.0=$cookie_Member-v1.0" My logs come through as: Member-v1.0=--v1.0 Is there a work around? I've tried wrapping the name in curly brackets and also using underscores but get an error about an unmatched bracket or no value. I've tried the following formats: "Member-v1.0=${cookie_Member-v1.0}" "Member-v1.0=$cookie_Member_v1.0" "Member-v1.0=$cookie_Member_v1_0" Any help would be greatly appreciated. I don't want to have to move to Apache :\ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223770,223770#msg-223770 From nginx-forum at nginx.us Mon Mar 12 19:55:51 2012 From: nginx-forum at nginx.us (alexscott) Date: Mon, 12 Mar 2012 15:55:51 -0400 (EDT) Subject: upstream keepalive - call for testing In-Reply-To: References: <20110801160725.GH1137@mdounin.ru> Message-ID: <6d7099c68b152cc9e288b4fb0041aa19.NginxMailingListEnglish@forum.nginx.org> The upstream server is able to handle all requests if necessary. So will you still suggest keepalive 1; for such a config or do you have any other ideas as well? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213207,223772#msg-223772 From ru at nginx.com Mon Mar 12 20:40:56 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Tue, 13 Mar 2012 00:40:56 +0400 Subject: Cannot log a cookie with a dash in the name In-Reply-To: References: Message-ID: <20120312204056.GB29710@lo0.su> On Mon, Mar 12, 2012 at 02:38:08PM -0400, Hates_ wrote: > I am trying to log cookies but they have a dash in the name as such: > > "Member-v1.0=$cookie_Member-v1.0" > > My logs come through as: > > Member-v1.0=--v1.0 > > Is there a work around? > > I've tried wrapping the name in curly brackets and also using > underscores but get an error about an unmatched bracket or no value. > I've tried the following formats: > > "Member-v1.0=${cookie_Member-v1.0}" > > "Member-v1.0=$cookie_Member_v1.0" > > "Member-v1.0=$cookie_Member_v1_0" > > Any help would be greatly appreciated. I don't want to have to move to > Apache :\ Currently, the names of nginx variables can be composed from upper and lower English letters, digits and underscores. The dash and dot characters are thus invalid. Without patching the code, you should be able to log the entire value of the "Cookie" request header field with the $http_cookie variable. It can also be useful if you have cookies whose names only differ in case as $cookie_ doesn't differentiate between upper and lower case: http { server { location / { return 200 'http_cookie=$http_cookie cookie_a=$cookie_a cookie_A=$cookie_A\n'; } } } $ curl -b 'a=a;A=A' http://localhost:8000/test http_cookie=a=a;A=A cookie_a=a cookie_A=a From ne at vbart.ru Mon Mar 12 20:57:17 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 13 Mar 2012 00:57:17 +0400 Subject: Cannot log a cookie with a dash in the name In-Reply-To: References: Message-ID: <201203130057.17280.ne@vbart.ru> On Monday 12 March 2012 22:38:08 Hates_ wrote: > I am trying to log cookies but they have a dash in the name as such: > > "Member-v1.0=$cookie_Member-v1.0" > > My logs come through as: > > Member-v1.0=--v1.0 > > Is there a work around? > > I've tried wrapping the name in curly brackets and also using > underscores but get an error about an unmatched bracket or no value. > I've tried the following formats: > > "Member-v1.0=${cookie_Member-v1.0}" > > "Member-v1.0=$cookie_Member_v1.0" > > "Member-v1.0=$cookie_Member_v1_0" > > Any help would be greatly appreciated. I don't want to have to move to > Apache :\ > The map module may help: map $http_cookie $member_cookie { default NONE; ^Member-v1\.0=(?P[^;]+) $mc; } http://wiki.nginx.org/HttpMapModule wbr, Valentin V. Bartenev From ne at vbart.ru Mon Mar 12 23:11:09 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 13 Mar 2012 03:11:09 +0400 Subject: Cannot log a cookie with a dash in the name In-Reply-To: <201203130057.17280.ne@vbart.ru> References: <201203130057.17280.ne@vbart.ru> Message-ID: <201203130311.09716.ne@vbart.ru> On Tuesday 13 March 2012 00:57:17 Valentin V. Bartenev wrote: [...] > > The map module may help: > > map $http_cookie $member_cookie { > default NONE; > ^Member-v1\.0=(?P[^;]+) $mc; > } > Oops.. must be: map $http_cookie $member_cookie { default ''; ~Member-v1\.0=(?P[^;]+) $mc; } wbr, Valentin V. Bartenev From nginx-forum at nginx.us Tue Mar 13 09:13:38 2012 From: nginx-forum at nginx.us (pprett) Date: Tue, 13 Mar 2012 05:13:38 -0400 (EDT) Subject: Nginx Stats Read - Write difference Message-ID: <49480136b3996f084a3c798aadc03ea0.NginxMailingListEnglish@forum.nginx.org> Hi, we are currently looking for a bottleneck in our application stack. We use Nginx as a reverse proxy which dispatches requests to an asynchronous backend (Twisted Python). When looking at the stub_stats output we notice a large deviation between reads and writes. Strangely, we notice substantially more reads than writes (about 4-6 times as much). Obviously read and write stats are only a snapshot of the counts in this very moment in which we poll stub_stats. Should we worry about such a huge discrepancy between reads and writes? How should we interpret these numbers? More detailed plots can be found here: Read/Writes https://picasaweb.google.com/lh/photo/u1wm7uUBECTgSh_hrCtsutMTjNZETYmyPJy0liipFm0?feat=directlink Waits https://picasaweb.google.com/lh/photo/1A4I6GJblxoZMGWemx25GtMTjNZETYmyPJy0liipFm0?feat=directlink thanks, Peter Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223788,223788#msg-223788 From nginx-forum at nginx.us Tue Mar 13 09:27:49 2012 From: nginx-forum at nginx.us (Hates_) Date: Tue, 13 Mar 2012 05:27:49 -0400 (EDT) Subject: Cannot log a cookie with a dash in the name In-Reply-To: References: Message-ID: <0f18d6d91c9c3dc3fc1bd681f681b1c9.NginxMailingListEnglish@forum.nginx.org> Thanks a lot, the mapping worked. I just had to escape the semi colon to get it to work :) Apache averted! :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223770,223790#msg-223790 From nginx-forum at nginx.us Tue Mar 13 12:46:25 2012 From: nginx-forum at nginx.us (Infinitnet) Date: Tue, 13 Mar 2012 08:46:25 -0400 (EDT) Subject: Images not loading sometimes with NGINX as RP Message-ID: <6efd982cf54edfbcf9dc439dabf0c4b2.NginxMailingListEnglish@forum.nginx.org> Hello NGINX users and devs, it's not the first time now, that I have the problem that some images are just not loading sometimes (only after a few refreshes, gif images in this case) with NGINX as reverse proxy. I haven't figured out yet why, I've had this problem with the old 0.x branch a few years ago, even with the default config and now I have the same problem with the 1.x branch and an advanced config with caching enabled (doesn't matter if I enable or disable it, have already tried that). Has anyone had the same problem before or has a clue why that could be? Greetings Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223791,223791#msg-223791 From appa at perusio.net Tue Mar 13 12:53:57 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 13 Mar 2012 13:53:57 +0100 Subject: Images not loading sometimes with NGINX as RP In-Reply-To: <6efd982cf54edfbcf9dc439dabf0c4b2.NginxMailingListEnglish@forum.nginx.org> References: <6efd982cf54edfbcf9dc439dabf0c4b2.NginxMailingListEnglish@forum.nginx.org> Message-ID: > Hello NGINX users and devs, > > it's not the first time now, that I have the problem that some images > are just not loading sometimes (only after a few refreshes, gif images > in this case) with NGINX as reverse proxy. I haven't figured out yet > why, I've had this problem with the old 0.x branch a few years ago, even > with the default config and now I have the same problem with the 1.x > branch and an advanced config with caching enabled (doesn't matter if I > enable or disable it, have already tried that). Has anyone had the same > problem before or has a clue why that could be? > > Greetings In order to be able to assist you we need the config. Without it it's like shooting in the dark. --appa From nginx-forum at nginx.us Tue Mar 13 13:04:48 2012 From: nginx-forum at nginx.us (Infinitnet) Date: Tue, 13 Mar 2012 09:04:48 -0400 (EDT) Subject: Images not loading sometimes with NGINX as RP In-Reply-To: References: Message-ID: <7ea5fcaab46e0cda2964f01ed84a0b9f.NginxMailingListEnglish@forum.nginx.org> As I said, I've also had this before with the default config. Anyway, here you go: nginx.conf ----------- user nginx; worker_processes 6; worker_rlimit_nofile 8000; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 4096; use epoll; } http { include /etc/nginx/mime.types; default_type application/octet-stream; open_file_cache max=60000 inactive=300s; open_file_cache_valid 360s; open_file_cache_min_uses 2; open_file_cache_errors off; server_names_hash_bucket_size 64; 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; client_body_temp_path /var/spool/nginx-client-body 1 2; client_max_body_size 32m; client_body_buffer_size 128k; client_header_buffer_size 2k; large_client_header_buffers 4 16k; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay off; keepalive_timeout 3; keepalive_requests 10; client_body_timeout 5; client_header_timeout 5; send_timeout 5; proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=nginxcache:10m inactive=10m max_size=1000m; proxy_temp_path /var/cache/nginx/proxy; proxy_cache_key "$scheme://$host$request_uri"; gzip on; gzip_http_version 1.0; gzip_comp_level 1; gzip_proxied any; gzip_min_length 10; gzip_buffers 16 8k; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_disable "MSIE [1-6].(?!.*SV1)"; gzip_vary on; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_max_temp_file_size 0; proxy_connect_timeout 30; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; include /etc/nginx/conf.d/*.conf; } vhost.conf ------------ upstream server { server 1.2.3.4:80 weight=1 fail_timeout=30s; } server { listen 80; server_name .domain.com; access_log /var/log/nginx/domain.com_access.log; error_log /var/log/nginx/domain.com.net_error.log; location / { proxy_pass http://server; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_cache nginxcache; proxy_cache_valid 200 30m; } location ~* \.(jpg|png|gif|jpeg|css|js|swf|doc|pdf|xls|ppt|docx|pptx|xlsx)$ { proxy_cache_valid 200 30m; expires 604800; proxy_pass http://server; proxy_cache nginxcache; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223791,223794#msg-223794 From baishen.lists at gmail.com Tue Mar 13 13:36:14 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Tue, 13 Mar 2012 09:36:14 -0400 Subject: upstream response is buffered to a temporary file Message-ID: I installed nginx with the defaults. I'm using it as a reverse proxy, but not caching. However, I keep getting a lot of entries in the log file saying that an "upstream response is buffered to a temporary file". Is there a way to turn this off? Will nginx clean out the cache, or do I have to do it manually? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From baishen.lists at gmail.com Tue Mar 13 13:38:56 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Tue, 13 Mar 2012 09:38:56 -0400 Subject: Custom error pages Message-ID: I'm using nginx to reverse proxy my web server. I want to be able to return a custom 503 page from nginx when I choose. I'm able to get nginx to return a 503 page by adding it to the top of the location. But that just returns the default nginx error page. How to do change this to a custom page? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From baishen.lists at gmail.com Tue Mar 13 14:45:51 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Tue, 13 Mar 2012 10:45:51 -0400 Subject: nginx recreating default configuration files Message-ID: I'm not sure how or why this happened, but nginx recreating the default configuration files in the conf.d directory. This caused it to attempt to bind to all interfaces on my server. Is there a way to prevent this from happening in the future? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at develix.com Tue Mar 13 16:09:50 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 13 Mar 2012 09:09:50 -0700 Subject: nginx recreating default configuration files In-Reply-To: References: Message-ID: <1331654990.31679.19.camel@portable-evil> On Tue, 2012-03-13 at 10:45 -0400, Bai Shen wrote: > I'm not sure how or why this happened, but nginx recreating the > default configuration files in the conf.d directory. This caused it > to attempt to bind to all interfaces on my server. > > Is there a way to prevent this from happening in the future? Nginx doesn't ever write configuration files. How did you install Nginx? My first guess is that you are using a non-official repository (i.e. a PPA) and they pushed a new configuration. Regards, Cliff From baishen.lists at gmail.com Tue Mar 13 16:57:08 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Tue, 13 Mar 2012 12:57:08 -0400 Subject: nginx recreating default configuration files In-Reply-To: <1331654990.31679.19.camel@portable-evil> References: <1331654990.31679.19.camel@portable-evil> Message-ID: I did the install by adding the nginx repo to my RH box. Then doing yum install nginx. I haven't done an update, so I'm not sure how anyone could have pushed a new configuration. On Tue, Mar 13, 2012 at 12:09 PM, Cliff Wells wrote: > On Tue, 2012-03-13 at 10:45 -0400, Bai Shen wrote: > > I'm not sure how or why this happened, but nginx recreating the > > default configuration files in the conf.d directory. This caused it > > to attempt to bind to all interfaces on my server. > > > > Is there a way to prevent this from happening in the future? > > Nginx doesn't ever write configuration files. How did you install > Nginx? My first guess is that you are using a non-official repository > (i.e. a PPA) and they pushed a new configuration. > > Regards, > Cliff > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at develix.com Tue Mar 13 17:52:03 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 13 Mar 2012 10:52:03 -0700 Subject: nginx recreating default configuration files In-Reply-To: References: <1331654990.31679.19.camel@portable-evil> Message-ID: <1331661123.31679.24.camel@portable-evil> On Tue, 2012-03-13 at 12:57 -0400, Bai Shen wrote: > I did the install by adding the nginx repo to my RH box. Then doing > yum install nginx. I haven't done an update, so I'm not sure how > anyone could have pushed a new configuration. My only guess then would be that somehow you reverted it yourself, or it was somehow never changed in the first place. I know I've done similar things (having the same file open in multiple editors, renaming a file and forgetting to reopen the buffer in emacs, etc). Regards, Cliff From francis at daoine.org Tue Mar 13 23:40:23 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 13 Mar 2012 23:40:23 +0000 Subject: Custom error pages In-Reply-To: References: Message-ID: <20120313234023.GJ18773@craic.sysops.org> On Tue, Mar 13, 2012 at 09:38:56AM -0400, Bai Shen wrote: Hi there, > I'm able to get nginx > to return a 503 page by adding it to the top of the location. But that > just returns the default nginx error page. How to do change this to a > custom page? Does http://www.nginx.org/r/error_page give the info you need? f -- Francis Daly francis at daoine.org From francis at daoine.org Tue Mar 13 23:49:46 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 13 Mar 2012 23:49:46 +0000 Subject: upstream response is buffered to a temporary file In-Reply-To: References: Message-ID: <20120313234946.GK18773@craic.sysops.org> On Tue, Mar 13, 2012 at 09:36:14AM -0400, Bai Shen wrote: Hi there, > I installed nginx with the defaults. I'm using it as a reverse proxy, but > not caching. However, I keep getting a lot of entries in the log file > saying that an "upstream response is buffered to a temporary file". Is > there a way to turn this off? If your upstream is from a proxy_pass directive, have a look at http://www.nginx.org/r/proxy_buffering and linked content. > Will nginx clean out the cache, or do I have > to do it manually? This is a buffer, not a cache, and (I believe) you shouldn't have to do anything manually about it. All the best, f -- Francis Daly francis at daoine.org From wtymdjs at gmail.com Wed Mar 14 03:55:46 2012 From: wtymdjs at gmail.com (adam estes) Date: Tue, 13 Mar 2012 23:55:46 -0400 Subject: Rebuilding Nginx Message-ID: I want to add a module to my nginx build. The only problem is that I don't know where the source files are located at. How do I find them, and then how to I rebuild with of my modules, plus the new one? From cliff at develix.com Wed Mar 14 06:48:35 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 13 Mar 2012 23:48:35 -0700 Subject: Rebuilding Nginx In-Reply-To: References: Message-ID: <1331707715.31679.28.camel@portable-evil> On Tue, 2012-03-13 at 23:55 -0400, adam estes wrote: > I want to add a module to my nginx build. > > The only problem is that I don't know where the source files are located at. How did you install Nginx? If you installed from a repository (e.g. with yum or apt-get), then there is no source. You will need to download the tar archive and build from source. > How do I find them, and then how to I rebuild with of my modules, plus > the new one? Usually you use something like: ./configure --add-module=/path/to/module/source --other-options make make install You can get a good idea of what --other-options should be by running nginx -V and noting the configure arguments of your current binary. Regards, Cliff From davide.damico at contactlab.com Wed Mar 14 10:18:09 2012 From: davide.damico at contactlab.com (Davide D'Amico) Date: Wed, 14 Mar 2012 11:18:09 +0100 Subject: Questions about fair_upstream module Message-ID: Hi, I'm actually serving pages using nginx-1.0.13 on fbsd-8.2 amd64 with 3 backends (fbsd-8.2 amd64 with apache-2.2.22) and I'm using the default rr upstream algorithm. I am trying to switch to an algorithm different from rr, and I am thinking to the fair upstream module. Well, the homepage of the project seems quite old (and so it's ticketing system: http://nginx.localdomain.pl/report/6) and that's not a good starting point :) Anyway, "googling" around searching for tips and use cases, I found: http://affectioncode.wordpress.com/2008/06/11/comparing-nginx-and-haproxy-for-web-applications/ that seems a very old post. Does anyone use fair-upstream module in production? Any hints or tips before trying it? Differences between fair-module and haproxy? Thanks in advance, -- d. From osa at FreeBSD.org.ru Wed Mar 14 11:18:16 2012 From: osa at FreeBSD.org.ru (Sergey A. Osokin) Date: Wed, 14 Mar 2012 15:18:16 +0400 Subject: Questions about fair_upstream module In-Reply-To: References: Message-ID: <20120314111816.GA84365@FreeBSD.org.ru> On Wed, Mar 14, 2012 at 11:18:09AM +0100, Davide D'Amico wrote: > Hi, > I'm actually serving pages using nginx-1.0.13 on fbsd-8.2 amd64 with 3 > backends (fbsd-8.2 amd64 with apache-2.2.22) and I'm using the default rr > upstream algorithm. > > I am trying to switch to an algorithm different from rr, and I am thinking > to the fair upstream module. > > Well, the homepage of the project seems quite old (and so it's ticketing > system: http://nginx.localdomain.pl/report/6) and that's not a good > starting point :) > > Anyway, "googling" around searching for tips and use cases, I found: > http://affectioncode.wordpress.com/2008/06/11/comparing-nginx-and-haproxy-for-web-applications/ > > that seems a very old post. > > Does anyone use fair-upstream module in production? Any hints or tips > before trying it? > > Differences between fair-module and haproxy? Just the note: nginx with nginx_upstream_fair module version 20090923 (i.e. dated material) available from FreeBSD ports tree. haproxy is the different product, the proxy server. -- Sergey A. Osokin osa at FreeBSD.org.ru osa at FreeBSD.org From baishen.lists at gmail.com Wed Mar 14 12:49:44 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Wed, 14 Mar 2012 08:49:44 -0400 Subject: nginx recreating default configuration files In-Reply-To: <1331661123.31679.24.camel@portable-evil> References: <1331654990.31679.19.camel@portable-evil> <1331661123.31679.24.camel@portable-evil> Message-ID: I'm not sure how that could have happened. I had renamed the files to add .orig to the end so nginx wouldn't pick them up. When I looked in the directory, there were two copies of the files. One with .orig and one without. On Tue, Mar 13, 2012 at 1:52 PM, Cliff Wells wrote: > On Tue, 2012-03-13 at 12:57 -0400, Bai Shen wrote: > > I did the install by adding the nginx repo to my RH box. Then doing > > yum install nginx. I haven't done an update, so I'm not sure how > > anyone could have pushed a new configuration. > > My only guess then would be that somehow you reverted it yourself, or it > was somehow never changed in the first place. I know I've done similar > things (having the same file open in multiple editors, renaming a file > and forgetting to reopen the buffer in emacs, etc). > > Regards, > Cliff > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From baishen.lists at gmail.com Wed Mar 14 12:51:06 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Wed, 14 Mar 2012 08:51:06 -0400 Subject: Custom error pages In-Reply-To: <20120313234023.GJ18773@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> Message-ID: IIRC, I tried that but wasn't able to get nginx to find my local error page. On Tue, Mar 13, 2012 at 7:40 PM, Francis Daly wrote: > On Tue, Mar 13, 2012 at 09:38:56AM -0400, Bai Shen wrote: > > Hi there, > > > I'm able to get nginx > > to return a 503 page by adding it to the top of the location. But that > > just returns the default nginx error page. How to do change this to a > > custom page? > > Does http://www.nginx.org/r/error_page give the info you need? > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From baishen.lists at gmail.com Wed Mar 14 12:52:50 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Wed, 14 Mar 2012 08:52:50 -0400 Subject: upstream response is buffered to a temporary file In-Reply-To: <20120313234946.GK18773@craic.sysops.org> References: <20120313234946.GK18773@craic.sysops.org> Message-ID: Is there a reason to have it on? Is there any recommended settings? On Tue, Mar 13, 2012 at 7:49 PM, Francis Daly wrote: > On Tue, Mar 13, 2012 at 09:36:14AM -0400, Bai Shen wrote: > > Hi there, > > > I installed nginx with the defaults. I'm using it as a reverse proxy, > but > > not caching. However, I keep getting a lot of entries in the log file > > saying that an "upstream response is buffered to a temporary file". Is > > there a way to turn this off? > > If your upstream is from a proxy_pass directive, have a look at > http://www.nginx.org/r/proxy_buffering and linked content. > > > Will nginx clean out the cache, or do I have > > to do it manually? > > This is a buffer, not a cache, and (I believe) you shouldn't have to do > anything manually about it. > > All the best, > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davide.damico at contactlab.com Wed Mar 14 13:50:36 2012 From: davide.damico at contactlab.com (Davide D'Amico) Date: Wed, 14 Mar 2012 14:50:36 +0100 Subject: Questions about fair_upstream module In-Reply-To: References: Message-ID: In data 14 marzo 2012 alle ore 13:00:00, ha scritto: > Message: 5 > Date: Wed, 14 Mar 2012 15:18:16 +0400 > From: "Sergey A. Osokin" > To: nginx at nginx.org > Subject: Re: Questions about fair_upstream module > Message-ID: <20120314111816.GA84365 at FreeBSD.org.ru> > Content-Type: text/plain; charset=koi8-r > On Wed, Mar 14, 2012 at 11:18:09AM +0100, Davide D'Amico wrote: >> Hi, >> I'm actually serving pages using nginx-1.0.13 on fbsd-8.2 amd64 with 3 >> backends (fbsd-8.2 amd64 with apache-2.2.22) and I'm using the default >> rr >> upstream algorithm. >> >> I am trying to switch to an algorithm different from rr, and I am >> thinking >> to the fair upstream module. >> >> Well, the homepage of the project seems quite old (and so it's ticketing >> system: http://nginx.localdomain.pl/report/6) and that's not a good >> starting point >> >> Anyway, "googling" around searching for tips and use cases, I found: >> http://affectioncode.wordpress.com/2008/06/11/comparing-nginx-and-haproxy-for-web-applications/ >> >> that seems a very old post. >> >> Does anyone use fair-upstream module in production? Any hints or tips >> before trying it? >> >> Differences between fair-module and haproxy? > Just the note: nginx with nginx_upstream_fair module version 20090923 > (i.e. dated material) available from FreeBSD ports tree. So if I wish to use upstream_fair I have to compile it? Or newer versions of upstream_fair don't compile on fbsd-8? > haproxy is the different product, the proxy server. > Yes, and I don't want to install other two server carp'ed in a chain to use haproxy :( -- d. From nginx-forum at nginx.us Wed Mar 14 14:10:46 2012 From: nginx-forum at nginx.us (gcaplan) Date: Wed, 14 Mar 2012 10:10:46 -0400 (EDT) Subject: Strange php-fpm problem... Message-ID: <22eb083c59866bac980076c5e7a0b151.NginxMailingListEnglish@forum.nginx.org> Hi folks Not strictly an Nginx issue, but got some great advice on php-fpm here before so though I'd trade on your generosity... ISSUE OVERVIEW 1) php-fpm is running fine on Ubuntu 12 2) I stupidly configure xdebug to run on the same port as php-fpm and try to restart php-fpm 3) I correct the misconfiguration, but now php-fpm won't start at all, even after a reboot. 4) The only diagnostics I can find are in boot.log: "Starting FastCGI server: No servers have been defined." No hits at all for this in Google. I have set up a pool which was working fine before the misconfiguration. DETAILS 1) If I run ">service php5-fpm start" there is a long pause, then the shell outputs "killed" 2) There is nothing in the php5-fpm log, even with log level debug, so it seems to hit the issue early in the process. 3) I've tried restarting with the xdebug config commented out, and with Nginx stopped. 4) I've tried rebooting 5) There's no orphaned pid file in /var/run, and no php-fpm processes running I've run out of ideas. Any help would be more than welcome. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223827,223827#msg-223827 From mdounin at mdounin.ru Wed Mar 14 14:56:38 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 14 Mar 2012 18:56:38 +0400 Subject: upstream response is buffered to a temporary file In-Reply-To: References: <20120313234946.GK18773@craic.sysops.org> Message-ID: <20120314145638.GR67687@mdounin.ru> Hello! On Wed, Mar 14, 2012 at 08:52:50AM -0400, Bai Shen wrote: > Is there a reason to have it on? Yes, the default "proxy_buffering on" is appropriate for most cases. It ensures minimal processing overhead and takes slow clients off your upstream servers (which are in many cases process-based and can't handle many connections). The "proxy_buffering off" is only appropriate in specific situations like long-running connections where you send small chunks of data periodically and need them to be immediately delivered to client(s). > Is there any recommended settings? The default is good enough. If it doesn't fit you needs, you may consider tuning proxy_buffers and/or proxy_max_temp_file_size. If you don't want to hit disk in any case, you may use proxy_max_temp_file_size 0; which disables disk buffering completely. Note that for obvious reasons it will limit nginx ability to offload slow clients from your backends. Maxim Dounin > > On Tue, Mar 13, 2012 at 7:49 PM, Francis Daly wrote: > > > On Tue, Mar 13, 2012 at 09:36:14AM -0400, Bai Shen wrote: > > > > Hi there, > > > > > I installed nginx with the defaults. I'm using it as a reverse proxy, > > but > > > not caching. However, I keep getting a lot of entries in the log file > > > saying that an "upstream response is buffered to a temporary file". Is > > > there a way to turn this off? > > > > If your upstream is from a proxy_pass directive, have a look at > > http://www.nginx.org/r/proxy_buffering and linked content. > > > > > Will nginx clean out the cache, or do I have > > > to do it manually? > > > > This is a buffer, not a cache, and (I believe) you shouldn't have to do > > anything manually about it. > > > > All the best, > > > > f > > -- > > Francis Daly francis at daoine.org > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed Mar 14 15:14:47 2012 From: nginx-forum at nginx.us (gcaplan) Date: Wed, 14 Mar 2012 11:14:47 -0400 (EDT) Subject: [SOLVED] Strange php-fpm problem In-Reply-To: <22eb083c59866bac980076c5e7a0b151.NginxMailingListEnglish@forum.nginx.org> References: <22eb083c59866bac980076c5e7a0b151.NginxMailingListEnglish@forum.nginx.org> Message-ID: <7520a9e7ca6874674f8cef0f1fc6a2da.NginxMailingListEnglish@forum.nginx.org> Discovered that xcache and xdebug are not compatible. For some reason, after trying to run them together php-fpm wouldn't start even though I had disabled xdebug. Disabling both xcache and xdebug has fixed the issue. Now I have to figure out how to get xcache working again... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223827,223832#msg-223832 From nginx-forum at nginx.us Wed Mar 14 17:05:55 2012 From: nginx-forum at nginx.us (Roddick) Date: Wed, 14 Mar 2012 13:05:55 -0400 (EDT) Subject: Please help with proxy_pass and trailing slash! Message-ID: <23fc298bbbd615b4d18029590e92e93a.NginxMailingListEnglish@forum.nginx.org> I have a php site with location /app served by Java app server on same server port 9001 What is in /app/ should become / (root) for Java app server I have this in config: server { ... index index.html index.htm index.php; location /app { proxy_pass http://localhost:9001; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_redirect off; } location / { # First attempt to serve request as file, then # as directory, then fall back to index.html try_files $uri $uri/ /index.php?$args; } location ~ index.php$ { try_files $uri =404; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } } with this configuration, Java server receives requests like "GET /app/" while it should receive "GET /" If I add trailing slash to proxy_pass: proxy_pass http://localhost:9001/; Then java server receives "GET //" and unable to serve that either. Do I need to involve rewrite here ? And how? or extra trailing slash is caused by other rewrite rules somehow? Thank you! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223839,223839#msg-223839 From ne at vbart.ru Wed Mar 14 18:06:01 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 14 Mar 2012 22:06:01 +0400 Subject: Please help with proxy_pass and trailing slash! In-Reply-To: <23fc298bbbd615b4d18029590e92e93a.NginxMailingListEnglish@forum.nginx.org> References: <23fc298bbbd615b4d18029590e92e93a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203142206.01618.ne@vbart.ru> On Wednesday 14 March 2012 21:05:55 Roddick wrote: > I have a php site with location /app served by Java app server on same > server port 9001 > > What is in /app/ should become / (root) for Java app server > > I have this in config: > > server { > ... > index index.html index.htm index.php; > > location /app { > > proxy_pass http://localhost:9001; > proxy_next_upstream error timeout invalid_header > http_500 http_502 http_503; > > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > > proxy_set_header X-Forwarded-Proto https; > > proxy_redirect off; > } > > location / { > # First attempt to serve request as file, then > # as directory, then fall back to index.html > try_files $uri $uri/ /index.php?$args; > } Just a side note, you don't need explicit set $args here. try_files $uri $uri/ /index.php; > location ~ index.php$ { > > try_files $uri =404; > > include fastcgi_params; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > fastcgi_pass 127.0.0.1:9000; > } > } > > with this configuration, Java server receives requests like "GET /app/" > while it should receive "GET /" > > If I add trailing slash to proxy_pass: > > proxy_pass http://localhost:9001/; > > Then java server receives "GET //" and unable to serve that either. > > Do I need to involve rewrite here ? And how? or extra trailing slash is > caused by other rewrite rules somehow? > Documentation already has answers to your questions: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass E.g., in your case: location /app/ { ... proxy_pass http://localhost:9001/; } wbr, Valentin V. Bartenev From nginx-forum at nginx.us Wed Mar 14 19:35:09 2012 From: nginx-forum at nginx.us (Samael) Date: Wed, 14 Mar 2012 15:35:09 -0400 (EDT) Subject: nginx build with OpenSSL 1.0.1 Message-ID: <3e3b17cd60c7ad1842393ab088ec1e8d.NginxMailingListEnglish@forum.nginx.org> Hello, community, I'm having trouble compiling nginx against OpenSSL 1.0.1. When I compile OpenSSL manually, I have no problems, everything is fine, but when trying to compile nginx with the --with-openssl option the compilation fails with the following message: ... make[4]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1/crypto/cmac' if [ -n "" ]; then \ (cd ..; make libcrypto.so.1.0.0); \ fi make[3]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1/crypto' make[2]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1' make[1]: *** [/usr/src/redhat/SOURCES/openssl-1.0.1/.openssl/include/openssl/ssl.h] Error 2 When I try to do a "make all" from openssl-1.0.1/crypto without cleaning the source tree, it fails with: ... cc -I. -I.. -I../include -g -c -o mem_clr.o mem_clr.c ar r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o mem_clr.o [ -z "" ] || ar r ../libcrypto.a fipscanister.o ../libcrypto.a || echo Never mind. /bin/sh: ../libcrypto.a: Permission denied Never mind. make: *** [subdirs] Error 1 Does anyone have an idea how to properly address this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223843,223843#msg-223843 From mp0306 at att.com Wed Mar 14 19:42:34 2012 From: mp0306 at att.com (PARMAR, MINESH) Date: Wed, 14 Mar 2012 19:42:34 +0000 Subject: SSL Not Working Message-ID: <11721EA0A9BCD24ABB0A4AEC9A9CC2FBC64859@GAALPA1MSGUSR9P.ITServices.sbc.com> Help Please.. I am create simple SSL configuration as describe in documentation but I keep getting following error message... Can you please advise what I am doing wrong.. -bash-3.2# nginx -v nginx version: nginx/1.0.13 2012/03/14 19:27:23 [crit] 5650#0: *1 SSL_do_handshake() failed (SSL: error:140B512D:SSL routines:SSL_GET_NEW_SESSION:ssl session id callback failed) while SSL handshaking, client: 135.199.76.62, server: localhost Here is my ngle.conf file upstream ngleproject { server 74.191.89.69:8080; server 74.191.89.71:8080; } server { listen 8080; server_name localhost; access_log /opt/ngnix/logs/ngle.access.log main; error_log /opt/ngnix/logs/ngle.error.log debug; location / { proxy_pass http://ngleproject; } } server { listen 8082; server_name localhost; access_log /opt/ngnix/logs/ngle.ssl-access.log main; error_log /opt/ngnix/logs/ngle.ssl-error.log debug; ssl on; ssl_certificate /etc/nginx/ssl/nginx.in.csr; ssl_certificate_key /etc/nginx/ssl/nginx.in.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root /opt/ngnix/docs; index index.html index.htm; } } From nginx-forum at nginx.us Wed Mar 14 21:18:41 2012 From: nginx-forum at nginx.us (nginxer) Date: Wed, 14 Mar 2012 17:18:41 -0400 (EDT) Subject: proxy_buffering Message-ID: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> Hey Guys, I'm new to nginx and have a question about the proxy_buffering feature. Our topology is very easy: Just nginx - No apache behind it. Our site gets the content (text,pictures,videos) of different sites via php and serves it to the client. My question is: Do we need the proxy_buffering? Could we turn it off without performance issues? I really don't understand this feature, maybe someone could explain it for me. :-) Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223845,223845#msg-223845 From zzz at zzz.org.ua Wed Mar 14 21:41:34 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Wed, 14 Mar 2012 23:41:34 +0200 Subject: proxy_buffering In-Reply-To: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> References: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> Message-ID: > I'm new to nginx and have a question about the proxy_buffering feature. > Our topology is very easy: > Just nginx - No apache behind it. > Our site gets the content (text,pictures,videos) of different sites via > php and serves it to the client. > My question is: > Do we need the proxy_buffering? Could we turn it off without performance > issues? You do need it. Otherwise any slow client will block an entire php process for a long time. > I really don't understand this feature, maybe someone could explain it > for me. :-) http://mailman.nginx.org/pipermail/nginx/2012-March/032608.html From guilherme.e at gmail.com Wed Mar 14 22:43:17 2012 From: guilherme.e at gmail.com (Guilherme) Date: Wed, 14 Mar 2012 19:43:17 -0300 Subject: proxy_buffering In-Reply-To: References: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> Message-ID: Enabling proxy_buffering, disk I/O will increase significantly. If you're running nginx and php on the same server, maybe it's not a good idea to enable it. On Wed, Mar 14, 2012 at 6:41 PM, Alexandr Gomoliako wrote: > > I'm new to nginx and have a question about the proxy_buffering feature. > > > Our topology is very easy: > > Just nginx - No apache behind it. > > Our site gets the content (text,pictures,videos) of different sites via > > php and serves it to the client. > > > My question is: > > Do we need the proxy_buffering? Could we turn it off without performance > > issues? > > You do need it. Otherwise any slow client will block an entire php > process for a long time. > > > I really don't understand this feature, maybe someone could explain it > > for me. :-) > > http://mailman.nginx.org/pipermail/nginx/2012-March/032608.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 Wed Mar 14 22:57:54 2012 From: nginx-forum at nginx.us (nginxer) Date: Wed, 14 Mar 2012 18:57:54 -0400 (EDT) Subject: proxy_buffering In-Reply-To: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> References: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2431c4c20a3624bed47823430445d45b.NginxMailingListEnglish@forum.nginx.org> This does not help! :-/ One says that I need it and the other says I don't. Maybe the information I provided are too lean. We run php-fpm and nginx on the same server. The php scripts will get the contents from different sites and sends them to the client. We do NOT own these "different sites" (= Google, Flickr, Youtube) @Alexandr Gomoliako: I still don't understand what proxy_buffering really does. When a client wants to visit Google, the php script will get the content from Google and sends it to the client. So where is the role of proxy_buffering? Could you provide a scenario how proxy_buffering will exactly work for our topology? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223845,223849#msg-223849 From zzz at zzz.org.ua Thu Mar 15 00:08:51 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Thu, 15 Mar 2012 02:08:51 +0200 Subject: proxy_buffering In-Reply-To: <2431c4c20a3624bed47823430445d45b.NginxMailingListEnglish@forum.nginx.org> References: <4b34d5ebe4339ffc46d8abe33322cd3c.NginxMailingListEnglish@forum.nginx.org> <2431c4c20a3624bed47823430445d45b.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Mar 15, 2012 at 12:57 AM, nginxer wrote: > This does not help! :-/ > > One says that I need it and the other says I don't. > Maybe the information I provided are too lean. It was fine. Have you read this? http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering I'm not sure what is so confusing about it. If you can receive an entire response from your giant php process you can send another request there right away, making it a lot more efficient, so it won't occupy those amounts of memory for nothing. Unless you have a lot of memory. From mdounin at mdounin.ru Thu Mar 15 00:41:16 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 04:41:16 +0400 Subject: nginx build with OpenSSL 1.0.1 In-Reply-To: <3e3b17cd60c7ad1842393ab088ec1e8d.NginxMailingListEnglish@forum.nginx.org> References: <3e3b17cd60c7ad1842393ab088ec1e8d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120315004116.GY67687@mdounin.ru> Hello! On Wed, Mar 14, 2012 at 03:35:09PM -0400, Samael wrote: > Hello, community, > > I'm having trouble compiling nginx against OpenSSL 1.0.1. When I compile > OpenSSL manually, I have no problems, everything is fine, but when > trying to compile nginx with the --with-openssl option the compilation > fails with the following message: > > ... > make[4]: Leaving directory > `/usr/src/redhat/SOURCES/openssl-1.0.1/crypto/cmac' > if [ -n "" ]; then \ > (cd ..; make libcrypto.so.1.0.0); \ > fi > make[3]: Leaving directory > `/usr/src/redhat/SOURCES/openssl-1.0.1/crypto' > make[2]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1' > make[1]: *** > [/usr/src/redhat/SOURCES/openssl-1.0.1/.openssl/include/openssl/ssl.h] > Error 2 Is it vanilla OpenSSL or some redhat-patched sources? Vanilla one builds just fine here under FreeBSD as well as CentOS 6.2. If it indeed doesn't work for you with vanilla OpenSSL, please try to remove and re-extract sources from openssl-1.0.1.tar.gz tarball to make sure there are no accedental changes. If it still fails to build with nginx, please provide full transcript of the nginx ./configure and build till failure, as well as some more details information about your OS. You may also try doing relevant build commands in openssl build directory yourself, in particular make sure the following works ok in the directory with openssl sources: ./config no-shared no-threads && make If it fails, there is probably some issue completely unrelated to nginx. > When I try to do a "make all" from openssl-1.0.1/crypto without cleaning > the source tree, it fails with: > > ... > cc -I. -I.. -I../include -g -c -o mem_clr.o mem_clr.c > ar r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o > cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o > fips_ers.o mem_clr.o > [ -z "" ] || ar r ../libcrypto.a fipscanister.o > ../libcrypto.a || echo Never mind. > /bin/sh: ../libcrypto.a: Permission denied > Never mind. > make: *** [subdirs] Error 1 This is expected to fail, you have to run just "make" (or "make top", which is the same). The "all" target requires variables set by top-level makefile. Maxim Dounin From mdounin at mdounin.ru Thu Mar 15 01:22:04 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 05:22:04 +0400 Subject: SSL Not Working In-Reply-To: <11721EA0A9BCD24ABB0A4AEC9A9CC2FBC64859@GAALPA1MSGUSR9P.ITServices.sbc.com> References: <11721EA0A9BCD24ABB0A4AEC9A9CC2FBC64859@GAALPA1MSGUSR9P.ITServices.sbc.com> Message-ID: <20120315012204.GZ67687@mdounin.ru> Hello! On Wed, Mar 14, 2012 at 07:42:34PM +0000, PARMAR, MINESH wrote: > Help Please.. > > I am create simple SSL configuration as describe in > documentation but I keep getting following error message... Can > you please advise what I am doing wrong.. > > -bash-3.2# nginx -v > nginx version: nginx/1.0.13 > > 2012/03/14 19:27:23 [crit] 5650#0: *1 SSL_do_handshake() failed (SSL: error:140B512D:SSL routines:SSL_GET_NEW_SESSION:ssl session id callback failed) while SSL handshaking, client: 135.199.76.62, server: localhost It looks like there is a problem with random source on your system, make sure /dev/urandom and/or /dev/random exists and readable. See also OpenSSL FAQ here: http://www.openssl.org/support/faq.html#USER1 Maxim Dounin From nginx-forum at nginx.us Thu Mar 15 03:30:14 2012 From: nginx-forum at nginx.us (justin) Date: Wed, 14 Mar 2012 23:30:14 -0400 (EDT) Subject: Dynamically Start/Stop FastCGI PHP Processes Message-ID: Ok, so I've got a crazy idea, but it might just work. Basically, we have a bunch of PHP pools managed with PHP-FPM. Each site has its own single PHP-FPM worker for security reasons. The majority of the sites don't get much traffic, so the PHP processes don't need to be running eating up RAM and resources. My thought was after N number of minutes of no requests to shut down that PHP worker for that site. Then when a request comes in, hold the request in sort-of a pause mode, start the worker for that site, and then forward off the request. Sure there would be a slight delay on that first request to spin up the worker, but should work beautifully. Does nginx have any plugins to emulate this behavior? I.E. sort of hooks? All I would need is a hook from nginx when a site is idle for X number of second/minutes. For this first hook, we could write a simple bash script which kills that PHP-FPM worker. Then another hook, when a request comes in on a given site. Again, another bash script which first checks if the PHP-FPM worker is up, if not, holds the requests, starts the worker, and then forwards the request. I was thinking at first, I can use node.js and write a middleware proxy that sits between nginx and the PHP-FPM workers, but then quickly realized the node.js app would have to speak cgi, and I didn't want to have to deal with that rubbish. :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223855,223855#msg-223855 From edho at myconan.net Thu Mar 15 03:37:58 2012 From: edho at myconan.net (Edho Arief) Date: Thu, 15 Mar 2012 10:37:58 +0700 Subject: Dynamically Start/Stop FastCGI PHP Processes In-Reply-To: References: Message-ID: Am 15.03.2012 10:30 schrieb "justin" : > > Ok, so I've got a crazy idea, but it might just work. > > Basically, we have a bunch of PHP pools managed with PHP-FPM. Each site > has its own single PHP-FPM worker for security reasons. > > The majority of the sites don't get much traffic, so the PHP processes > don't need to be running eating up RAM and resources. My thought was > after N number of minutes of no requests to shut down that PHP worker > for that site. Then when a request comes in, hold the request in sort-of > a pause mode, start the worker for that site, and then forward off the > request. Sure there would be a slight delay on that first request to > spin up the worker, but should work beautifully. > > Does nginx have any plugins to emulate this behavior? I.E. sort of > hooks? All I would need is a hook from nginx when a site is idle for X > number of second/minutes. For this first hook, we could write a simple > bash script which kills that PHP-FPM worker. Then another hook, when a > request comes in on a given site. Again, another bash script which first > checks if the PHP-FPM worker is up, if not, holds the requests, starts > the worker, and then forwards the request. > > I was thinking at first, I can use node.js and write a middleware proxy > that sits between nginx and the PHP-FPM workers, but then quickly > realized the node.js app would have to speak cgi, and I didn't want to > have to deal with that rubbish. :) What you're looking for is php-fpm with 0 initial worker. I'm not sure how far its current progress but you should try asking php folks. In the meantime you can config the pool to start with only one inital worker. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 15 03:53:14 2012 From: nginx-forum at nginx.us (justin) Date: Wed, 14 Mar 2012 23:53:14 -0400 (EDT) Subject: Dynamically Start/Stop FastCGI PHP Processes In-Reply-To: References: Message-ID: <36c24d9c0b11a0c890032d289ec45d2a.NginxMailingListEnglish@forum.nginx.org> Awesome idea, but the minium appears to be 1. I tried 0 and get the following: Starting php-fpm: [14-Mar-2012 20:52:28] WARNING: [pool justin] pm.start_servers is not set. It's been set to 1. [14-Mar-2012 20:52:28] WARNING: [pool simon] pm.start_servers is not set. It's been set to 1. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223855,223857#msg-223857 From edho at myconan.net Thu Mar 15 03:55:38 2012 From: edho at myconan.net (Edho Arief) Date: Thu, 15 Mar 2012 10:55:38 +0700 Subject: Dynamically Start/Stop FastCGI PHP Processes In-Reply-To: <36c24d9c0b11a0c890032d289ec45d2a.NginxMailingListEnglish@forum.nginx.org> References: <36c24d9c0b11a0c890032d289ec45d2a.NginxMailingListEnglish@forum.nginx.org> Message-ID: Am 15.03.2012 10:53 schrieb "justin" : > > Awesome idea, but the minium appears to be 1. I tried 0 and get the > following: Yes, it is work in progress. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 15 04:08:10 2012 From: nginx-forum at nginx.us (Roddick) Date: Thu, 15 Mar 2012 00:08:10 -0400 (EDT) Subject: Please help with proxy_pass and trailing slash! In-Reply-To: <201203142206.01618.ne@vbart.ru> References: <201203142206.01618.ne@vbart.ru> Message-ID: <8949d87903ded7b52eff432871d6d6b5.NginxMailingListEnglish@forum.nginx.org> Valentin V. Bartenev Wrote: ------------------------------------------------------- > > location / { > > # First attempt to serve request > as file, then > > # as directory, then fall back > to index.html > > try_files $uri $uri/ > /index.php?$args; > > } > > Just a side note, you don't need explicit set > $args here. > > try_files $uri $uri/ /index.php; > > > > location ~ index.php$ { > > > > try_files $uri =404; > > > > include fastcgi_params; > > fastcgi_index index.php; > > fastcgi_param SCRIPT_FILENAME > > $document_root$fastcgi_script_name; > > fastcgi_pass 127.0.0.1:9000; > > } > > } > > > > with this configuration, Java server receives > requests like "GET /app/" > > while it should receive "GET /" > > > > If I add trailing slash to proxy_pass: > > > > proxy_pass http://localhost:9001/; > > > > Then java server receives "GET //" and unable > to serve that either. > > > > Do I need to involve rewrite here ? And how? or > extra trailing slash is > > caused by other rewrite rules somehow? > > > > Documentation already has answers to your > questions: > http://nginx.org/en/docs/http/ngx_http_proxy_modul > e.html#proxy_pass > > E.g., in your case: > > location /app/ { > ... > proxy_pass http://localhost:9001/; > } > > wbr, Valentin V. Bartenev > Thanks Valentin. I get it now! I had location /app { and it should be location /app/ { with trailing slash. Weird that it's sensitive for that slash there. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223839,223859#msg-223859 From edho at myconan.net Thu Mar 15 04:18:45 2012 From: edho at myconan.net (Edho Arief) Date: Thu, 15 Mar 2012 11:18:45 +0700 Subject: Please help with proxy_pass and trailing slash! In-Reply-To: <8949d87903ded7b52eff432871d6d6b5.NginxMailingListEnglish@forum.nginx.org> References: <201203142206.01618.ne@vbart.ru> <8949d87903ded7b52eff432871d6d6b5.NginxMailingListEnglish@forum.nginx.org> Message-ID: Am 15.03.2012 11:08 schrieb "Roddick" : > > Valentin V. Bartenev Wrote: > ------------------------------------------------------- > > > > > location / { > > > # First attempt to serve request > > as file, then > > > # as directory, then fall back > > to index.html > > > try_files $uri $uri/ > > /index.php?$args; > > > } > > > > Just a side note, you don't need explicit set > > $args here. > > > > try_files $uri $uri/ /index.php; > > > > > > > location ~ index.php$ { > > > > > > try_files $uri =404; > > > > > > include fastcgi_params; > > > fastcgi_index index.php; > > > fastcgi_param SCRIPT_FILENAME > > > $document_root$fastcgi_script_name; > > > fastcgi_pass 127.0.0.1:9000; > > > } > > > } > > > > > > with this configuration, Java server receives > > requests like "GET /app/" > > > while it should receive "GET /" > > > > > > If I add trailing slash to proxy_pass: > > > > > > proxy_pass http://localhost:9001/; > > > > > > Then java server receives "GET //" and unable > > to serve that either. > > > > > > Do I need to involve rewrite here ? And how? or > > extra trailing slash is > > > caused by other rewrite rules somehow? > > > > > > > Documentation already has answers to your > > questions: > > http://nginx.org/en/docs/http/ngx_http_proxy_modul > > e.html#proxy_pass > > > > E.g., in your case: > > > > location /app/ { > > ... > > proxy_pass http://localhost:9001/; > > } > > > > wbr, Valentin V. Bartenev > > > > Thanks Valentin. > > I get it now! I had > location /app { > > and it should be > location /app/ { > > with trailing slash. Weird that it's sensitive for that slash there. > Trivia: "location /app { ... }" will match url " http://domain.com/appwhatever" -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 15 04:38:30 2012 From: nginx-forum at nginx.us (justin) Date: Thu, 15 Mar 2012 00:38:30 -0400 (EDT) Subject: Dynamically Start/Stop FastCGI PHP Processes In-Reply-To: References: Message-ID: Edho, Appears to be working, commented out other directives such as max_workers. Added the following: pm = ondemand pm.process_idle_timeout = 60 pm.max_children = 1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223855,223861#msg-223861 From jabberuser at gmail.com Thu Mar 15 08:39:37 2012 From: jabberuser at gmail.com (Piotr Karbowski) Date: Thu, 15 Mar 2012 09:39:37 +0100 Subject: Dynamically Start/Stop FastCGI PHP Processes In-Reply-To: References: Message-ID: <4F61AAC9.4040507@gmail.com> On 03/15/2012 04:30 AM, justin wrote: > Ok, so I've got a crazy idea, but it might just work. > > Basically, we have a bunch of PHP pools managed with PHP-FPM. Each site > has its own single PHP-FPM worker for security reasons. > > The majority of the sites don't get much traffic, so the PHP processes > don't need to be running eating up RAM and resources. My thought was > after N number of minutes of no requests to shut down that PHP worker > for that site. Then when a request comes in, hold the request in sort-of > a pause mode, start the worker for that site, and then forward off the > request. Sure there would be a slight delay on that first request to > spin up the worker, but should work beautifully. > > Does nginx have any plugins to emulate this behavior? I.E. sort of > hooks? All I would need is a hook from nginx when a site is idle for X > number of second/minutes. For this first hook, we could write a simple > bash script which kills that PHP-FPM worker. Then another hook, when a > request comes in on a given site. Again, another bash script which first > checks if the PHP-FPM worker is up, if not, holds the requests, starts > the worker, and then forwards the request. > > I was thinking at first, I can use node.js and write a middleware proxy > that sits between nginx and the PHP-FPM workers, but then quickly > realized the node.js app would have to speak cgi, and I didn't want to > have to deal with that rubbish. :) php-fpm support 'ondemand' governor so it will spawn processes as-needed and kill them after specified period if not needed (keeping zero workers for pool). This is what you are looking for. -- Piotr. From nginx-forum at nginx.us Thu Mar 15 09:13:30 2012 From: nginx-forum at nginx.us (Samael) Date: Thu, 15 Mar 2012 05:13:30 -0400 (EDT) Subject: nginx build with OpenSSL 1.0.1 In-Reply-To: <20120315004116.GY67687@mdounin.ru> References: <20120315004116.GY67687@mdounin.ru> Message-ID: Hello, Maxim, I'm compiling with vanilla nginx 1.1.16 with vanilla OpenSSL sources on CentOS 5 i686. When I compile OpenSSL manually, it compiles (and works) just fine. https://gist.github.com/1c7d728ac08f3c314eea Thanks for the "make all" clarification. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223843,223869#msg-223869 From nginx-forum at nginx.us Thu Mar 15 09:16:09 2012 From: nginx-forum at nginx.us (atrus) Date: Thu, 15 Mar 2012 05:16:09 -0400 (EDT) Subject: Catch success download file event. Message-ID: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> Hi Guys, I have nginx server host some static files. How can I catch (trigger) when users successfully download a file ?! That means the size of downloaded file equals to the size of the file on server. I mean user have fully downloaded a file. Sorry for my bad english. Thank you. Atrus@ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223870,223870#msg-223870 From mdounin at mdounin.ru Thu Mar 15 09:55:42 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 13:55:42 +0400 Subject: nginx build with OpenSSL 1.0.1 In-Reply-To: References: <20120315004116.GY67687@mdounin.ru> Message-ID: <20120315095541.GD67687@mdounin.ru> Hello! On Thu, Mar 15, 2012 at 05:13:30AM -0400, Samael wrote: > Hello, Maxim, > > I'm compiling with vanilla nginx 1.1.16 with vanilla OpenSSL sources on > CentOS 5 i686. When I compile OpenSSL manually, it compiles (and works) > just fine. > > https://gist.github.com/1c7d728ac08f3c314eea The "make -j2" you use seems to be the culprit, OpenSSL fails to build with the "make -j2". The following fails for me as well: ./config no-shared no-threads make -j2 You may want to report this problem to OpenSSL folks. Meanwile, workaround is obvious - don't use "make -j2" till this is fixed in OpenSSL. Maxim Dounin From nginx-forum at nginx.us Thu Mar 15 10:14:19 2012 From: nginx-forum at nginx.us (Samael) Date: Thu, 15 Mar 2012 06:14:19 -0400 (EDT) Subject: nginx build with OpenSSL 1.0.1 In-Reply-To: <3e3b17cd60c7ad1842393ab088ec1e8d.NginxMailingListEnglish@forum.nginx.org> References: <3e3b17cd60c7ad1842393ab088ec1e8d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <895696a5d6073fcdd6d00fb6cb481d71.NginxMailingListEnglish@forum.nginx.org> Oh, boy, was this stupid. Thank you very much, I've actually though about this, but said "naah, probably won't help". I will report it to the OpenSSL guys. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223843,223873#msg-223873 From gelonida at gmail.com Thu Mar 15 10:21:27 2012 From: gelonida at gmail.com (Gelonida N) Date: Thu, 15 Mar 2012 11:21:27 +0100 Subject: Dynamically Start/Stop FastCGI PHP Processes In-Reply-To: <4F61AAC9.4040507@gmail.com> References: <4F61AAC9.4040507@gmail.com> Message-ID: On 03/15/2012 09:39 AM, Piotr Karbowski wrote: > On 03/15/2012 04:30 AM, justin wrote: >> >> Does nginx have any plugins to emulate this behavior? I.E. sort of >> hooks? All I would need is a hook from nginx when a site is idle for X >> number of second/minutes. For this first hook, we could write a simple >> bash script which kills that PHP-FPM worker. Then another hook, when a >> request comes in on a given site. Again, another bash script which first >> checks if the PHP-FPM worker is up, if not, holds the requests, starts >> the worker, and then forwards the request. >> >> I was thinking at first, I can use node.js and write a middleware proxy >> that sits between nginx and the PHP-FPM workers, but then quickly >> realized the node.js app would have to speak cgi, and I didn't want to >> have to deal with that rubbish. :) > > php-fpm support 'ondemand' governor so it will spawn processes as-needed > and kill them after specified period if not needed (keeping zero workers > for pool). This is what you are looking for. I'd be interested, whether there is something generic nginx specific, which would allow to start / stop any fast-cgi / uwsgi service. I think it could be rather intersting for a lot of rarely used services where a startup penalty is not important. From nginx-forum at nginx.us Thu Mar 15 10:59:39 2012 From: nginx-forum at nginx.us (rishabh) Date: Thu, 15 Mar 2012 06:59:39 -0400 (EDT) Subject: Get request_body in set_by_lua directive Message-ID: <6140397ba88d1f5dd2d97139c5d88047.NginxMailingListEnglish@forum.nginx.org> I wont to parse the request_body in a lua script file but am unable to access the request_body in set_by_lua_file directive. Is there any way to access the headers/cookies/get/post ? my conf structure is like http{ server { ... set_by_lua_file $myContent myFile.lua; location @abcd { ... } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223876,223876#msg-223876 From nginx-forum at nginx.us Thu Mar 15 11:10:47 2012 From: nginx-forum at nginx.us (nginxer) Date: Thu, 15 Mar 2012 07:10:47 -0400 (EDT) Subject: proxy_buffering In-Reply-To: References: Message-ID: <01dba4309cdebfb9cac7881abbe2f437.NginxMailingListEnglish@forum.nginx.org> OK. The last link from you was helpful! But one last question to see if I got this right: Imagine following scenario: The proxy_buffers are empty. A client wants to visit let's say google.com. Our php script gets the content of google.com, sends it to the client and nginx will also buffer the response from google.com in a proxy_buffer. Is that right so far? So the next time if a client wants to visit google.com nginx will take the response from a proxy_buffer without making a request to google.com. Right? If I understood it right, proxy_buffering is caching? The term "proxied server" confused me... Thanks Alexandr Gomoliako! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223845,223877#msg-223877 From mdounin at mdounin.ru Thu Mar 15 12:23:37 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 16:23:37 +0400 Subject: nginx-1.1.17 Message-ID: <20120315122336.GI67687@mdounin.ru> Changes with nginx 1.1.17 15 Mar 2012 *) Security: content of previously freed memory might be sent to a client if backend returned specially crafted response. Thanks to Matthew Daley. *) Bugfix: in the embedded perl module if used from SSI. Thanks to Matthew Daley. *) Bugfix: in the ngx_http_uwsgi_module. Maxim Dounin From mdounin at mdounin.ru Thu Mar 15 12:24:25 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 16:24:25 +0400 Subject: nginx-1.0.14 Message-ID: <20120315122425.GM67687@mdounin.ru> Changes with nginx 1.0.14 15 Mar 2012 *) Security: content of previously freed memory might be sent to a client if backend returned specially crafted response. Thanks to Matthew Daley. Maxim Dounin From mdounin at mdounin.ru Thu Mar 15 12:26:15 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 16:26:15 +0400 Subject: security advisory Message-ID: <20120315122615.GQ67687@mdounin.ru> Hello! Matthew Daley recently discovered a security problem which may lead to a disclosure of previously freed memory on specially crafted response from an upstream server, potentially resulting in sensitive information leak. Patch for the problem can be found here: http://nginx.org/download/patch.2012.memory.txt The patch is not required for 1.1.17, 1.0.14. Maxim Dounin From appa at perusio.net Thu Mar 15 12:52:26 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Thu, 15 Mar 2012 13:52:26 +0100 Subject: security advisory In-Reply-To: <20120315122615.GQ67687@mdounin.ru> References: <20120315122615.GQ67687@mdounin.ru> Message-ID: <3764bfa109a2a60648cb130be2d3b844.squirrel@damiao.org> > Hello! Hello Maxim, > Matthew Daley recently discovered a security problem which may > lead to a disclosure of previously freed memory on specially > crafted response from an upstream server, potentially resulting in > sensitive information leak. > > Patch for the problem can be found here: > > http://nginx.org/download/patch.2012.memory.txt > > The patch is not required for 1.1.17, 1.0.14. There's a CVE # for it? Someone asked me about it on twitter. Thanks, --appa From mdounin at mdounin.ru Thu Mar 15 13:01:36 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 17:01:36 +0400 Subject: security advisory In-Reply-To: <3764bfa109a2a60648cb130be2d3b844.squirrel@damiao.org> References: <20120315122615.GQ67687@mdounin.ru> <3764bfa109a2a60648cb130be2d3b844.squirrel@damiao.org> Message-ID: <20120315130136.GV67687@mdounin.ru> Hello! On Thu, Mar 15, 2012 at 01:52:26PM +0100, Antonio P.P. Almeida wrote: > > Hello! > > Hello Maxim, > > > Matthew Daley recently discovered a security problem which may > > lead to a disclosure of previously freed memory on specially > > crafted response from an upstream server, potentially resulting in > > sensitive information leak. > > > > Patch for the problem can be found here: > > > > http://nginx.org/download/patch.2012.memory.txt > > > > The patch is not required for 1.1.17, 1.0.14. > > There's a CVE # for it? Someone asked me about it on twitter. No. Maxim Dounin From appa at perusio.net Thu Mar 15 13:04:07 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Thu, 15 Mar 2012 14:04:07 +0100 Subject: security advisory In-Reply-To: <3764bfa109a2a60648cb130be2d3b844.squirrel@damiao.org> References: <20120315122615.GQ67687@mdounin.ru> <3764bfa109a2a60648cb130be2d3b844.squirrel@damiao.org> Message-ID: <94f4f0356dad193bc543f2c8d8100b30.squirrel@damiao.org> Replying to myself here. Maxim, Igor, Andrei, Valentin, Ruslan, &c, I think that there's room for improvement on the security advisory front. 1. Make it official: nginx-sa-01-2012 with an official numbering scheme. 2. Get a CVE identifier. 3. Publish it also on security lists like full-disclosure and bugtraq, for example I know that Nginx has been a labour of love of a few people until recently. But now that you're an established company I think that having in place a more formal procedure for security advisories would bring great benefits to Nginx as a free software project with its community and as a company also. Just my unsolicited $.02 Salutations distingu?es, Ant?nio From andrew at nginx.com Thu Mar 15 13:46:36 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Thu, 15 Mar 2012 17:46:36 +0400 Subject: security advisory In-Reply-To: <94f4f0356dad193bc543f2c8d8100b30.squirrel@damiao.org> References: <20120315122615.GQ67687@mdounin.ru> <3764bfa109a2a60648cb130be2d3b844.squirrel@damiao.org> <94f4f0356dad193bc543f2c8d8100b30.squirrel@damiao.org> Message-ID: Antonio, On Mar 15, 2012, at 5:04 PM, Antonio P.P. Almeida wrote: > 2. Get a CVE identifier. > > 3. Publish it also on security lists like full-disclosure and bugtraq, > for example > > I know that Nginx has been a labour of love of a few people until recently. > But now that you're an established company I think that having in place a > more formal procedure for security advisories would bring great benefits > to Nginx as a free software project with its community and as a company > also. > > Just my unsolicited $.02 Thanks, this had been planned and now ongoing. > Salutations distingu?es, > > Ant?nio From baishen.lists at gmail.com Thu Mar 15 14:48:13 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Thu, 15 Mar 2012 10:48:13 -0400 Subject: Custom error pages In-Reply-To: <20120313234023.GJ18773@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> Message-ID: How do I get nginx to serve the page? I added in the line from the link, but I still get the default nginx page, not my custom one. On Tue, Mar 13, 2012 at 7:40 PM, Francis Daly wrote: > On Tue, Mar 13, 2012 at 09:38:56AM -0400, Bai Shen wrote: > > Hi there, > > > I'm able to get nginx > > to return a 503 page by adding it to the top of the location. But that > > just returns the default nginx error page. How to do change this to a > > custom page? > > Does http://www.nginx.org/r/error_page give the info you need? > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Mar 15 18:42:53 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 15 Mar 2012 22:42:53 +0400 Subject: Latency problem with one browser In-Reply-To: References: <20120302135146.GL67687@mdounin.ru> <20120302180134.GQ67687@mdounin.ru> <20120304174045.GW67687@mdounin.ru> Message-ID: <20120315184253.GG67687@mdounin.ru> Hello! On Sun, Mar 04, 2012 at 10:08:45PM +0100, Piotr Sikora wrote: > Hi Maxim, > > >Restricting the workaround to something like "Safari on Mac OS X" > >would be fine too, though it's mostly orthogonal to changing the > >default. > > I believe this patch is sufficient. > > "Mac OS X" string is present in all affected devices, i.e.: > - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8) ... > - Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) ... > - Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) ... > - Mozilla/5.0 (iPod; CPU iPhone OS 5_0_1 like Mac OS X) ... > > --- src/http/ngx_http_request.c.orig Sun Mar 4 20:53:14 2012 > +++ src/http/ngx_http_request.c Sun Mar 4 20:55:36 2012 > @@ -1496,6 +1496,10 @@ ngx_http_process_user_agent(ngx_http_request_t *r, ngx > } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) { > r->headers_in.safari = 1; > > + if (ngx_strstrn(user_agent, "Mac OS X", 8 - 1)) { > + r->headers_in.safari_osx = 1; > + } I would rather do --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1493,7 +1493,9 @@ ngx_http_process_user_agent(ngx_http_req } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) { r->headers_in.chrome = 1; - } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) { + } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1) + && ngx_strstrn(user_agent, "Mac OS X", 8 - 1)) + { r->headers_in.safari = 1; } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) { As the sole purpose of r->headers_in.safari bit is to activate this particular workaround. Any objections? Maxim Dounin From francis at daoine.org Thu Mar 15 19:24:09 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 15 Mar 2012 19:24:09 +0000 Subject: Custom error pages In-Reply-To: References: <20120313234023.GJ18773@craic.sysops.org> Message-ID: <20120315192409.GM18773@craic.sysops.org> On Thu, Mar 15, 2012 at 10:48:13AM -0400, Bai Shen wrote: Hi there, > How do I get nginx to serve the page? I added in the line from the link, > but I still get the default nginx page, not my custom one. === server { error_page 503 /my-503-error.html; location / { return 503; } location = /my-503-error.html { internal; } } === will serve the content of the file my-503-error.html in your document root with a http status 503 for (almost) every request to this server. f -- Francis Daly francis at daoine.org From zzz at zzz.org.ua Thu Mar 15 19:55:26 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Thu, 15 Mar 2012 21:55:26 +0200 Subject: [ANNOUNCE] nginx-perl-1.1.17.1 Message-ID: Hello, everyone. It's been awhile since my last announce, it was 1.1.11.1 roughly two months ago. And now it's 1.1.17.1. There were couple of bugfixes and new features. But most of the work was done on automated testing to make it work properly on things like cpantesters and travis-ci. http://matrix.cpantesters.org/?dist=Nginx-Perl%201.1.16.1 So, it is now possible to use Nginx::Perl as a dependency for perl modules and test against it on cpantesters and travis-ci. Here's an example of such module and its tests: http://matrix.cpantesters.org/?dist=Nginx-HTTP https://github.com/zzzcpan/Nginx-HTTP/tree/master/t Also wanted to mention one example, just to show how much you can do: "In nginx-perl every request object $r is created and destroyed with nginx's own request. This means, that it is possible to reorder natural request flow in any way you want. It can be very helpful in case of DDOS, unusual load spikes or anything else you can think of." http://zzzcpan.github.com/nginx-perl/Nginx.html#REQUEST_QUEUE https://github.com/zzzcpan/nginx-perl/tree/master/eg/requestqueue Webpage: http://zzzcpan.github.com/nginx-perl/ Github: https://github.com/zzzcpan/nginx-perl CPAN: Nginx::Perl Changes: https://raw.github.com/zzzcpan/nginx-perl/master/CHANGES.perl From francis at daoine.org Thu Mar 15 22:07:05 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 15 Mar 2012 22:07:05 +0000 Subject: proxy_buffering In-Reply-To: <01dba4309cdebfb9cac7881abbe2f437.NginxMailingListEnglish@forum.nginx.org> References: <01dba4309cdebfb9cac7881abbe2f437.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120315220705.GN18773@craic.sysops.org> On Thu, Mar 15, 2012 at 07:10:47AM -0400, nginxer wrote: Hi there, > But one last question to see if I got this right: I don't think you have. "buffering" and "caching" are two different things. "caching" is not involved here at all. > Imagine following scenario: > > The proxy_buffers are empty. A proxy_buffer is associated with a single proxy_pass connection. So the buffers are empty at the start and end of the connection, and may hold something in between. > A client wants to visit let's say google.com. Our php script gets If you're using php and php-fpm and not apache, you're probably not using proxy_pass but fastcgi_pass. That means the actual directives you will want to use will probably start with fastcgi_ rather than proxy_, but the outline is the same. > the content of google.com, sends it to the client Upstream doesn't talk to the client. Upstream talks to nginx, and nginx talks to the client. > and nginx will also buffer the response from google.com in a > proxy_buffer. > > Is that right so far? Perhaps it is easier to think of the full process as a chain of processes. web browser talks to nginx, over a 1 MB/s link. nginx talks to upstream server, over a 100 MB/s link. upstream server returns 100 MB of content to nginx. nginx returns 100 MB of content to web browser. With proxy_buffering on, nginx can hold the whole 100 MB, so the nginx-upstream connection can be closed after 1 s, and then nginx can spend 100 s sending the content to the web browser. With proxy_buffering off, nginx can only take the content from upstream at the same rate that nginx can send it to the web browser. The web browser doesn't care about the difference -- it still takes 100 s for it to get the whole content. nginx doesn't care much about the difference -- it still takes 100 s to feed the content to the browser, but it does have to hold the connection to upstream open for an extra 99 s. Upstream does care about the difference -- what could have taken it 1 s actually takes 100 s; and for the extra 99 s, that upstream server is not serving any other requests. Usually: the nginx-upstream link is faster than the browser-nginx link; and upstream is more "heavyweight" than nginx; so it is prudent to let upstream finish processing as quickly as possible. Hence buffering. > So the next time if a client wants to visit google.com nginx will take > the response from a proxy_buffer without making a request to > google.com. > > Right? No. That would be caching. The directives to configure that tend to have the word "cache" in them. > If I understood it right, proxy_buffering is caching? > > The term "proxied server" confused me... When you "proxy_pass", what you proxy_pass to is the proxied server. If you are using fastcgi_pass, then the content at http://www.nginx.org/en/docs/http/ngx_http_fastcgi_module.html is probably more interesting to you. There is no explicit "fastcgi_buffering" directive; it is effectively always "on". f -- Francis Daly francis at daoine.org From agentzh at gmail.com Fri Mar 16 02:30:15 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 16 Mar 2012 10:30:15 +0800 Subject: Get request_body in set_by_lua directive In-Reply-To: <6140397ba88d1f5dd2d97139c5d88047.NginxMailingListEnglish@forum.nginx.org> References: <6140397ba88d1f5dd2d97139c5d88047.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, Mar 15, 2012 at 6:59 PM, rishabh wrote: > I wont to parse the request_body in a lua script file but am unable to > access the request_body in set_by_lua_file directive. Is there any way > to access the headers/cookies/get/post ? > The request body API will not work at all in the context of set_by_lua and set_by_lua_file directives. You should use rewrite_by_lua, rewrite_by_lua_file instead. Regards, -agentzh From nginx-forum at nginx.us Fri Mar 16 03:18:09 2012 From: nginx-forum at nginx.us (atrus) Date: Thu, 15 Mar 2012 23:18:09 -0400 (EDT) Subject: Catch success download file event. In-Reply-To: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> References: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9c0e9f302bf049a6cdb54cc6eb3a33fe.NginxMailingListEnglish@forum.nginx.org> Guy ! Anyone show me the solution plz. Thanks so much. Atrus@ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223870,223934#msg-223934 From roman.vasilyev at yousendit.com Fri Mar 16 03:31:25 2012 From: roman.vasilyev at yousendit.com (Roman Vasilyev) Date: Thu, 15 Mar 2012 20:31:25 -0700 Subject: Catch success download file event. In-Reply-To: <9c0e9f302bf049a6cdb54cc6eb3a33fe.NginxMailingListEnglish@forum.nginx.org> References: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> <9c0e9f302bf049a6cdb54cc6eb3a33fe.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F62B40D.6070504@yousendit.com> On 03/15/2012 08:18 PM, atrus wrote: > Anyone show me the solution plz. > > Seems like you asking about *post_action* http://wiki.nginx.org/HttpCoreModule#post_action From roman.vasilyev at yousendit.com Fri Mar 16 03:38:09 2012 From: roman.vasilyev at yousendit.com (Roman Vasilyev) Date: Thu, 15 Mar 2012 20:38:09 -0700 Subject: Catch success download file event. In-Reply-To: <4F62B40D.6070504@yousendit.com> References: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> <9c0e9f302bf049a6cdb54cc6eb3a33fe.NginxMailingListEnglish@forum.nginx.org> <4F62B40D.6070504@yousendit.com> Message-ID: <4F62B5A1.1060502@yousendit.com> On 03/15/2012 08:31 PM, Roman Vasilyev wrote: > On 03/15/2012 08:18 PM, atrus wrote: >> Anyone show me the solution plz. >> > Seems like you asking about *post_action* > http://wiki.nginx.org/HttpCoreModule#post_action > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Just your red previous question. While I've attempted to solve this issue got proper result only after parsing logs. From nginx-forum at nginx.us Fri Mar 16 03:43:45 2012 From: nginx-forum at nginx.us (atrus) Date: Thu, 15 Mar 2012 23:43:45 -0400 (EDT) Subject: Catch success download file event. In-Reply-To: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> References: <029a6fbe4ced7a4dafcb989c6954501b.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks. I'll try the post_action term. Atrus@ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223870,223937#msg-223937 From kworthington at gmail.com Fri Mar 16 11:23:12 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Fri, 16 Mar 2012 07:23:12 -0400 Subject: nginx-1.0.14 In-Reply-To: <20120315122425.GM67687@mdounin.ru> References: <20120315122425.GM67687@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.0.14 For Windows http://goo.gl/nw0Vq (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On 3/15/12, Maxim Dounin wrote: > Changes with nginx 1.0.14 15 Mar 2012 > > *) Security: content of previously freed memory might be sent to a > client if backend returned specially crafted response. > Thanks to Matthew Daley. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Kevin Worthington kworthington at gmail.com http://www.kevinworthington.com/ http://twitter.com/kworthington From kworthington at gmail.com Fri Mar 16 11:24:24 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Fri, 16 Mar 2012 07:24:24 -0400 Subject: nginx-1.1.17 In-Reply-To: <20120315122336.GI67687@mdounin.ru> References: <20120315122336.GI67687@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.1.17 For Windows http://goo.gl/nw0Vq (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On 3/15/12, Maxim Dounin wrote: > Changes with nginx 1.1.17 15 Mar 2012 > > *) Security: content of previously freed memory might be sent to a > client if backend returned specially crafted response. > Thanks to Matthew Daley. > > *) Bugfix: in the embedded perl module if used from SSI. > Thanks to Matthew Daley. > > *) Bugfix: in the ngx_http_uwsgi_module. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Kevin Worthington kworthington at gmail.com http://www.kevinworthington.com/ http://twitter.com/kworthington From nginx-forum at nginx.us Fri Mar 16 11:57:22 2012 From: nginx-forum at nginx.us (compiler2k) Date: Fri, 16 Mar 2012 07:57:22 -0400 (EDT) Subject: Can't configure 33 "virtualhosts" in nginx 0.7.62-0 (max=32?) Message-ID: <7ffefce4f8b616e168c9ebb2ff1ff076.NginxMailingListEnglish@forum.nginx.org> Hi. I have a Linux Ubuntu 8.04 LTS machine with nginx 0.7.62-0 installed from a PPA repository. NGINX is being working correctly since now, but today I've tried to add the 33th "virtualhost" to the sites-available and sites-enabled/ directory and nginx does not start. I have 32 working virtualhosts from 000-virthost1 to 031-virthost31, but when I try to add 032-virthost (the 33th), nginx refuses to start with no error message. If I remove any of the virtualhosts files and add the new one (having again a maximum of 32), it works. Is there a limit on the number of virtualhosts to be served? Maybe it's a limit in the number of files or symlinks you can have in sites-enabled? Should I upgrade nginx to correct this behaviour. Thanks for any help, I don't know how to fix this. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223950,223950#msg-223950 From nginx-forum at nginx.us Fri Mar 16 11:58:47 2012 From: nginx-forum at nginx.us (n1xman) Date: Fri, 16 Mar 2012 07:58:47 -0400 (EDT) Subject: Content Encoding Error while returning data from memcached stored by ngx_srcache Message-ID: <0bf493625f1c3895fd80a628fbc87e12.NginxMailingListEnglish@forum.nginx.org> I need little help here. First time browsing or memcached restart will show you the data correctly; but when you refresh second time and it will gives you content encoding error and I think it is something to do with my nginx or ngx_srcache config for fetching data from memcached. I checked using Wireshark from the client-end and found nginx sending uncompressed data and I can see the Accept-encoding and Connection-encoding on request and response header are set respectively. I suspect the error triggers due to browser expect compressed data instead of uncompressed data. Backend I get uncompressed data and I assume that ngx_srcache will compress said data before storing them on memcached. If ngx_srcache compress data and store them in memcached by default, how do we pass client accept encoding to memcached via ngx_srcache which is not happening. If I use gzip off; then I get data properly. Here are my configurations: uname -a Linux abmx-test 2.6.18-194.el5PAE #1 SMP Tue Mar 16 22:00:21 EDT 2010 i686 i686 i386 GNU/Linux ./nginx -V nginx version: nginx/1.1.17 built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48) TLS SNI support disabled configure arguments: --add-module=./contrib/echo-nginx-module-6c1f553 --add-module=./contrib/memc-nginx-module-4007350 --add-module=./contrib/simpl-ngx_devel_kit-24202b4 --add-module=./contrib/set-misc-nginx-module-e6a54ab --add-module=./contrib/srcache-nginx-module-86e7a18 --with-debug --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-mail_ssl_module nginx.conf user nginx; worker_processes 1; error_log /usr/local/nginx/logs/error.log debug; pid /usr/local/nginx/logs/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; gzip on; gzip_static on; gzip_buffers 16 8k; gzip_proxied any; gzip_comp_level 8; gzip_http_version 1.1; gzip_min_length 512; gzip_types text/plain text/css application/json application/x-javascript application/xml application/xml+rss text/javascript application/javascript text/x-js application/x-shockwave-flash text/json; gzip_vary on; upstream my_mem { server 127.0.0.1:11211; } server { listen 80; server_name localhost; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log debug; default_type application/json; location = /memc { internal; memc_connect_timeout 100ms; memc_send_timeout 100ms; memc_read_timeout 100ms; set $memc_key $query_string; set $memc_exptime 30; # set $memc_exptime $arg_exptime; memc_pass my_mem; } location /mix2 { default_type "application/json;charset=UTF-8"; set $key $args; srcache_fetch GET /memc key=$key; srcache_store PUT /memc key=$key; srcache_store_statuses 200 301 302 404; srcache_response_cache_control off; # No data found in memcached proxy_pass http://192.168.20.101; proxy_set_header Accept-Encoding ""; } location / { root /usr/share/nginx/html; index index.html index.htm; } # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } } Error log when there is not data in memcached http://pastebin.com/fUeD2yCA Error log when there is data in memcahced http://pastebin.com/Vism9Yyp Please advice. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223951,223951#msg-223951 From laursen at oxygen.net Fri Mar 16 12:02:16 2012 From: laursen at oxygen.net (Lasse Laursen) Date: Fri, 16 Mar 2012 13:02:16 +0100 Subject: Can't configure 33 "virtualhosts" in nginx 0.7.62-0 (max=32?) In-Reply-To: <7ffefce4f8b616e168c9ebb2ff1ff076.NginxMailingListEnglish@forum.nginx.org> References: <7ffefce4f8b616e168c9ebb2ff1ff076.NginxMailingListEnglish@forum.nginx.org> Message-ID: <73B1A082-1590-4DFC-8F28-5E61D60FB771@oxygen.net> Try adding: # Number of hash buckets server_names_hash_bucket_size 128; in the 'http' section of your nginx.conf file. http://wiki.nginx.org/HttpCoreModule#server_names_hash_bucket_size On 16/03/2012, at 12.57, compiler2k wrote: > Hi. > > I have a Linux Ubuntu 8.04 LTS machine with nginx 0.7.62-0 installed > from a PPA repository. > > NGINX is being working correctly since now, but today I've tried to add > the 33th "virtualhost" to the sites-available and sites-enabled/ > directory and nginx does not start. > > I have 32 working virtualhosts from 000-virthost1 to 031-virthost31, > but when I try to add 032-virthost (the 33th), nginx refuses to start > with no error message. If I remove any of the virtualhosts files and add > the new one (having again a maximum of 32), it works. > > Is there a limit on the number of virtualhosts to be served? Maybe it's > a limit in the number of files or symlinks you can have in > sites-enabled? > > Should I upgrade nginx to correct this behaviour. > > Thanks for any help, I don't know how to fix this. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223950,223950#msg-223950 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From agentzh at gmail.com Fri Mar 16 12:30:31 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 16 Mar 2012 20:30:31 +0800 Subject: Content Encoding Error while returning data from memcached stored by ngx_srcache In-Reply-To: <0bf493625f1c3895fd80a628fbc87e12.NginxMailingListEnglish@forum.nginx.org> References: <0bf493625f1c3895fd80a628fbc87e12.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Fri, Mar 16, 2012 at 7:58 PM, n1xman wrote: > > I need little help here. First time browsing or memcached restart will > show you the data correctly; but when you refresh second time and it > will gives you content encoding error and I think it is something to do > with my nginx or ngx_srcache config for fetching data from memcached. I > checked using Wireshark from the client-end and found nginx sending > uncompressed data and I can see the Accept-encoding and > Connection-encoding on request and response header are set respectively. > I suspect the error triggers due to browser expect compressed data > instead of uncompressed data. > It looks like a bug in old versions of ngx_srcache (like the one, v0.13rc2, that you're currently using). Please try the latest version, v0.13rc6: https://github.com/agentzh/srcache-nginx-module/tags Please let me if the problem still persist with the latest version :) Best regards, -agentzh From baishen.lists at gmail.com Fri Mar 16 13:34:34 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Fri, 16 Mar 2012 09:34:34 -0400 Subject: Custom error pages In-Reply-To: <20120315192409.GM18773@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> Message-ID: I should still be able to use the listen and server_name directives to have this apply to certain servers, correct? On Thu, Mar 15, 2012 at 3:24 PM, Francis Daly wrote: > On Thu, Mar 15, 2012 at 10:48:13AM -0400, Bai Shen wrote: > > Hi there, > > > How do I get nginx to serve the page? I added in the line from the link, > > but I still get the default nginx page, not my custom one. > > === > server { > error_page 503 /my-503-error.html; > location / { > return 503; > } > location = /my-503-error.html { > internal; > } > } > === > > will serve the content of the file my-503-error.html in your document > root with a http status 503 for (almost) every request to this server. > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From baishen.lists at gmail.com Fri Mar 16 13:43:39 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Fri, 16 Mar 2012 09:43:39 -0400 Subject: Custom error pages In-Reply-To: <20120315192409.GM18773@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> Message-ID: I added this into my config file, and put my-503-error.html in the same location as the default 50x.html file, but all I get is a generic 404 error page. Is that not the document root for nginx? On Thu, Mar 15, 2012 at 3:24 PM, Francis Daly wrote: > On Thu, Mar 15, 2012 at 10:48:13AM -0400, Bai Shen wrote: > > Hi there, > > > How do I get nginx to serve the page? I added in the line from the link, > > but I still get the default nginx page, not my custom one. > > === > server { > error_page 503 /my-503-error.html; > location / { > return 503; > } > location = /my-503-error.html { > internal; > } > } > === > > will serve the content of the file my-503-error.html in your document > root with a http status 503 for (almost) every request to this server. > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Fri Mar 16 15:18:56 2012 From: francis at daoine.org (Francis Daly) Date: Fri, 16 Mar 2012 15:18:56 +0000 Subject: Custom error pages In-Reply-To: References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> Message-ID: <20120316151856.GP18773@craic.sysops.org> On Fri, Mar 16, 2012 at 09:43:39AM -0400, Bai Shen wrote: Hi there, > I added this into my config file, and put my-503-error.html in the same > location as the default 50x.html file, but all I get is a generic 404 error > page. You got an error page. What does the error log say? Either put your 503 file there; or configure "root" so that it is correct within this location{}. If you're still having problems, please follow the "debug" instructions to make it easier for people to help you. Details on the web site, but in brief: what did you do? what did you see? what did you expect to see? and the more specific you are, the easier it will be for someone else to reproduce the problem you are reporting. Good luck with it, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Fri Mar 16 15:29:02 2012 From: nginx-forum at nginx.us (trojan2748) Date: Fri, 16 Mar 2012 11:29:02 -0400 (EDT) Subject: Static ETags Message-ID: <893e5ccd20f30a4cc165e3eae1f4f610.NginxMailingListEnglish@forum.nginx.org> Hi Everyone, I had a look at the Static Etag 3rd party module, and noticed a few things: 1) There is a memory leak, a malloc() requesting 1000 bytes is called, but never free()'d 2) Doesn't check headers from client to see if there is a "If-None-Matched:" header, so all it does is generate etags, never checks 3) Not very robust. I've written the author Mike West a couple of times but got no reply. So I took it upon myself to fix. Below is the github with the fixed version. This is my first nginx module, so please critique as much as you can. I'm still getting acquainted with the code. https://github.com/trojan2748/NginX-Etags Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223971,223971#msg-223971 From ne at vbart.ru Fri Mar 16 16:13:33 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Fri, 16 Mar 2012 20:13:33 +0400 Subject: Static ETags In-Reply-To: <893e5ccd20f30a4cc165e3eae1f4f610.NginxMailingListEnglish@forum.nginx.org> References: <893e5ccd20f30a4cc165e3eae1f4f610.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203162013.33789.ne@vbart.ru> On Friday 16 March 2012 19:29:02 trojan2748 wrote: > Hi Everyone, > I had a look at the Static Etag 3rd party module, and noticed a few > things: > > 1) There is a memory leak, a malloc() requesting 1000 bytes is called, > but never free()'d > 2) Doesn't check headers from client to see if there is a > "If-None-Matched:" header, so all it does is generate etags, never > checks > 3) Not very robust. > > I've written the author Mike West a couple of times but got no reply. So > I took it upon myself to fix. Below is the github with the fixed > version. This is my first nginx module, so please critique as much as > you can. I'm still getting acquainted with the code. > > https://github.com/trojan2748/NginX-Etags > A cursory examination shows a large number of problems with the code. But the most serious one is that your module just block nginx on fread(), which will completely kill the performance. wbr, Valentin V. Bartenev From hamano at osstech.co.jp Fri Mar 16 16:58:14 2012 From: hamano at osstech.co.jp (Tsukasa Hamano) Date: Sat, 17 Mar 2012 01:58:14 +0900 Subject: How to unset header in nginx module Message-ID: <87ehsszdnd.wl%hamano@osstech.co.jp> Hi, I'd like to delete particular headers_in like a apr_table_unset() in request handler of my module. I wrote examples from the article: http://wiki.nginx.org/HeadersManagement static void unset_header(ngx_http_request_t *r, u_char *key){ ngx_list_part_t *part; ngx_table_elt_t *h; ngx_uint_t i; size_t len = strlen((char *)key); part = &r->headers_in.headers.part; h = part->elts; for (i = 0; ; i++) { if (i >= part->nelts) { if (part->next == NULL) { break; } part = part->next; h = part->elts; i = 0; } if (len != h[i].key.len || ngx_strcasecmp(key, h[i].key.data) != 0) { h[i].hash = 0; h[i].key.len = 0; h[i].key.data = NULL; h[i].value.len = 0; h[i].value.data = NULL; h[i].lowcase_key = NULL; } } } But this code send empty header(only colon) line to backend. like this: : Should I reconstruct list of headers_in.headers? Or, should I modify http main module that to avoid sending null header? Or, Is there any better(faster) way? Thank you. -- Open Source Solution Technology Corporation Tsukasa Hamano fingerprint = 2285 2111 6D34 3816 3C2E A5B9 16BE D101 6069 BE55 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP Digital Signature URL: From nginx-forum at nginx.us Fri Mar 16 17:22:52 2012 From: nginx-forum at nginx.us (n1xman) Date: Fri, 16 Mar 2012 13:22:52 -0400 (EDT) Subject: Content Encoding Error while returning data from memcached stored by ngx_srcache In-Reply-To: <0bf493625f1c3895fd80a628fbc87e12.NginxMailingListEnglish@forum.nginx.org> References: <0bf493625f1c3895fd80a628fbc87e12.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4c77c85fef94e34e225a2e88e71ed8e8.NginxMailingListEnglish@forum.nginx.org> Hi agentzh, Thanks for the quick response. I have recompiled with the latest ngx_srcache and now it is working without any error. Thanks again for the support and this is brilliant piece of module for nginx and we loving it. n1xman Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223951,223976#msg-223976 From mdounin at mdounin.ru Fri Mar 16 17:32:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 16 Mar 2012 21:32:23 +0400 Subject: How to unset header in nginx module In-Reply-To: <87ehsszdnd.wl%hamano@osstech.co.jp> References: <87ehsszdnd.wl%hamano@osstech.co.jp> Message-ID: <20120316173223.GS67687@mdounin.ru> Hello! On Sat, Mar 17, 2012 at 01:58:14AM +0900, Tsukasa Hamano wrote: > Hi, > > I'd like to delete particular headers_in like a apr_table_unset() in > request handler of my module. > > I wrote examples from the article: > http://wiki.nginx.org/HeadersManagement > > static void unset_header(ngx_http_request_t *r, u_char *key){ > ngx_list_part_t *part; > ngx_table_elt_t *h; > ngx_uint_t i; > size_t len = strlen((char *)key); > > part = &r->headers_in.headers.part; > h = part->elts; > for (i = 0; ; i++) { > if (i >= part->nelts) { > if (part->next == NULL) { > break; > } > part = part->next; > h = part->elts; > i = 0; > } > if (len != h[i].key.len || ngx_strcasecmp(key, h[i].key.data) != 0) { > h[i].hash = 0; > h[i].key.len = 0; > h[i].key.data = NULL; > h[i].value.len = 0; > h[i].value.data = NULL; > h[i].lowcase_key = NULL; > } > } > } > > But this code send empty header(only colon) line to backend. > like this: > > : > > Should I reconstruct list of headers_in.headers? > Or, should I modify http main module that to avoid sending null header? > Or, Is there any better(faster) way? You shouldn't touch r->headers_in at all. It represents headers got from client, and it's incorrect to change them. Instead, to restrict headers passed to backends you should use functionality provided by relevant backend modules, e.g. with proxy_pass use proxy_set_header X-Some-Header ""; Maxim Dounin From baishen.lists at gmail.com Fri Mar 16 18:27:26 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Fri, 16 Mar 2012 14:27:26 -0400 Subject: Custom error pages In-Reply-To: <20120316151856.GP18773@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> <20120316151856.GP18773@craic.sysops.org> Message-ID: Doh! I forgot 'bout the error log. Apparently, nginx is looking for the file in /etc/nginx//html However, the default html files were installed in /usr/share/nginx/html I installed from the repo, so I'm not sure why it installed in one place yet is looking in another. And I don't have a root html directory set in any of the conf files. On Fri, Mar 16, 2012 at 11:18 AM, Francis Daly wrote: > On Fri, Mar 16, 2012 at 09:43:39AM -0400, Bai Shen wrote: > > Hi there, > > > I added this into my config file, and put my-503-error.html in the same > > location as the default 50x.html file, but all I get is a generic 404 > error > > page. > > You got an error page. > > What does the error log say? > > Either put your 503 file there; or configure "root" so that it is correct > within this location{}. > > If you're still having problems, please follow the "debug" instructions > to make it easier for people to help you. > > Details on the web site, but in brief: > > what did you do? > what did you see? > what did you expect to see? > > and the more specific you are, the easier it will be for someone else to > reproduce the problem you are reporting. > > Good luck with it, > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From quintinpar at gmail.com Sat Mar 17 04:01:59 2012 From: quintinpar at gmail.com (Quintin Par) Date: Sat, 17 Mar 2012 09:31:59 +0530 Subject: image_filter_jpeg_quality based on size Message-ID: Hi all, In the --with-http_image_filter_module: Can I set image_filter_jpeg_quality based on image size? Say I want to apply a loss of 75 to all images greater than 400KB. For the rest do nothing. -Quintin -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto at unbit.it Sat Mar 17 07:48:22 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Sat, 17 Mar 2012 08:48:22 +0100 Subject: [ANNOUNCE] uWSGI 1.1 Message-ID: <0d7a90a943d24d8052c0126af7790b74.squirrel@manage.unbit.it> I am pleased to announce the 1.1 release of the uWSGI project. This release focuses on a new option parser subsystem, improved perl/psgi and ruby/rack support and a new (stable) php plugin. A lot of optimizations have been introduced for the fastrouter and the various threading modes. This is the first release officially deprecating some old-style configuration (see notes). Changelog [20120317] - new options parser subsystem - improved php support http://projects.unbit.it/uwsgi/wiki/PHP - multiple spooler with multiprocessing simply add multiple --spooler options (on different directories) to have multiple spooler. Add --spooler-processes to fork() them - segmentation fault and floating point exceptions manager you will get a handy backtrace whenever SIGSEGV and SIGFPE are triggered - never-swap option enabling this option will force uWSGI to lock all memory areas on physical memory to avoid on-disk swapping. - zergpool plugin another step towards down-free reloads http://projects.unbit.it/uwsgi/wiki/ZergMode - perl/psgi multiple interpreters support you can now mount multiple perl-apps in the same process - deadlock detector on some specific conditions, uwsgi locking subsystem can be damaged, the master process got a new feature, allowing it to detect such conditions - pluggable cheaper algos by default the old-fashioned apache-style spare algorithm is used for adaptive process spawning. A new one, based on socket listen queue can be used, or you can implement a completely new approach: http://projects.unbit.it/uwsgi/browser/plugins/cheaper_backlog2/cheaper_backlog2.c - new internal routing susbsystem http://projects.unbit.it/uwsgi/wiki/InternalRouting - preliminary support for config logic http://projects.unbit.it/uwsgi/wiki/ConfigLogic - log rotation infrastructure you can now trigger log-rotation simply touching files - support for paste loggers - threading improvements - plugins can now mapped to specific modifiers - tag is deprecated (use mount option) - report startup time for apps - reintroduced expat support by default libxml2 is searched, if it is not available libexpat will be used. If both are not available, xml support will not be compiled in. - reintroduced remote spooler plugin - various fastrouter optimizations - added ruby rvm support add --gemset option to set a specific rvm gemset - a lot of fixes all over the place Notes: - tag has been deprecated, some simple old-style-config still works, but you should move to the new mount option. In uWSGI 1.2 the tag will map 1:1 to the mount one. - xml support is now automatically detected (and eventually not compiled in) Special thanks for this release go to Anthon van der Neut (mongrel2 fixes and setuptools packaging) ?ukasz Mierzwa (bug-hunter in-chief) Raffaele Colace (for the upython contrib script) Cal Leeming Ultrabug (ultrabug.fr, sorry i do not know your real name) Riccardo Magliocchetti C Anthony Risinger Evgeny Turnaev Marcin Deranek Mike Kuznetsov (sorry if i have missed someone) You can download uWSGI 1.1 from http://projects.unbit.it/downloads/uwsgi-1.1.tar.gz -- Roberto De Ioris http://unbit.it From hamano at osstech.co.jp Sat Mar 17 08:34:08 2012 From: hamano at osstech.co.jp (Tsukasa Hamano) Date: Sat, 17 Mar 2012 17:34:08 +0900 Subject: How to unset header in nginx module In-Reply-To: <20120316173223.GS67687@mdounin.ru> References: <87ehsszdnd.wl%hamano@osstech.co.jp> <20120316173223.GS67687@mdounin.ru> Message-ID: <87d38bzkvz.wl%hamano@osstech.co.jp> Hi Maxim, Thank you for your advice. At Fri, 16 Mar 2012 21:32:23 +0400, Maxim Dounin wrote: > > > Should I reconstruct list of headers_in.headers? > > Or, should I modify http main module that to avoid sending null header? > > Or, Is there any better(faster) way? > > You shouldn't touch r->headers_in at all. It represents headers > got from client, and it's incorrect to change them. > > Instead, to restrict headers passed to backends you should use > functionality provided by relevant backend modules, e.g. with > proxy_pass use > > proxy_set_header X-Some-Header ""; > I want to modify and unset header based on client request. Apache can do it. Is there a plan to make something like apr_table_unset()? I found the following code: https://github.com/agentzh/headers-more-nginx-module/blob/master/src/ngx_http_headers_more_util.c ngx_http_headers_more_rm_header() I think I have no choise other than this code. but It looks inefficient and slow. Perhaps we can give meaning to key.len = 0 is unset flag, because empty header name is not permitted by RFC. Thanks for your comment. -- Open Source Solution Technology Corporation Tsukasa Hamano fingerprint = 2285 2111 6D34 3816 3C2E A5B9 16BE D101 6069 BE55 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP Digital Signature URL: From wandenberg at gmail.com Sat Mar 17 14:50:55 2012 From: wandenberg at gmail.com (Wandenberg Peixoto) Date: Sat, 17 Mar 2012 11:50:55 -0300 Subject: [push-stream-announce] Release nginx-push-stream version 0.3.3 Message-ID: Hi, I am releasing version 0.3.3 of nginx push stream module Changelog: * Adding JSONP support to pushstream.js and dynamically callback parameter * Adding event type feature to Event Source support * Adding tag and time available at message template, and make possible pass these values without set headers * Adding a reference count to the message to avoid discard it before be processed for all workers * Adding padding messages based on user agent to bypass some problems on android/safari browsers on long-polling * Improvement on memory usage to reuse chains and buffers * Improvement on javascript message parser regexp * Improvement on sending alert messages to workers only when necessary * Improvement on reset ping timer when a message is sent * Improvement on disconnect any subscriber which receives a non OK response when writing to its socket * Improvement on documentation organization * Improvement on preventing XSS when using pushstream.js * Fixing memory leak when saving channels on a rbtree with ids which collides, problem inherited from Nginx and reported by Lanshun Zhou * Fixing memory leak in javascript * Fixing read messages in high throughput using keepalive on * Fixing EventSourceWrapper class on pushstream.js to use native reconnection feature from EventSource Regards, Wandenberg -------------- next part -------------- An HTML attachment was scrubbed... URL: From kayasaman at gmail.com Sat Mar 17 17:53:18 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sat, 17 Mar 2012 17:53:18 +0000 Subject: Using Nginx to stream h.264 video Message-ID: <4F64CF8D.5040008@gmail.com> Hi, I'm currently trying to setup Nginx to stream an mp4 video file. Currently I have read through: http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Nginx-Version2 http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Testing-Version2 but wasn't quite sure how to integrate these with Nginx itself. I have a few questions regarding this: Is this the mp4 module that I need to be able to stream or is there an embedded solution? Currently I'm running CentOS 6.2 as the server OS and have install Nginx from the EPEL repo.... does this contain the module or do I need to get the source code and compile it in? If I need the source code where can I find it as I checked on the site but got lost? Once I have everything correctly up and running how do integrate or rather embed a video into an html page? - are there any guides on this? Sorry if these questions are quite obvious but I am totally new to Nginx and I'm still trying to understand the documentation. Regards, Kaya From cliff at develix.com Sat Mar 17 18:41:58 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 17 Mar 2012 11:41:58 -0700 Subject: Using Nginx to stream h.264 video In-Reply-To: <4F64CF8D.5040008@gmail.com> References: <4F64CF8D.5040008@gmail.com> Message-ID: <1332009718.2437.8.camel@portable-evil> On Sat, 2012-03-17 at 17:53 +0000, Kaya Saman wrote: > Is this the mp4 module that I need to be able to stream or is there an > embedded solution? http://nginx.org/en/docs/http/ngx_http_mp4_module.html > Currently I'm running CentOS 6.2 as the server OS and have install Nginx > from the EPEL repo.... does this contain the module or do I need to get > the source code and compile it in? I would uninstall this and install from the official repositories instead (they are newer): http://wiki.nginx.org/Install#Official_Red_Hat.2FCentOS_packages Regards, Cliff From kayasaman at gmail.com Sat Mar 17 19:16:45 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sat, 17 Mar 2012 19:16:45 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: <1332009718.2437.8.camel@portable-evil> References: <4F64CF8D.5040008@gmail.com> <1332009718.2437.8.camel@portable-evil> Message-ID: <4F64E31D.4010604@gmail.com> On 03/17/2012 06:41 PM, Cliff Wells wrote: > On Sat, 2012-03-17 at 17:53 +0000, Kaya Saman wrote: > >> Is this the mp4 module that I need to be able to stream or is there an >> embedded solution? > http://nginx.org/en/docs/http/ngx_http_mp4_module.html Thanks. The links states: " This module is not built by default, it should be enabled with the |--with-http_mp4_module| configuration parameter. " So does this mean that from the **official** repo stated below that Nginx isn't built with this module??? If not then where do I find the source code to get it or can I grab the module from the repo, as in yum install mp4_module? >> Currently I'm running CentOS 6.2 as the server OS and have install Nginx >> from the EPEL repo.... does this contain the module or do I need to get >> the source code and compile it in? > I would uninstall this and install from the official repositories > instead (they are newer): > > http://wiki.nginx.org/Install#Official_Red_Hat.2FCentOS_packages > > Regards, > Cliff Regards, Kaya > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at develix.com Sat Mar 17 19:54:04 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 17 Mar 2012 12:54:04 -0700 Subject: Using Nginx to stream h.264 video In-Reply-To: <4F64E31D.4010604@gmail.com> References: <4F64CF8D.5040008@gmail.com> <1332009718.2437.8.camel@portable-evil> <4F64E31D.4010604@gmail.com> Message-ID: <1332014044.2437.15.camel@portable-evil> On Sat, 2012-03-17 at 19:16 +0000, Kaya Saman wrote: > On 03/17/2012 06:41 PM, Cliff Wells wrote: > > On Sat, 2012-03-17 at 17:53 +0000, Kaya Saman wrote: > > > > > Is this the mp4 module that I need to be able to stream or is there an > > > embedded solution? > > http://nginx.org/en/docs/http/ngx_http_mp4_module.html > > Thanks. The links states: > > " This module is not built by default, it should be enabled with the > --with-http_mp4_module configuration parameter. " > > So does this mean that from the **official** repo stated below that > Nginx isn't built with this module??? It is. Here's the output from "nginx -V" on one of my CentOS systems with the official nginx installed: --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_flv_module --with-http_mp4_module ^^^^^^^^^^^^^^^^^^^^^^ --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -march=i386 -mtune=i686' > If not then where do I find the source code to get it or can I grab > the module from the repo, as in yum install mp4_module? The source code is available at http://nginx.org More information on Nginx can be found at http://wiki.nginx.org (including links to the source). Regards, Cliff From kayasaman at gmail.com Sat Mar 17 20:01:33 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sat, 17 Mar 2012 20:01:33 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: <1332014044.2437.15.camel@portable-evil> References: <4F64CF8D.5040008@gmail.com> <1332009718.2437.8.camel@portable-evil> <4F64E31D.4010604@gmail.com> <1332014044.2437.15.camel@portable-evil> Message-ID: <4F64ED9D.80002@gmail.com> Thanks a lot Cliff I really appreciate the help! However as per the documentation it claims {http://nginx.org/en/docs/http/ngx_http_mp4_module.html}: " location /video/ { mp4; mp4_buffer_size 1m; mp4_max_buffer_size 5m; } " as the configuration for the module. I added the above to the nginx.conf file and now nginx won't start so I'm guessing that it's been added to the wrong place?? Also I guess what I'm trying to find out more then anything else is if Nginx will be able to serve up information like YouTube? By embedding the video into an html page then streaming via web browser with sufficient plugin or straight to a player such as Mplayer or Xine? Is there any guide or howto on how to do this as the documentation seems a little sparse! Regards, Kaya On 03/17/2012 07:54 PM, Cliff Wells wrote: > On Sat, 2012-03-17 at 19:16 +0000, Kaya Saman wrote: >> On 03/17/2012 06:41 PM, Cliff Wells wrote: >>> On Sat, 2012-03-17 at 17:53 +0000, Kaya Saman wrote: >>> >>>> Is this the mp4 module that I need to be able to stream or is there an >>>> embedded solution? >>> http://nginx.org/en/docs/http/ngx_http_mp4_module.html >> Thanks. The links states: >> >> " This module is not built by default, it should be enabled with the >> --with-http_mp4_module configuration parameter. " >> >> So does this mean that from the **official** repo stated below that >> Nginx isn't built with this module??? > It is. Here's the output from "nginx -V" on one of my CentOS systems > with the official nginx installed: > > --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_flv_module > --with-http_mp4_module > > ^^^^^^^^^^^^^^^^^^^^^^ > > --with-http_gzip_static_module > --with-http_random_index_module > --with-http_secure_link_module > --with-http_stub_status_module > --with-mail > --with-mail_ssl_module > --with-file-aio > --with-ipv6 > --with-cc-opt='-O2 -g -march=i386 -mtune=i686' > >> If not then where do I find the source code to get it or can I grab >> the module from the repo, as in yum install mp4_module? > The source code is available at http://nginx.org > > More information on Nginx can be found at http://wiki.nginx.org > (including links to the source). > > Regards, > Cliff > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From cliff at develix.com Sat Mar 17 20:11:54 2012 From: cliff at develix.com (Cliff Wells) Date: Sat, 17 Mar 2012 13:11:54 -0700 Subject: Using Nginx to stream h.264 video In-Reply-To: <4F64ED9D.80002@gmail.com> References: <4F64CF8D.5040008@gmail.com> <1332009718.2437.8.camel@portable-evil> <4F64E31D.4010604@gmail.com> <1332014044.2437.15.camel@portable-evil> <4F64ED9D.80002@gmail.com> Message-ID: <1332015114.2437.20.camel@portable-evil> On Sat, 2012-03-17 at 20:01 +0000, Kaya Saman wrote: > I added the above to the nginx.conf file and now nginx won't start so > I'm guessing that it's been added to the wrong place?? Checking your logs is somewhat better than guessing ;-) On CentOS that's probably /var/log/nginx/error.log. > Also I guess what I'm trying to find out more then anything else is if > Nginx will be able to serve up information like YouTube? By embedding > the video into an html page then streaming via web browser with > sufficient plugin or straight to a player such as Mplayer or Xine? I believe the mp4 module is designed for use with Flash. Someone else who has actually used it could probably offer a more informed opinion. > Is there any guide or howto on how to do this as the documentation seems > a little sparse! I suspect it's sparse because there's not much to it on the Nginx-side of things. If you are looking for a guide for the client-side as well, I can only suggest Google or hope that someone here can offer more assistance on that end. Regards, Cliff From kayasaman at gmail.com Sat Mar 17 20:14:34 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sat, 17 Mar 2012 20:14:34 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: <1332015114.2437.20.camel@portable-evil> References: <4F64CF8D.5040008@gmail.com> <1332009718.2437.8.camel@portable-evil> <4F64E31D.4010604@gmail.com> <1332014044.2437.15.camel@portable-evil> <4F64ED9D.80002@gmail.com> <1332015114.2437.20.camel@portable-evil> Message-ID: <4F64F0AA.5000307@gmail.com> Many thanks Cliff for your support! Regards, Kaya On 03/17/2012 08:11 PM, Cliff Wells wrote: > On Sat, 2012-03-17 at 20:01 +0000, Kaya Saman wrote: > >> I added the above to the nginx.conf file and now nginx won't start so >> I'm guessing that it's been added to the wrong place?? > Checking your logs is somewhat better than guessing ;-) On CentOS > that's probably /var/log/nginx/error.log. > >> Also I guess what I'm trying to find out more then anything else is if >> Nginx will be able to serve up information like YouTube? By embedding >> the video into an html page then streaming via web browser with >> sufficient plugin or straight to a player such as Mplayer or Xine? > I believe the mp4 module is designed for use with Flash. Someone else > who has actually used it could probably offer a more informed opinion. > >> Is there any guide or howto on how to do this as the documentation seems >> a little sparse! > I suspect it's sparse because there's not much to it on the Nginx-side > of things. If you are looking for a guide for the client-side as well, > I can only suggest Google or hope that someone here can offer more > assistance on that end. > > Regards, > Cliff > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From jombik at platon.org Sun Mar 18 08:09:01 2012 From: jombik at platon.org (Ondrej Jombik) Date: Sun, 18 Mar 2012 09:09:01 +0100 (CET) Subject: Suggestions for streaming architecture Message-ID: I am building new streaming architecture and I would like to ask you sugestions. We will stream FLV and MP4, both using native nginx modules. There is one storage server and 4 video streamers. Storage server contains all the FLV and MP4 files. Streamers by default does not contain anything (except configuration), but they have fast SAS drives in RAID-0, what we can use for caching/mirroring/whatever. Our goal is to move load from storage server to those streamers. Because all the servers are on the same gigabit LAN, I can have any setup I want. I see these three options: 1. mount storage via NFS and stream files from this NFS (I have no idea how to setup caching/mirroring in this case) 2. forward all the request to storage backend and use proxy_cache on streamers (this will, however, cache also request with start=NN, where NN>0, so I might have cache poluted with a lot of unusable MP4/FLV files) 3. use proxy_store; documentation says it is mirror on demand, but how to mirror only whole MP4/FLV files in this mirror-on-demand? If there is any other possibility how to do this, please suggest. Thanks for you suggestions Ondrej -- Ondrej JOMBIK Platon Technologies s.r.o., Hlavna 3, Sala SK-92701 +421 903 PLATON - info at platon.org - http://platon.org From lists at ruby-forum.com Sun Mar 18 10:03:26 2012 From: lists at ruby-forum.com (Delai S.) Date: Sun, 18 Mar 2012 11:03:26 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org> Message-ID: Roberto De Ioris wrote in post #1048644: >> --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl >> --with-xmlrpc --with-xsl --with-bz2 --with-gettext >> --with-fpm-user=www-data --with-fpm-group=www-data --disable-debug >> --enable-fpm --enable-exif --enable-wddx --enable-zip --enable-bcmath >> --enable-calendar --enable-ftp --enable-embed --enable-mbstring >> --enable-soap --enable-sockets --enable-shmop --enable-dba >> --enable-inline-optimization --enable-sysvsem --enable-sysvshm >> --enable-sysvmsg >> >> How would I then proceed to build the uWSGI php plugin? >> > > download 1.1 uWSGI sources: > > http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz > > uncompress and move to the resulting directory and run > > make > > if all goes well you will end with a binary named 'uwsgi' > > then build the php plugin with > > python uwsgiconfig.py --plugin plugins/php > > finally run (always from the same dir) > > ./uwsgi -s :3031 --plugins php > > now point nginx to that port as described here: > > http://projects.unbit.it/uwsgi/wiki/PHP > > -- > Roberto De Ioris > http://unbit.it Hi, I follow the tutorial of http://projects.unbit.it/uwsgi/wiki/PHP the server config in nginx is: server { listen 8080; server_name www.myphp.com myphp.com; location ~ .php { root /var/www/php_test; uwsgi_pass 127.0.0.1:3030; include uwsgi_params; } } Put a file name index.php in /var/www/php_test. Than i run uwsgi -s :3030 --plugin php -M -p 4 the output is: >>> *** Starting uWSGI 1.1 (64bit) on [Sun Mar 18 17:57:32 2012] *** compiled with version: 4.6.1 on 17 March 2012 17:44:26 current working directory: /home/delai/uwsgi detected binary path: /usr/local/bin/uwsgi your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread mutexes uwsgi socket 0 bound to TCP address :3030 fd 3 Python version: 2.7.2+ (default, Oct 4 2011, 20:41:12) [GCC 4.6.1] Python main interpreter initialized at 0x6945a0 PHP 5.3.10 initialized your server socket listen backlog is limited to 100 connections *** Operational MODE: preforking *** *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 9385) spawned uWSGI worker 1 (pid: 9386, cores: 1) spawned uWSGI worker 2 (pid: 9387, cores: 1) spawned uWSGI worker 3 (pid: 9388, cores: 1) spawned uWSGI worker 4 (pid: 9389, cores: 1) <<< it looks fine. when i visit http://myphp.com:8080/, nginx return 404 not found visit http://myphp.com:8080/index.php, nginx return "uWSGI Error Python application not found" php was recompiled and php plugin was configured. Any one know Why? -- Posted via http://www.ruby-forum.com/. From luky-37 at hotmail.com Sun Mar 18 12:39:33 2012 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sun, 18 Mar 2012 13:39:33 +0100 Subject: Using Nginx to stream h.264 video In-Reply-To: <4F64ED9D.80002@gmail.com> References: <4F64CF8D.5040008@gmail.com>, <1332009718.2437.8.camel@portable-evil>, <4F64E31D.4010604@gmail.com>, <1332014044.2437.15.camel@portable-evil>, <4F64ED9D.80002@gmail.com> Message-ID: > Is there any guide or howto on how to do this as the documentation seems > a little sparse! nginx and the mp4 module documentation is about the server side of things only. If you need documentation and solutions for the client side, take a look at JWPlayer [1], but remember its off-topic on this list. Longtailvideo has forums and commercial support offerings, in case you need any support on JWPlayer. [1] http://www.longtailvideo.com/players/ From kayasaman at gmail.com Sun Mar 18 12:44:11 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sun, 18 Mar 2012 12:44:11 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: References: <4F64CF8D.5040008@gmail.com>, <1332009718.2437.8.camel@portable-evil>, <4F64E31D.4010604@gmail.com>, <1332014044.2437.15.camel@portable-evil>, <4F64ED9D.80002@gmail.com> Message-ID: <4F65D89B.70109@gmail.com> On 03/18/2012 12:39 PM, Lukas Tribus wrote: >> Is there any guide or howto on how to do this as the documentation seems >> a little sparse! > nginx and the mp4 module documentation is about the server side of things only. > > > If you need documentation and solutions for the client side, take a look at > JWPlayer [1], but remember its off-topic on this list. Longtailvideo has > forums and commercial support offerings, in case you need any support on > JWPlayer. > > > [1] http://www.longtailvideo.com/players/ > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Many thanks! I actually discovered how to 'server up' video files using nginx: location /video/ { mp4; mp4_buffer_size 1m; mp4_max_buffer_size 5m; root /usr/share/nginx/html; } by putting the above into conf.d/default.conf Now it all works fine and am able to access the video via mplayer. Quick question... is building an html page then embedding a video into it client side? I always considered that server side while my view of client side was always just the browser and URL........ Regards, Kaya From roberto at unbit.it Sun Mar 18 15:29:53 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Sun, 18 Mar 2012 16:29:53 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org> Message-ID: <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> > Roberto De Ioris wrote in post #1048644: >>> --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl >>> --with-xmlrpc --with-xsl --with-bz2 --with-gettext >>> --with-fpm-user=www-data --with-fpm-group=www-data --disable-debug >>> --enable-fpm --enable-exif --enable-wddx --enable-zip --enable-bcmath >>> --enable-calendar --enable-ftp --enable-embed --enable-mbstring >>> --enable-soap --enable-sockets --enable-shmop --enable-dba >>> --enable-inline-optimization --enable-sysvsem --enable-sysvshm >>> --enable-sysvmsg >>> >>> How would I then proceed to build the uWSGI php plugin? >>> >> >> download 1.1 uWSGI sources: >> >> http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz >> >> uncompress and move to the resulting directory and run >> >> make >> >> if all goes well you will end with a binary named 'uwsgi' >> >> then build the php plugin with >> >> python uwsgiconfig.py --plugin plugins/php >> >> finally run (always from the same dir) >> >> ./uwsgi -s :3031 --plugins php >> >> now point nginx to that port as described here: >> >> http://projects.unbit.it/uwsgi/wiki/PHP >> >> -- >> Roberto De Ioris >> http://unbit.it > > > Hi, I follow the tutorial of http://projects.unbit.it/uwsgi/wiki/PHP > > the server config in nginx is: > > server { > listen 8080; > server_name www.myphp.com myphp.com; > location ~ .php { > root /var/www/php_test; > uwsgi_pass 127.0.0.1:3030; > include uwsgi_params; > } > } here you have missed uwsgi_modifier1 14; that instruct uWSGI to route the request to the php plugin. About index.php you can add an index directive in nginx or php-index = index.php in uwsgi config -- Roberto De Ioris http://unbit.it From Richard.Kearsley at m247.com Sun Mar 18 16:59:32 2012 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Sun, 18 Mar 2012 16:59:32 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: <4F65D89B.70109@gmail.com> References: <4F64CF8D.5040008@gmail.com>, <1332009718.2437.8.camel@portable-evil>, <4F64E31D.4010604@gmail.com>, <1332014044.2437.15.camel@portable-evil>, <4F64ED9D.80002@gmail.com> , <4F65D89B.70109@gmail.com> Message-ID: Nginx can't write a website for you if that's what you mean It's long hard work making a tube site, either pay someone or get learning :) -- Richard On 18 Mar 2012, at 12:44, "Kaya Saman" wrote: > On 03/18/2012 12:39 PM, Lukas Tribus wrote: >>> Is there any guide or howto on how to do this as the documentation seems >>> a little sparse! >> nginx and the mp4 module documentation is about the server side of things only. >> >> >> If you need documentation and solutions for the client side, take a look at >> JWPlayer [1], but remember its off-topic on this list. Longtailvideo has >> forums and commercial support offerings, in case you need any support on >> JWPlayer. >> >> >> [1] http://www.longtailvideo.com/players/ >> >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://mailman.nginx.org/mailman/listinfo/nginx > > Many thanks! > > I actually discovered how to 'server up' video files using nginx: > > > location /video/ { > mp4; > mp4_buffer_size 1m; > mp4_max_buffer_size 5m; > root /usr/share/nginx/html; > } > > > by putting the above into conf.d/default.conf > > > Now it all works fine and am able to access the video via mplayer. > > > Quick question... is building an html page then embedding a video into it client side? I always considered that server side while my view of client side was always just the browser and URL........ > > > Regards, > > > Kaya > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From kayasaman at gmail.com Sun Mar 18 18:03:18 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sun, 18 Mar 2012 18:03:18 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: References: <4F64CF8D.5040008@gmail.com>, <1332009718.2437.8.camel@portable-evil>, <4F64E31D.4010604@gmail.com>, <1332014044.2437.15.camel@portable-evil>, <4F64ED9D.80002@gmail.com> , <4F65D89B.70109@gmail.com> Message-ID: <4F662366.6010209@gmail.com> On 03/18/2012 04:59 PM, Richard Kearsley wrote: > Nginx can't write a website for you if that's what you mean No no that's not what I meant :-) A long time ago I played around with the Darwin Streaming Server from Apple and vaguely recall the mechanism used to call up the .mov files in an html page. I was more referring to either a jscript or php snippet that would allow for the embed.... just something quick and easy. No biggie though! > > It's long hard work making a tube site, either pay someone or get learning :) I personally don't intend to, the only knowledge I need is what I kinda have already but would be nice to know the above (jscript or php) too...... Regards, Kaya > > -- > Richard > > On 18 Mar 2012, at 12:44, "Kaya Saman" wrote: > >> On 03/18/2012 12:39 PM, Lukas Tribus wrote: >>>> Is there any guide or howto on how to do this as the documentation seems >>>> a little sparse! >>> nginx and the mp4 module documentation is about the server side of things only. >>> >>> >>> If you need documentation and solutions for the client side, take a look at >>> JWPlayer [1], but remember its off-topic on this list. Longtailvideo has >>> forums and commercial support offerings, in case you need any support on >>> JWPlayer. >>> >>> >>> [1] http://www.longtailvideo.com/players/ >>> >>> >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> Many thanks! >> >> I actually discovered how to 'server up' video files using nginx: >> >> >> location /video/ { >> mp4; >> mp4_buffer_size 1m; >> mp4_max_buffer_size 5m; >> root /usr/share/nginx/html; >> } >> >> >> by putting the above into conf.d/default.conf >> >> >> Now it all works fine and am able to access the video via mplayer. >> >> >> Quick question... is building an html page then embedding a video into it client side? I always considered that server side while my view of client side was always just the browser and URL........ >> >> >> Regards, >> >> >> Kaya >> >> _______________________________________________ >> 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 Richard.Kearsley at m247.com Sun Mar 18 19:39:01 2012 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Sun, 18 Mar 2012 19:39:01 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: <4F662366.6010209@gmail.com> References: <4F64CF8D.5040008@gmail.com>, <1332009718.2437.8.camel@portable-evil>, <4F64E31D.4010604@gmail.com>, <1332014044.2437.15.camel@portable-evil>, <4F64ED9D.80002@gmail.com> , <4F65D89B.70109@gmail.com> <4F662366.6010209@gmail.com> Message-ID: The primary reason for the mp4 module is to allow seeking of the video before the whole file has been downloaded by flash - it's all a nasty workaround for flash being **** Mp4 can be used in some browsers with html5 video tag (and most mobile devices) Otherwise you will have to use one of the flash video players, like flowplayer or jwplayer The nginx mp4 filter is only beneficial to the latter as it allows pseudo-streaming in flash Html5 will work fine without the mp4 module and indeed in other httpds, as it uses the http range header (e.g. to seek the video, it just "resumes" the download from a later point) -----Original Message----- From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of Kaya Saman Sent: 18 March 2012 18:03 To: nginx at nginx.org Subject: Re: Using Nginx to stream h.264 video On 03/18/2012 04:59 PM, Richard Kearsley wrote: > Nginx can't write a website for you if that's what you mean No no that's not what I meant :-) A long time ago I played around with the Darwin Streaming Server from Apple and vaguely recall the mechanism used to call up the .mov files in an html page. I was more referring to either a jscript or php snippet that would allow for the embed.... just something quick and easy. No biggie though! > > It's long hard work making a tube site, either pay someone or get learning :) I personally don't intend to, the only knowledge I need is what I kinda have already but would be nice to know the above (jscript or php) too...... Regards, Kaya > > -- > Richard > > On 18 Mar 2012, at 12:44, "Kaya Saman" wrote: > >> On 03/18/2012 12:39 PM, Lukas Tribus wrote: >>>> Is there any guide or howto on how to do this as the documentation seems >>>> a little sparse! >>> nginx and the mp4 module documentation is about the server side of things only. >>> >>> >>> If you need documentation and solutions for the client side, take a look at >>> JWPlayer [1], but remember its off-topic on this list. Longtailvideo has >>> forums and commercial support offerings, in case you need any support on >>> JWPlayer. >>> >>> >>> [1] http://www.longtailvideo.com/players/ >>> >>> >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> Many thanks! >> >> I actually discovered how to 'server up' video files using nginx: >> >> >> location /video/ { >> mp4; >> mp4_buffer_size 1m; >> mp4_max_buffer_size 5m; >> root /usr/share/nginx/html; >> } >> >> >> by putting the above into conf.d/default.conf >> >> >> Now it all works fine and am able to access the video via mplayer. >> >> >> Quick question... is building an html page then embedding a video into it client side? I always considered that server side while my view of client side was always just the browser and URL........ >> >> >> Regards, >> >> >> Kaya >> >> _______________________________________________ >> 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 kayasaman at gmail.com Sun Mar 18 20:06:56 2012 From: kayasaman at gmail.com (Kaya Saman) Date: Sun, 18 Mar 2012 20:06:56 +0000 Subject: Using Nginx to stream h.264 video In-Reply-To: References: <4F64CF8D.5040008@gmail.com>, <1332009718.2437.8.camel@portable-evil>, <4F64E31D.4010604@gmail.com>, <1332014044.2437.15.camel@portable-evil>, <4F64ED9D.80002@gmail.com> , <4F65D89B.70109@gmail.com> <4F662366.6010209@gmail.com> Message-ID: <4F664060.5010303@gmail.com> On 03/18/2012 07:39 PM, Richard Kearsley wrote: > The primary reason for the mp4 module is to allow seeking of the video before the whole file has been downloaded by flash - it's all a nasty workaround for flash being **** > > Mp4 can be used in some browsers with html5 video tag (and most mobile devices) > Otherwise you will have to use one of the flash video players, like flowplayer or jwplayer > > The nginx mp4 filter is only beneficial to the latter as it allows pseudo-streaming in flash > Html5 will work fine without the mp4 module and indeed in other httpds, as it uses the http range header (e.g. to seek the video, it just "resumes" the download from a later point) Thanks the HTML5 video tag worked :-) Regards, Kaya > > -----Original Message----- > From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of Kaya Saman > Sent: 18 March 2012 18:03 > To: nginx at nginx.org > Subject: Re: Using Nginx to stream h.264 video > > On 03/18/2012 04:59 PM, Richard Kearsley wrote: >> Nginx can't write a website for you if that's what you mean > No no that's not what I meant :-) > > A long time ago I played around with the Darwin Streaming Server from Apple and vaguely recall the mechanism used to call up the .mov files in an html page. > > I was more referring to either a jscript or php snippet that would allow for the embed.... just something quick and easy. No biggie though! > > > > >> It's long hard work making a tube site, either pay someone or get learning :) > I personally don't intend to, the only knowledge I need is what I kinda > have already but would be nice to know the above (jscript or php) too...... > > > Regards, > > > Kaya > > >> -- >> Richard >> >> On 18 Mar 2012, at 12:44, "Kaya Saman" wrote: >> >>> On 03/18/2012 12:39 PM, Lukas Tribus wrote: >>>>> Is there any guide or howto on how to do this as the documentation seems >>>>> a little sparse! >>>> nginx and the mp4 module documentation is about the server side of things only. >>>> >>>> >>>> If you need documentation and solutions for the client side, take a look at >>>> JWPlayer [1], but remember its off-topic on this list. Longtailvideo has >>>> forums and commercial support offerings, in case you need any support on >>>> JWPlayer. >>>> >>>> >>>> [1] http://www.longtailvideo.com/players/ >>>> >>>> >>>> >>>> _______________________________________________ >>>> nginx mailing list >>>> nginx at nginx.org >>>> http://mailman.nginx.org/mailman/listinfo/nginx >>> Many thanks! >>> >>> I actually discovered how to 'server up' video files using nginx: >>> >>> >>> location /video/ { >>> mp4; >>> mp4_buffer_size 1m; >>> mp4_max_buffer_size 5m; >>> root /usr/share/nginx/html; >>> } >>> >>> >>> by putting the above into conf.d/default.conf >>> >>> >>> Now it all works fine and am able to access the video via mplayer. >>> >>> >>> Quick question... is building an html page then embedding a video into it client side? I always considered that server side while my view of client side was always just the browser and URL........ >>> >>> >>> Regards, >>> >>> >>> Kaya >>> >>> _______________________________________________ >>> 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 hamano at osstech.co.jp Mon Mar 19 03:27:20 2012 From: hamano at osstech.co.jp (Tsukasa Hamano) Date: Mon, 19 Mar 2012 12:27:20 +0900 Subject: src/os/win32/ is not found in source archive Message-ID: <87bontz2w7.wl%hamano@osstech.co.jp> Hi, I'm trying to build windows binary. But I can't find some files in src/os/win32/ It would be nice if you include win32 files in source archive. # I know there is the files in svn repository. Thank you. -- Open Source Solution Technology Corporation Tsukasa Hamano fingerprint = 2285 2111 6D34 3816 3C2E A5B9 16BE D101 6069 BE55 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP Digital Signature URL: From www at lc365.net Mon Mar 19 05:23:29 2012 From: www at lc365.net (=?gb2312?B?ufnV8cGi?=) Date: Mon, 19 Mar 2012 13:23:29 +0800 Subject: a new uWSGI PHP plugin is available In-Reply-To: <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it>, <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org>, , , <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> Message-ID: Hello Roberto, Thank you for so cute plugin. I'd tested the PHP-FPM and uWSGI-PHP at the same box. They can be configued to run at the same time to the same scripts. I found from the scripts's spend time that PHP-FPM is a little faster than uWSGI-PHP, about 0.010ms ~0.030ms faster than uWSGI-PHP. I wonder if is there any tips to optimize the options to compile the uWSGI to run PHP only no other plugins and unneccesary functions? And more, is there any options to make libphp5 better for speed? Thank you very much. Robert > > download 1.1 uWSGI sources: > > http://projects.unbit.it/downloads/uwsgi-1.1-snapshot5.tar.gz > > uncompress and move to the resulting directory and run > > make > > if all goes well you will end with a binary named 'uwsgi' > > then build the php plugin with > > python uwsgiconfig.py --plugin plugins/php > > finally run (always from the same dir) > > ./uwsgi -s :3031 --plugins php > > now point nginx to that port as described here: > > http://projects.unbit.it/uwsgi/wiki/PHP > > -- > Roberto De Ioris > http://unbit.it > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto at unbit.it Mon Mar 19 06:24:39 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 19 Mar 2012 07:24:39 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it>, <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org>, , , <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> Message-ID: <636e4cea6bc00f78f889cdda8e1996a7.squirrel@manage.unbit.it> > > Hello Roberto, > > > Thank you for so cute plugin. > > > > I'd tested the PHP-FPM and uWSGI-PHP at the same box. They can be > configued to run at the same time to the same scripts. > > > I found from the scripts's spend time that PHP-FPM is a little faster than > uWSGI-PHP, about 0.010ms ~0.030ms faster than uWSGI-PHP. > > > I wonder if is there any tips to optimize the options to compile the uWSGI > to run PHP only no other plugins and unneccesary functions? And more, is > there any options to make libphp5 better for speed? > > > Thank you very much. > > > Robert There should be not much difference in both (or php-fastcgi), the only thing that came to my mind is in different configuration. Best way to test is in using both with a single process, or with the same number of processes (adaptive process spawning is completely different from the php-fpm one so i would not expect a fair comparison). But again, do not expect too much differences, the internal php stuff is the same. -- Roberto De Ioris http://unbit.it From roberto at unbit.it Mon Mar 19 06:50:28 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 19 Mar 2012 07:50:28 +0100 Subject: a new uWSGI PHP plugin is available [integration] In-Reply-To: <636e4cea6bc00f78f889cdda8e1996a7.squirrel@manage.unbit.it> References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it>, <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org>, , , <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> <636e4cea6bc00f78f889cdda8e1996a7.squirrel@manage.unbit.it> Message-ID: <1177f87b8a159e8c565b4589242005bb.squirrel@manage.unbit.it> > > > > There should be not much difference in both (or php-fastcgi), the only > thing that came to my mind is in different configuration. > > Best way to test is in using both with a single process, or with the same > number of processes (adaptive process spawning is completely different > from the php-fpm one so i would not expect a fair comparison). But again, > do not expect too much differences, the internal php stuff is the same. > ...and obviously disable request logging as uWSGI by default is really verbose. This is the command line of my test suite: ./uwsgi -s :3031 --plugins php --disable-logging -p 4 -M this spawn 4 processes (as php-fpm default on debian/ubuntu). -- Roberto De Ioris http://unbit.it From nginx-forum at nginx.us Mon Mar 19 10:02:56 2012 From: nginx-forum at nginx.us (rishabh) Date: Mon, 19 Mar 2012 06:02:56 -0400 (EDT) Subject: Get request_body in set_by_lua directive In-Reply-To: <6140397ba88d1f5dd2d97139c5d88047.NginxMailingListEnglish@forum.nginx.org> References: <6140397ba88d1f5dd2d97139c5d88047.NginxMailingListEnglish@forum.nginx.org> Message-ID: <284ffe8675af624f266d5de3aec67893.NginxMailingListEnglish@forum.nginx.org> thanks have figured it out. Another concern is, Say the processing time of LUA file is 10 seconds and the request completes in 4 seconds. So will the total time NGINX take will be 10 secs or 14 secs ? Here is how i have structured my conf http { server { location / { proxy_pass http://upstream123; post_action @loglua; } location @loglua { set $log ''; rewrite_by_lua_file /nginx/mylua.lua; logformat format1 '$log'; access_log /var/log/nginx/newlog.log format1; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223876,224020#msg-224020 From nginx-forum at nginx.us Mon Mar 19 10:08:15 2012 From: nginx-forum at nginx.us (rishabh) Date: Mon, 19 Mar 2012 06:08:15 -0400 (EDT) Subject: Sending Traffic to another Server/Port/IP asynchronously In-Reply-To: References: <99a0ae2be9961e64f44ac416ec1ede38.NginxMailingListEnglish@forum.nginx.org> Message-ID: <249c949cc21bb63846c23a61b9c9426c.NginxMailingListEnglish@forum.nginx.org> That logging issue was a mistake. All the access_log directive need to be in a single location/server block. After a lot of testing. I found an issue. The processing time of post_action is added to the response time. hence delaying the response. Here is how i have used post_action to log. http { server { location / { proxy_pass http://upstream123; post_action @loglua; } location @loglua { set $log ''; rewrite_by_lua_file /nginx/mylua.lua; logformat format1 '$log'; access_log /var/log/nginx/newlog.log format1; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,222196,224021#msg-224021 From nginx-forum at nginx.us Mon Mar 19 10:08:46 2012 From: nginx-forum at nginx.us (rishabh) Date: Mon, 19 Mar 2012 06:08:46 -0400 (EDT) Subject: Sending Traffic to another Server/Port/IP asynchronously In-Reply-To: References: <99a0ae2be9961e64f44ac416ec1ede38.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3bf4973efb7ef2a1284fac970c66a804.NginxMailingListEnglish@forum.nginx.org> rishabh Wrote: ------------------------------------------------------- > Thanks, post_action works like a charm. > > Just one problem. Nothing is getting logged > access_log if i use post_action ! whats the > co-relation ? That logging issue was a mistake. All the access_log directive need to be in a single location/server block. After a lot of testing. I found another issue. The processing time of post_action is added to the response time. hence delaying the response. Here is how i have used post_action to log. http { server { location / { proxy_pass http://upstream123; post_action @loglua; } location @loglua { set $log ''; rewrite_by_lua_file /nginx/mylua.lua; logformat format1 '$log'; access_log /var/log/nginx/newlog.log format1; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,222196,224022#msg-224022 From ne at vbart.ru Mon Mar 19 10:36:14 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Mon, 19 Mar 2012 14:36:14 +0400 Subject: Sending Traffic to another Server/Port/IP asynchronously In-Reply-To: <3bf4973efb7ef2a1284fac970c66a804.NginxMailingListEnglish@forum.nginx.org> References: <99a0ae2be9961e64f44ac416ec1ede38.NginxMailingListEnglish@forum.nginx.org> <3bf4973efb7ef2a1284fac970c66a804.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203191436.15012.ne@vbart.ru> On Monday 19 March 2012 14:08:46 rishabh wrote: [...] > After a lot of testing. I found another issue. > > The processing time of post_action is added to the response time. hence > delaying the response. It doesn't delay response, but block the connection, and that's why we don't recommend to use it. The best way to gather statistics is parsing access log files. wbr, Valentin V. Bartenev From agentzh at gmail.com Mon Mar 19 10:50:36 2012 From: agentzh at gmail.com (agentzh) Date: Mon, 19 Mar 2012 18:50:36 +0800 Subject: Get request_body in set_by_lua directive In-Reply-To: <284ffe8675af624f266d5de3aec67893.NginxMailingListEnglish@forum.nginx.org> References: <6140397ba88d1f5dd2d97139c5d88047.NginxMailingListEnglish@forum.nginx.org> <284ffe8675af624f266d5de3aec67893.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Mon, Mar 19, 2012 at 6:02 PM, rishabh wrote: > > Another concern is, Say the processing time of LUA file is 10 seconds > and the request completes in 4 seconds. So will the total time NGINX > take will be 10 secs or 14 secs ? > > > Here is how i have structured my conf > > http { > > ? ? ? server { > > ? ? ? ? ? ? ?location / { > ? ? ? ? ? ? ? ? ? ? proxy_pass http://upstream123; > ? ? ? ? ? ? ? ? ? ? post_action @loglua; > ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ?location @loglua { > ? ? ? ? ? ? ? ? ? ? set $log ''; > ? ? ? ? ? ? ? ? ? ? rewrite_by_lua_file /nginx/mylua.lua; > ? ? ? ? ? ? ? ? ? ? logformat format1 '$log'; > ? ? ? ? ? ? ? ? ? ? access_log /var/log/nginx/newlog.log format1; > ? ? ? ? ? ? ?} > ? ? ? } > } > I don't think this question is really related to the ngx_lua module. This is really a question about the behavior of the standard "post_action" configure directive. The answer can be trivially found out by preparing a small example: location /test { echo_sleep 1; post_action @post; } location @post { echo_sleep 5; } Here we use ngx_echo module's echo_sleep directive to do non-blocking sleep to emulate the time of real processing and computation. By using the "curl" utility to access the /test interface defined above, we can only observe a delay of 1 sec: $ time curl localhost:8080/test real 0m1.009s user 0m0.004s sys 0m0.005s But we can not really draw a conclusion from just this because "curl" actively closes the connection as soon as when it sees the end of the response (in this case, the "last chunk" sent from nginx). But nginx will not really close the connection until the post_action thing completes, as can be seen when we use telnet to do the HTTP request outself: $ telnet 127.0.0.1 8080 GET /test HTTP/1.1 Host: localhost Connection: close 0 The "last chunk", i.e., the "0\r\n\r\n" bytes, appears right after 1 sec's delay but the current telnet session does not quit until another 5 sec is passed. That is, the nginx does not close the current connection until 5 + 1 == 6 sec is passed. If HTTP keepalive is enabled, the extra delay can make the second request on the same connection much slower. But if HTTP keepalive is disabled, we're probably safe because most decent HTTP clients will actively close the connection even if Nginx does not do that on the server side. Regards, -agentzh From nginx-forum at nginx.us Mon Mar 19 16:54:40 2012 From: nginx-forum at nginx.us (rmalayter) Date: Mon, 19 Mar 2012 12:54:40 -0400 (EDT) Subject: consistent hashing for upstreams Message-ID: Has anybody used ngx_http_upstream_consistent_hash with newer nginx releases (>1.0)? If so, is it possible to use ngx_http_upstream_consistent_hash with HTTP-based back-ends, or does it only work with memcahe backends? The documentation isn't at all clear. We want to load-balance multiple static file servers behind nginx, and basing the upstream chosen on consistent hash will drastically increase the filesystem cache hit ratios the back-end servers, while preventing a "thundering herd" issue when one fails. Basically you get to use all of your RAM amongst the back ends for cache, rather than having the same objects in the cache of multiple back end servers. I thought of trying to use map directives and regexes to pick a back end, but handling weighting and failover makes this a complex and therefore brittle approach. Could consistent hashing for upstreams be achieved with embedded lua or perl? I know HAproxy has consistent hashing features for this use case (as do almost all commercial load balancers), but I would prefer not adding layers to my stack if it can be avoided. We're already using nginx and proxy_cache and it has been rock-solid and stable for us. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224038,224038#msg-224038 From zzz at zzz.org.ua Mon Mar 19 19:09:16 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Mon, 19 Mar 2012 21:09:16 +0200 Subject: consistent hashing for upstreams In-Reply-To: References: Message-ID: > We want to load-balance multiple static file servers behind nginx, and > basing the upstream chosen on consistent hash will drastically increase > the filesystem cache hit ratios the back-end servers, while preventing a > "thundering herd" issue when one fails. Basically you get to use all of > your RAM amongst the back ends for cache, rather than having the same > objects in the cache of multiple back end servers. > > I thought of trying to use map directives and regexes to pick a back > end, but handling weighting and failover makes this a complex and > therefore brittle approach. Could consistent hashing for upstreams be > achieved with embedded lua or perl? Here's a simple approach on consistent hashing with embedded perl: https://gist.github.com/2124034 From nginx-forum at nginx.us Mon Mar 19 21:16:09 2012 From: nginx-forum at nginx.us (rmalayter) Date: Mon, 19 Mar 2012 17:16:09 -0400 (EDT) Subject: consistent hashing for upstreams In-Reply-To: References: Message-ID: <6ad8475385ded214082b2d964021a23b.NginxMailingListEnglish@forum.nginx.org> Alexandr Gomoliako Wrote: > Here's a simple approach on consistent hashing > with embedded perl: > https://gist.github.com/2124034 Interesting. Clearly one could generate the upstream blocks via script. The only potential issues I foresee are: 1) performance, as this perl will be called for 1000+ requests per second, and there are going to be potentially many upstream blocks. Maybe Digest::MurmurHash would help with performance instead of MD5 (it's supposedly 3x faster in Perl than Digest::MD5 while using far less state). A native hash ring implementation in C would obviously be far more performant. 2) a single backup server is problematic, but that can be fixed by adding more backups to the upstream blocks I think, or doing an error location that hashes again to find a new upstream. Not sure if a server being down would cause it to fail inside all upstream blocks it appears though, which might mean some very slow responses when a server goes offline. 3) Perl module is still marked as experimental, which scares me I will give it a good long-term load test though, it might just be good enough! Thanks! -- RPM Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224038,224045#msg-224045 From zzz at zzz.org.ua Mon Mar 19 22:08:33 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 20 Mar 2012 00:08:33 +0200 Subject: consistent hashing for upstreams In-Reply-To: <6ad8475385ded214082b2d964021a23b.NginxMailingListEnglish@forum.nginx.org> References: <6ad8475385ded214082b2d964021a23b.NginxMailingListEnglish@forum.nginx.org> Message-ID: > The only potential issues I foresee are: > ? ?1) performance, as this perl will be called for 1000+ requests per > second, and there are going to be potentially many upstream blocks. > Maybe Digest::MurmurHash would help with performance instead of MD5 > (it's supposedly 3x faster in Perl than Digest::MD5 while using far less > state). A native hash ring implementation in C would obviously be far > more performant. Couple of microseconds per request isn't something to worry about here. > ? ?2) a single backup server is problematic, but that can be fixed by > adding more backups to the upstream blocks I think, or doing an error > location that hashes again to find a new upstream. Not sure if a server > being down would cause it to fail inside all upstream blocks it appears > though, which might mean some very slow responses when a server goes > offline. But at least it's simple. > ? 3) Perl module is still marked as experimental, which scares me Don't be scared, it's not really experimental. Build it with relatively modern perl and you'll be fine. From gelonida at gmail.com Mon Mar 19 22:28:09 2012 From: gelonida at gmail.com (Gelonida N) Date: Mon, 19 Mar 2012 23:28:09 +0100 Subject: nginx as fwd-proxy to an https server Message-ID: If I understood well, the 'normal' setup is to let the client talk via https to nginx and to have all servers behind nginx talk plain http. web client --https--> nginx --http--> another server However I have one setup, where I'd like to have an encrypted communication between nginx and one of the other servers (which cannot be reached directly by the web client) web client --https--> nginx --https--> another server Nginx may be able to intercept (decrypt) the request (no security issue for the given setup), but it would also be fine if nginx wouldn't be able to decrypt the communication. The remote server is also running nginx, but has however another certificate. Any suggestions / recommendations for such a setup? From cliff at develix.com Mon Mar 19 23:04:54 2012 From: cliff at develix.com (Cliff Wells) Date: Mon, 19 Mar 2012 16:04:54 -0700 Subject: nginx as fwd-proxy to an https server In-Reply-To: References: Message-ID: <1332198294.2437.23.camel@portable-evil> On Mon, 2012-03-19 at 23:28 +0100, Gelonida N wrote: > If I understood well, the 'normal' setup is to > let the client talk via https to nginx and to have all servers > behind nginx talk plain http. > > However I have one setup, where I'd like to have an encrypted > communication between nginx and one of the other servers (which cannot > be reached directly by the web client) > > web client --https--> nginx --https--> another server This is perfectly normal too, although probably less common. > Nginx may be able to intercept (decrypt) the request (no security issue > for the given setup), but it would also be fine if nginx wouldn't be > able to decrypt the communication. Nginx will need to decrypt the data in order to re-encrypt it for the second leg. > The remote server is also running nginx, but has however another > certificate. Won't matter. > Any suggestions / recommendations for such a setup? It is just as you described. Just use https:// as the scheme rather than http:// in your proxy_pass directive. Regards, Cliff From zhuzhaoyuan at gmail.com Tue Mar 20 01:54:26 2012 From: zhuzhaoyuan at gmail.com (Joshua Zhu) Date: Tue, 20 Mar 2012 09:54:26 +0800 Subject: consistent hashing for upstreams In-Reply-To: References: Message-ID: Hi, On Tue, Mar 20, 2012 at 12:54 AM, rmalayter wrote: > Has anybody used ngx_http_upstream_consistent_hash with newer nginx > releases (>1.0)? > > If so, is it possible to use ngx_http_upstream_consistent_hash with > HTTP-based back-ends, or does it only work with memcahe backends? The > documentation isn't at all clear. > > We want to load-balance multiple static file servers behind nginx, and > basing the upstream chosen on consistent hash will drastically increase > the filesystem cache hit ratios the back-end servers, while preventing a > "thundering herd" issue when one fails. Basically you get to use all of > your RAM amongst the back ends for cache, rather than having the same > objects in the cache of multiple back end servers. > > I thought of trying to use map directives and regexes to pick a back > end, but handling weighting and failover makes this a complex and > therefore brittle approach. Could consistent hashing for upstreams be > achieved with embedded lua or perl? > > I know HAproxy has consistent hashing features for this use case (as do > almost all commercial load balancers), but I would prefer not adding > layers to my stack if it can be avoided. We're already using nginx and > proxy_cache and it has been rock-solid and stable for us. > Please try this fork: https://github.com/yaoweibin/ngx_http_consistent_hash BTW, this module will be officially supported by the Tengine team soon. Regards, -- Joshua Zhu Senior Software Engineer Server Platforms Team at Taobao -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Mar 20 02:45:59 2012 From: lists at ruby-forum.com (Delai S.) Date: Tue, 20 Mar 2012 03:45:59 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org> <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> Message-ID: <49aff47cad966977526104780395d4e6@ruby-forum.com> Roberto De Ioris wrote in post #1052159: >>>> How would I then proceed to build the uWSGI php plugin? >>> if all goes well you will end with a binary named 'uwsgi' >>> >> >> server { >> listen 8080; >> server_name www.myphp.com myphp.com; >> location ~ .php { >> root /var/www/php_test; >> uwsgi_pass 127.0.0.1:3030; >> include uwsgi_params; >> } >> } > > > here you have missed > > uwsgi_modifier1 14; > > that instruct uWSGI to route the request to the php plugin. > > About index.php you can add an index directive in nginx or > > php-index = index.php > > in uwsgi config > > -- > Roberto De Ioris > http://unbit.it Hi, Ioris Thanks for your reply, I add uwsgi_modifier1 14; to nginx server config file. myphp.com:8080/index.php can visited now, but myphp.com:8080 still return 404. I Hava try a lot solution, like add "index index.php" to nginx or run uwsgi with --php-index index.php all failed SO, HOW CAN I TELL UWSGI to run index.php defaultly? Another Question: I use the uwsgi config in http://projects.unbit.it/uwsgi/wiki/PHP, run as uwsgi --ini uwsgi_config While I visit myphp.com/index.php, return 502 error uwsgi print the error message: -- unavailable modifier requested: 14 -- -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Mar 20 03:30:21 2012 From: lists at ruby-forum.com (edgar r.) Date: Tue, 20 Mar 2012 04:30:21 +0100 Subject: no performance improvement on nginx reverse-proxy In-Reply-To: References: Message-ID: Vg -- Posted via http://www.ruby-forum.com/. From roberto at unbit.it Tue Mar 20 06:23:55 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Tue, 20 Mar 2012 07:23:55 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: <49aff47cad966977526104780395d4e6@ruby-forum.com> References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org> <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> <49aff47cad966977526104780395d4e6@ruby-forum.com> Message-ID: > Roberto De Ioris wrote in post #1052159: >>>>> How would I then proceed to build the uWSGI php plugin? >>>> if all goes well you will end with a binary named 'uwsgi' >>>> >>> >>> server { >>> listen 8080; >>> server_name www.myphp.com myphp.com; >>> location ~ .php { >>> root /var/www/php_test; >>> uwsgi_pass 127.0.0.1:3030; >>> include uwsgi_params; >>> } >>> } >> >> >> here you have missed >> >> uwsgi_modifier1 14; >> >> that instruct uWSGI to route the request to the php plugin. >> >> About index.php you can add an index directive in nginx or >> >> php-index = index.php >> >> in uwsgi config >> >> -- >> Roberto De Ioris >> http://unbit.it > > > Hi, Ioris > Thanks for your reply, I add uwsgi_modifier1 14; to nginx server config > file. myphp.com:8080/index.php can visited now, but myphp.com:8080 still > return 404. > > I Hava try a lot solution, like > add "index index.php" to nginx > or run uwsgi with --php-index index.php > all failed > > SO, HOW CAN I TELL UWSGI to run index.php defaultly? > > Another Question: > I use the uwsgi config in http://projects.unbit.it/uwsgi/wiki/PHP, run > as uwsgi --ini uwsgi_config > While I visit myphp.com/index.php, return 502 error > uwsgi print the error message: -- unavailable modifier requested: 14 -- > > -- I fear you are not loading the php plugin into uwsgi: --plugin php Check startup logs, for plugin loading errors (they come pretty soon) -- Roberto De Ioris http://unbit.it From quintinpar at gmail.com Tue Mar 20 07:08:52 2012 From: quintinpar at gmail.com (Quintin Par) Date: Tue, 20 Mar 2012 12:38:52 +0530 Subject: image_filter_jpeg_quality based on size In-Reply-To: References: Message-ID: Let me rephrase my Q :-) Can I find out the file size in a location directive? -Quintin On Sat, Mar 17, 2012 at 9:31 AM, Quintin Par wrote: > Hi all, > > In the --with-http_image_filter_module: > > Can I set image_filter_jpeg_quality based on image size? Say I want to > apply a loss of 75 to all images greater than 400KB. For the rest do > nothing. > > -Quintin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue Mar 20 09:08:55 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Tue, 20 Mar 2012 10:08:55 +0100 Subject: image_filter_jpeg_quality based on size In-Reply-To: References: Message-ID: <13951ad13b39a2474354334c261e45da.squirrel@damiao.org> > Let me rephrase my Q :-) > > Can I find out the file size in a location directive? > -Quintin Using set_by_lua (http://wiki.nginx.org/HttpLuaModule#set_by_lua): location ~* \.(?:gif|jpe?g|png)$ { set_by_lua $img_file_size ' function fsize (file) local current = file:seek() -- get current position local size = file:seek("end") -- get file size file:seek("set", current) -- restore position return size end fsize(ngx.var.request_filename)'; } Untested. This will give you the file size on the variable $img_file_size. --appa From nginx-forum at nginx.us Tue Mar 20 09:21:28 2012 From: nginx-forum at nginx.us (rishabh) Date: Tue, 20 Mar 2012 05:21:28 -0400 (EDT) Subject: Log entire header & cookie Message-ID: Hi, Is there a variable which stores entire header & cookie in a single string ? I want to log the entire request header. But dont want to specify each $http_HEADER. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224062,224062#msg-224062 From nginx-forum at nginx.us Tue Mar 20 09:49:17 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 20 Mar 2012 05:49:17 -0400 (EDT) Subject: error log not reflect the problem related log Message-ID: Hi I have configured the nagios on centos, I have perl related code that I have set. the problem is that when I was configured the same, it had a problem of database connection, but in error log it shows the error like 502 bad gateway or other error which not reflect the error related to database. Means from the error I was not able to conclude that what was the problem. Is there any way to change the error log setting so it reflect the exact problem ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224065,224065#msg-224065 From mdounin at mdounin.ru Tue Mar 20 10:21:45 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Mar 2012 14:21:45 +0400 Subject: Log entire header & cookie In-Reply-To: References: Message-ID: <20120320102145.GF67687@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 05:21:28AM -0400, rishabh wrote: > Hi, > > Is there a variable which stores entire header & cookie in a single > string ? > > I want to log the entire request header. But dont want to specify each > $http_HEADER. No, there is no such variable. It would be fine to add one though, as it looks like something useful in some cases. Maxim Dounin From mdounin at mdounin.ru Tue Mar 20 10:25:38 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Mar 2012 14:25:38 +0400 Subject: error log not reflect the problem related log In-Reply-To: References: Message-ID: <20120320102538.GG67687@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 05:49:17AM -0400, niraj wrote: > Hi > > I have configured the nagios on centos, I have perl related code that > I have set. > > the problem is that when I was configured the same, it had a problem of > database connection, but in error log it shows the error like 502 bad > gateway or other error which not reflect the error related to database. > Means from the error I was not able to conclude that what was the > problem. > > > Is there any way to change the error log setting so it reflect the > exact problem ? The exact reason is expected to be in your backend's log. It's your backend which failed to produce response, nginx doesn't known why it failed to do so. Maxim Dounin From nginx-forum at nginx.us Tue Mar 20 11:01:53 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 20 Mar 2012 07:01:53 -0400 (EDT) Subject: error log not reflect the problem related log In-Reply-To: <20120320102538.GG67687@mdounin.ru> References: <20120320102538.GG67687@mdounin.ru> Message-ID: <5df059a01954f7ef2b3760c386197ee1.NginxMailingListEnglish@forum.nginx.org> Hi backend's log mean in which file ? I was using apache (httpd) also in that access.log and error.log in that if any application having any error then it reflect in error log. at the same time that was not happened in Nginx. can you tell me how can I diagnose my application related error ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224065,224073#msg-224073 From lists at ruby-forum.com Tue Mar 20 11:09:10 2012 From: lists at ruby-forum.com (Delai S.) Date: Tue, 20 Mar 2012 12:09:10 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org> <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it> <49aff47cad966977526104780395d4e6@ruby-forum.com> Message-ID: Roberto De Ioris wrote in post #1052411: >>>> uwsgi_pass 127.0.0.1:3030; >>> >> >> SO, HOW CAN I TELL UWSGI to run index.php defaultly? >> >> Another Question: >> I use the uwsgi config in http://projects.unbit.it/uwsgi/wiki/PHP, run >> as uwsgi --ini uwsgi_config >> While I visit myphp.com/index.php, return 502 error >> uwsgi print the error message: -- unavailable modifier requested: 14 -- >> >> -- > > I fear you are not loading the php plugin into uwsgi: > > --plugin php > > Check startup logs, for plugin loading errors (they come pretty soon) > > > -- > Roberto De Ioris > http://unbit.it I am very sure "--plugin php" is added, as myphp.com:8080/index.php can return a phpinfo() page correctly. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Mar 20 11:10:03 2012 From: lists at ruby-forum.com (Delai S.) Date: Tue, 20 Mar 2012 12:10:03 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> Message-ID: My be the question is: HOW CAN I TELL UWSGI to run index.php defaultly? -- Posted via http://www.ruby-forum.com/. From roberto at unbit.it Tue Mar 20 11:17:15 2012 From: roberto at unbit.it (Roberto De Ioris) Date: Tue, 20 Mar 2012 12:17:15 +0100 Subject: a new uWSGI PHP plugin is available In-Reply-To: References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it> Message-ID: <1AE79051-293E-49BD-9C4B-AF36E2715D46@unbit.it> Il giorno 20/mar/2012, alle ore 12:10, Delai S. ha scritto: > My be the question is: HOW CAN I TELL UWSGI to run index.php defaultly? --php-app > -- Roberto De Ioris http://unbit.it JID: roberto at jabber.unbit.it From mdounin at mdounin.ru Tue Mar 20 12:35:57 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Mar 2012 16:35:57 +0400 Subject: error log not reflect the problem related log In-Reply-To: <5df059a01954f7ef2b3760c386197ee1.NginxMailingListEnglish@forum.nginx.org> References: <20120320102538.GG67687@mdounin.ru> <5df059a01954f7ef2b3760c386197ee1.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120320123557.GJ67687@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 07:01:53AM -0400, niraj wrote: > backend's log mean in which file ? This depends on which backend do you use to execute your application. E.g. if you use Apache as a backend - it will be Apache's error log. Maxim Dounin From nginx-forum at nginx.us Tue Mar 20 12:56:44 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 20 Mar 2012 08:56:44 -0400 (EDT) Subject: error log not reflect the problem related log In-Reply-To: <20120320123557.GJ67687@mdounin.ru> References: <20120320123557.GJ67687@mdounin.ru> Message-ID: <7901cf5b7c55116fa9d2ba45783ef329.NginxMailingListEnglish@forum.nginx.org> Hi Very True, If application use apache then logs in apache's error log. But now I am using Nginx, and its error log not give the details error due to that from error log we are not able to rectified the issue. You suggested backend's log but I dont found any backend's log which can help to rectified the issue. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224065,224089#msg-224089 From julyclyde at gmail.com Tue Mar 20 13:19:29 2012 From: julyclyde at gmail.com (=?UTF-8?B?5pmT56OK5Lu7?=) Date: Tue, 20 Mar 2012 21:19:29 +0800 Subject: streamed gzip VS buffered gzip Message-ID: <-3062958262231484685@unknownmsgid> My workmate just noticed that HTTP response of nginx gzip module is chunked, while Apache's goes with Content-Length, seems to be buffered. How to force nginx do a buffered gzipped output, too? -- ??????????????????? From mdounin at mdounin.ru Tue Mar 20 13:42:05 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Mar 2012 17:42:05 +0400 Subject: error log not reflect the problem related log In-Reply-To: <7901cf5b7c55116fa9d2ba45783ef329.NginxMailingListEnglish@forum.nginx.org> References: <20120320123557.GJ67687@mdounin.ru> <7901cf5b7c55116fa9d2ba45783ef329.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120320134205.GM67687@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 08:56:44AM -0400, niraj wrote: > Hi > > Very True, If application use apache then logs in apache's error > log. > > But now I am using Nginx, and its error log not give the details error > due to that from error log we are not able to rectified the issue. > > You suggested backend's log but I dont found any backend's log which can > help to rectified the issue. By itself nginx doesn't execute applications. You haven't provided any information about which backend you've configured to do so, therefore it's unlikely that anybody will be able to help you to find your backend's logs. Maxim Dounin From mdounin at mdounin.ru Tue Mar 20 13:51:40 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 20 Mar 2012 17:51:40 +0400 Subject: streamed gzip VS buffered gzip In-Reply-To: <-3062958262231484685@unknownmsgid> References: <-3062958262231484685@unknownmsgid> Message-ID: <20120320135140.GN67687@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 09:19:29PM +0800, ??? wrote: > My workmate just noticed that HTTP response of nginx gzip module is > chunked, while Apache's goes with Content-Length, seems to be > buffered. How to force nginx do a buffered gzipped output, too? It's not currently possible. Maxim Dounin From julyclyde at gmail.com Tue Mar 20 14:02:39 2012 From: julyclyde at gmail.com (=?UTF-8?B?5pmT56OK5Lu7?=) Date: Tue, 20 Mar 2012 22:02:39 +0800 Subject: streamed gzip VS buffered gzip In-Reply-To: <20120320135140.GN67687@mdounin.ru> References: <-3062958262231484685@unknownmsgid> <20120320135140.GN67687@mdounin.ru> Message-ID: <-3959192644495365877@unknownmsgid> Thank you for answering. -- ??????????????????? On 2012?3?20?, at 21:51, Maxim Dounin wrote: > Hello! > > It's not currently possible. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue Mar 20 16:06:36 2012 From: nginx-forum at nginx.us (yoavaner) Date: Tue, 20 Mar 2012 12:06:36 -0400 (EDT) Subject: rewrite rule failing with unicode urls on nginx with pcre 8.3 Message-ID: <02fafdaf000eebfe9fe13b6627347a30.NginxMailingListEnglish@forum.nginx.org> First post on the list, so please be gentle :) I asked this question on stackoverflow, but wasn't getting any love there, and then realised I should go to the source! I managed to get nginx (1.0.14) compiled with the latest PCRE (8.30), changed the rewrite rule to use UTF8, but it still fails in some cases with unicode characters. My rewrite rule is location / { try_files $uri $uri/ /index.php; rewrite "(*UTF8)^/imgthumb/(.*)$" /timthumb.php?$1 last; } This works fine with images without unicode, but fails when the filename contains unicode characters. so `/imgthumb/src=/wp-content/uploads/8????????????.jpg&h=121&w=137&zc=1` **fails** but `/imgthumb/src=/wp-content/uploads/MOD0005.jpg&h=121&w=137&zc=1` **works** fine. On Apache using .htaccess rewrite rule, it works with both `RewriteRule ^/imgthumb/(.*)$ /timthumb.php?$1 [L]` I noticed that the problem seems to stem from the fact that the PHP script gets only one parameter (src) into the `$_GET` array with nginx, but with apache rewrite it's broken down to different parameters... Is my nginx rewrite rule wrong? Is there a way to make this work? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224105,224105#msg-224105 From nginx-forum at nginx.us Tue Mar 20 16:17:32 2012 From: nginx-forum at nginx.us (DeneB) Date: Tue, 20 Mar 2012 12:17:32 -0400 (EDT) Subject: Power Failure Now NginX Restart Problem Message-ID: This morning we had one of those power disruptions (the kind that last just long enough to cause you to reset the clock). Now when I restart Nginx I get the error that it can't open the error.log file /var/log/nginx/error.log failed (13:permission denied) also get the failure for the configuration file /var/run/nginx.pid failed (13:permission denied) configuration file /etc/nginx/nginx.conf test failed (the syntax for the configuration file is ok) Before this nginx was running with no problems. Why am I get these errors and how do I correct them? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224106,224106#msg-224106 From guzman.braso at gmail.com Tue Mar 20 16:43:19 2012 From: guzman.braso at gmail.com (=?ISO-8859-1?B?R3V6beFuIEJyYXPz?=) Date: Tue, 20 Mar 2012 13:43:19 -0300 Subject: [ANNOUNCE] nginx-perl-1.1.17.1 In-Reply-To: References: Message-ID: Hello Alexander, I've one simple question, how is performance affected when opening a small text file (a small database). I know if the file is small linux itself will cache into memory the file, but I'm worried about how it will affect each url request to open the file, even from memory reading again the whole file, then querying, then closing the handler, etc. All in vain because this file won't change more than once per hour. My question is: There is any way to store information in memory to use between different requests within perl? Thank you, Guzm?n On Thu, Mar 15, 2012 at 4:55 PM, Alexandr Gomoliako wrote: > Hello, everyone. > > It's been awhile since my last announce, it was 1.1.11.1 roughly two > months ago. And now it's 1.1.17.1. > > There were couple of bugfixes and new features. But most of the work > was done on automated testing to make it work properly on things like > cpantesters and travis-ci. > > ? ?http://matrix.cpantesters.org/?dist=Nginx-Perl%201.1.16.1 > > So, it is now possible to use Nginx::Perl as a dependency for perl > modules and test against it on cpantesters and travis-ci. Here's an > example of such module and its tests: > > ? ?http://matrix.cpantesters.org/?dist=Nginx-HTTP > ? ?https://github.com/zzzcpan/Nginx-HTTP/tree/master/t > > Also wanted to mention one example, just to show how much you can do: > "In nginx-perl every request object $r is created and destroyed with > nginx's own request. This means, that it is possible to reorder > natural request flow in any way you want. It can be very helpful in > case of DDOS, unusual load spikes or anything else you can think of." > > ? ?http://zzzcpan.github.com/nginx-perl/Nginx.html#REQUEST_QUEUE > ? ?https://github.com/zzzcpan/nginx-perl/tree/master/eg/requestqueue > > > Webpage: > ? ?http://zzzcpan.github.com/nginx-perl/ > > Github: > ? ?https://github.com/zzzcpan/nginx-perl > > CPAN: > ? ?Nginx::Perl > > Changes: > ? ?https://raw.github.com/zzzcpan/nginx-perl/master/CHANGES.perl > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -- Guzm?n Bras? N??ez Senior Perl Developer / Sysadmin Web: http://guzman.braso.info Mobile: +598 98 674020 From zzz at zzz.org.ua Tue Mar 20 17:11:59 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 20 Mar 2012 19:11:59 +0200 Subject: [ANNOUNCE] nginx-perl-1.1.17.1 In-Reply-To: References: Message-ID: > My question is: > There is any way to store information in memory to use between > different requests within perl? There is just one interpreter instance per worker. So every variable outside of the handler's scope is persistent across multiple requests. my %cache; my $count = 0; sub handler { my ($r) = @_; ... $count++; ... my $uri = $r->uri; if ($cache{$uri}) { ... } } From nginx-forum at nginx.us Tue Mar 20 17:26:29 2012 From: nginx-forum at nginx.us (DeneB) Date: Tue, 20 Mar 2012 13:26:29 -0400 (EDT) Subject: Power Failure Now NginX Restart Problem In-Reply-To: References: Message-ID: <84e66e8c3e6ddc1f5990e1cde88ac131.NginxMailingListEnglish@forum.nginx.org> Found the problem!!!! First problem. My OS is Ubunto 11.01, when I installed it as a server setup it automatically installed Apache as well and had set apache to start at boot time. So what happened was Apache, grabbed port 80 before nginx could. Then the second problem occurred when I logged in and tried to restart nginx, for some reason I didn't have the permission as sudo. I'll have to fix that, but now the server is back up and running from boot. Whew! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224106,224109#msg-224109 From guzman.braso at gmail.com Tue Mar 20 18:57:14 2012 From: guzman.braso at gmail.com (=?ISO-8859-1?B?R3V6beFuIEJyYXPz?=) Date: Tue, 20 Mar 2012 15:57:14 -0300 Subject: [ANNOUNCE] nginx-perl-1.1.17.1 In-Reply-To: References: Message-ID: That's just great, thank you! Then I can load the db into each worker and reload db as I wish/need. Thank you! (again) Guzman From nginx-forum at nginx.us Tue Mar 20 21:33:44 2012 From: nginx-forum at nginx.us (gtuhl) Date: Tue, 20 Mar 2012 17:33:44 -0400 (EDT) Subject: Nginx as Load Balancer Connection Issues In-Reply-To: <6ecc7d03b64833b6f692b7a09d9a4c74.NginxMailingListEnglish@forum.nginx.org> References: <6ecc7d03b64833b6f692b7a09d9a4c74.NginxMailingListEnglish@forum.nginx.org> Message-ID: I'm thinking about giving the development version with the upstream keepalive over http 1.1 a try. Are people using that version in production? Is there a release schedule/estimate anywhere that indicates when that feature might trickle over to stable? We're using nginx heavily in a pretty vanilla load balancer role - upstream of apache servers, ssl termination in nginx, that's it in terms of features we are using. It's worked fantastically well overall, we're just flirting with an ephemeral port limit on a few of our sites (have worked around by setting up multiple A records pointed at multiple nginx pairs). If we could get keepalive connections between nginx and the upstream apaches I believe we would be in very good shape and could keep our configuration simple moving forward. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220894,224118#msg-224118 From zzz at zzz.org.ua Tue Mar 20 21:42:20 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 20 Mar 2012 23:42:20 +0200 Subject: Nginx as Load Balancer Connection Issues In-Reply-To: References: <6ecc7d03b64833b6f692b7a09d9a4c74.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Tue, Mar 20, 2012 at 11:33 PM, gtuhl wrote: > I'm thinking about giving the development version with the upstream > keepalive over http 1.1 a try. > > Are people using that version in production? ?Is there a release > schedule/estimate anywhere that indicates when that feature might > trickle over to stable? According to their roadmap -- in 6 days :) http://trac.nginx.org/nginx/roadmap From david.yu.ftw at gmail.com Tue Mar 20 21:46:30 2012 From: david.yu.ftw at gmail.com (David Yu) Date: Wed, 21 Mar 2012 05:46:30 +0800 Subject: Nginx as Load Balancer Connection Issues In-Reply-To: <7F55D3941DC042E3ABD2AF99C723E3AA@gmail.com> References: <6ecc7d03b64833b6f692b7a09d9a4c74.NginxMailingListEnglish@forum.nginx.org> <7F55D3941DC042E3ABD2AF99C723E3AA@gmail.com> Message-ID: On Thu, Jan 26, 2012 at 7:21 AM, Rami Essaid wrote: > Out of curiosity why would it keep it in TIME_WAIT if it is closing the > connection? > +1. Also if the connection is closed, why is the upstream (apache) in TIME_WAIT also? > > On Wednesday, January 25, 2012 at 5:14 PM, ggrensteiner wrote: > > Have you tried using HTTP 1.1 keepalive connections from nginx to > apache? They became available in 1.1.4 and will re-use sockets rather > then close them and leaving them in TIME_WAIT > > Be sure to remember to turn on keepalive in your apache config as well. > > http://nginx.org/en/docs/http/ngx_http_upstream_module.html > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,220894,221646#msg-221646 > > _______________________________________________ > 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 > -- When the cat is away, the mouse is alone. - David Yu -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 21 01:07:41 2012 From: nginx-forum at nginx.us (Smeagle) Date: Tue, 20 Mar 2012 21:07:41 -0400 (EDT) Subject: HttpAdditionModule not working for subdirectories Message-ID: Hy everyone! It turns out that HttpAdditionModule is only working for the PHP files stored into the web root dir. All content from, let's say, "/forum" won't display the embedded content. Error log pointed out that Nginx is including the subdirectory into the HttpAdditionModule URI, so "/header/global.php" mistakenly becomes "/forum/header/global.php". Needless to say, that file doesn't exist. Given that variables are not supported in this module, how can I fix that? Thank you so much! Base system: Nginx 1.0.14 with PHP5-FPM Settings: location ~ \.php$ { root /var/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; add_before_body /header/global.php; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224124,224124#msg-224124 From quintinpar at gmail.com Wed Mar 21 02:40:37 2012 From: quintinpar at gmail.com (Quintin Par) Date: Wed, 21 Mar 2012 08:10:37 +0530 Subject: image_filter_jpeg_quality based on size In-Reply-To: <13951ad13b39a2474354334c261e45da.squirrel@damiao.org> References: <13951ad13b39a2474354334c261e45da.squirrel@damiao.org> Message-ID: Thanks Appa. On Tue, Mar 20, 2012 at 2:38 PM, Antonio P.P. Almeida wrote: > > Let me rephrase my Q :-) > > > > Can I find out the file size in a location directive? > > -Quintin > > Using set_by_lua (http://wiki.nginx.org/HttpLuaModule#set_by_lua): > > location ~* \.(?:gif|jpe?g|png)$ { > set_by_lua $img_file_size ' > function fsize (file) > local current = file:seek() -- get current position > local size = file:seek("end") -- get file size > file:seek("set", current) -- restore position > return size > end > fsize(ngx.var.request_filename)'; > } > > Untested. This will give you the file size on the variable $img_file_size. > > > --appa > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abioy.sun at gmail.com Wed Mar 21 02:53:45 2012 From: abioy.sun at gmail.com (Abioy Sun) Date: Wed, 21 Mar 2012 10:53:45 +0800 Subject: In memory subrequest hang if backend return 500 Message-ID: Hi All, In the file ngx_http_upstream.c I found some code like this: 1618 if (u->headers_in.status_n > NGX_HTTP_SPECIAL_RESPONSE) { 1619 1620 if (r->subrequest_in_memory) { 1621 u->buffer.last = u->buffer.pos; 1622 } that means, if the status backend return if greater than 300, the first part of the body would be abandoned. Will this cause the issue that the main request won't be woken again and keep sleeping until timeout? Or did I misunderstand anything? Yours, Abioy -------------- next part -------------- An HTML attachment was scrubbed... URL: From quintinpar at gmail.com Wed Mar 21 02:54:48 2012 From: quintinpar at gmail.com (Quintin Par) Date: Wed, 21 Mar 2012 08:24:48 +0530 Subject: OS tuning an nginx webserver machine Message-ID: Hi all, Recently I resorted to tuning my nginx webserver box for more performance. I went ahead an changed sudo ip route change default via 1.25.29.1 dev eth0 initcwnd 10 sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0 This changed exposed a much better performance than anticipated. And since most of my pages are httpd cached, the load times went down from 2.3 ? 3 seconds to 1.5-2 seconds While browsing I came across another benchmarking echo "2048 64512" > /proc/sys/net/ipv4/ip_local_port_range echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse echo "10" > /proc/sys/net/ipv4/tcp_fin_timeout echo "65536" > /proc/sys/net/core/somaxconn echo "65536" > /proc/sys/net/ipv4/tcp_max_syn_backlog echo "262144" > /proc/sys/net/netfilter/nf_conntrack_max worker_processes 16; worker_rlimit_nofile 262144; daemon off; events { use epoll; worker_connections 16384; } error_log error.log; pid /dev/null; http { sendfile on; tcp_nopush on; keepalive_requests 100; open_file_cache max=100; gzip off; gzip_min_length 1024; access_log off; server { listen *:8080 backlog=16384; location / { root html; index index.html; } } } But the type of machines that the tester has used does not allow me to believe the results. Have someone else gone along the same path? Are these system variable changes recommended by the nginx community? -Quintin -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 21 04:33:34 2012 From: nginx-forum at nginx.us (niraj) Date: Wed, 21 Mar 2012 00:33:34 -0400 (EDT) Subject: error log not reflect the problem related log In-Reply-To: <7901cf5b7c55116fa9d2ba45783ef329.NginxMailingListEnglish@forum.nginx.org> References: <20120320123557.GJ67687@mdounin.ru> <7901cf5b7c55116fa9d2ba45783ef329.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi I am using the application which having code in perl. I have both html and cgi files. For Cgi and perl files I have install the fcgi and spawn-fcgi and configure the same in Nginx configuration. For database I am using Mysql and OS is Cent OS. Is any other information required ? Please suggest where would be the exact error log for this application which can help to solve the application related error. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224065,224130#msg-224130 From mp3geek at gmail.com Wed Mar 21 06:16:27 2012 From: mp3geek at gmail.com (Ryan Brown) Date: Wed, 21 Mar 2012 19:16:27 +1300 Subject: Trunk can't be compiled atm. Message-ID: Unable to compile nginx trunk.. gcc-4.6.1-9 (Ubuntu) ./configure --with-openssl=/root/openssl/openssl-dev/openssl --with-cpu-opt=pentium4 --with-http_gzip_static_module --with-http_ssl_module --with-ipv6 --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_charset_module --without-http_ssi_module --without-http_userid_module --without-http_autoindex_module --without-http_rewrite_module --with-pcre --with-cc-opt='-O2 -g -march=i386 -mtune=i686' gcc -o objs/nginx \ objs/src/core/nginx.o \ objs/src/core/ngx_log.o \ objs/src/core/ngx_palloc.o \ objs/src/core/ngx_array.o \ objs/src/core/ngx_list.o \ objs/src/core/ngx_hash.o \ objs/src/core/ngx_buf.o \ objs/src/core/ngx_queue.o \ objs/src/core/ngx_output_chain.o \ objs/src/core/ngx_string.o \ objs/src/core/ngx_parse.o \ objs/src/core/ngx_inet.o \ objs/src/core/ngx_file.o \ objs/src/core/ngx_crc32.o \ objs/src/core/ngx_murmurhash.o \ objs/src/core/ngx_md5.o \ objs/src/core/ngx_rbtree.o \ objs/src/core/ngx_radix_tree.o \ objs/src/core/ngx_slab.o \ objs/src/core/ngx_times.o \ objs/src/core/ngx_shmtx.o \ objs/src/core/ngx_connection.o \ objs/src/core/ngx_cycle.o \ objs/src/core/ngx_spinlock.o \ objs/src/core/ngx_cpuinfo.o \ objs/src/core/ngx_conf_file.o \ objs/src/core/ngx_resolver.o \ objs/src/core/ngx_open_file_cache.o \ objs/src/core/ngx_crypt.o \ objs/src/event/ngx_event.o \ objs/src/event/ngx_event_timer.o \ objs/src/event/ngx_event_posted.o \ objs/src/event/ngx_event_busy_lock.o \ objs/src/event/ngx_event_accept.o \ objs/src/event/ngx_event_connect.o \ objs/src/event/ngx_event_pipe.o \ objs/src/os/unix/ngx_time.o \ objs/src/os/unix/ngx_errno.o \ objs/src/os/unix/ngx_alloc.o \ objs/src/os/unix/ngx_files.o \ objs/src/os/unix/ngx_socket.o \ objs/src/os/unix/ngx_recv.o \ objs/src/os/unix/ngx_readv_chain.o \ objs/src/os/unix/ngx_udp_recv.o \ objs/src/os/unix/ngx_send.o \ objs/src/os/unix/ngx_writev_chain.o \ objs/src/os/unix/ngx_channel.o \ objs/src/os/unix/ngx_shmem.o \ objs/src/os/unix/ngx_process.o \ objs/src/os/unix/ngx_daemon.o \ objs/src/os/unix/ngx_setproctitle.o \ objs/src/os/unix/ngx_posix_init.o \ objs/src/os/unix/ngx_user.o \ objs/src/os/unix/ngx_process_cycle.o \ objs/src/os/unix/ngx_linux_init.o \ objs/src/event/modules/ngx_epoll_module.o \ objs/src/os/unix/ngx_linux_sendfile_chain.o \ objs/src/event/ngx_event_openssl.o \ objs/src/core/ngx_regex.o \ objs/src/http/ngx_http.o \ objs/src/http/ngx_http_core_module.o \ objs/src/http/ngx_http_special_response.o \ objs/src/http/ngx_http_request.o \ objs/src/http/ngx_http_parse.o \ objs/src/http/ngx_http_header_filter_module.o \ objs/src/http/ngx_http_write_filter_module.o \ objs/src/http/ngx_http_copy_filter_module.o \ objs/src/http/modules/ngx_http_log_module.o \ objs/src/http/ngx_http_request_body.o \ objs/src/http/ngx_http_variables.o \ objs/src/http/ngx_http_script.o \ objs/src/http/ngx_http_upstream.o \ objs/src/http/ngx_http_upstream_round_robin.o \ objs/src/http/ngx_http_parse_time.o \ objs/src/http/modules/ngx_http_static_module.o \ objs/src/http/modules/ngx_http_index_module.o \ objs/src/http/modules/ngx_http_chunked_filter_module.o \ objs/src/http/modules/ngx_http_range_filter_module.o \ objs/src/http/modules/ngx_http_headers_filter_module.o \ objs/src/http/modules/ngx_http_not_modified_filter_module.o \ objs/src/http/ngx_http_busy_lock.o \ objs/src/http/ngx_http_file_cache.o \ objs/src/http/modules/ngx_http_gzip_filter_module.o \ objs/src/http/modules/ngx_http_gzip_static_module.o \ objs/src/http/modules/ngx_http_auth_basic_module.o \ objs/src/http/modules/ngx_http_access_module.o \ objs/src/http/modules/ngx_http_limit_conn_module.o \ objs/src/http/modules/ngx_http_limit_req_module.o \ objs/src/http/modules/ngx_http_geo_module.o \ objs/src/http/modules/ngx_http_map_module.o \ objs/src/http/modules/ngx_http_split_clients_module.o \ objs/src/http/modules/ngx_http_referer_module.o \ objs/src/http/modules/ngx_http_ssl_module.o \ objs/src/http/modules/ngx_http_proxy_module.o \ objs/src/http/modules/ngx_http_fastcgi_module.o \ objs/src/http/modules/ngx_http_uwsgi_module.o \ objs/src/http/modules/ngx_http_scgi_module.o \ objs/src/http/modules/ngx_http_memcached_module.o \ objs/src/http/modules/ngx_http_empty_gif_module.o \ objs/src/http/modules/ngx_http_browser_module.o \ objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \ objs/src/http/modules/ngx_http_upstream_keepalive_module.o \ objs/ngx_modules.o \ -lpthread -lcrypt -lpcre /root/openssl/openssl-dev/openssl/.openssl/lib/libssl.a /root/openssl/openssl-dev/openssl/.openssl/lib/libcrypto.a -ldl -lz objs/src/core/ngx_resolver.o: In function `ngx_udp_connect': /root/trunk/src/core/ngx_resolver.c:2214: undefined reference to `__sync_fetch_and_add_4' objs/src/core/ngx_file.o: In function `ngx_next_temp_number': /root/trunk/src/core/ngx_file.c:232: undefined reference to `__sync_fetch_and_add_4' objs/src/core/ngx_times.o: In function `ngx_time_sigsafe_update': /root/trunk/src/core/ngx_times.c:193: undefined reference to `__sync_bool_compare_and_swap_4' objs/src/core/ngx_times.o: In function `ngx_time_update': /root/trunk/src/core/ngx_times.c:83: undefined reference to `__sync_bool_compare_and_swap_4' objs/src/core/ngx_shmtx.o: In function `ngx_shmtx_wakeup': /root/trunk/src/core/ngx_shmtx.c:181: undefined reference to `__sync_bool_compare_and_swap_4' objs/src/core/ngx_shmtx.o: In function `ngx_shmtx_trylock': /root/trunk/src/core/ngx_shmtx.c:65: undefined reference to `__sync_bool_compare_and_swap_4' objs/src/core/ngx_shmtx.o: In function `ngx_shmtx_lock': /root/trunk/src/core/ngx_shmtx.c:78: undefined reference to `__sync_bool_compare_and_swap_4' objs/src/core/ngx_shmtx.o:/root/trunk/src/core/ngx_shmtx.c:91: more undefined references to `__sync_bool_compare_and_swap_4' follow objs/src/event/ngx_event_accept.o: In function `ngx_event_accept': /root/trunk/src/event/ngx_event_accept.c:224: undefined reference to `__sync_fetch_and_add_4' objs/src/event/ngx_event_connect.o: In function `ngx_event_connect_peer': /root/trunk/src/event/ngx_event_connect.c:105: undefined reference to `__sync_fetch_and_add_4' objs/src/http/ngx_http_file_cache.o: In function `ngx_http_file_cache_loader': /root/trunk/src/http/ngx_http_file_cache.c:1364: undefined reference to `__sync_bool_compare_and_swap_4' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/root/trunk' make: *** [build] Error 2 From igor at sysoev.ru Wed Mar 21 06:39:16 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 21 Mar 2012 10:39:16 +0400 Subject: Trunk can't be compiled atm. In-Reply-To: References: Message-ID: <20120321063916.GA42010@nginx.com> On Wed, Mar 21, 2012 at 07:16:27PM +1300, Ryan Brown wrote: > Unable to compile nginx trunk.. > > gcc-4.6.1-9 (Ubuntu) > ./configure --with-openssl=/root/openssl/openssl-dev/openssl > --with-cpu-opt=pentium4 --with-http_gzip_static_module > --with-http_ssl_module --with-ipv6 --without-mail_pop3_module > --without-mail_imap_module --without-mail_smtp_module > --without-http_charset_module --without-http_ssi_module > --without-http_userid_module --without-http_autoindex_module > --without-http_rewrite_module --with-pcre --with-cc-opt='-O2 -g > -march=i386 -mtune=i686' > objs/src/core/ngx_resolver.o: In function `ngx_udp_connect': > /root/trunk/src/core/ngx_resolver.c:2214: undefined reference to > `__sync_fetch_and_add_4' > objs/src/core/ngx_file.o: In function `ngx_next_temp_number': > /root/trunk/src/core/ngx_file.c:232: undefined reference to > `__sync_fetch_and_add_4' > objs/src/core/ngx_times.o: In function `ngx_time_sigsafe_update': > /root/trunk/src/core/ngx_times.c:193: undefined reference to > `__sync_bool_compare_and_swap_4' i386 CPU does not support atomic operations. The minimum level is i486. Do you really need "-march=i386" ? -- Igor Sysoev From rainer at ultra-secure.de Wed Mar 21 08:41:43 2012 From: rainer at ultra-secure.de (Rainer Duffner) Date: Wed, 21 Mar 2012 09:41:43 +0100 Subject: wiki maintenance? Message-ID: <20120321094143.522a37c0@suse2.iptech.internal> Hi nginx-team. it's down currently. Just when I wanted to lookup something... From andrew at nginx.com Wed Mar 21 08:49:33 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Wed, 21 Mar 2012 12:49:33 +0400 Subject: wiki maintenance? In-Reply-To: <20120321094143.522a37c0@suse2.iptech.internal> References: <20120321094143.522a37c0@suse2.iptech.internal> Message-ID: <590CAD0F-6CC1-40B5-92BF-3FE188A5D62A@nginx.com> Checking it, sorry for any inconvenience. For a long time it's been a community resource maintained completely separately from "nginx-team". We're now trying to converge it. If you've been looking into configuration guide, check nginx.org/en On Mar 21, 2012, at 12:41 PM, Rainer Duffner wrote: > Hi nginx-team. > > it's down currently. > > Just when I wanted to lookup something... > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From mdounin at mdounin.ru Wed Mar 21 08:53:56 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Mar 2012 12:53:56 +0400 Subject: In memory subrequest hang if backend return 500 In-Reply-To: References: Message-ID: <20120321085356.GA88788@mdounin.ru> Hello! On Wed, Mar 21, 2012 at 10:53:45AM +0800, Abioy Sun wrote: > Hi All, > > In the file ngx_http_upstream.c I found some code like this: > > 1618 if (u->headers_in.status_n > NGX_HTTP_SPECIAL_RESPONSE) { > 1619 > 1620 if (r->subrequest_in_memory) { > 1621 u->buffer.last = u->buffer.pos; > 1622 } > > that means, if the status backend return if greater than 300, the first > part of the body would be abandoned. Will this cause the issue that the > main request won't be woken again and keep sleeping until timeout? Or did I > misunderstand anything? Do you use keepalive connections to backends? As far as I see, this may indeed cause problems with keepalive connections, though should be ok in non-keepalive case. Maxim Dounin From mdounin at mdounin.ru Wed Mar 21 10:30:26 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Mar 2012 14:30:26 +0400 Subject: error log not reflect the problem related log In-Reply-To: References: <20120320123557.GJ67687@mdounin.ru> <7901cf5b7c55116fa9d2ba45783ef329.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120321103026.GD88788@mdounin.ru> Hello! On Wed, Mar 21, 2012 at 12:33:34AM -0400, niraj wrote: > Hi > I am using the application which having code in perl. I have both > html and cgi files. > > For Cgi and perl files I have install the fcgi and spawn-fcgi and > configure the same in Nginx configuration. What do you mean by "fcgi" here? Perl cgi files aren't able to talk via the FastCGI protocol, you either have to change them to use the FastCGI protocol (e.g. by using FCGI perl module), or need some wrapper which will do fastcgi to cgi protocol conversion. (Note well that spawn-fcgi isn't a fastcgi/cgi wrapper, it's just a simple helper program to start multiple processes of a fastcgi application.) In theory fastcgi allows to pass errors from an application to server via special FCGI_STDERR stream (and nginx will log such errors into it's error log at 'error' level with "FastCGI sent in stderr" prefix). Though in practice this requires fastcgi application to properly redirect errors into the stream in question, and this isn't always done properly. Maxim Dounin From nginx-forum at nginx.us Wed Mar 21 10:36:18 2012 From: nginx-forum at nginx.us (niraj) Date: Wed, 21 Mar 2012 06:36:18 -0400 (EDT) Subject: error log not reflect the problem related log In-Reply-To: <20120321103026.GD88788@mdounin.ru> References: <20120321103026.GD88788@mdounin.ru> Message-ID: <84fe4d55d80fd1b015d8a27c29cf416c.NginxMailingListEnglish@forum.nginx.org> k Thnkx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224065,224156#msg-224156 From mdounin at mdounin.ru Wed Mar 21 10:41:00 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Mar 2012 14:41:00 +0400 Subject: rewrite rule failing with unicode urls on nginx with pcre 8.3 In-Reply-To: <02fafdaf000eebfe9fe13b6627347a30.NginxMailingListEnglish@forum.nginx.org> References: <02fafdaf000eebfe9fe13b6627347a30.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120321104100.GE88788@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 12:06:36PM -0400, yoavaner wrote: > First post on the list, so please be gentle :) > > I asked this question on stackoverflow, but wasn't getting any love > there, and then realised I should go to the source! > > I managed to get nginx (1.0.14) compiled with the latest PCRE (8.30), > changed the rewrite rule to use UTF8, but it still fails in some cases > with unicode characters. > > My rewrite rule is > > location / { > try_files $uri $uri/ /index.php; > rewrite "(*UTF8)^/imgthumb/(.*)$" /timthumb.php?$1 last; > } > > This works fine with images without unicode, but fails when the filename > contains unicode characters. > > so > `/imgthumb/src=/wp-content/uploads/8????????????.jpg&h=121&w=137&zc=1` > **fails** > > but `/imgthumb/src=/wp-content/uploads/MOD0005.jpg&h=121&w=137&zc=1` > **works** fine. > > On Apache using .htaccess rewrite rule, it works with both > > `RewriteRule ^/imgthumb/(.*)$ /timthumb.php?$1 [L]` > > I noticed that the problem seems to stem from the fact that the PHP > script gets only one parameter (src) into the `$_GET` array with nginx, > but with apache rewrite it's broken down to different parameters... This a problem in rewrite handling, it inconsistently escapes $1 in some cases but not in others. And it's not really related to unicode, just any escaped char in uri will be enough to trigger escaping. This needs fixing. > Is my nginx rewrite rule wrong? Is there a way to make this work? Avoid using rewrites. Maxim Dounin From nginx-forum at nginx.us Wed Mar 21 10:56:49 2012 From: nginx-forum at nginx.us (yoavaner) Date: Wed, 21 Mar 2012 06:56:49 -0400 (EDT) Subject: rewrite rule failing with unicode urls on nginx with pcre 8.3 In-Reply-To: <20120321104100.GE88788@mdounin.ru> References: <20120321104100.GE88788@mdounin.ru> Message-ID: <56590928e8e0323cfa3a8e0994d5e462.NginxMailingListEnglish@forum.nginx.org> Thanks Maxim! > This a problem in rewrite handling, it inconsistently escapes $1 > in some cases but not in others. And it's not really related to > unicode, just any escaped char in uri will be enough to trigger > escaping. > This needs fixing. Good to know. Thanks. > > Is my nginx rewrite rule wrong? Is there a way to make this work? > Avoid using rewrites. Or avoid using nginx, but that won't be an ideal solution obviously. Hope that this gets fixed some time... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224105,224159#msg-224159 From mdounin at mdounin.ru Wed Mar 21 11:20:19 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 21 Mar 2012 15:20:19 +0400 Subject: HttpAdditionModule not working for subdirectories In-Reply-To: References: Message-ID: <20120321112018.GH88788@mdounin.ru> Hello! On Tue, Mar 20, 2012 at 09:07:41PM -0400, Smeagle wrote: > Hy everyone! > > It turns out that HttpAdditionModule is only working for the PHP files > stored into the web root dir. All content from, let's say, "/forum" > won't display the embedded content. > > Error log pointed out that Nginx is including the subdirectory into the > HttpAdditionModule URI, so "/header/global.php" mistakenly becomes > "/forum/header/global.php". Needless to say, that file doesn't exist. No it doesn't. Note though, that uri specified in add_before_body is subject normal processing, and if there are rewrites or something like in your config - you may end up with completely different uri. > Given that variables are not supported in this module, how can I fix > that? > > Thank you so much! > > > Base system: Nginx 1.0.14 with PHP5-FPM > Settings: > > location ~ \.php$ { > root /var/www; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > include fastcgi_params; > add_before_body /header/global.php; Please show full config which triggers the problem for you. I suppose there are rewrites which change /header/global.php to /forum/header/global.php. Maxim Dounin From ne at vbart.ru Wed Mar 21 11:30:26 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 21 Mar 2012 15:30:26 +0400 Subject: rewrite rule failing with unicode urls on nginx with pcre 8.3 In-Reply-To: <56590928e8e0323cfa3a8e0994d5e462.NginxMailingListEnglish@forum.nginx.org> References: <20120321104100.GE88788@mdounin.ru> <56590928e8e0323cfa3a8e0994d5e462.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203211530.26363.ne@vbart.ru> On Wednesday 21 March 2012 14:56:49 yoavaner wrote: [...] > > > Is my nginx rewrite rule wrong? Is there a way to make this work? > > > > Avoid using rewrites. > > Or avoid using nginx, but that won't be an ideal solution obviously. > Hope that this gets fixed some time... > Try this: location ~ (*UTF8)^/imgthumb/(.*)$ { fastcgi_pass ... or whatever you use fastcgi_param QUERY_STRING $1; ... } wbr, Valentin V. Bartenev From nginx-forum at nginx.us Wed Mar 21 12:56:54 2012 From: nginx-forum at nginx.us (gtuhl) Date: Wed, 21 Mar 2012 08:56:54 -0400 (EDT) Subject: Nginx as Load Balancer Connection Issues In-Reply-To: References: Message-ID: <8c7edebe2730969674b0e1970692830c.NginxMailingListEnglish@forum.nginx.org> Alexandr Gomoliako Wrote: ------------------------------------------------------- > On Tue, Mar 20, 2012 at 11:33 PM, gtuhl > wrote: > > I'm thinking about giving the development > version with the upstream > > keepalive over http 1.1 a try. > > > > Are people using that version in production? > ?Is there a release > > schedule/estimate anywhere that indicates when > that feature might > > trickle over to stable? > > According to their roadmap -- in 6 days :) > http://trac.nginx.org/nginx/roadmap > This is excellent news. Also apologies for somehow missing this page, was exactly what I was looking for. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220894,224171#msg-224171 From nginx-forum at nginx.us Wed Mar 21 14:05:38 2012 From: nginx-forum at nginx.us (maverick78) Date: Wed, 21 Mar 2012 10:05:38 -0400 (EDT) Subject: Check if php-file exists in chroot jail Message-ID: <543804d354e4a9af5b27a09199c73899.NginxMailingListEnglish@forum.nginx.org> Hello! I configured php-fpm to use build-in chroot. Everything works fine, but there ist a problem when I try to check if a php-file exists. server { location ~ \.php$ { root /public; try_files $uri =404; } } In this case, I alsways get 404 not found for php-files. When I comment out try_files, the php-files are processed. Is there a way of proper configuration in this case? How can I check if a php-file really exists before I pass it to php-fpm? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224182,224182#msg-224182 From ne at vbart.ru Wed Mar 21 16:12:49 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 21 Mar 2012 20:12:49 +0400 Subject: Check if php-file exists in chroot jail In-Reply-To: <543804d354e4a9af5b27a09199c73899.NginxMailingListEnglish@forum.nginx.org> References: <543804d354e4a9af5b27a09199c73899.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203212012.49803.ne@vbart.ru> On Wednesday 21 March 2012 18:05:38 maverick78 wrote: > Hello! > > I configured php-fpm to use build-in chroot. Everything works fine, but > there ist a problem when I try to check if a php-file exists. > > server { > location ~ \.php$ { > root /public; > try_files $uri =404; > } > } > > In this case, I alsways get 404 not found for php-files. > > When I comment out try_files, the php-files are processed. > > Is there a way of proper configuration in this case? How can I check if > a php-file really exists before I pass it to php-fpm? > By setting proper root and permissions. If you get 404 here: location ~ \.php$ { root /public; try_files $uri =404; } then /public/$uri isn't accessible to nginx or it doesn't exist. See error/debug log for additional information. wbr, Valentin V. Bartenev From gt0057 at gmail.com Wed Mar 21 16:57:12 2012 From: gt0057 at gmail.com (Giuseppe Tofoni) Date: Wed, 21 Mar 2012 17:57:12 +0100 Subject: Rewrite rules, for Zope, small problem with authentication user Message-ID: Hi, List I would use Nginx with Zope, but with the following configuration I can not authenticate the user (from Nginx), otherwise works properly. Where am I doing wrong? ....... upstream database { postgres_server 172.16.65.1 dbname=dbname user=username password=pwd; } upstream zope { server 172.16.65.1:80; } server { listen 80; server_name www.myhostname.com; rewrite ^/(.*) /VirtualHostBase/http/www.myhostname.com/www/VirtualHostRoot/$1 last; index index.htm index.html index_html; location =/auth { internal; more_set_headers -s 401 'WWW-Authenticate: Basic realm="$auth_user"'; postgres_escape $user $remote_user; postgres_escape $pass $remote_passwd; postgres_pass database; postgres_query "SELECT user FROM usertable WHERE user=$user AND pwd=crypt($pass, pwd) $private"; postgres_rewrite no_rows 401; postgres_output none; } # For registered users in DB location /news/ { set $auth_user "News"; set $private "and reserve ='S'"; auth_request /auth; } location / { proxy_set_header X-Real-IP $remote_addr; proxy_pass http://zope; } error_page 405 /error/405.htm; error_page 404 /error/404.htm; error_page 403 /error/403.htm; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /error/50x.html; } ......... Thanks in advance Giuseppe From nginx-forum at nginx.us Wed Mar 21 17:10:19 2012 From: nginx-forum at nginx.us (maverick78) Date: Wed, 21 Mar 2012 13:10:19 -0400 (EDT) Subject: Check if php-file exists in chroot jail In-Reply-To: <201203212012.49803.ne@vbart.ru> References: <201203212012.49803.ne@vbart.ru> Message-ID: <19a899056678285fafd0a20099a25751.NginxMailingListEnglish@forum.nginx.org> Thanks for your reply. I got stuck with finding out the proper settings. My files are located in /www/example.com/public. This is set as document root in nginx server block. In my pool of php-fpm I set a chroot path. chroot = /www/example.com That's why I have to set another path to document_root in my location block for php-files. root /public; With these settings all my php-files are delivered by php-fpm. Nothing to complain about. So, permissions and paths sem to be correct. For security reasons I want to check, if the called file with php-extension really exists. For this purpose I want to use try_files. But when I put try_files $uri =404; in the php location block, I always get an 404 error for php-files. I think nginx cant find the right path because of the chroot setting in php-fpm. Is the a way to get around this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224182,224188#msg-224188 From nginx-forum at nginx.us Wed Mar 21 18:44:26 2012 From: nginx-forum at nginx.us (spacerobot) Date: Wed, 21 Mar 2012 14:44:26 -0400 (EDT) Subject: Question about allowing a percentage of traffic Message-ID: This is about traffic control, in the case we get slammed by heavier traffic than expected we want to be able to gracefully only allow part of the users' requests to come through. In my current nginx config, I have a white list based on a $http_x_user_id header in the request and only allow traffic from those users. The way I did it was a condition in the location / block: if ( $http_x_user_id !~ (THE_WHITE_LIST_OF_IDs) ) { return 503; } (We can control the white list dynamically and re-render the config with Chef.) What I also need to do is to allow a certain percentage of requests from users whose id is not in the white list. For example, I need to be able to allow 30% of users in addition to those in the white list to get access. Based on my limited knowledge on nginx, I have no idea on what's the best way to do it. Any insights? Thanks a lot. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224190,224190#msg-224190 From ne at vbart.ru Wed Mar 21 18:57:44 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 21 Mar 2012 22:57:44 +0400 Subject: Check if php-file exists in chroot jail In-Reply-To: <19a899056678285fafd0a20099a25751.NginxMailingListEnglish@forum.nginx.org> References: <201203212012.49803.ne@vbart.ru> <19a899056678285fafd0a20099a25751.NginxMailingListEnglish@forum.nginx.org> Message-ID: <201203212257.44362.ne@vbart.ru> On Wednesday 21 March 2012 21:10:19 maverick78 wrote: > Thanks for your reply. > > I got stuck with finding out the proper settings. > > My files are located in /www/example.com/public. This is set as document > root in nginx server block. But in your configuration you override it by "root /public". Just remove "root /public" from the location directive or set it to "/www/example.com/public". > In my pool of php-fpm I set a chroot path. > > chroot = /www/example.com > > That's why I have to set another path to document_root in my location > block for php-files. > > root /public; No, this directive is for nginx only. I suppose you use fastcgi for php-fpm and you set "document root" by relevant fastcgi_param. Am I right? Please, provide your full config. wbr, Valentin V. Bartenev From francis at daoine.org Wed Mar 21 19:00:53 2012 From: francis at daoine.org (Francis Daly) Date: Wed, 21 Mar 2012 19:00:53 +0000 Subject: Check if php-file exists in chroot jail In-Reply-To: <19a899056678285fafd0a20099a25751.NginxMailingListEnglish@forum.nginx.org> References: <201203212012.49803.ne@vbart.ru> <19a899056678285fafd0a20099a25751.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120321190053.GA547@craic.sysops.org> On Wed, Mar 21, 2012 at 01:10:19PM -0400, maverick78 wrote: Hi there, > My files are located in /www/example.com/public. This is set as document > root in nginx server block. That is relevant for files that nginx needs to touch. > In my pool of php-fpm I set a chroot path. > > chroot = /www/example.com That means that the filesystem from the perspective of your fastcgi server is not the same as the filesystem from the perspective of nginx. > That's why I have to set another path to document_root in my location > block for php-files. > > root /public; In general, nginx doesn't need to touch the php files, so it doesn't care what "root" is set to. Except that the "default" values for some important fastcgi_param parameters are based on what "root" is set to. So it can matter there. You must ensure that "fastcgi_param SCRIPT_FILENAME" is the name of the file from the perspective of the fastcgi server. In your case, setting "root /public" achieves that. (There are other ways too.) > For security reasons I want to check, if the called file with > php-extension really exists. For this purpose I want to use try_files. > But when I put try_files $uri =404; in the php location block, I always > get an 404 error for php-files. In general, nginx cannot know whether a file exists on your upstream server; so this try_files cannot be the correct solution. In this case, where the fastcgi server is (presumably) sharing a filesystem with the nginx server, then it can work. $uri is the filename that nginx would look for from the perspective of nginx -- which in this case is rooted at /public (because of your configuration). That file does not exist, so try_files correctly fails to find it. You must tell try_files the name of the file that you want to check for -- which in this case is presumably /web/example.com$uri. Use that in your try_files directive > I think nginx cant find the right path because of the chroot setting in > php-fpm. Is the a way to get around this? You need to tell try_files the nginx-based file to look for, and fastcgi_param the php-fpm-based file to look for. The above should do that. (Untested.) f -- Francis Daly francis at daoine.org From ne at vbart.ru Wed Mar 21 19:10:41 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 21 Mar 2012 23:10:41 +0400 Subject: Question about allowing a percentage of traffic In-Reply-To: References: Message-ID: <201203212310.41831.ne@vbart.ru> On Wednesday 21 March 2012 22:44:26 spacerobot wrote: > This is about traffic control, in the case we get slammed by heavier > traffic than expected we want to be able to gracefully only allow part > of the users' requests to come through. > > In my current nginx config, I have a white list based on a > $http_x_user_id header in the request and only allow traffic from those > users. > > The way I did it was a condition in the location / block: > > if ( $http_x_user_id !~ (THE_WHITE_LIST_OF_IDs) ) { > return 503; > } > > (We can control the white list dynamically and re-render the config with > Chef.) > > What I also need to do is to allow a certain percentage of requests from > users whose id is not in the white list. For example, I need to be able > to allow 30% of users in addition to those in the white list to get > access. Based on my limited knowledge on nginx, I have no idea on what's > the best way to do it. > > Any insights? > Perhaps the split clients module will be suitable for you: http://nginx.org/en/docs/http/ngx_http_split_clients_module.html wbr, Valentin V. Bartenev From zzz at zzz.org.ua Wed Mar 21 19:14:17 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Wed, 21 Mar 2012 21:14:17 +0200 Subject: Question about allowing a percentage of traffic In-Reply-To: References: Message-ID: > What I also need to do is to allow a certain percentage of requests from > users whose id is not in the white list. For example, I need to be able > to allow 30% of users in addition to those in the white list to get > access. Based on my limited knowledge on nginx, I have no idea on what's > the best way to do it. > > Any insights? Embedded perl can help. From nginx-forum at nginx.us Wed Mar 21 19:54:28 2012 From: nginx-forum at nginx.us (makononov) Date: Wed, 21 Mar 2012 15:54:28 -0400 (EDT) Subject: Help with convert .htaccess to nginx :( In-Reply-To: References: Message-ID: <58494ad5ba673822b51195cd366fbb24.NginxMailingListEnglish@forum.nginx.org> I realize I'm responding to an old thread here, but thought I would post the configuration that I used to get this working: location / { try_files $uri $uri/ /index.php$uri?$args; } location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. {access_log off; log_not_found off; deny all; } location ~ \.(lock|conf)$ { access_log off; log_not_found off; deny all; } location ~ pre_.+\.php { access_log off; log_not_found off; deny all; } location = /test_rewrite1.txt { rewrite ^ /test_rewrite2.txt; } location /js/i18n { autoindex on; } location ~ \.php { include fastcgi.conf; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_pass unix:/tmp/php-fpm.sock; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217447,224195#msg-224195 From kurtis.mullins at gmail.com Wed Mar 21 20:15:00 2012 From: kurtis.mullins at gmail.com (Kurtis Mullins) Date: Wed, 21 Mar 2012 16:15:00 -0400 Subject: Rewrite Subdomains to Paths Message-ID: Hey, Is it possible to rewrite subdomains to paths? I want to do something like this: x.example.com/foo/bar/ -> www.example.com/x/foo/bar/ Thanks! - Kurtis -------------- next part -------------- An HTML attachment was scrubbed... URL: From ne at vbart.ru Wed Mar 21 20:33:02 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 22 Mar 2012 00:33:02 +0400 Subject: Rewrite Subdomains to Paths In-Reply-To: References: Message-ID: <201203220033.02956.ne@vbart.ru> On Thursday 22 March 2012 00:15:00 Kurtis Mullins wrote: > Hey, > > Is it possible to rewrite subdomains to paths? I want to do something like > this: > > x.example.com/foo/bar/ -> www.example.com/x/foo/bar/ > server { server_name ~^(?P.+)\.example\.com$; location / { return 301 http://www.example.com/$subdomain$request_uri; } } wbr, Valentin V. Bartenev From nginx-forum at nginx.us Wed Mar 21 21:22:17 2012 From: nginx-forum at nginx.us (maverick78) Date: Wed, 21 Mar 2012 17:22:17 -0400 (EDT) Subject: Check if php-file exists in chroot jail In-Reply-To: <20120321190053.GA547@craic.sysops.org> References: <20120321190053.GA547@craic.sysops.org> Message-ID: There a a lot of configuration-files, so I better put them into a pastebin. example.com vhost: http://pastebin.com/ibAfvGNu nginx.conf: http://pastebin.com/mRtvvDq4 fastcgi_params http://pastebin.com/mqxQPAK6 php-fpm.conf: http://pastebin.com/2DSEescT php fpm pool configuration: http://pastebin.com/zkek7TzN The above with try_files /web/example.com$uri =404; doesn't work either. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224182,224198#msg-224198 From nginx-forum at nginx.us Wed Mar 21 21:39:52 2012 From: nginx-forum at nginx.us (yoavaner) Date: Wed, 21 Mar 2012 17:39:52 -0400 (EDT) Subject: rewrite rule failing with unicode urls on nginx with pcre 8.3 In-Reply-To: <201203211530.26363.ne@vbart.ru> References: <201203211530.26363.ne@vbart.ru> Message-ID: <54ed5faf8d7f211ef0cd36a0d714b39f.NginxMailingListEnglish@forum.nginx.org> Valentin V. Bartenev Wrote: ------------------------------------------------------- > On Wednesday 21 March 2012 14:56:49 yoavaner > wrote: > [...] > > > > Is my nginx rewrite rule wrong? Is there a > way to make this work? > > > > > > Avoid using rewrites. > > > > Or avoid using nginx, but that won't be an ideal > solution obviously. > > Hope that this gets fixed some time... > > > > Try this: > > location ~ (*UTF8)^/imgthumb/(.*)$ { > fastcgi_pass ... or whatever you use > fastcgi_param QUERY_STRING $1; > ... > } > > wbr, Valentin V. Bartenev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Thanks Valentin. Your suggestion sounds promising. However, I'm sorry, but I'm not that familiar with the nginx configuration rules. How do I point it in the location directive to my php script (which is timthumb.php) ? I tried something like this, but it doesn't seem to work... I'm getting an empty response unfortunately. location ~ (*UTF8)^/imgthumb/(.*)$ { fastcgi_pass unix:/var/spool/phpfpm.sock; fastcgi_param SCRIPT_FILENAME $document_root/timthumb.php; fastcgi_param SCRIPT_NAME /timthumb-orig.php; fastcgi_param QUERY_STRING $1; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224105,224201#msg-224201 From nginx-forum at nginx.us Wed Mar 21 22:04:02 2012 From: nginx-forum at nginx.us (yoavaner) Date: Wed, 21 Mar 2012 18:04:02 -0400 (EDT) Subject: rewrite rule failing with unicode urls on nginx with pcre 8.3 In-Reply-To: <54ed5faf8d7f211ef0cd36a0d714b39f.NginxMailingListEnglish@forum.nginx.org> References: <201203211530.26363.ne@vbart.ru> <54ed5faf8d7f211ef0cd36a0d714b39f.NginxMailingListEnglish@forum.nginx.org> Message-ID: Never mind. My mistake. I forgot to use `include fastcgi_params` This seems to work !! Fantastic. Thanks so much for the suggestion Valentin. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224105,224205#msg-224205 From cliff at develix.com Wed Mar 21 22:39:34 2012 From: cliff at develix.com (Cliff Wells) Date: Wed, 21 Mar 2012 15:39:34 -0700 Subject: wiki maintenance? In-Reply-To: <20120321094143.522a37c0@suse2.iptech.internal> References: <20120321094143.522a37c0@suse2.iptech.internal> Message-ID: <1332369574.6111.92.camel@portable-evil> On Wed, 2012-03-21 at 09:41 +0100, Rainer Duffner wrote: > Hi nginx-team. > > it's down currently. > > Just when I wanted to lookup something... Sorry, this is on my end. The server the wiki is hosted on has crashed twice this week for reasons unknown (I suspect hardware). We may have some more downtime tonight as I plan on doing some maintenance to see if I can determine and eliminate this issue. We're also going to setup a mirror (finally) so hopefully we can prevent this from occurring in the future. Regards, Cliff From francis at daoine.org Wed Mar 21 23:22:14 2012 From: francis at daoine.org (Francis Daly) Date: Wed, 21 Mar 2012 23:22:14 +0000 Subject: Check if php-file exists in chroot jail In-Reply-To: References: <20120321190053.GA547@craic.sysops.org> Message-ID: <20120321232214.GB547@craic.sysops.org> On Wed, Mar 21, 2012 at 05:22:17PM -0400, maverick78 wrote: > The above with try_files /web/example.com$uri =404; doesn't work either. Is it /web or /www? If the result is still "doesn't work", then the debug log is probably worth investigating. f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Thu Mar 22 02:34:03 2012 From: nginx-forum at nginx.us (artemg) Date: Wed, 21 Mar 2012 22:34:03 -0400 (EDT) Subject: capture in if - escaping depends on location bug Message-ID: <105c5495f5be99d5e565fe7afc107ade.NginxMailingListEnglish@forum.nginx.org> I am capturing some data in if, and then redirecting on what was captured. The problem is, that captured data is escaped if url contains "%" char, and may be others, and do not escaped if it does not. I have simple config: Having simple config location / { set $out "http://example.com/?a=b&c=d%"; if ( $out ~ "(.*)" ){ set $z $1; rewrite ^ $z redirect; } Making 2 requests: telnet 127.0.0.1 80 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. GET / HTTP/1.0 Host: my.ru HTTP/1.1 302 Moved Temporarily Server: nginx/1.0.14 Date: Thu, 22 Mar 2012 02:20:14 GMT Content-Type: text/html Content-Length: 161 Connection: close Location: http://example.com/?a=b&c=d% 302 Found

302 Found


nginx/1.0.14
Connection closed by foreign host. telnet 127.0.0.1 80 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. GET /% HTTP/1.0 Host: my.ru HTTP/1.1 302 Moved Temporarily Server: nginx/1.0.14 Date: Thu, 22 Mar 2012 02:21:00 GMT Content-Type: text/html Content-Length: 161 Connection: close Location: http://example.com/?a=b%26c=d%25 302 Found

302 Found


nginx/1.0.14
Connection closed by foreign host. Expected the same location as in first request, but got another. Tested on nginx-1.0.14 , nginx-1.0.6 . Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224209,224209#msg-224209 From emakyol at gmail.com Thu Mar 22 03:17:08 2012 From: emakyol at gmail.com (Engin Akyol) Date: Wed, 21 Mar 2012 22:17:08 -0500 Subject: Finding out content type before logging process: Message-ID: Hey guys! I need to know if there's a way to find out the content type of content going through the proxy before the logging process. I can use $upstream_http_content_type for logging the information, but I need to access the value before outputting the page to the browser. The http_content_type and send_http_content_type variables mentioned on the Proxy page are empty. Thanks in advance, Engin -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at tengu.ch Thu Mar 22 08:59:26 2012 From: nginx at tengu.ch (=?UTF-8?Q?C=C3=A9dric_Jeanneret?=) Date: Thu, 22 Mar 2012 10:59:26 +0200 Subject: WebDav not working at all :( Message-ID: <927549647abd7b13c164415238602ff5@webmail.tengu.ch> Hello, I'm currently trying to get the webdav working on nginx 1.1.0. Unfortunately, it doesn't seem to work at all. I'm following http://wiki.nginx.org/HttpDavModule but I cannot even connect to the dav with cadaver. It seems that it doesn't support the OPTIONS nore PROPFIND, and thus it's just unusable... I really don't want to install apache to serve only webdav (nginx is currently used for proxypass). Is there a way to make it work properly ? Cheers, C. From andrew at nginx.com Thu Mar 22 09:01:56 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Thu, 22 Mar 2012 13:01:56 +0400 Subject: WebDav not working at all :( In-Reply-To: <927549647abd7b13c164415238602ff5@webmail.tengu.ch> References: <927549647abd7b13c164415238602ff5@webmail.tengu.ch> Message-ID: <5FF9D1E7-823B-4F9F-A646-3FE7F46D2630@nginx.com> On Mar 22, 2012, at 12:59 PM, C?dric Jeanneret wrote: > Hello, > > I'm currently trying to get the webdav working on nginx 1.1.0. > Unfortunately, it doesn't seem to work at all. > I'm following http://wiki.nginx.org/HttpDavModule but I cannot even connect to the dav with cadaver. > It seems that it doesn't support the OPTIONS nore PROPFIND, and thus it's just unusable... > > I really don't want to install apache to serve only webdav (nginx is currently used for proxypass). > > Is there a way to make it work properly ? > > Cheers, > > C. Check this one: https://github.com/arut/nginx-dav-ext-module From nginx-forum at nginx.us Thu Mar 22 09:24:10 2012 From: nginx-forum at nginx.us (maverick78) Date: Thu, 22 Mar 2012 05:24:10 -0400 (EDT) Subject: Check if php-file exists in chroot jail In-Reply-To: <20120321232214.GB547@craic.sysops.org> References: <20120321232214.GB547@craic.sysops.org> Message-ID: <252d491ede5d070da7745c068758b1ad.NginxMailingListEnglish@forum.nginx.org> Ops, sorry. It's www. Tht was a fault of mine and I corrected it. But it's the same result. Every .php-page shows 404 not found. And the dubug-log only complains about the favicon that cannot be found. But the file hello.php (a hello world script) definitely exists. 2012/03/22 10:08:40 [notice] 2900#0: *3 "^(GET|HEAD|POST)$" matches "GET", client: 127.0.0.1, server: www.example.com, request: "GET /hello.php HTTP/1.1", host: "www.example.com" 2012/03/22 10:08:40 [notice] 2900#0: *2 "^(GET|HEAD|POST)$" matches "GET", client: 127.0.0.1, server: www.example.com, request: "GET /favicon.ico HTTP/1.1", host: "www.example.com" 2012/03/22 10:08:40 [error] 2900#0: *2 open() "/www/example.com/public/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: www.example.com, request: "GET /favicon.ico HTTP/1.1", host: "www.example.com" root at localhost:/var/log/nginx# Thanks for your attention. But I think, I have to find another way of chrooting or abandon it. Nginx is great. There is no alternative for me. For example the gzip-static module has no competition. ;-) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224182,224214#msg-224214 From zhialien at gmail.com Thu Mar 22 12:49:28 2012 From: zhialien at gmail.com (Alianous Deng) Date: Thu, 22 Mar 2012 20:49:28 +0800 Subject: main process crashed when after executing nginx.exe -s reload Message-ID: Hi, I run the nginx1.0.14 on a windows server2003, after executing nginx.exe -s reload, I found the main process of nginx crashed. But this didn't happen on another windows server2003. Anyone can help me with this plz? From nginx-forum at nginx.us Thu Mar 22 14:13:09 2012 From: nginx-forum at nginx.us (etrader) Date: Thu, 22 Mar 2012 10:13:09 -0400 (EDT) Subject: Serving direct static image vs via php Message-ID: <52d9e79863352db6fce3954bd5c8833b.NginxMailingListEnglish@forum.nginx.org> Serving static files is the native behavior of nginx, and when we use gateway for scripting, it needs more works by nginx. Thus, loading a php file should take more time than loading an image file. I compare the speed of loading an image file with serving via php by $image=imagecreatefromjpeg($imagepath); header('Content-Type: image/jpeg'); imagejpeg($image); Surprisingly (at least to me), the speed of loading the image via php was 50 - 70% faster than loading the original image file directly. What is the reason for this peculiar behavior? I tested with Pingdom. The difference was in Receive step, which is associated with downloading the data. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224228,224228#msg-224228 From nginx-forum at nginx.us Thu Mar 22 16:32:11 2012 From: nginx-forum at nginx.us (lockev3.0) Date: Thu, 22 Mar 2012 12:32:11 -0400 (EDT) Subject: Default_server catch all block not working In-Reply-To: <4b142fa24c8249c90f455f6736fe5ccf.NginxMailingListEnglish@forum.nginx.org> References: <4b142fa24c8249c90f455f6736fe5ccf.NginxMailingListEnglish@forum.nginx.org> Message-ID: <02f48feaa0cfe20f4e2b8bed64c98cc8.NginxMailingListEnglish@forum.nginx.org> At last I got it ! Well, to be honest I will say Maxim Dounim helped me thru my logs. In the end it was so simple ::: My load balancer in front of my Nginx's always looked thru IP so no host name ever matched any of my server_name's. Solution simple :: Do the balancer refer to nodes thru a locally resolved hostname also put as a new server_name. ...........simple like crazyness when it comes. The thing now is I have following block and it works quite right. But If I mean to use the commented return 444 instead of the rewrite ==> al my web start returning 503 !!! and nothing's functioning .......always the strange things to me. server { listen 80 default_server; server_name _; error_log /var/log/nginx/000default-error.log error; location / { proxy_set_header Host $host; rewrite .* http://somewherelse.net permanent; #return 444; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221572,224230#msg-224230 From www at lc365.net Thu Mar 22 16:41:15 2012 From: www at lc365.net (=?gb2312?B?ufnV8cGi?=) Date: Fri, 23 Mar 2012 00:41:15 +0800 Subject: a new uWSGI PHP plugin is available [integration] In-Reply-To: <1177f87b8a159e8c565b4589242005bb.squirrel@manage.unbit.it> References: <3d48767af03d191288de489a162bea88.squirrel@manage.unbit.it>, , <2358ac1eca01af28d325433d5c46e8ad.NginxMailingListEnglish@forum.nginx.org>, , , , , , <5fb1146746f054c0cdbd0264ac4c4880.squirrel@manage.unbit.it>, , <636e4cea6bc00f78f889cdda8e1996a7.squirrel@manage.unbit.it>, <1177f87b8a159e8c565b4589242005bb.squirrel@manage.unbit.it> Message-ID: Thank you, Roberto. > Date: Mon, 19 Mar 2012 07:50:28 +0100 > Subject: RE: a new uWSGI PHP plugin is available [integration] > From: roberto at unbit.it > To: nginx at nginx.org > > > > > > > > > > There should be not much difference in both (or php-fastcgi), the only > > thing that came to my mind is in different configuration. > > > > Best way to test is in using both with a single process, or with the same > > number of processes (adaptive process spawning is completely different > > from the php-fpm one so i would not expect a fair comparison). But again, > > do not expect too much differences, the internal php stuff is the same. > > > > > ...and obviously disable request logging as uWSGI by default is really > verbose. > This is the command line of my test suite: > > ./uwsgi -s :3031 --plugins php --disable-logging -p 4 -M > > this spawn 4 processes (as php-fpm default on debian/ubuntu). > > > -- > Roberto De Ioris > http://unbit.it > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Thu Mar 22 18:45:57 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 22 Mar 2012 18:45:57 +0000 Subject: Check if php-file exists in chroot jail In-Reply-To: <252d491ede5d070da7745c068758b1ad.NginxMailingListEnglish@forum.nginx.org> References: <20120321232214.GB547@craic.sysops.org> <252d491ede5d070da7745c068758b1ad.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120322184557.GC547@craic.sysops.org> On Thu, Mar 22, 2012 at 05:24:10AM -0400, maverick78 wrote: Hi there, > Ops, sorry. It's www. Tht was a fault of mine and I corrected it. But > it's the same result. Every .php-page shows 404 not found. This time, I've actually tested what I suggest ;-) try_files takes arguments of uris, which it then looks for as files by prefixing $document_root. So you must leave "root" set correctly for nginx if you want nginx to care about files. Without try_files in this case, nginx doesn't care about files; with it, it does. So: leave "root" alone (as /www/example.com/public), and just set the correct fastcgi_param values. Something like: include fastcgi.conf; fastcgi_param SCRIPT_FILENAME /public$fastcgi_script_name; could be sufficient. You might also want fastcgi_param DOCUMENT_ROOT /public; if your code cares about that variable. Then "try_files $uri =404" and "fasctcgi_pass ..." work for me. > And the > dubug-log only complains about the favicon that cannot be found. But the > file hello.php (a hello world script) definitely exists. For information: that's not the debug log. The debug log shows every uri / filename that try_files tests (among many other things). If you still have difficulties, it may be worth enabling the debug log just to see what it does show. Good luck with it, f -- Francis Daly francis at daoine.org From katmai at keptprivate.com Thu Mar 22 19:20:15 2012 From: katmai at keptprivate.com (Stefanita Rares Dumitrescu) Date: Thu, 22 Mar 2012 20:20:15 +0100 Subject: php-fpm / nginx random php lock ups php 5.3.10 w/ nginx 1.0.12 Message-ID: <4F6B7B6F.4000701@keptprivate.com> hi guys, i have a problem. i have a high end server - dual quad core xeons, 16 gb ram, 4 x 120 gb ssd's in raid 10, and a gigabit pipe. i only host 1 site on it, and from time to time the php simply locks up, restarts, and during that time, the users experience 5-10 seconds load times on pages. i have around 1000 1500 concurrent users at peak times on the website. here's what happens in the php-fpm.log: http://pastebin.ca/2131186 some of those scripts that you see as executing slow, are like 4 - 5 lines of code, so it's pretty impossible to be a coding issue. here is my php-fpm.conf: http://pastebin.ca/2131189 if you guys couuld help me shed some light on this i would much appreciate. From nginx-forum at nginx.us Thu Mar 22 20:17:46 2012 From: nginx-forum at nginx.us (maverick78) Date: Thu, 22 Mar 2012 16:17:46 -0400 (EDT) Subject: Check if php-file exists in chroot jail In-Reply-To: <20120322184557.GC547@craic.sysops.org> References: <20120322184557.GC547@craic.sysops.org> Message-ID: <873037de8fa4bbe9b419c10e2638c4b5.NginxMailingListEnglish@forum.nginx.org> You are my hero. You found out the solution. That works fine. You made a human very happy :D And I think it may be help others too. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224182,224241#msg-224241 From chaeplin at gmail.com Fri Mar 23 01:56:00 2012 From: chaeplin at gmail.com (chaepil lim) Date: Fri, 23 Mar 2012 10:56:00 +0900 Subject: period(.) is used in cokie name Message-ID: <6E233929-A853-447C-B349-23649CD2351D@gmail.com> Hello One of my clients use period(.) as cookie name start. (ex Set-Cookie: .blabla=abcd) Is it possible to use period(.) in a cookie name? If possible, how can I use $cookie_COOKIE variable ? Best Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Mar 23 01:58:08 2012 From: nginx-forum at nginx.us (nginx_newbie) Date: Thu, 22 Mar 2012 21:58:08 -0400 (EDT) Subject: nginx location regex for processing php extension less files Message-ID: Dear Nginx Forum Members, I wish to implement the following which is working perfectly under Apache. This is being done for better SEO of the URLs. Example URLS: http://www.astrogyan.com/enter/indian_astrology_horoscope_chart_prediction.html http://www.astrogyan.com/register/free_astrology_member_sign_up.html http://www.astrogyan.com/sitemap/indian_horoscope_astrology_chart_site_map.html http://www.astrogyan.com/know_your_gemstone/gID-7/sani_planet_saturn_gemstone_blue_sapphire_neelam.html What I am exactly looking forward to is a location regex to catch all extension-less php scripts in the ROOT FOLDER ONLY for processing by php-fptm. In all the above URLs "enter", "register", "sitemap", "know_your_gemstone" are all PHP scripts and what follows them are dummy file names generated by PHP for SEO. Actually "indian_astrology_horoscope_chart_prediction.html" file name does not exist. In Apache, I use the following: DefaultType application/x-httpd-php In the last of the above URL, "gID-7" is used to pass a variable to the script to show appropriate content. While this URL is showing DYNAMIC content, the URL is so crafted that is looks like a STATIC URL which can be indexed by search engines easily. This variable parsing is done in PHP already and has nothing to do with Nginx. I need to know how best can this be implemented under NGINX? I have a VPS running ubuntu where I have installed nginx with php-fpm and for normal URL's like index.htm / index.php the setup is working fine. I am not a pro in regex writing hence I am stuck up at this juncture. I searched online under many nginx blogs / forum but could not find the right solution. I am using the latest development version of Nginx v1.1.17 with php v5.3.6.13. I have also compiled additional modules like more header, cache purge, memcache etc. Any help on this will be most appreciated. Thanks in advance... Regards Ganesh Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224251,224251#msg-224251 From andrew at nginx.com Fri Mar 23 06:39:03 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Fri, 23 Mar 2012 10:39:03 +0400 Subject: co-author a book on nginx Message-ID: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> Hi, Packt Publishing are looking for a co-author for their next book on nginx (Mastering nginx). If anyone is interested to co-author an extensive guide on nginx configuration for a variety of uses, please email to Usha Iyer . Many thanks! -- andrew@ From agentzh at gmail.com Fri Mar 23 07:20:13 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 23 Mar 2012 15:20:13 +0800 Subject: co-author a book on nginx In-Reply-To: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> References: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> Message-ID: On Fri, Mar 23, 2012 at 2:39 PM, Andrew Alexeev wrote: > > Packt Publishing are looking for a co-author for their next book on nginx (Mastering nginx). > Maybe a little OT, but we're currently actively working on series of Nginx tutorials for helping people (deeply) master Nginx configuration here: https://github.com/agentzh/nginx-tutorials Both in Chinese and English. They will eventually become published books (the Chinese book may come out first). Best, -agentzh P.S. There's a single-HTML version for the Chinese version of the tutorials here: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html From ft at falkotimme.com Fri Mar 23 07:31:38 2012 From: ft at falkotimme.com (Falko Timme) Date: Fri, 23 Mar 2012 08:31:38 +0100 Subject: co-author a book on nginx References: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> Message-ID: <70A91184D53F4CF7A8B1D11ACE678C1F@notebook> Ok, while we're at it, here's another series of nginx tutorials: http://www.howtoforge.com/howtos/web-server/nginx ----- Original Message ----- From: "agentzh" To: Sent: Friday, March 23, 2012 8:20 AM Subject: Re: co-author a book on nginx > On Fri, Mar 23, 2012 at 2:39 PM, Andrew Alexeev wrote: >> >> Packt Publishing are looking for a co-author for their next book on nginx >> (Mastering nginx). >> > > Maybe a little OT, but we're currently actively working on series of > Nginx tutorials for helping people (deeply) master Nginx configuration > here: > > https://github.com/agentzh/nginx-tutorials > > Both in Chinese and English. They will eventually become published > books (the Chinese book may come out first). > > Best, > -agentzh > > P.S. There's a single-HTML version for the Chinese version of the > tutorials here: > http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From oscaretu at gmail.com Fri Mar 23 08:08:15 2012 From: oscaretu at gmail.com (Oscar Fernandez) Date: Fri, 23 Mar 2012 09:08:15 +0100 Subject: co-author a book on nginx In-Reply-To: References: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> Message-ID: Hello agentz I've downloaded it with git clone ... and after executing make there is only a chinese version. What should I've change to generate epub and mobi english version? Thanks a lot in advance On Fri, Mar 23, 2012 at 8:20 AM, agentzh wrote: > On Fri, Mar 23, 2012 at 2:39 PM, Andrew Alexeev wrote: > > > > Packt Publishing are looking for a co-author for their next book on > nginx (Mastering nginx). > > > > Maybe a little OT, but we're currently actively working on series of > Nginx tutorials for helping people (deeply) master Nginx configuration > here: > > https://github.com/agentzh/nginx-tutorials > > Both in Chinese and English. They will eventually become published > books (the Chinese book may come out first). > > Best, > -agentzh > > P.S. There's a single-HTML version for the Chinese version of the > tutorials here: > http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- Oscar Fernandez Sierra oscaretu at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From axelhols at gmail.com Fri Mar 23 08:22:38 2012 From: axelhols at gmail.com (Axel Holscher (GMAIL)) Date: Fri, 23 Mar 2012 10:22:38 +0200 Subject: Problems with TLS SNI Server Name Indication when using IE9 Message-ID: <005301cd08ce$1f1382f0$5d3a88d0$@gmail.com> Hi there, For those successfully using TLS SNi for https servers. My IE9 (on Windows7 64 bit) fails to trigger the correct nginx virtual https server name and SSL certificate (It ignores all except the default -1st server). But It seems to work fine with FF10 and Chrome17. Is this an IE9 issue? or am I missing something from my nginx/openssl compilation options? /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.0.13 built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51) TLS SNI support enabled configure arguments: --with-debug --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_addition_module --with-sha1=/usr/lib --with-md5=/usr/lib --with-openssl=/home/holscha/downloads/openssl/openssl-1.0.1 bin/openssl version -a openSSL 1.0.1 14 Mar 2012 built on: Tue Mar 20 23:19:10 CET 2012 platform: linux-x86_64 options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/usr/local/ssl" . # # Default Server # server { listen 443; server_name myaccount.yabroo.at; ssl on; ssl_certificate /etc/httpd/ssl/myaccount.yabroo.at/myaccount.yabroo.at.crt; ssl_certificate_key /etc/httpd/ssl/myaccount.yabroo.at/myaccount.yabroo.at.key; .. } server { listen 443; server_name admin.yabroo.com; ssl on; ssl_certificate /etc/httpd/ssl/yabroocom/admin.yabroo.com.crt; ssl_certificate_key /etc/httpd/ssl/yabroocom/admin.yabroo.com.key; .. } .. server { listen 443; server_name myaccount.yabroo.com; ssl on; ssl_certificate /etc/httpd/ssl/myaccount.yabroo.com/myaccount.yabroo.com.crt; ssl_certificate_key /etc/httpd/ssl/myaccount.yabroo.com/myaccount.yabroo.com.key; .. } Regards Axel -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Fri Mar 23 08:24:35 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 23 Mar 2012 16:24:35 +0800 Subject: co-author a book on nginx In-Reply-To: References: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> Message-ID: On Fri, Mar 23, 2012 at 4:08 PM, Oscar Fernandez wrote: > Hello agentz > Please call me agentzh. Thank you :) > I've downloaded it with git clone ... > > and after executing > > make > > there is only a chinese version. > > What should I've change to generate epub? and mobi english version? > The current build system only generates the Chinese ebooks. I'll fix this to generate the English version in the next few minutes or so :) Thanks! -agentzh From contact at jpluscplusm.com Fri Mar 23 09:19:49 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Fri, 23 Mar 2012 10:19:49 +0100 Subject: period(.) is used in cokie name In-Reply-To: <6E233929-A853-447C-B349-23649CD2351D@gmail.com> References: <6E233929-A853-447C-B349-23649CD2351D@gmail.com> Message-ID: On 23 March 2012 02:56, chaepil lim wrote: > Hello > > One of my clients use period(.) as cookie name start. > (ex Set-Cookie: .blabla=abcd) > > Is it possible to use period(.) in a cookie name? I don't know if things have improved since http://www.ruby-forum.com/topic/205828 ... Jonathan From agentzh at gmail.com Fri Mar 23 09:47:07 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 23 Mar 2012 17:47:07 +0800 Subject: The English version of the ebooks for my Nginx tutorials (Was Re: co-author a book on nginx) Message-ID: On Fri, Mar 23, 2012 at 4:24 PM, agentzh wrote: > On Fri, Mar 23, 2012 at 4:08 PM, Oscar Fernandez wrote: >> I've downloaded it with git clone ... >> and after executing >> make >> there is only a chinese version. >> What should I've change to generate epub? and mobi english version? > > The current build system only generates the Chinese ebooks. I'll fix > this to generate the English version in the next few minutes or so :) > Now the build system will also generate ebooks for the en-uk version. Pre-generated versions can be downloaded from here: http://openresty.org/#eBooks In particular, the "single HTML page" version for the English tutorials can be found here: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-enuk.html The English transcript is done by kai10k in the community. I haven't reviewed them yet, because I'm now still busy writing more Chinese tutorials. kai10k translates them as new Chinese tutorials come out. Everyone is welcomed to send feedback or even patches or github pull requests :) Thanks! -agentzh From nginx-forum at nginx.us Fri Mar 23 11:16:37 2012 From: nginx-forum at nginx.us (niraj) Date: Fri, 23 Mar 2012 07:16:37 -0400 (EDT) Subject: rewrite proxy flag set problem Message-ID: Hi I have write a one rewrite rule as below rewrite /auction(.*)$ http://192.168.1.210$1; This rewrite rule working fine for me. but the problem is it show the Ip address 192.168.1.210 also. I want to hide this IP , for that in apache flage [P] is there. but Nginx I dont know how to set proxy flag [P]. Please guide for the same. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224274#msg-224274 From mdounin at mdounin.ru Fri Mar 23 11:50:51 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 23 Mar 2012 15:50:51 +0400 Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: <20120323115051.GB13466@mdounin.ru> Hello! On Fri, Mar 23, 2012 at 07:16:37AM -0400, niraj wrote: > Hi > > I have write a one rewrite rule as below > > rewrite /auction(.*)$ http://192.168.1.210$1; > > This rewrite rule working fine for me. > > but the problem is it show the Ip address 192.168.1.210 also. > > I want to hide this IP , for that in apache flage [P] is there. > > but Nginx I dont know how to set proxy flag [P]. Please guide for the > same. Use location /auction/ { proxy_pass http://192.168.1.210/; } instead. Maxim Dounin From mdounin at mdounin.ru Fri Mar 23 12:23:53 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 23 Mar 2012 16:23:53 +0400 Subject: Problems with TLS SNI Server Name Indication when using IE9 In-Reply-To: <005301cd08ce$1f1382f0$5d3a88d0$@gmail.com> References: <005301cd08ce$1f1382f0$5d3a88d0$@gmail.com> Message-ID: <20120323122353.GC13466@mdounin.ru> Hello! On Fri, Mar 23, 2012 at 10:22:38AM +0200, Axel Holscher (GMAIL) wrote: > My IE9 (on Windows7 64 bit) fails to trigger the correct nginx virtual https > server name and SSL certificate (It ignores all except the default -1st > server). > > But It seems to work fine with FF10 and Chrome17. > > Is this an IE9 issue? or am I missing something from my nginx/openssl > compilation options? Most likely it's IE issue, your nginx config looks fine. You may try looking what's happening on the wire (e.g. in wireshark) or just test if you see the same behaviour on the clean install of Win7 + IE9 (google search suggests some incorrect registry settings may cause problems). Maxim Dounin From brian at akins.org Fri Mar 23 13:19:08 2012 From: brian at akins.org (Brian Akins) Date: Fri, 23 Mar 2012 09:19:08 -0400 Subject: The English version of the ebooks for my Nginx tutorials (Was Re: co-author a book on nginx) In-Reply-To: References: Message-ID: <1E695FF5-09C2-462C-9A69-811B387A83C1@akins.org> On Mar 23, 2012, at 5:47 AM, agentzh wrote: > > Everyone is welcomed to send feedback or even patches or github pull requests :) Thanks! I'll read through them. I've always found your blog posts helpful. From brian at akins.org Fri Mar 23 13:23:46 2012 From: brian at akins.org (Brian Akins) Date: Fri, 23 Mar 2012 09:23:46 -0400 Subject: period(.) is used in cokie name In-Reply-To: <6E233929-A853-447C-B349-23649CD2351D@gmail.com> References: <6E233929-A853-447C-B349-23649CD2351D@gmail.com> Message-ID: On Mar 22, 2012, at 9:56 PM, chaepil lim wrote: > > If possible, how can I use $cookie_COOKIE variable ? I think you can access those in embedded Lua or Perl. From mdounin at mdounin.ru Fri Mar 23 13:41:11 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 23 Mar 2012 17:41:11 +0400 Subject: period(.) is used in cokie name In-Reply-To: References: <6E233929-A853-447C-B349-23649CD2351D@gmail.com> Message-ID: <20120323134111.GE13466@mdounin.ru> Hello! On Fri, Mar 23, 2012 at 09:23:46AM -0400, Brian Akins wrote: > > On Mar 22, 2012, at 9:56 PM, chaepil lim wrote: > > > > > If possible, how can I use $cookie_COOKIE variable ? > > I think you can access those in embedded Lua or Perl. Just vanilla map module should do the trick (if/set will do too, but map is better). The link already provided in this thread contains if/set based solution. Map-based solution will be similar (it's now possible as regexp support was added to map module). Maxim Dounin From nginx-forum at nginx.us Fri Mar 23 19:41:29 2012 From: nginx-forum at nginx.us (spacerobot) Date: Fri, 23 Mar 2012 15:41:29 -0400 (EDT) Subject: Question about allowing a percentage of traffic In-Reply-To: <201203212310.41831.ne@vbart.ru> References: <201203212310.41831.ne@vbart.ru> Message-ID: Thanks guys, the split_clients module worked. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224190,224296#msg-224296 From nginx-forum at nginx.us Fri Mar 23 19:43:27 2012 From: nginx-forum at nginx.us (spacerobot) Date: Fri, 23 Mar 2012 15:43:27 -0400 (EDT) Subject: Port range in upstream Message-ID: Is it possible to specify a range of ports for the servers in upstream? For example, something like: upstream foo { server 10.123.111.100 : 6000 - 7000 weight=1; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224297,224297#msg-224297 From tdgh2323 at hotmail.com Sat Mar 24 00:40:06 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sat, 24 Mar 2012 00:40:06 +0000 Subject: Help with setting proxy_header Message-ID: Hello! I have a reverse proxy setup like this... server { ...... ...... if ($host = '23.71.33.142' ) { proxy_set_header Host www.domain.com; } location / { proxy_pass http://31.186.1.131:60/; } } The problem is that i cannot have a proxy_set_header inside an IF like this. Basically what iam intending to do is.. If the remote client visits my server with the IP (23.71.33.142) as the header (by using http://23.71.33.142) I need to send hardcoded the header to the backend server si my backend server knows it should respond with the content of domain.com . If they send any other header then it needs to be past to the backend server to deal with intact (it can be domain.com / www.domain.com / sub.domain.com ) Thanks! --Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Sat Mar 24 00:44:31 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sat, 24 Mar 2012 00:44:31 +0000 Subject: Whats the use of large_client_header_buffers if client_header_buffer_size exist? Message-ID: Hello All! Suppose I have client_header_buffer_size to 1k; ................. And i dont want anything to be sent past 1k... Why would i ever have the need to use the large... variable? Is it like having the possibility of "bursting" up to the value of "large_client_header_buffers" variable? What so special with the large_client_header_buffers that I cannot define it within a server {} ... on the contrary I can use client_header_buffer_size inside the a {} and locations... ? Regards, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Mar 24 00:48:11 2012 From: nginx-forum at nginx.us (zhnupy) Date: Fri, 23 Mar 2012 20:48:11 -0400 (EDT) Subject: either error log empty or access log empty Message-ID: hello, I have an nginx/1.0.14 installation with 3 virtual hosts. Each virtual hosts features its own error_log and access_log, problem is: eventhough I have similar log configuration on all virtual hosts either access.log is always empty or error.log is always empty on each virtual hosts. I better explain with facts, this is nginx configuration ( I'm just copying relevant parts please disregard any syntax error I might have introduced by doing this) : server { listen 80 default_server; server_name www.HOST_A.com; error_log /var/log/nginx/HOST_A.error.log error; access_log /var/log/nginx/HOST_A.access.log; root /srv/www/HOST_A.com/public_html; } server { listen 80; server_name www.HOST_B.com; error_log /var/log/nginx/HOST_B.error.log error; access_log /var/log/nginx/HOST_B.access.log; root /srv/www/HOST_B.com/public_html; } server { listen 80; server_name www.HOST_C.com; error_log /var/log/nginx/HOST_C.error.log error; access_log /var/log/nginx/HOST_C.access.log; root /srv/www/HOST_C.com/public_html; } Now, I use wget to make a request for a non existent file and get a 404 response wget http://www.HOST_A.com/nonexistentfile.php wget http://www.HOST_B.com/nonexistentfile.php wget http://www.HOST_C.com/nonexistentfile.php ls command output shows that for HOST_A only error.log gets updated, and for HOST_B and HOST_C only access.log gets updated (I've changed directory and file owner to nginx user and relaxed permissions but it didn't worked): -rw-rw-rw- 1 nginx nginx 0 Mar 23 17:28 HOST_A.access.log -rw-rw-rw- 1 nginx nginx 1240 Mar 23 17:52 HOST_A.error.log -rw-rw-rw- 1 nginx nginx 817 Mar 23 17:52 HOST_B.access.log -rw-rw-rw- 1 nginx nginx 0 Mar 23 17:28 HOST_B.error.log -rw-rw-rw- 1 nginx nginx 817 Mar 23 17:48 HOST_C.access.log -rw-rw-rw- 1 nginx nginx 0 Mar 23 17:28 HOST_C.error.log As you can see: either .access.log is empty or .error.log is empty This is last line from error log of HOST_A: 2012/03/23 17:29:12 [error] 3227#0: *3 open() "/srv/www/HOST_A.com/public_html/nonexistentfile.php" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: www.HOST_A.com, request: "GET /nonexistentfile.php HTTP/1.1", host: "HOST_A.com" and this is last line from access log of HOST_B ( HOST_C is identical): 201.141.61.209 - - [23/Mar/2012:17:52:42 -0600] "GET /nonexistentfile.php HTTP/1.1" 404 191 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0" In short, I don't know why only one log file per host gets updated. Using htop with "L" option I can verify that the nginx process has all log files open and yet it doesn't write to all of them. I tried changing file and directory ownership but that didn't worked ( I restarted nginx after those changes). I remember this wasn't an issue when I started using nginx 1.0.11 I'd deeply appreciate any suggestions on this issue Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224315,224315#msg-224315 From nginx-forum at nginx.us Sat Mar 24 02:45:47 2012 From: nginx-forum at nginx.us (rapwaydown) Date: Fri, 23 Mar 2012 22:45:47 -0400 (EDT) Subject: cant access phpmyadmin with LNMP setup Message-ID: <2e368ba87e35ff8507a2a8637b415c01.NginxMailingListEnglish@forum.nginx.org> I installed phpmyadmin in "/home/wwwroot/pma" and wordpress under "/home/wwwroot" but when I try to login to phpmyadmin, after i entered the password and username, it redirected me to my home page(which is served from wordpress) here is the screenshot of login similar to mine (except mine is in english) : http://bbs.vpser.net/attachment.php?aid=826&noupdate=yes below is the rewrite rule for wordpress: location / { if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } } can anyone help me and see what is wrong, really need phpmyadmin to manage the database. thank you Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224316,224316#msg-224316 From nginx-forum at nginx.us Sat Mar 24 04:35:15 2012 From: nginx-forum at nginx.us (rapwaydown) Date: Sat, 24 Mar 2012 00:35:15 -0400 (EDT) Subject: cant access phpmyadmin with LNMP setup In-Reply-To: <2e368ba87e35ff8507a2a8637b415c01.NginxMailingListEnglish@forum.nginx.org> References: <2e368ba87e35ff8507a2a8637b415c01.NginxMailingListEnglish@forum.nginx.org> Message-ID: if i change the rewrite rule to the following, phpmyadmin will works fine, but then some of my wordpress url will stop working. location / { # This is cool because no php is touched for static content try_files $uri $uri/ /index.php; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224316,224317#msg-224317 From nginx-forum at nginx.us Sat Mar 24 09:19:54 2012 From: nginx-forum at nginx.us (bizshop) Date: Sat, 24 Mar 2012 05:19:54 -0400 (EDT) Subject: Unable to install Message-ID: <557e8e105dec7874d29ead7f7e6ef442.NginxMailingListEnglish@forum.nginx.org> I mistakenly posted this on the PHP-FPM list. Running Ubuntu on Asus Transformer, I get the following when trying to apt-get install: The following packages have unmet dependencies: nginx-light : Depends: nginx-common (= 1.0.5-1) but 1.1.17-1ppa1~oneiric is to be installed Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224321,224321#msg-224321 From cyril.lavier at davromaniak.eu Sat Mar 24 10:01:03 2012 From: cyril.lavier at davromaniak.eu (Cyril Lavier) Date: Sat, 24 Mar 2012 11:01:03 +0100 Subject: Unable to install In-Reply-To: <557e8e105dec7874d29ead7f7e6ef442.NginxMailingListEnglish@forum.nginx.org> References: <557e8e105dec7874d29ead7f7e6ef442.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4F6D9B5F.20303@davromaniak.eu> On 03/24/2012 10:19 AM, bizshop wrote: > I mistakenly posted this on the PHP-FPM list. > > Running Ubuntu on Asus Transformer, > > I get the following when trying to apt-get install: > > The following packages have unmet dependencies: > nginx-light : Depends: nginx-common (= 1.0.5-1) but > 1.1.17-1ppa1~oneiric is to be installed > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224321,224321#msg-224321 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hi bizshop. Which PPA do you use ? I CC Michael Lustfield, which manages a PPA with latest nginx versions, maybe it's the one you are using. Thanks. -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu From nginx-forum at nginx.us Sat Mar 24 11:48:46 2012 From: nginx-forum at nginx.us (niraj) Date: Sat, 24 Mar 2012 07:48:46 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: <9f4af27cad5f7df720e76d0260dbbc7f.NginxMailingListEnglish@forum.nginx.org> Hi I know that solution but it will not work in my case, I am using the reguralar expression. Proxy pass not support regural expression right ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224324#msg-224324 From francis at daoine.org Sat Mar 24 12:46:00 2012 From: francis at daoine.org (Francis Daly) Date: Sat, 24 Mar 2012 12:46:00 +0000 Subject: either error log empty or access log empty In-Reply-To: References: Message-ID: <20120324124600.GE547@craic.sysops.org> On Fri, Mar 23, 2012 at 08:48:11PM -0400, zhnupy wrote: Hi there, > eventhough I have similar log configuration on all virtual hosts either > access.log is always empty or error.log is always empty on each virtual > hosts. I fail to reproduce the problem you report with the configuration you provide. > I better explain with facts, this is nginx configuration ( I'm just > copying relevant parts please disregard any syntax error I might have > introduced by doing this) : Either you've left out a relevant part, or there is some other difference in our test cases. nginx -V, perhaps? Can you provide a (minimal) config that shows the problem for you? > Now, I use wget to make a request for a non existent file and get a 404 > response > > wget http://www.HOST_A.com/nonexistentfile.php > wget http://www.HOST_B.com/nonexistentfile.php > wget http://www.HOST_C.com/nonexistentfile.php > > ls command output shows that for HOST_A only error.log gets updated, and > for HOST_B and HOST_C only access.log gets updated If nginx returns 404, access_log should be written. For HOST_A, have you any other access_log defined that is used instead? If nginx tries to read a missing file, error_log should be written. "try_files" and "fastcgi_pass" don't involve nginx trying to read a file. Are you using either of those in the HOST_B and HOST_C configs? Or have you any other error_log defined? > I'd deeply appreciate any suggestions on this issue More information needed; ideally a config that you confirm shows the problem. Does it fail with only one server{} block? Or with two? f -- Francis Daly francis at daoine.org From c.kworr at gmail.com Thu Mar 22 12:33:06 2012 From: c.kworr at gmail.com (Volodymyr Kostyrko) Date: Thu, 22 Mar 2012 14:33:06 +0200 Subject: Check if php-file exists in chroot jail In-Reply-To: References: <20120321190053.GA547@craic.sysops.org> Message-ID: <4F6B1C02.5040103@gmail.com> maverick78 wrote: > There a a lot of configuration-files, so I better put them into a > pastebin. > > example.com vhost: http://pastebin.com/ibAfvGNu > nginx.conf: http://pastebin.com/mRtvvDq4 > fastcgi_params http://pastebin.com/mqxQPAK6 And that's your poison: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; You haven't said anywhere that nginx is chrooted but your php-fpm pool surely is. This way you should use full path in nginx config and submit relative path to php-fpm. Here's my sample setup for chrooted yii app: == nginx.conf server { listen server_name root /home/user/www/sitedir; access_log /var/log/nginx/site.access.log; error_log /var/log/nginx/site.error.log; index index.php; set $docroot /www/sitedir; location / { expires 1d; try_files $uri $uri/ @missing; } location @missing { rewrite ^ /index.php?url=$uri last; } include "/home/user/etc/nginx_php.conf"; } == == nginx_php.conf location ~ .*\.php$ { try_files $uri =404; include /usr/local/etc/nginx/fastcgi_params; fastcgi_pass unix:/home/user/www/.fastcgi.php.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $docroot$fastcgi_script_name; } == > php-fpm.conf: http://pastebin.com/2DSEescT > php fpm pool configuration: http://pastebin.com/zkek7TzN > > The above with try_files /web/example.com$uri =404; doesn't work either. PS: Remember that some php modules do require access to extra files and even devices like '/tmp' and '/dev/crypto'. -- Sphinx of black quartz judge my vow. From htruong at tnhh.net Sat Mar 24 16:45:37 2012 From: htruong at tnhh.net (Huan Truong) Date: Sat, 24 Mar 2012 11:45:37 -0500 Subject: Fwd: Wrong $server_name variable (FastCGI phpCAS problem) In-Reply-To: References: Message-ID: Hi all, We were trying to migrate Wordpress multisite from Apache to nginx and had a pretty frustrated time trying to figure out why our our CAS authentication did not work correctly with our setup. In our setup, we have a whole bunch of sub-domains hosted at: *.sites.example.edu So we let nginx listening as follow server_name sites.example.edu *.sites.example.edu *.example.edu; When we tried our CAS authentication, only the CAS requests originated from sites.example.edu worked, none of the requests originated from *.sites.example.edu worked and resulted in a infinite redirect. I dug in a bit and found out that PHP was requesting a wrong return service url [1] (on Apache the return service url that PHP constructed is mysite.sites.example.edu, while with nginx it is sites.example.edu). It turned out that phpCAS used SERVER_NAME to determine the return service URL, and nginx passed to PHP the wrong answer. The fastcgi configuration is as follow: fastcgi_param ?SERVER_NAME ? ? ? ?$server_name; # returns sites.example.edu on http://mysite.sites.example.edu It can be temporarily fixed by setting fastcgi_param ?SERVER_NAME ? ? ? ?$host; # returns mysite.sites.example.edu on http://mysite.sites.example.edu But in this case I feel the $server_name should take the value of mysite.sites.example.edu when the browser requests mysite.sites.example.edu instead of sites.example.edu, the first value it found on the server_name directive. [1]: https://wiki.case.edu/Central_Authentication_Service#Detailed_overview -- code ninja | tnhh.net | @huant From francis at daoine.org Sat Mar 24 19:58:15 2012 From: francis at daoine.org (Francis Daly) Date: Sat, 24 Mar 2012 19:58:15 +0000 Subject: Help with setting proxy_header In-Reply-To: References: Message-ID: <20120324195815.GF547@craic.sysops.org> On Sat, Mar 24, 2012 at 12:40:06AM +0000, Micheal Wolfskill wrote: Hi there, > if ($host = '23.71.33.142' ) { proxy_set_header Host www.domain.com; } > location / { proxy_pass http://31.186.1.131:60/; } You want to have proxy_set_header Host $host; unless $host is this IP address, in which case you want a different value? set $myhost $host; if ($host = '23.71.33.142') { set $myhost www.domain.com; } proxy_set_header Host $myhost; where the first two are at server{} level, and the last is at server{} or location{} level. Using the "map" directive is another way of setting your $myhost variable. f -- Francis Daly francis at daoine.org From francis at daoine.org Sat Mar 24 20:21:31 2012 From: francis at daoine.org (Francis Daly) Date: Sat, 24 Mar 2012 20:21:31 +0000 Subject: Port range in upstream In-Reply-To: References: Message-ID: <20120324202131.GG547@craic.sysops.org> On Fri, Mar 23, 2012 at 03:43:27PM -0400, spacerobot wrote: Hi there, > Is it possible to specify a range of ports for the servers in upstream? No. You must list each ip:port individually. You can "include" a file containing the upstream{} block, if you want to keep your nginx.conf small. f -- Francis Daly francis at daoine.org From brian at akins.org Sun Mar 25 02:06:29 2012 From: brian at akins.org (Brian Akins) Date: Sat, 24 Mar 2012 22:06:29 -0400 Subject: Wrong $server_name variable (FastCGI phpCAS problem) In-Reply-To: References: Message-ID: <2D985BF2-993A-4344-A26F-EF83910284C8@akins.org> On Mar 24, 2012, at 12:45 PM, Huan Truong wrote: > > But in this case I feel the $server_name should take the value of > mysite.sites.example.edu when the browser requests > mysite.sites.example.edu instead of sites.example.edu, the first value > it found on the server_name directive. That *is* what $host does: http://wiki.nginx.org/HttpCoreModule#.24host From tdgh2323 at hotmail.com Sun Mar 25 04:20:16 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 25 Mar 2012 04:20:16 +0000 Subject: Using geoip per continent instead of country... possible? Message-ID: Hello guys... I need to perform a specific action for Asia countries... is there anyway to use GeoIP per continent instead of specifying a seperate IF for every Asian country? Thanks --Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Sun Mar 25 07:41:39 2012 From: agentzh at gmail.com (agentzh) Date: Sun, 25 Mar 2012 15:41:39 +0800 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: Message-ID: Hi, folks! I'm happy to announce that ngx_openresty's new stable version 1.0.11.28 has just been released. You can download the source tarball from the Download page on openresty.org: http://openresty.org/#Download This is the first (and also the last) stable version of ngx_openresty based on the Nginx 1.0.11 core. Future versions will be based on the latest Nginx stable version. This version features the new "cosocket API" shipped with the ngx_lua module as well as various new Lua client libraries based on that (for Memcached, Redis, MySQL, and others), which are all 100% nonblocking. Special thanks go to all our contributors and users! Here goes the complete change log, as compared to the last stable version, 1.0.10.48, released about two months ago. - feature: bundle Piotr Sikora's CoolkitNginxModule0.2rc1, which is also enabled by default. - feature: bundle LuaRestyMySQLLibrary0.06, which is enabled by default. - feature: bundle LuaRestyRedisLibrary0.08, which is enabled by default. - feature: bundle LuaRestyMemcachedLibrary0.06, which is enabled by default. - feature: bundle LuaRestyUploadLibrary0.02, which is enabled by default. thanks Taylor Weibley for sponsoring the development work. - feature: bundle LuaRestyStringLibrary0.05, which is enabled by default. - upgraded LuaNginxModule to 0.5.0rc21. - feature: implemented the coroutine-based TCP and Unix Domain client socket API (aka the "cosocket" API) that is mostly compatible with the LuaSocket library. - feature: implemented built-in connection pool support for the cosocket API. - feature: added new function ngx.req.socket()to return a cosocket object for the downstream connection so as to do streaming request body reading. thanks Taylor Weibley for sponsoring the development work. - feature: added new directive lua_http10_bufferingwhich is on by default. - feature: added user flags support to the shared dictionary API. thanks Brian Akins. - feature: added new method flush_all to the shared dict. thanks Weiqiang Li. - feature: added the ngx.sha1_binmethod which returns the binary form of the SHA-1 digest. - feature: added constant ngx.null which is a NULL light userdata to represent nil values in Lua tables and etc. this is compatible with at least lua-cjsonlibrary's cjson.null constant. - feature: allow use of ngx.null in ngx.log()and print() arguments. - feature: added new constant ngx.DECLINED. - bugfix: we did not declare C variables at the beginning of the current code block in ngx_http_lua_del_thread, reported by runner-mei in github issue #93 . - bugfix: incorrectly used ngx_conf_log_error by feeding NGX_ERROR as the first argument, as reported by runner-mei in github issue #92 . - bugfix: spelling errors in Lua exception message text. - bugfix: access_by_luacould not work with the satisfy any configuration. - bugfix: now we recycle the special flush buffer and chain link for ngx.flush to prevent request-scoped memory leaks when emitting long data streams to the downstream. - bugfix: time stamps could overflow on 32-bit systems in the shared dict API; now we explicitly use 64-bit integers. - bugfix: the shared dict storage might leak memory in the store: ngx_http_lua_shdict_lookup incorrectly assumed that nodes with identical keys are linked together, which might not be true after tree re-balancing. thanks the patch from Lanshun Zhou. - bugfix: the exptime argument to shdict:set/add/etc methods was incorrectly ignored when the flags argument is also specified. thanks the patch from Brian Akins. - bugfix: now we avoid using luaL_checkstring which could do another long jump on its own. thanks Wang Bin. - bugfix: when the parent request takes a request body, the subrequest does not take any bodies, and the subrequest's method is neither PUT nor POST, then the subrequest will no longer inherit the parent request's request body. thanks Ou Yuanning for reporting this issue. - bugfix: C macro directives were used inside a C macro argument which made (at least) gcc 3.2.3 unhappy. thanks Feng Bin. - bugfix: setting ngx.header.last_modified was not implemented fully. thanks Brian Akins. - optimize: removed a redundant piece of code for subrequest headers_in fixes in ngx_http_lua_adjust_subrequest. - optimize: introduced a minor optimization that we can save one recvcall when the read event is active *and* the read event is not ready. - optimize: now we recycle the downstream output buffers to save memory and dynamic allocation times for long-running requests with huge outputs. - optimize: optimized the chain-link and buf recycle logic for the subrequest API and make it share free buffers with the cosocket API. - docs: documented the max concurrent subrequest count limitation and max error log line size limit. - docs: fixed various typos in docs. thanks Wang Bin. - upgraded EchoNginxModule to 0.38rc2. - bugfix: $echo_request_bodyvariable was not able to work on arbitrary request body chains (i.e., more than 2 chain links), just like the standard $request_bodyvariable that only processes the first two chain links. now $echo_request_bodyno longer has this limitation. - upgraded SrcacheNginxModule to 0.13rc6. - bugfix: fixed a typo in an error message text for response truncation check in srcache_store . - feature: now srcache_storediscards responses that are obviously truncated when the actual output data is shorter than what is declared in its Content-Length response header. thanks Greg Grensteiner. - bugfix: the access phase handler actually ran in a phase later than the access phase. - bugfix: HTTP HEAD requests that lead to a cache hits would cause memory issues like invalid reads. - upgraded Redis2NginxModule to 0.08rc4. - bugfix: redis "nil multi bulk replies" did not parse at all. thanks Guo Ying for reporting this issue. - upgraded LuaRedisParserLibrary to 0.09rc7. - bugfix: redis "nil multi bulk replies" did not parse at all. thanks Guo Ying for reporting this issue. - bugfix: remove unneeded string push operations. thanks Brian Akins. - upgraded XssNginxModule to 0.03rc9, RdsCsvNginxModule to 0.05rc1, and Redis2NginxModule to 0.08rc3, allowing enabling DDEBUG=1 globally. - upgraded IconvNginxModule to 0.10rc7. - bugfix: enabling DDEBUG=1 globally lead to compilation errors. - bugfix: could not work with HTTP 1.0 requests. - optimize: only register output filters when the iconv_filter is actually used in the config file. - upgraded PostgresNginxModule to 0.9. - bugfix: Fix compatibility with poll, select and /dev/poll event models. - bugfix: Fix compatibility with PostgreSQL 9.x. - bugfix: Fix compatibility with nginx-1.1.4+. - bugfix: applied the official hotfix #1 patchfor LuaJIT 2.0.0 beta9. - now we enable the -DLUA_USE_APICHECK -DLUA_USE_ASSERT flags for LuaJITwhen the --with-debug option is specified. - apply the max_subrequests patchto allow the NGX_HTTP_MAX_SUBREQUESTS macro to be overridden from the outside and adjusted the default value from 50 to 200 because 50 is a little too conservative. - applied the upstream_pipelining patch to the nginx core, as discussed here: http://mailman.nginx.org/pipermail/nginx-devel/2012-March/002040.htmlthis patch is required at least for the pipelined requests support in nginx upstream modules. - applied the null-character-fixes patch from the mainstream. The bug did result in a disclosure of previously freed memory if upstream server returned specially crafted response, potentially exposing sensitive information. - upgraded the Nginx core to 1.0.11. - see the changes here: http://nginx.org/en/CHANGES-1.0 As always, you're welcome to report bugs and feature requests either here or directly to me :) OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well as most of their external dependencies. By taking advantage of various well-designed Nginx modules, OpenRestyeffectively turns the Nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing Nginx C modules and Lua modules and construct extremely high-performance web applications that is capable to handle 10K+ connections. OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis. You can find more details on the homepage of ngx_openresty here: http://openresty.org Enjoy! -agentzh -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Sun Mar 25 09:22:09 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 25 Mar 2012 13:22:09 +0400 Subject: Using geoip per continent instead of country... possible? In-Reply-To: References: Message-ID: <20120325092209.GA52761@nginx.com> On Sun, Mar 25, 2012 at 04:20:16AM +0000, Micheal Wolfskill wrote: > > Hello guys... > > I need to perform a specific action for Asia countries... is there anyway to use GeoIP per continent instead of specifying a seperate IF for every Asian country? You can convert GeoIP base to nginx geo module custom map. Please read this: http://mailman.nginx.org/pipermail/nginx/2009-August/014705.html http://mailman.nginx.org/pipermail/nginx/2009-August/014707.html http://mailman.nginx.org/pipermail/nginx/2009-August/014710.html -- Igor Sysoev From nginx-forum at nginx.us Sun Mar 25 16:55:10 2012 From: nginx-forum at nginx.us (gadelkareem) Date: Sun, 25 Mar 2012 12:55:10 -0400 (EDT) Subject: HttpLimitZoneModule + Varnish (frontend) In-Reply-To: References: Message-ID: Extended description of HttpLimitZoneModule and HttpLimitReqModule usage with examples and how to exclude a whitelist of IPs can be found here http://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221508,224347#msg-224347 From lists at ruby-forum.com Sun Mar 25 17:03:23 2012 From: lists at ruby-forum.com (Waleed G.) Date: Sun, 25 Mar 2012 19:03:23 +0200 Subject: DDoS protection module suggestion In-Reply-To: <856d8eb789286a17845b5c6eaccd96ff.NginxMailingListEnglish@forum.nginx.org> References: <856d8eb789286a17845b5c6eaccd96ff.NginxMailingListEnglish@forum.nginx.org> Message-ID: Extended description of HttpLimitZoneModule and HttpLimitReqModule usage with examples and how to exclude a whitelist of IPs can be found here http://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/ -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Mar 25 17:06:43 2012 From: lists at ruby-forum.com (Waleed G.) Date: Sun, 25 Mar 2012 19:06:43 +0200 Subject: nginx 0.7 and limit_req In-Reply-To: References: Message-ID: <79d0e099cc8870f6b74ec73dc3efa65b@ruby-forum.com> Extended description of HttpLimitZoneModule and HttpLimitReqModule usage with examples and how to exclude a whitelist of IPs can be found here http://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/ -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Mar 25 17:06:59 2012 From: lists at ruby-forum.com (Waleed G.) Date: Sun, 25 Mar 2012 19:06:59 +0200 Subject: Limit requests per resource In-Reply-To: References: Message-ID: <16831bacc77a8686c101b065b2107c60@ruby-forum.com> Extended description of HttpLimitZoneModule and HttpLimitReqModule usage with examples and how to exclude a whitelist of IPs can be found here http://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/ -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Sun Mar 25 17:15:51 2012 From: nginx-forum at nginx.us (gadelkareem) Date: Sun, 25 Mar 2012 13:15:51 -0400 (EDT) Subject: Limit requests per resource In-Reply-To: <4b9a6042fe2c7b486f46fff0fe2bf4a3.NginxMailingListEnglish@forum.nginx.org> References: <4b9a6042fe2c7b486f46fff0fe2bf4a3.NginxMailingListEnglish@forum.nginx.org> Message-ID: Extended description of HttpLimitZoneModule and HttpLimitReqModule usage with examples and how to exclude a whitelist of IPs can be found here http://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216652,224351#msg-224351 From tdgh2323 at hotmail.com Sun Mar 25 19:21:20 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 25 Mar 2012 19:21:20 +0000 Subject: "access_log" directive is not allowed here in... how to do this properly? Message-ID: Hello ! Iam trying to log the requests coming from a list of countries into a seperate log file.. Iam using the config below... BUt iam getting this error: [emerg]: "access_log" directive is not allowed here in /etc/nginx/nginx.conf:55 configuration file /etc/nginx/nginx.conf test failed How could I accomplish what iam trying to do? Thanks! --Mike http { ...... ....... geoip_country /etc/nginx/GeoIP.dat; map $geoip_country_code $log { default 0; CN 1; #"China" RO 1; #"Romania" IQ 1; #"Iraq" IR 1; #"Iran HK 1; #"Hong Kong" IN 1; #"India" } server { listen 80; server_name domain.com; ..... ..... if ($log) { access_log /root/access-selected-slim.log; } location / { proxy_pass http://12.163.169.32:80/; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at akins.org Sun Mar 25 19:26:38 2012 From: brian at akins.org (Brian Akins) Date: Sun, 25 Mar 2012 15:26:38 -0400 Subject: Using geoip per continent instead of country... possible? In-Reply-To: <20120325092209.GA52761@nginx.com> References: <20120325092209.GA52761@nginx.com> Message-ID: untested, but would this work? map $geoip_city_country_code $continent { RUS Asia; ... } From nginx-forum at nginx.us Sun Mar 25 20:20:54 2012 From: nginx-forum at nginx.us (zhnupy) Date: Sun, 25 Mar 2012 16:20:54 -0400 (EDT) Subject: either error log empty or access log empty In-Reply-To: References: Message-ID: <5d819accb34e16c0be7b38a3e4e7bec7.NginxMailingListEnglish@forum.nginx.org> thanks Francis, after testing one by one it was easier to isolate my problem. I have a location definition which turns off the access log, but it doesn't suppose to fire every time, just for specific file extensions, here is the entire server block: 52 server { 53 listen 80 default_server; 54 server_name www.DOMAIN_A.com *.DOMAIN_A.com; 55 error_log /var/log/nginx/DOMAIN_A.error.log debug; 56 access_log /var/log/nginx/DOMAIN_A.access.log; 57 58 root /srv/www/DOMAIN_A.com/public_html; 59 60 error_page 404 /404.html; 61 62 location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { 63 # access_log off; 64 expires max; 65 } 66 67 location ~ /\.ht { 68 deny all; 69 } 70 } The desired intention of line 62 is to turn off access log only for resources with given extensions, however I found it is firing everytime. for instance, this URL: http://DOMAIN_A/aaaa.txt is not supposed to fire that rule, but it does. As soon as I comment line 63 (and restart nginx) the access log gets updated. I have repeated this several times (adding/removing comment in line 63) with same results. I don't see nothing wrong with that regular expression, so I'm not sure what is going on. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224315,224360#msg-224360 From alabdelouahab at gmail.com Sun Mar 25 21:44:36 2012 From: alabdelouahab at gmail.com (aliane abdelouahab) Date: Sun, 25 Mar 2012 23:44:36 +0200 Subject: co-author a book on nginx In-Reply-To: References: <2F98E6B4-3E72-4EAD-AADA-C724E499A36E@nginx.com> Message-ID: sorry for being out of subject, but thank you for those links :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Sun Mar 25 22:12:36 2012 From: francis at daoine.org (Francis Daly) Date: Sun, 25 Mar 2012 23:12:36 +0100 Subject: either error log empty or access log empty In-Reply-To: <5d819accb34e16c0be7b38a3e4e7bec7.NginxMailingListEnglish@forum.nginx.org> References: <5d819accb34e16c0be7b38a3e4e7bec7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120325221236.GH547@craic.sysops.org> On Sun, Mar 25, 2012 at 04:20:54PM -0400, zhnupy wrote: Hi there, > I have a location definition which turns off the access log, > but it doesn't suppose to fire every time, just for specific file > extensions, here is the entire server block: If you look through the debug log for one request, you'll see exactly why things happen. When you request "/notthere.php", it uses the "null" location, and returns 404. Then your error_page directive causes a rewrite to /404.html, which uses the "extensions" location. That is where the request finishes, so that is where it is logged. And you have access_log off there. > for instance, this URL: http://DOMAIN_A/aaaa.txt is not supposed to > fire that rule, but it does. It shouldn't match that rule if it doesn't generate a 404. All 404s will match that rule, because of your error_page configuration. Maybe you want a separate "location = /404.html{}" block? f -- Francis Daly francis at daoine.org From francis at daoine.org Sun Mar 25 22:32:31 2012 From: francis at daoine.org (Francis Daly) Date: Sun, 25 Mar 2012 23:32:31 +0100 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: References: Message-ID: <20120325223231.GI547@craic.sysops.org> On Sun, Mar 25, 2012 at 07:21:20PM +0000, Micheal Wolfskill wrote: Hi there, > Iam trying to log the requests coming from a list of countries into a seperate log file.. > map $geoip_country_code $log { > default 0; > CN 1; #"China" > } access_log logs/$log.log; You may want to make the content of $log be more descriptive: "access" and "special" instead of 0 and 1, for example. Or just log normally, and post-process the file to split based on the logged IP address. f -- Francis Daly francis at daoine.org From tdgh2323 at hotmail.com Sun Mar 25 22:42:57 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 25 Mar 2012 22:42:57 +0000 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: <20120325223231.GI547@craic.sysops.org> References: , <20120325223231.GI547@craic.sysops.org> Message-ID: Thanks.. but i think you are not understanding me.. the problem is that the log line is throwing an error. So i cannot log. This is the line that is throwing that error if ($log) { access_log /root/access-selected-slim.log slim; } I have that line inside my server {} .. thats where i need it. If i cant do it this way.. how can I do it then? Mike > Date: Sun, 25 Mar 2012 23:32:31 +0100 > From: francis at daoine.org > To: nginx at nginx.org > Subject: Re: "access_log" directive is not allowed here in... how to do this properly? > > On Sun, Mar 25, 2012 at 07:21:20PM +0000, Micheal Wolfskill wrote: > > Hi there, > > > Iam trying to log the requests coming from a list of countries into a seperate log file.. > > > map $geoip_country_code $log { > > default 0; > > CN 1; #"China" > > > } > > access_log logs/$log.log; > > You may want to make the content of $log be more descriptive: "access" > and "special" instead of 0 and 1, for example. > > Or just log normally, and post-process the file to split based on the > logged IP address. > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Sun Mar 25 23:09:02 2012 From: francis at daoine.org (Francis Daly) Date: Mon, 26 Mar 2012 00:09:02 +0100 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: References: <20120325223231.GI547@craic.sysops.org> Message-ID: <20120325230902.GJ547@craic.sysops.org> On Sun, Mar 25, 2012 at 10:42:57PM +0000, Micheal Wolfskill wrote: Hi there, > Thanks.. but i think you are not understanding me.. the problem is that the log line is throwing an error. So i cannot log. Put a line like access_log logs/$log.log; inside the server{} block. Whatever you set $log to in your map directive will be used in the filename. f -- Francis Daly francis at daoine.org From tdgh2323 at hotmail.com Sun Mar 25 23:15:43 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 25 Mar 2012 23:15:43 +0000 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: <20120325230902.GJ547@craic.sysops.org> References: <20120325223231.GI547@craic.sysops.org>, , <20120325230902.GJ547@craic.sysops.org> Message-ID: Hello Francis, > Put a line like > > access_log logs/$log.log; > > inside the server{} block. > I did, iam still getting the error. [emerg]: "access_log" directive is not allowed here in /etc/nginx/nginx.conf:55 The line 55 is: if ($log) { access_log /root/$log.log; slim; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Sun Mar 25 23:21:40 2012 From: francis at daoine.org (Francis Daly) Date: Mon, 26 Mar 2012 00:21:40 +0100 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: References: <20120325230902.GJ547@craic.sysops.org> Message-ID: <20120325232140.GK547@craic.sysops.org> On Sun, Mar 25, 2012 at 11:15:43PM +0000, Micheal Wolfskill wrote: Hi there, > I did, iam still getting the error. > [emerg]: "access_log" directive is not allowed here in /etc/nginx/nginx.conf:55 Don't write: > if ($log) { access_log /root/$log.log; slim; } Do write: access_log /root/$log.log; f -- Francis Daly francis at daoine.org From kolesen.a at gmail.com Sun Mar 25 23:29:38 2012 From: kolesen.a at gmail.com (Alexander Kolesen) Date: Mon, 26 Mar 2012 02:29:38 +0300 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: References: Message-ID: <20120325232937.GA8561@macbookpro.wargaming.net> > Hello ! > > Iam trying to log the requests coming from a list of countries into a seperate > log file.. Iam using the config below... BUt iam getting this error: > > [emerg]: "access_log" directive is not allowed here in /etc/nginx/nginx.conf:55 > configuration file /etc/nginx/nginx.conf test failed > > How could I accomplish what iam trying to do? > > Thanks! > > --Mike > > > http { > ...... > ....... > > geoip_country /etc/nginx/GeoIP.dat; > > map $geoip_country_code $log { > default 0; > CN 1; #"China" > RO 1; #"Romania" > IQ 1; #"Iraq" > IR 1; #"Iran > HK 1; #"Hong Kong" > IN 1; #"India" > } > > server { > listen 80; > server_name domain.com; > ..... > ..... > if ($log) { access_log /root/access-selected-slim.log; } > location / { proxy_pass http://12.163.169.32:80/; } > > } > } > If you want to log queries from only the listed countries, you may write the following: http { ...... ....... geoip_country /etc/nginx/GeoIP.dat; map $geoip_country_code $log { default dev/null; CN root/access-selected-slim.log; #"China" RO root/access-selected-slim.log; #"Romania" IQ root/access-selected-slim.log; #"Iraq" IR root/access-selected-slim.log; #"Iran HK root/access-selected-slim.log; #"Hong Kong" IN root/access-selected-slim.log; #"India" } server { listen 80; server_name domain.com; ..... ..... access_log /$log; location / { proxy_pass http://12.163.169.32:80/; } } } But note that access logs with variables in their names have limitatios. Refer to the http://wiki.nginx.org/HttpLogModule From tdgh2323 at hotmail.com Sun Mar 25 23:40:51 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 25 Mar 2012 23:40:51 +0000 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: <20120325232140.GK547@craic.sysops.org> References: <20120325230902.GJ547@craic.sysops.org>, , <20120325232140.GK547@craic.sysops.org> Message-ID: > Don't write: > > > if ($log) { access_log /root/$log.log; slim; } > > Do write: > > access_log /root/$log.log; I did. No errors.. but its not writing any log file at all... I think this defeats the purpose... because I only want to log for when the IP of the remote user matches any of those countries in the http {} section. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdgh2323 at hotmail.com Sun Mar 25 23:59:06 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Sun, 25 Mar 2012 23:59:06 +0000 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: <20120325232937.GA8561@macbookpro.wargaming.net> References: , <20120325232937.GA8561@macbookpro.wargaming.net> Message-ID: Alex, Thank you. This worked. Is it absolutely necessary to use a variable in the log file at the server {} section? Afterall... all of the logs of the listed countries are going to the same static filename. --Mike > Date: Mon, 26 Mar 2012 02:29:38 +0300 > From: kolesen.a at gmail.com > To: nginx at nginx.org > Subject: Re: "access_log" directive is not allowed here in... how to do this properly? > > > Hello ! > > > > Iam trying to log the requests coming from a list of countries into a seperate > > log file.. Iam using the config below... BUt iam getting this error: > > > > [emerg]: "access_log" directive is not allowed here in /etc/nginx/nginx.conf:55 > > configuration file /etc/nginx/nginx.conf test failed > > > > How could I accomplish what iam trying to do? > > > > Thanks! > > > > --Mike > > > > > > http { > > ...... > > ....... > > > > geoip_country /etc/nginx/GeoIP.dat; > > > > map $geoip_country_code $log { > > default 0; > > CN 1; #"China" > > RO 1; #"Romania" > > IQ 1; #"Iraq" > > IR 1; #"Iran > > HK 1; #"Hong Kong" > > IN 1; #"India" > > } > > > > server { > > listen 80; > > server_name domain.com; > > ..... > > ..... > > if ($log) { access_log /root/access-selected-slim.log; } > > location / { proxy_pass http://12.163.169.32:80/; } > > > > } > > } > > > > If you want to log queries from only the listed countries, > you may write the following: > > http { > ...... > ....... > > geoip_country /etc/nginx/GeoIP.dat; > > map $geoip_country_code $log { > default dev/null; > CN root/access-selected-slim.log; #"China" > RO root/access-selected-slim.log; #"Romania" > IQ root/access-selected-slim.log; #"Iraq" > IR root/access-selected-slim.log; #"Iran > HK root/access-selected-slim.log; #"Hong Kong" > IN root/access-selected-slim.log; #"India" > } > > server { > listen 80; > server_name domain.com; > ..... > ..... > access_log /$log; > location / { proxy_pass http://12.163.169.32:80/; } > > } > } > > > But note that access logs with variables in their names have limitatios. > Refer to the http://wiki.nginx.org/HttpLogModule > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Mon Mar 26 00:04:29 2012 From: francis at daoine.org (Francis Daly) Date: Mon, 26 Mar 2012 01:04:29 +0100 Subject: "access_log" directive is not allowed here in... how to do this properly? In-Reply-To: References: <20120325232140.GK547@craic.sysops.org> Message-ID: <20120326000429.GL547@craic.sysops.org> On Sun, Mar 25, 2012 at 11:40:51PM +0000, Micheal Wolfskill wrote: Hi there, > > access_log /root/$log.log; > > I did. No errors.. but its not writing any log file at all... What does error_log say? When I try to write to a new file in /root/ as a non-root nginx user, I see something like open() "/root/default.log" failed (13: Permission denied) > I think this defeats the purpose... because I only want to log for when the IP of the remote user matches any of those countries in the http {} section. > Probably something like map $geoip_country_code $mylogfile { default off; CN logs/access.log; } access_log $mylogfile; will work, then. "log normally and post-process" is always another option, of course. f -- Francis Daly francis at daoine.org From al-nginx at none.at Mon Mar 26 00:29:30 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Mon, 26 Mar 2012 02:29:30 +0200 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: Message-ID: <44da09fe8f8f1aed3291586d974f13c9@none.at> Hi agentzh, do you know the Kyoto Tycoon ( http://fallabs.com/ )? Do you have plans to add it to openresty? Best regards Aleks On 25-03-2012 09:41, agentzh wrote: > Hi, folks! > > I'm happy to announce that ngx_openresty's new stable version 1.0.11.28 has just been released. You can download the source tarball from the Download page on openresty.org [1]: > > http://openresty.org/#Download [2] > > This is the first (and also the last) stable version of ngx_openresty based on the Nginx 1.0.11 core. Future versions will be based on the latest Nginx stable version. > [SNIPP] > You can find more details on the homepage of ngx_openresty here: > > http://openresty.org [3] > > Enjoy! > -agentzh http://blog.reddit.com/search?updated-max=2009-11-02T12:29:00-08:00&max-results=20&start=154&by-date=false Links: ------ [1] http://openresty.org [2] http://openresty.org/#Download [3] http://openresty.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Mon Mar 26 04:10:10 2012 From: agentzh at gmail.com (agentzh) Date: Mon, 26 Mar 2012 12:10:10 +0800 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: <44da09fe8f8f1aed3291586d974f13c9@none.at> References: <44da09fe8f8f1aed3291586d974f13c9@none.at> Message-ID: On Mon, Mar 26, 2012 at 8:29 AM, Aleksandar Lazic wrote: > do you know the Kyoto Tycoon ( http://fallabs.com/ )? > Yes. > Do you have plans to add it to openresty? > As long as it has a sane Lua binding :) The current official Lua binding incorrectly uses Lua globals to store its internal states, which will cause troubles in the context of ngx_lua. Best, -agentzh From david.yu.ftw at gmail.com Mon Mar 26 07:05:54 2012 From: david.yu.ftw at gmail.com (David Yu) Date: Mon, 26 Mar 2012 15:05:54 +0800 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: <44da09fe8f8f1aed3291586d974f13c9@none.at> Message-ID: On Mon, Mar 26, 2012 at 12:10 PM, agentzh wrote: > On Mon, Mar 26, 2012 at 8:29 AM, Aleksandar Lazic > wrote: > > do you know the Kyoto Tycoon ( http://fallabs.com/ )? > > > > Yes. > > > Do you have plans to add it to openresty? > > > > As long as it has a sane Lua binding :) The current official Lua > binding incorrectly uses Lua globals to store its internal states, > which will cause troubles in the context of ngx_lua. > Not sure but are you meaning to run kyoto inside nginx? The binary protocol of ktycoon is simple and well documented. > > Best, > -agentzh > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -- When the cat is away, the mouse is alone. - David Yu -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Mar 26 04:01:21 2012 From: nginx-forum at nginx.us (TECK) Date: Mon, 26 Mar 2012 00:01:21 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0e83ad661722588b30515f4b4c213da0.NginxMailingListEnglish@forum.nginx.org> This occurs randomly, it is not something constant. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224382#msg-224382 From nginx-forum at nginx.us Mon Mar 26 02:31:22 2012 From: nginx-forum at nginx.us (edwin) Date: Sun, 25 Mar 2012 22:31:22 -0400 (EDT) Subject: how to custom nginx as a forward proxy In-Reply-To: References: Message-ID: <22e6cb9661170ee2799e35292da3d010.NginxMailingListEnglish@forum.nginx.org> access log like this , but the webpage has no any infomation shown. 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 127.0.0.1 - - [26/Mar/2012:10:28:54 +0500] "GET /www.yahoo.com HTTP/1.0" 499 0 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224378,224379#msg-224379 From nginx-forum at nginx.us Mon Mar 26 02:17:46 2012 From: nginx-forum at nginx.us (edwin) Date: Sun, 25 Mar 2012 22:17:46 -0400 (EDT) Subject: how to custom nginx as a forward proxy Message-ID: as I know squid can be use a proxy server , but currently I don't want to use it , but want to use nginx ,I google "forward proxy " , and get some idea : add server { listen 8080; resolver 8.8.8.8; location / { proxy_pass http://$http_host$request_uri; } but when I add the context to nginx.conf , and reload nginx view the website such as http://127.0.0.1:8080/www.yahoo.com get no response ,so can guys help me :) thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224378,224378#msg-224378 From nginx-forum at nginx.us Mon Mar 26 00:38:54 2012 From: nginx-forum at nginx.us (zhnupy) Date: Sun, 25 Mar 2012 20:38:54 -0400 (EDT) Subject: either error log empty or access log empty In-Reply-To: References: Message-ID: <1e3c445ab29728a562e42b432b8744d9.NginxMailingListEnglish@forum.nginx.org> a very enlightening response thank you very much Francis! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224315,224377#msg-224377 From nginx-forum at nginx.us Mon Mar 26 03:55:53 2012 From: nginx-forum at nginx.us (TECK) Date: Sun, 25 Mar 2012 23:55:53 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 Message-ID: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> Hi everyone, I just wanted to let the developers know about some error flags I discovered into Nginx 1.0.14, with debug mode disabled. Socket leaks and pread: 2012/03/24 23:29:52 [alert] 10770#0: open socket #46 left in connection 5 2012/03/24 23:29:52 [alert] 10770#0: open socket #115 left in connection 54 2012/03/24 23:29:52 [alert] 10770#0: open socket #110 left in connection 107 2012/03/24 23:29:52 [alert] 10770#0: aborting 2012/03/24 23:29:52 [alert] 10772#0: open socket #44 left in connection 57 2012/03/24 23:29:52 [alert] 10772#0: open socket #38 left in connection 140 2012/03/24 23:29:52 [alert] 10772#0: aborting 2012/03/25 00:01:35 [alert] 4105#0: *14584 pread() read only 0 of 5733 from "/var/www/domain.com/index.html" while sending response to client, client: xx.xxx.xx.xxx, server: www.domain.com, request: "GET / HTTP/1.1", host: "www.domain.com" SSL_Write() 2012/03/25 12:59:25 [crit] 8254#0: *342055 SSL_write() failed (SSL:) while sending to client, client: xxx.xx.xxx.xxx, server: www.domain.com, request: "GET /community/attachments/info007-jpg.179371/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer: "https://www.domain.com/community/threads/photos.42232/" 2012/03/25 14:52:15 [crit] 8253#0: *388269 SSL_write() failed (SSL:) while sending to client, client: xx.xxx.xx.xxx, server: www.domain.com, request: "GET /community/ HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com" We are running Nginx on CentOS 5.8 64bits, with openssl 0.9.8e-22.el5. All ssl directives are located into host, only the ssl_certificate and ssl_certificate_key are into server. # uname -a Linux chronos.domain.com 2.6.18-274.18.1.el5 #1 SMP Thu Feb 9 12:45:44 EST 2012 x86_64 x86_64 x86_64 GNU/Linux # nginx -V nginx version: nginx/1.0.14 built by gcc 4.1.2 20080704 (Red Hat 4.1.2-52) TLS SNI support disabled configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/client --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/subsys/nginx --with-cc-opt='-O3 -g -m64 -mtune=nocona -m128bit-long-double -mmmx -msse3 -mfpmath=sse' --with-file-aio --with-http_addition_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --with-poll_module --with-rtsig_module --with-select_module open_file_cache is enabled into http: open_file_cache max=1024 inactive=30s; open_file_cache_errors on; open_file_cache_min_uses 2; open_log_file_cache max=1024 inactive=30s min_uses=2; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224381#msg-224381 From nginx-forum at nginx.us Mon Mar 26 09:41:48 2012 From: nginx-forum at nginx.us (niraj) Date: Mon, 26 Mar 2012 05:41:48 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <9f4af27cad5f7df720e76d0260dbbc7f.NginxMailingListEnglish@forum.nginx.org> References: <9f4af27cad5f7df720e76d0260dbbc7f.NginxMailingListEnglish@forum.nginx.org> Message-ID: Is there any other way to complete my requirement ?? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224393#msg-224393 From mdounin at mdounin.ru Mon Mar 26 10:21:47 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 26 Mar 2012 14:21:47 +0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120326102147.GK13466@mdounin.ru> Hello! On Sun, Mar 25, 2012 at 11:55:53PM -0400, TECK wrote: > Hi everyone, > > I just wanted to let the developers know about some error flags I > discovered into Nginx 1.0.14, with debug mode disabled. > Socket leaks and pread: > 2012/03/24 23:29:52 [alert] 10770#0: open socket #46 left in connection > 5 > 2012/03/24 23:29:52 [alert] 10770#0: open socket #115 left in connection > 54 > 2012/03/24 23:29:52 [alert] 10770#0: open socket #110 left in connection > 107 > 2012/03/24 23:29:52 [alert] 10770#0: aborting > 2012/03/24 23:29:52 [alert] 10772#0: open socket #44 left in connection > 57 > 2012/03/24 23:29:52 [alert] 10772#0: open socket #38 left in connection > 140 > 2012/03/24 23:29:52 [alert] 10772#0: aborting Do you see this as a regression from some previous version? If yes - which one? Do you see the same problem in 1.1.x? > 2012/03/25 00:01:35 [alert] 4105#0: *14584 pread() read only 0 of 5733 > from "/var/www/domain.com/index.html" while sending response to client, > client: xx.xxx.xx.xxx, server: www.domain.com, request: "GET / > HTTP/1.1", host: "www.domain.com" This usually happens if you update files non-atomically, i.e. edit files in-place instead of creating new file and then renaming it to desired name. Obvious solution is to update files atomically. Note well: by using open_file_cache you allow much bigger time frame for non-atomic updates to trigger problems. If you can't eliminate non-atomic updates it's a good idea to avoid using open_file_cache. > SSL_Write() > 2012/03/25 12:59:25 [crit] 8254#0: *342055 SSL_write() failed (SSL:) > while sending to client, client: xxx.xx.xxx.xxx, server: www.domain.com, > request: "GET /community/attachments/info007-jpg.179371/ HTTP/1.1", > upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer: > "https://www.domain.com/community/threads/photos.42232/" > 2012/03/25 14:52:15 [crit] 8253#0: *388269 SSL_write() failed (SSL:) > while sending to client, client: xx.xxx.xx.xxx, server: www.domain.com, > request: "GET /community/ HTTP/1.0", upstream: > "fastcgi://127.0.0.1:9000", host: "www.domain.com" > > We are running Nginx on CentOS 5.8 64bits, with openssl 0.9.8e-22.el5. As openssl 0.9.8e is quite old, I assume it's heavily modified by your OS vendor. Do you see the same errors if you compile nginx with recent vanilla openssl (0.9.8u, 1.0.0h or 1.0.1 will be ok)? [...] Maxim Dounin From nginx-forum at nginx.us Mon Mar 26 10:41:28 2012 From: nginx-forum at nginx.us (canp) Date: Mon, 26 Mar 2012 06:41:28 -0400 (EDT) Subject: vbseo rewrite Message-ID: <613d4c29b88492504172c68c05f6512e.NginxMailingListEnglish@forum.nginx.org> Hi, I have a wordpress site with vbulletin+vBSEO forum section under "/forum/" directory and I'm trying to move this site from apache2 to nginx 1.0.12. Everything works good except the vBSEO rewrite rules. The webserver is configured with a chain(1) of serveral components in order to speed up the web requests. I have "varnish" listening on port 80 that forwards the requests to nginx on port 8069. Nginx is provided with apc cache and uses php-fpm on port "9000" to handle php requests. The wordpress is also provided with W3TotalCache. Tha server setup is based on ISPConfig 3.0.4.3. When I try to access the forum section I recive a "500 Internal Server Error". /var/log/ispconfig/httpd/www.domain.com/error.log says: [error] 14702#0: *30 rewrite or internal redirection cycle while processing "/forum/vbseo.php", client: 127.0.0.1, server: www.dominio.com, request: "GET /forum/ HTTP/1.1", host: "www.dominio.com", referrer: "http://www.dominio.com/FIRENDLY-URL/" The "forum" section is linked from the main wordpress menu. If I try to access directly the sections of the forum using the drop-down men? in wordpress I'm able to see it but the URL rewrited is not correct. The URL displayed is "www.dominio.com/subsectionoftheforum" instead of "www.dominio.com/forum/subsectionoftheforum". However, this is a secondary problem. /etc/nginx.conf is the default, I just added this lines of code for Cloudflare part: set_real_ip_from 204.93.240.0/24; set_real_ip_from 204.93.177.0/24; set_real_ip_from 199.27.128.0/21; set_real_ip_from 173.245.48.0/20; set_real_ip_from 103.22.200.0/22; set_real_ip_from 141.101.64.0/18; set_real_ip_from 108.162.192.0/18; real_ip_header CF-Connecting-IP; This(2) is my "/etc/nginx/sites-enabled/dominio.vhost: http://pastebin.com/s93rDtUu As you can see the configuration file is subdivided in 4 sections: - general - vBulletin - VBSEO - wordpress - W3TotalCache I tried to remove wordpress and W3TC part in order to exclude conflict problems but I didn't resolved the issue. Anyway I tried it with other rewrite URL set. The vBSEO rewrite rule set is the one suggested by vBSEO developers. I've already opened a support ticket on vBSEO customer support section. They says the code is correct and I have a conflict issue with wordpress and other directives. This what tey say: ------------------ Your nginx rules look ok but the issue is it looks like you have conflicting url rewrite rules all around. You should either hire an experienced nginx administrator to fix the issue or remove your wordpress rules as they don't look ok and we can't assist you on fixing third party script rules. ------------------ Your rules look ok. However you seem to have other issues. Again your best bet is hiring someone experienced or reverting back to the web server you are confident with. ------------------ If is necessary I can upload this other configuration files: - nginx.conf (entire) - apc.ini - a txt file with all the rewrite rule sets i tried. - php.ini - php-fpm.conf - default.vcl Thank you in advance for your reply. Maurizio (1) all the requests comes from cloudflare - I set up all the "set_real_ip" directives in nginx.conf (2) I used "pastebin" service as a matter of order of this post. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224398,224398#msg-224398 From contact at jpluscplusm.com Mon Mar 26 11:03:55 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 26 Mar 2012 12:03:55 +0100 Subject: rewrite proxy flag set problem In-Reply-To: References: <9f4af27cad5f7df720e76d0260dbbc7f.NginxMailingListEnglish@forum.nginx.org> Message-ID: You state that "it will not work in my case [as] I am using the regular expression", but don't provide any examples of how you're doing this or how it breaks. Please provide a fuller and more complete set of examples. You could also try removing the trailing slash from Maxim's rewritten example. i.e. location /auction/ { proxy_pass http://192.168.1.210; } This will pass on the remainder of the URI's path more equivalently to your original example. Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From kolesen.a at gmail.com Mon Mar 26 11:21:53 2012 From: kolesen.a at gmail.com (Alexander Kolesen) Date: Mon, 26 Mar 2012 14:21:53 +0300 Subject: Help with setting proxy_header In-Reply-To: References: Message-ID: <20120326112153.GA25274@macbookpro.wargaming.net> > Hello! > > I have a reverse proxy setup like this... > > server { > ...... > ...... > > if ($host = '23.71.33.142' ) { proxy_set_header Host > www.domain.com; } > location / { proxy_pass http://31.186.1.131:60/; } > > } > > The problem is that i cannot have a proxy_set_header inside an IF like this. > Basically what iam intending to do is.. If the remote client visits my server > with the IP (23.71.33.142) as the header (by using http://23.71.33.142) I need > to send hardcoded the header to the backend server si my backend server knows > it should respond with the content of domain.com . If they send any other > header then it needs to be past to the backend server to deal with intact (it > can be domain.com / www.domain.com / sub.domain.com ) > > Thanks! > > --Mike > The more proper way is to use 'map' directive: map $remote_addr $myhost { default $http_host; 23.71.33.142 www.domain.com; } server { ... location / { proxy_set_header Host $myhost; } ... } From contact at hksvietnam.com Mon Mar 26 11:32:56 2012 From: contact at hksvietnam.com (HKS VIETNAM) Date: Mon, 26 Mar 2012 18:32:56 +0700 Subject: How to prevent processing requests with undefined server names on nginx 1.1.17 Message-ID: <017301cd0b44$33b84b50$9b28e1f0$@hksvietnam.com> Dear Team, My OS: Centos 5.8 My nginx 1.1.7 Apache listen on: 8080 Nginx listen on: 80 nginx as reverse proxy. My proxy.conf file proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; client_header_buffer_size 64k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 16k; proxy_buffers 32 16k; proxy_busy_buffers_size 64k; My nginx config file: server { listen 80; server_name ""; return 444; } server { listen 192.168.1.3:80 default_server; server_name www1.domain1.com; access_log /var/log/nginx/www1.domain1.com.access.log main; location / { include proxy.conf; proxy_pass http://127.0.0.1:8080; } } server { listen 192.168.1.3:80; server_name forum.domain1.com; access_log /var/log/nginx/forum.domain1.com.access.log main; location / { include proxy.conf; proxy_pass http://127.0.0.1:8080; } } server { listen 192.168.1.3:80; server_name www.domain1.com domain1.com; access_log /var/log/nginx/www.domain1.com.access.log main; location / { include proxy.conf; proxy_pass http://127.0.0.1:8080; } } server { listen 192.168.1.3:80; server_name www.domain2.com domain2.com; access_log /var/log/nginx/www.domain2.com.access.log main; location / { include proxy.conf; proxy_pass http://127.0.0.1:8080; } } My problem: When I access undefined server names, ex: anything.domain1.com or anything.domain2.com I can still access, I want it to return 444. How I fix my problem ??? Thank all team Nginx, Nguyen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Mar 26 11:39:56 2012 From: nginx-forum at nginx.us (niraj) Date: Mon, 26 Mar 2012 07:39:56 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: Hi I have installed the catalyst and I am trying to integrate the same with Nginx. rewrite /auction(.*)$ http://192.168.1.210$1; the following rewrite rule is working for me right now. If I write rule that u mentioned then it will gives the error location /auction/ { proxy_pass http://192.168.1.210; } The reason for error might is that because my request is just like.. http://192.168.1.45/auction?id=1332416535292370.0097187543142212 for that I required to write a regular expression rewrite /auction(.*)$ http://192.168.1.210$1; Hope Now you understand my point clearly. If required any other info then let me know. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224402#msg-224402 From rm at rmax.be Mon Mar 26 11:41:17 2012 From: rm at rmax.be (Raphael Marot) Date: Mon, 26 Mar 2012 13:41:17 +0200 Subject: 502 Bad Gateway Message-ID: <4F7055DD.8050603@rmax.be> Hi all, I have a simple setup with Nginx in front Apache, under debian wheezy (nginx for static content, apache for php) Since the last Nginx update (1.1.17-2 via apt-get), every night after daily crons i have a 502 error (bad gateway) until i reload apache. Everything was fine before. I tried to reload apache after nginx in the logrotate daily task, but without effect. In my logs i just have : [error] 22332#0: *10804 connect() failed (111: Connection refused) while connecting to upstream Where should i look at? Thanks! From caldcv at gmail.com Mon Mar 26 11:42:19 2012 From: caldcv at gmail.com (Chris) Date: Mon, 26 Mar 2012 07:42:19 -0400 Subject: 502 Bad Gateway In-Reply-To: <4F7055DD.8050603@rmax.be> References: <4F7055DD.8050603@rmax.be> Message-ID: PHP is a common cause of such an error From appa at perusio.net Mon Mar 26 11:44:29 2012 From: appa at perusio.net (Antonio P.P. Almeida) Date: Mon, 26 Mar 2012 13:44:29 +0200 Subject: How to prevent processing requests with undefined server names on nginx 1.1.17 In-Reply-To: <017301cd0b44$33b84b50$9b28e1f0$@hksvietnam.com> References: <017301cd0b44$33b84b50$9b28e1f0$@hksvietnam.com> Message-ID: Try: server { listen [::]:80 default_server; server_name _; return 444; } You'll have to define *all valid* hosts in each server block. --appa From mailing at securitylabs.it Mon Mar 26 11:45:00 2012 From: mailing at securitylabs.it (mailing at securitylabs.it) Date: Mon, 26 Mar 2012 13:45:00 +0200 Subject: 502 Bad Gateway In-Reply-To: <4F7055DD.8050603@rmax.be> References: <4F7055DD.8050603@rmax.be> Message-ID: <4F7056BC.3040401@securitylabs.it> Il 26/03/2012 13:41, Raphael Marot ha scritto: > Hi all, > > I have a simple setup with Nginx in front Apache, under debian wheezy > (nginx for static content, apache for php) > Since the last Nginx update (1.1.17-2 via apt-get), every night after > daily crons i have a 502 error (bad gateway) until i reload apache. > Everything was fine before. > I tried to reload apache after nginx in the logrotate daily task, but > without effect. > In my logs i just have : > > [error] 22332#0: *10804 connect() failed (111: Connection refused) > while connecting to upstream > > Where should i look at? > Look at Apache's logs. It seems that apache does not restart correctly after che log rotate, and a manual restart fix it. The error tells you that nginx can't communicate with apache. From kolesen.a at gmail.com Mon Mar 26 11:48:27 2012 From: kolesen.a at gmail.com (Alexander Kolesen) Date: Mon, 26 Mar 2012 14:48:27 +0300 Subject: How to prevent processing requests with undefined server names on nginx 1.1.17 In-Reply-To: <017301cd0b44$33b84b50$9b28e1f0$@hksvietnam.com> References: <017301cd0b44$33b84b50$9b28e1f0$@hksvietnam.com> Message-ID: <20120326114826.GB25274@macbookpro.wargaming.net> > Dear Team, > > > > My OS: Centos 5.8 > > My nginx 1.1.7 > > > > Apache listen on: 8080 > > Nginx listen on: 80 > > > > nginx as reverse proxy. > > > > My proxy.conf file > > proxy_redirect off; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > client_max_body_size 10m; > client_body_buffer_size 128k; > client_header_buffer_size 64k; > proxy_connect_timeout 90; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 16k; > proxy_buffers 32 16k; > proxy_busy_buffers_size 64k; > > > > My nginx config file: > > > > server { > > listen 80; > > server_name ""; > > return 444; > > } > > > > > Just rewrite your "catch all" virtual host as a following: server { listen 80 default_server; server_name _; return 444; } And move 'default_server' attribute here, from your second virtual host. Note that the 'server_name ""' syntax means 'empty Host header'. But it will work with the 'listen 80 default_server'. Refer the http://nginx.org/en/docs/http/server_names.html From contact at jpluscplusm.com Mon Mar 26 11:56:47 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 26 Mar 2012 12:56:47 +0100 Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: On 26 March 2012 12:39, niraj wrote: > Hi > > > ?I have installed the catalyst and I am trying to integrate the same > with Nginx. I don't know what "the catalyst" is, sorry. I'm not sure I need to, however. > ?rewrite /auction(.*)$ http://192.168.1.210$1; > > the following rewrite rule is working for me right now. > > If I write rule that u mentioned then it will gives the error > > location /auction/ { > proxy_pass http://192.168.1.210; > } You need to tell us what "the error" is. Just saying that an error occurs really isn't helpful. > The reason for error might is that because my request is just like.. > > http://192.168.1.45/auction?id=1332416535292370.0097187543142212 > > for that I required to write a regular expression > > ?rewrite /auction(.*)$ http://192.168.1.210$1; Yes, you need to amend the location clause Maxim and I gave you so that it doesn't mandate a trailing slash. NB this is a *different* trailing slash from the one I mentioned previously in this thread. You need *not* to use any rewrite statements in the way that you're currently doing. As http://wiki.nginx.org/NginxHttpRewriteModule#rewrite says: "If the replacement string begins with http:// then the client will be redirected". This means that the only reason the rewrite is working for *you* is because your client machine has direct access to 192.168.1.210. If you try to make this work for external users, it won't. Use the "location" method instead of using "rewrite". Get rid of the trailing slash. Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From rm at rmax.be Mon Mar 26 12:01:17 2012 From: rm at rmax.be (Raphael Marot) Date: Mon, 26 Mar 2012 14:01:17 +0200 Subject: 502 Bad Gateway In-Reply-To: <4F7056BC.3040401@securitylabs.it> References: <4F7055DD.8050603@rmax.be> <4F7056BC.3040401@securitylabs.it> Message-ID: <4F705A8D.7010002@rmax.be> Le 26/03/2012 13:45, mailing at securitylabs.it a ?crit : > Il 26/03/2012 13:41, Raphael Marot ha scritto: >> Hi all, >> >> I have a simple setup with Nginx in front Apache, under debian wheezy >> (nginx for static content, apache for php) >> Since the last Nginx update (1.1.17-2 via apt-get), every night after >> daily crons i have a 502 error (bad gateway) until i reload apache. >> Everything was fine before. >> I tried to reload apache after nginx in the logrotate daily task, but >> without effect. >> In my logs i just have : >> >> [error] 22332#0: *10804 connect() failed (111: Connection refused) >> while connecting to upstream >> >> Where should i look at? >> > Look at Apache's logs. It seems that apache does not restart correctly > after che log rotate, and a manual restart fix it. The error tells you > that nginx can't communicate with apache. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Thanks! Indeed I have an error in my apache log. seg fault or similar nasty error detected in the parent process It is definitely php related and has nothing to do with Nginx. I think i uninstalled a php module which is still called in the php.ini, and maybe this is the cause... From nginx-forum at nginx.us Mon Mar 26 12:04:13 2012 From: nginx-forum at nginx.us (TECK) Date: Mon, 26 Mar 2012 08:04:13 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> Hi Maxim, > Do you see this as a regression from some previous version? If > yes - which one? Do you see the same problem in 1.1.x? I used before 1.0.12 and did not experienced the socket leaks. > This usually happens if you update files non-atomically, i.e. edit > files in-place instead of creating new file and then renaming it > to desired name. Obvious solution is to update files atomically. Thanks, that is what I was doing, editing the file with nano. :) > As openssl 0.9.8e is quite old, I assume it's heavily modified by > your OS vendor. Do you see the same errors if you compile nginx with > recent vanilla openssl (0.9.8u, 1.0.0h or 1.0.1 will be ok)? We are using the default openssl version available in CentOS 5.8. I could look into that but we are talking hundreds of thousands of servers still using 0.9.8e. Personally I'm not comfortable yet moving to CentOS 6.2. I will create an openssl-1.0.1 RPM for CentOS 5.8 and test it on a development server, then move it into production. Still, I don't recall noticing any SSL errors on previous Nginx version (1.0.12). Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224410#msg-224410 From nginx-forum at nginx.us Mon Mar 26 12:27:27 2012 From: nginx-forum at nginx.us (niraj) Date: Mon, 26 Mar 2012 08:27:27 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: Hi Let me clear my question again. My current problem is if I used the rewrite rules my site is working(this is my testing machine so Ip just like 192.168......), but problem is it not show the original server Ip , instead it show the 192.168.1.210 at client side, I want to hide this Ip 192.168.1.210. want to show the original server IP when redirect happened. Hope you clear with my requirement. Now I have set this in nginx, I just give u my nginx configuration details as below server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { root /var/www/vendx/html_asp; index index.html index.shtml; } location \.(js|css|png|jpg|jpeg|gif|ico|html|xml)$ {} location /auction/ { proxy_pass http://192.168.1.210; } location ~ \.(cgi|pm)$ { gzip off; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME /var/www/vendx$fastcgi_script_name; #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } I am getting the following error when redirect happened ............... 2012/03/26 17:32:24 [error] 5349#0: *1 open() "/var/www/vendx/html_asp/stylesheet" failed (2: No such file or directory), client: 192.168.1.44, server: localhost, request: "GET /stylesheet HTTP/1.1", host: "192.168.1.45", referrer: "http://192.168.1.45/auction/?id=1332416535292370.0097187543142212" 2012/03/26 17:32:24 [error] 5349#0: *5 open() "/var/www/vendx/html_asp/static/images/error.png" failed (2: No such file or directory), client: 192.168.1.44, server: localhost, request: "GET /static/images/error.png HTTP/1.1", host: "192.168.1.45", referrer: "http://192.168.1.45/auction/?id=1332416535292370.0097187543142212" 2012/03/26 17:32:24 [error] 5349#0: *1 directory index of "/var/www/vendx/html_asp/scripts/" is forbidden, client: 192.168.1.44, server: localhost, request: "GET /scripts/ HTTP/1.1", host: "192.168.1.45", referrer: "http://192.168.1.45/auction/?id=1332416535292370.0097187543142212" 2012/03/26 17:32:24 [error] 5349#0: *1 open() "/var/www/vendx/html_asp/static/images/error.png" failed (2: No such file or directory), client: 192.168.1.44, server: localhost, request: "GET /static/images/error.png HTTP/1.1", host: "192.168.1.45", referrer: "http://192.168.1.45/auction/?id=1332416535292370.0097187543142212" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224414#msg-224414 From nginx-forum at nginx.us Mon Mar 26 12:49:57 2012 From: nginx-forum at nginx.us (TECK) Date: Mon, 26 Mar 2012 08:49:57 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: I looked into upgrading to 1.0.1, it is not possible. We are talking about 84 package deps, on a minimal install. So upgrading openssl is not viable. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224416#msg-224416 From contact at jpluscplusm.com Mon Mar 26 13:38:43 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 26 Mar 2012 14:38:43 +0100 Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: On 26 March 2012 13:27, niraj wrote: > Hi > > ? ? Let me clear my question again. > > ? ? My current problem is ?if I used the rewrite rules ?my site is > working(this is my testing machine so Ip just like 192.168......), but > problem is it not show the original server Ip , instead it show the > 192.168.1.210 at client side, I want to hide this Ip 192.168.1.210. Yes - as I explained, that's because you were using a redirect with an http:// prefix. That's what it *does*. > want to show the original server IP when redirect happened. > Hope you clear with my requirement. "Requirements" are what you give to people you're *paying* to help you. I think you mean "this is what I'm try to achieve" ... ;-) > Now I have set this ?in nginx, I just give u my nginx configuration > details as below > > > server { > ? ?listen ? ? ? 80; > ? ?server_name ?localhost; > > ? ?#charset koi8-r; > ? ?#access_log ?/var/log/nginx/log/host.access.log ?main; > > ? ?location / { > ? ? ? ?root ? /var/www/vendx/html_asp; > ? ? ? ?index ?index.html index.shtml; > ? ?} > > > ? ?location ?\.(js|css|png|jpg|jpeg|gif|ico|html|xml)$ {} > > location /auction/ { > proxy_pass http://192.168.1.210; > } I think I've already suggested the small change that you need to try here. Read my previous email again. > I am getting the following error ?when redirect happened Are these errors in the nginx logs? Ort the logs on 192.168.1.210? In response to what single initial request *exactly*? Have a read of http://www.catb.org/~esr/faqs/smart-questions.html#volume and the rest of that document - it may help. Cheers, Jonathan From kurtis.mullins at gmail.com Mon Mar 26 14:14:53 2012 From: kurtis.mullins at gmail.com (Kurtis Mullins) Date: Mon, 26 Mar 2012 10:14:53 -0400 Subject: Rewrite Subdomains to Paths (Valentin V. Bartenev) Message-ID: Hello, Thanks for the quick reply. I apologize ahead-of-time if this is the incorrect way to reply to messages on here. I have my notification settings set to once per day. Anyways, this would definitely work for redirects. Is it possible to do it in a way that is transparent to the end-user and my WSGI Application server? Basically, when the user accesses username.example.com/foo/bar/then my WSGI Application would just see " example.com/username/foo/bar/". I'm trying to get around a limitation of django where it processes URLs based on the path alone. I mainly want this done dynamically so I don't have thousands of configuration directives going on. Thanks again! > ------------------------------ > > Message: 3 > Date: Thu, 22 Mar 2012 00:33:02 +0400 > From: "Valentin V. Bartenev" > To: nginx at nginx.org > Subject: Re: Rewrite Subdomains to Paths > Message-ID: <201203220033.02956.ne at vbart.ru> > Content-Type: Text/Plain; charset="iso-8859-6" > > On Thursday 22 March 2012 00:15:00 Kurtis Mullins wrote: > > Hey, > > > > Is it possible to rewrite subdomains to paths? I want to do something > like > > this: > > > > x.example.com/foo/bar/ -> www.example.com/x/foo/bar/ > > > > server { > server_name ~^(?P.+)\.example\.com$; > > location / { > return 301 http://www.example.com/$subdomain$request_uri; > } > } > > wbr, Valentin V. Bartenev -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Mar 26 14:41:38 2012 From: nginx-forum at nginx.us (Samael) Date: Mon, 26 Mar 2012 10:41:38 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <30dfe945daf09f94e02d38d5616c082d.NginxMailingListEnglish@forum.nginx.org> No need to - it will be statically compiled. Just drop the "make %{?_smp_mflags}" part for just "make" - otherwise not going to work with OpenSSL 1.0.1 due to a bug. And you will be able to use EC EDH - a lot better than just Ephemeral Diffie-Hellman (if you need Perfect Forward Secrecy, of course); most of the browsers already support it. '--with-openssl=/usr/src/redhat/SOURCES/openssl-1.0.1 --with-openssl-opt=enable-ec_nistp_64_gcc_128 --with-cc=/usr/bin/gcc44' will do the job for a 64bit build. Just make sure you are using gcc44 (export CC=/usr/bin/gcc44). Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224427#msg-224427 From contact at hksvietnam.com Mon Mar 26 16:15:17 2012 From: contact at hksvietnam.com (HKS VIETNAM) Date: Mon, 26 Mar 2012 23:15:17 +0700 Subject: How to prevent processing requests with undefined server names on nginx 1.1.17 In-Reply-To: References: <017301cd0b44$33b84b50$9b28e1f0$@hksvietnam.com> Message-ID: <000301cd0b6b$a537b4b0$efa71e10$@hksvietnam.com> Dear, Thank you so much. It's OK :) My proplem has been fixed. Thank you, Nguyen -----Original Message----- From: nginx-bounces at nginx.org [mailto:nginx-bounces at nginx.org] On Behalf Of Antonio P.P. Almeida Sent: Monday, March 26, 2012 6:44 PM To: nginx at nginx.org Subject: Re: How to prevent processing requests with undefined server names on nginx 1.1.17 Try: server { listen [::]:80 default_server; server_name _; return 444; } You'll have to define *all valid* hosts in each server block. --appa _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From francis at daoine.org Mon Mar 26 16:28:52 2012 From: francis at daoine.org (Francis Daly) Date: Mon, 26 Mar 2012 17:28:52 +0100 Subject: Rewrite Subdomains to Paths (Valentin V. Bartenev) In-Reply-To: References: Message-ID: <20120326162852.GM547@craic.sysops.org> On Mon, Mar 26, 2012 at 10:14:53AM -0400, Kurtis Mullins wrote: Hi there, > Anyways, this would definitely work for redirects. Is it possible to do it > in a way that is transparent to the end-user and my WSGI Application > server? That's (mostly) up to your application server. > Basically, when the user accesses > username.example.com/foo/bar/then my WSGI Application would just see " > example.com/username/foo/bar/". On the nginx side, you "just" adjust the uwsgi_param values that you send. (Assuming that's how nginx access the application.) But before you do that: try accessing the WSGI Application using the example.com/username/foo/bar/ style urls. Look in the returned content. Do you see the string "username" anywhere? Do you see any linked content with a url that starts "/" or with multiple "../"? Do you see any linked content with a url that includes "example.com"? If you do, consider how they will look to a client which thinks that its initial request was to username.example.com/foo/bar. You can get nginx to mangle http headers. You shouldn't get nginx to mangle the http body. It can work. But it is worth testing your particular setup to make sure that it works for you. f -- Francis Daly francis at daoine.org From mdounin at mdounin.ru Mon Mar 26 16:47:54 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 26 Mar 2012 20:47:54 +0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120326164754.GL13466@mdounin.ru> Hello! On Mon, Mar 26, 2012 at 08:04:13AM -0400, TECK wrote: > Hi Maxim, > > > Do you see this as a regression from some previous version? If > > yes - which one? Do you see the same problem in 1.1.x? > > I used before 1.0.12 and did not experienced the socket leaks. That's really strange, changes between 1.0.12 and 1.0.14 are minimal. Could you please re-try with 1.0.12 to see if it works for you without problems? > > As openssl 0.9.8e is quite old, I assume it's heavily modified by > > your OS vendor. Do you see the same errors if you compile nginx with > > recent vanilla openssl (0.9.8u, 1.0.0h or 1.0.1 will be ok)? > > We are using the default openssl version available in CentOS 5.8. > I could look into that but we are talking hundreds of thousands of > servers still using 0.9.8e. I'm mostly concerned by local changes by your OS vendor, not about openssl 0.9.8e by itself. BTW, when you've upgraded your openssl last time? I.e. did the same openssl package version worked for you before, or you've upgraded it with nginx as well? > Personally I'm not comfortable yet moving to CentOS 6.2. I will create > an openssl-1.0.1 RPM for CentOS 5.8 and test it on a development server, > then move it into production. Still, I don't recall noticing any SSL > errors on previous Nginx version (1.0.12). As already suggested - you may build nginx with any particular openssl version statically, by using --with-openssl= configure argument. Maxim Dounin From al-nginx at none.at Mon Mar 26 20:26:33 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Mon, 26 Mar 2012 22:26:33 +0200 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: <44da09fe8f8f1aed3291586d974f13c9@none.at> Message-ID: On 26-03-2012 06:10, agentzh wrote: > On Mon, Mar 26, 2012 at 8:29 AM, Aleksandar Lazic > wrote: >> do you know the Kyoto Tycoon ( http://fallabs.com/ )? >> > > Yes. > >> Do you have plans to add it to openresty > > As long as it has a sane Lua binding :) The current official Lua > binding incorrectly uses Lua globals to store its internal states, > which will cause troubles in the context of ngx_lua. There is the possibility to use the memcache interface ;-) http://fallabs.com/kyototycoon/spex.html#tips_pluggableserver I use it with http://search.cpan.org/~dormando/Cache-Memcached-1.29/lib/Cache/Memcached.pm ;-) Cheers Aleks From al-nginx at none.at Mon Mar 26 20:28:48 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Mon, 26 Mar 2012 22:28:48 +0200 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: <44da09fe8f8f1aed3291586d974f13c9@none.at> Message-ID: <4dfa1597c08acd8d75ca2b58f285567f@none.at> Due to the fact that Kyoto Tycoon can speak memcache I think it should be possible to use Kyoto Tycoon also direct with *memcache* module. Due to the fact that I have not a use case for this I hope the 'comunity' have some ideas or needs ;-) Cheers Aleks On 26-03-2012 09:05, David Yu wrote: > On Mon, Mar 26, 2012 at 12:10 PM, agentzh wrote: > >> On Mon, Mar 26, 2012 at 8:29 AM, Aleksandar Lazic wrote: >> > do you know the Kyoto Tycoon ( http://fallabs.com/ [2] )? >> > >> >> Yes. >> >> > Do you have plans to add it to openresty? >> > >> >> As long as it has a sane Lua binding :) The current official Lua >> binding incorrectly uses Lua globals to store its internal states, >> which will cause troubles in the context of ngx_lua. > > Not sure but are you meaning to run kyoto inside nginx? > The binary protocol of ktycoon is simple and well documented. > >> Best, >> -agentzh >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org [3] >> http://mailman.nginx.org/mailman/listinfo/nginx [4] > > -- > When the cat is away, the mouse is alone. > - David Yu Links: ------ [1] mailto:al-nginx at none.at [2] http://fallabs.com/ [3] mailto:nginx at nginx.org [4] http://mailman.nginx.org/mailman/listinfo/nginx [5] mailto:agentzh at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon Mar 26 22:57:10 2012 From: nginx-forum at nginx.us (TECK) Date: Mon, 26 Mar 2012 18:57:10 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <820c0844d4c5883295babcfec8c1d191.NginxMailingListEnglish@forum.nginx.org> > That's really strange, changes between 1.0.12 and 1.0.14 are > minimal. Could you please re-try with 1.0.12 to see if it works > for you without problems? Will do, Maxim. I have to rebuild the RPM again, as I tossed the previous version from yum repository. > As already suggested - you may build nginx with any particular > openssl version statically, by using --with-openssl= configure > argument. Personally, I don't think is a good idea at all to compile source on a production server. I only use RPM's for the sake of easy upgrades, I build my own missing RPM's for that task. Either ways, the answer is clear, in order to have Nginx working properly with SSL in a production environment will require to upgrade to CentOS 6 which has openssl 1.0.0 RPM available. I thought it was a bug that generates those random crit issues. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224443#msg-224443 From agentzh at gmail.com Tue Mar 27 01:07:26 2012 From: agentzh at gmail.com (agentzh) Date: Tue, 27 Mar 2012 09:07:26 +0800 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: <4dfa1597c08acd8d75ca2b58f285567f@none.at> References: <44da09fe8f8f1aed3291586d974f13c9@none.at> <4dfa1597c08acd8d75ca2b58f285567f@none.at> Message-ID: On Tue, Mar 27, 2012 at 4:28 AM, Aleksandar Lazic wrote: > Due to the fact that? Kyoto Tycoon can speak memcache I think it should be > possible to use Kyoto Tycoon also direct with > > *memcache* module. > And also the lua-resty-memcached library based on ngx_lua's cosocket API: https://github.com/agentzh/lua-resty-memcached But I'm fraid the functionalities exposed by KT's memcached interface are a little limited, a Lua binding for KT's native wire protocol based on ngx_lua's cosocket may still be useful :) Best, -agentzh From nginx-forum at nginx.us Tue Mar 27 02:28:41 2012 From: nginx-forum at nginx.us (TECK) Date: Mon, 26 Mar 2012 22:28:41 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <820c0844d4c5883295babcfec8c1d191.NginxMailingListEnglish@forum.nginx.org> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <820c0844d4c5883295babcfec8c1d191.NginxMailingListEnglish@forum.nginx.org> Message-ID: I mention this because the [crit] issues were present in the past with Nginx 0.8 and they were solved by Igor. I was hoping a similar fix would be provided for latest stable version. Do you recommend me to switch to development version? Upgrading openssl is not a viable solution at the present time and we are getting a fairly large number of [crit] SSL_write() errors in our logs. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224445#msg-224445 From nginx-forum at nginx.us Tue Mar 27 04:29:06 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 00:29:06 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: References: Message-ID: <0355e7ef037735d5e0fc7cc78ab8f731.NginxMailingListEnglish@forum.nginx.org> Hi Sorry for that Mess up. As u suggested I have added the following line location /auction/ { proxy_pass http://192.168.1.210; when I click into my application I got the error that I mentioned in earlier e-mail. that error log of original server (192.168.1.45) and there is no log for 192.168.1.210 error log file. this is the request that my application is sending to the Nginx auction?id=1332416535292370.0097187543142212 In above example and as u suggested it will proxy or redirect the /auction folder query to the http://192.168.1.210; but you can see above request its not call the /auction folder. so we required to do something like auction(.*) am I correct ? And As I know proxy_pass not support the regular expression (.*) is it correct ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224446#msg-224446 From igor at sysoev.ru Tue Mar 27 05:18:39 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 09:18:39 +0400 Subject: rewrite proxy flag set problem In-Reply-To: <0355e7ef037735d5e0fc7cc78ab8f731.NginxMailingListEnglish@forum.nginx.org> References: <0355e7ef037735d5e0fc7cc78ab8f731.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120327051839.GA6821@nginx.com> On Tue, Mar 27, 2012 at 12:29:06AM -0400, niraj wrote: > Hi > > Sorry for that Mess up. > > As u suggested I have added the following line > > location /auction/ { > proxy_pass http://192.168.1.210; > > when I click into my application I got the error that I mentioned in > earlier e-mail. > > that error log of original server (192.168.1.45) and there is no log > for 192.168.1.210 error log file. > > this is the request that my application is sending to the Nginx > > auction?id=1332416535292370.0097187543142212 > > > In above example and as u suggested it will proxy or redirect the > /auction folder query to the http://192.168.1.210; > > but you can see above request its not call the /auction folder. > > so we required to do something like auction(.*) am I correct ? > > And As I know proxy_pass not support the regular expression (.*) is > it correct ? You do not need regular expression in this case. It seems you need just these two locations: location = /auction { proxy_pass http://192.168.1.210; } to proxy requests like "/auction?id=1332416535292370.0097187543142212" And location /auction/ { proxy_pass http://192.168.1.210/; } to proxy "/auction/some/page" to "http://192.168.1.210/some/page". -- Igor Sysoev From nginx-forum at nginx.us Tue Mar 27 05:22:32 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 01:22:32 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <0355e7ef037735d5e0fc7cc78ab8f731.NginxMailingListEnglish@forum.nginx.org> References: <0355e7ef037735d5e0fc7cc78ab8f731.NginxMailingListEnglish@forum.nginx.org> Message-ID: <97291469e23b8e693c83809deb8a5d51.NginxMailingListEnglish@forum.nginx.org> HI I was trying the with the following changes location /auction(.*)$1 { proxy_pass http://192.168.1.210$1/; } It was giving the following error 2012/03/27 10:32:39 [error] 7871#0: *1 open() "/var/www/vendx/html_asp/auction" failed (2: No such file or directory), client: 192.168.1.44, server: localhost, request: "GET /auction?id=1332416535292370.0097187543142212 HTTP/1.1", host: "192.168.1.45", referrer: "http://192.168.1.45/cgi-bin/baybuy_vendx/index.cgi?vendx_action=productlist&ShowPopup=1&pageid=10445&ID=20815613327607825242140023430669" Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224449#msg-224449 From igor at sysoev.ru Tue Mar 27 05:25:49 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 09:25:49 +0400 Subject: rewrite proxy flag set problem In-Reply-To: <20120327051839.GA6821@nginx.com> References: <0355e7ef037735d5e0fc7cc78ab8f731.NginxMailingListEnglish@forum.nginx.org> <20120327051839.GA6821@nginx.com> Message-ID: <20120327052549.GA7116@nginx.com> On Tue, Mar 27, 2012 at 09:18:39AM +0400, Igor Sysoev wrote: > On Tue, Mar 27, 2012 at 12:29:06AM -0400, niraj wrote: > > Hi > > > > Sorry for that Mess up. > > > > As u suggested I have added the following line > > > > location /auction/ { > > proxy_pass http://192.168.1.210; > > > > when I click into my application I got the error that I mentioned in > > earlier e-mail. > > > > that error log of original server (192.168.1.45) and there is no log > > for 192.168.1.210 error log file. > > > > this is the request that my application is sending to the Nginx > > > > auction?id=1332416535292370.0097187543142212 > > > > > > In above example and as u suggested it will proxy or redirect the > > /auction folder query to the http://192.168.1.210; > > > > but you can see above request its not call the /auction folder. > > > > so we required to do something like auction(.*) am I correct ? > > > > And As I know proxy_pass not support the regular expression (.*) is > > it correct ? > > You do not need regular expression in this case. > It seems you need just these two locations: > > location = /auction { > proxy_pass http://192.168.1.210; > } > > to proxy requests like "/auction?id=1332416535292370.0097187543142212" Or location = /auction { proxy_pass http://192.168.1.210/; } if request "/auction?id=1332416535292370.0097187543142212" should be proxied to "http://192.168.1.210/?id=1332416535292370.0097187543142212". -- Igor Sysoev From nginx-forum at nginx.us Tue Mar 27 05:47:20 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 01:47:20 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <20120327051839.GA6821@nginx.com> References: <20120327051839.GA6821@nginx.com> Message-ID: <38c75b17a8b8180662451651fb349ca1.NginxMailingListEnglish@forum.nginx.org> Hi Tnx a lot. that is what exactly I want to do I have done the following and its works. location = /auction { proxy_pass http://192.168.1.210/; } Tnx for the solution. And thnx for understanding the requirement. I have googling so much but I did not find this = syntax would you suggest for Nginx doc link in that I found such details docs. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224453#msg-224453 From igor at sysoev.ru Tue Mar 27 05:52:24 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 09:52:24 +0400 Subject: rewrite proxy flag set problem In-Reply-To: <38c75b17a8b8180662451651fb349ca1.NginxMailingListEnglish@forum.nginx.org> References: <20120327051839.GA6821@nginx.com> <38c75b17a8b8180662451651fb349ca1.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120327055224.GA7635@nginx.com> On Tue, Mar 27, 2012 at 01:47:20AM -0400, niraj wrote: > Hi > > Tnx a lot. > > that is what exactly I want to do I have done the > following and its works. > > > location = /auction { > proxy_pass http://192.168.1.210/; > } > > > Tnx for the solution. And thnx for understanding the requirement. > > I have googling so much but I did not find this = syntax > would you suggest for Nginx doc link in that I found such details > docs. http://nginx.org/en/docs/http/ngx_http_core_module.html#location -- Igor Sysoev From nginx-forum at nginx.us Tue Mar 27 06:07:34 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 02:07:34 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <20120327055224.GA7635@nginx.com> References: <20120327055224.GA7635@nginx.com> Message-ID: <36e0ec611f989471c2e1faa91636a989.NginxMailingListEnglish@forum.nginx.org> Hi Thnx for link. We can not do the same with rewrite ? for me with rewrite it was working but the only problem was that the url not proxied. its show the 192.168.1.210 at user end instead showing the original server name(my case 192.168.1.45). we can not solve that with rewrite ???? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224458#msg-224458 From nginx-forum at nginx.us Tue Mar 27 06:13:51 2012 From: nginx-forum at nginx.us (ahoura) Date: Tue, 27 Mar 2012 02:13:51 -0400 (EDT) Subject: Takes too long for a connection to be established! Message-ID: <10aae5dab83736a540fbfb03a4d039c3.NginxMailingListEnglish@forum.nginx.org> Hi, I am new to nginx, and I am using it currently on my server to serve videos to users. a few days ago the server started becoming extremely slow while have around 500-600 users online, note that I have a 1gbps line on the server so its not the bandwidth. it takes the server around a minute or 2 to respond but once the file starts streaming the speed is decent, so its taking the server long to spot the file I guess! I was wondering if anyone knows how I can fix this? I have already tried increasing the open file limit and worker limit, but still not luck!!! I am also interested to hire someone to fix this for me if they know how to do it exactly and have previous experience with a similar situation. Regards Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224460,224460#msg-224460 From igor at sysoev.ru Tue Mar 27 06:17:15 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 10:17:15 +0400 Subject: rewrite proxy flag set problem In-Reply-To: <36e0ec611f989471c2e1faa91636a989.NginxMailingListEnglish@forum.nginx.org> References: <20120327055224.GA7635@nginx.com> <36e0ec611f989471c2e1faa91636a989.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120327061715.GA8130@nginx.com> On Tue, Mar 27, 2012 at 02:07:34AM -0400, niraj wrote: > Hi > > Thnx for link. We can not do the same with rewrite ? > > for me with rewrite it was working but the only problem was that the url > not proxied. its show the 192.168.1.210 at user end instead showing the > original server name(my case 192.168.1.45). > > we can not solve that with rewrite ???? No, you cannot proxy with rewrite in nginx. As to the rewrite usage itself, this is a wrong, cumbersome, and ineffective way of configuration in both nginx and Apache. -- Igor Sysoev From nginx-forum at nginx.us Tue Mar 27 06:52:30 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 02:52:30 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <36e0ec611f989471c2e1faa91636a989.NginxMailingListEnglish@forum.nginx.org> References: <20120327055224.GA7635@nginx.com> <36e0ec611f989471c2e1faa91636a989.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi As I read and from that I understand, Proxypass in apache not used for regular express. mostly for regular expression in apache used the rewriterule http://httpd.apache.org/docs/current/mod/mod_rewrite.html The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly Please correct me If I wrong. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224464#msg-224464 From axelhols at gmail.com Tue Mar 27 06:59:05 2012 From: axelhols at gmail.com (Axel Holscher (GMAIL)) Date: Tue, 27 Mar 2012 08:59:05 +0200 Subject: nginx Digest, Vol 29, Issue 68 In-Reply-To: References: Message-ID: <001701cd0be7$21ed6790$65c836b0$@gmail.com> Hi Maxim, Wireshark showed it was IE9 that was not sending the URL name, at all, on first SSL handshake. Reset IE9 back to factory default and it works now. (..but have not found the actual IE9 security settings that caused theTLS SNI request to be suppressed though...yet) Thanks Axel >Date: Fri, 23 Mar 2012 16:23:53 +0400 >From: Maxim Dounin >Hello! >On Fri, Mar 23, 2012 at 10:22:38AM +0200, Axel Holscher (GMAIL) wrote: >> My IE9 (on Windows7 64 bit) fails to trigger the correct nginx virtual >> https server name and SSL certificate (It ignores all except the >> default -1st server). >> >> But It seems to work fine with FF10 and Chrome17. > >> Is this an IE9 issue? or am I missing something from my nginx/openssl >> compilation options? >Most likely it's IE issue, your nginx config looks fine. You may try looking what's happening on the wire (e.g. in wireshark) or just test if you see the same behaviour on the clean install of >Win7 + IE9 (google search suggests some incorrect registry settings may cause problems). >Maxim Dounin From igor at sysoev.ru Tue Mar 27 08:05:36 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 12:05:36 +0400 Subject: rewrite proxy flag set problem In-Reply-To: References: <20120327055224.GA7635@nginx.com> <36e0ec611f989471c2e1faa91636a989.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120327080536.GA10789@nginx.com> On Tue, Mar 27, 2012 at 02:52:30AM -0400, niraj wrote: > Hi > > As I read and from that I understand, Proxypass in apache not used > for regular express. > > mostly for regular expression in apache used the rewriterule > > http://httpd.apache.org/docs/current/mod/mod_rewrite.html > > The mod_rewrite module uses a rule-based rewriting engine, based on a > PCRE regular-expression parser, to rewrite requested URLs on the fly > > > Please correct me If I wrong. Yes, Apache did not support regexes ProxyPass. However, in your case regexes are not needed: ProxyPass /auction http://192.168.1.210/ or ProxyPass http://192.168.1.210/ -- Igor Sysoev From nginx-forum at nginx.us Tue Mar 27 08:50:59 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 04:50:59 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <20120327080536.GA10789@nginx.com> References: <20120327080536.GA10789@nginx.com> Message-ID: <68bed9e13a1494dc8c7c2c951366be08.NginxMailingListEnglish@forum.nginx.org> Hi I tried Proxy_Pass /auction http://192.168.1.210/; its not working gives the following error nginx: [emerg] invalid number of arguments in "proxy_pass" directive in /etc/nginx/conf.d/default.conf:52 nginx: configuration file /etc/nginx/nginx.conf test failed Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224471#msg-224471 From igor at sysoev.ru Tue Mar 27 08:55:08 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 12:55:08 +0400 Subject: rewrite proxy flag set problem In-Reply-To: <68bed9e13a1494dc8c7c2c951366be08.NginxMailingListEnglish@forum.nginx.org> References: <20120327080536.GA10789@nginx.com> <68bed9e13a1494dc8c7c2c951366be08.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120327085508.GA12789@nginx.com> On Tue, Mar 27, 2012 at 04:50:59AM -0400, niraj wrote: > Hi > > I tried > > Proxy_Pass /auction http://192.168.1.210/; > > > its not working gives the following error > > > nginx: [emerg] invalid number of arguments in "proxy_pass" directive in > /etc/nginx/conf.d/default.conf:52 > nginx: configuration file /etc/nginx/nginx.conf test failed These were Apache examples. -- Igor Sysoev From apachemaven0 at gmail.com Tue Mar 27 11:43:22 2012 From: apachemaven0 at gmail.com (maven apache) Date: Tue, 27 Mar 2012 19:43:22 +0800 Subject: when front proxy meet reverse proxy Message-ID: Hi: This is a cross post at stackoverflow,since I got no answser there,so I post it here. Since I think my question is related to the reverse proxy. This is the post body: In our app,we have make the cross domain ajax request,and we have no control on the server domain which does not support jsonp,so we try to use the proxy. We have a proxy.ashx on our server,and try to get the data through this proxy. So in this case I think our server is the front server to the client,isn't it? However our server is deployed in the internal network which use the reverse proxy. Say I make a requset: http://ourserver/proxy.ashx?url=http://crossdomainserver¶=xxx. Then the reverse proxy forward this requst to our server,but our server have no access to the internet,that's to say,our server can not access http://crossdomainserver here. So I want to know if you guys have met the same suitation,and how to solve it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From al-nginx at none.at Tue Mar 27 12:25:14 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Tue, 27 Mar 2012 14:25:14 +0200 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: <44da09fe8f8f1aed3291586d974f13c9@none.at> <4dfa1597c08acd8d75ca2b58f285567f@none.at> Message-ID: <1cffaea19ed9cad9fce8c60c439d8d16@none.at> On 27-03-2012 03:07, agentzh wrote: > On Tue, Mar 27, 2012 at 4:28 AM, Aleksandar Lazic > wrote: >> Due to the fact that? Kyoto Tycoon can speak memcache I think it >> should be >> possible to use Kyoto Tycoon also direct with >> >> *memcache* module. >> > > And also the lua-resty-memcached library based on ngx_lua's cosocket > API: > > https://github.com/agentzh/lua-resty-memcached > > But I'm fraid the functionalities exposed by KT's memcached interface > are a little limited, a Lua binding for KT's native wire protocol > based on ngx_lua's cosocket may still be useful :) Which module is the best to fork and start to implement ;-) https://github.com/agentzh/ The 'native wire protocol' is HTTP ;-) http://fallabs.com/kyototycoon/spex.html#protocol #### ... Kyoto Cabinet uses an RPC model called TSV-RPC, which is similar to XML-RPC but uses TSV rather than XML. Although TSV is inferior to XML in terms of expressive ability, TSV is superior to XML in terms of simplicity, space efficiency, and processing effectiveness. ... #### Cheers From nginx-forum at nginx.us Tue Mar 27 12:47:57 2012 From: nginx-forum at nginx.us (niraj) Date: Tue, 27 Mar 2012 08:47:57 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <20120327085508.GA12789@nginx.com> References: <20120327085508.GA12789@nginx.com> Message-ID: <93f51c1c0f37415b621ae6a794042639.NginxMailingListEnglish@forum.nginx.org> Hi For that auction proxy_pass working but now I have request like /user/ongoingra/display_ra_list?from_period=&to_period=&type=20 I want to redirect this query for that I have added the following location =/user/ongoingra/ { proxy_pass http://192.168.1.210/user/ongoingra/; } or location =/user { proxy_pass http://192.168.1.210/user; } or location /user/ongoingra { proxy_pass http://192.168.1.210/user/ongoingra; } but I am not able to get the result of the following request /user/ongoingra/display_ra_list?from_period=&to_period=&type=20 just like the same other request also i.e. /user/completedra/display_ra_list?type=20 Please suggest which rule will fulfill my request to redirect ? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224484#msg-224484 From igor at sysoev.ru Tue Mar 27 13:01:01 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 27 Mar 2012 17:01:01 +0400 Subject: rewrite proxy flag set problem In-Reply-To: <93f51c1c0f37415b621ae6a794042639.NginxMailingListEnglish@forum.nginx.org> References: <20120327085508.GA12789@nginx.com> <93f51c1c0f37415b621ae6a794042639.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120327130101.GA28844@nginx.com> On Tue, Mar 27, 2012 at 08:47:57AM -0400, niraj wrote: > Hi > > For that auction proxy_pass working but now > > I have request like > > /user/ongoingra/display_ra_list?from_period=&to_period=&type=20 > > I want to redirect this query for that I have added the following > > location =/user/ongoingra/ { > proxy_pass http://192.168.1.210/user/ongoingra/; > } > > or > > location =/user { > proxy_pass http://192.168.1.210/user; > } > or > > location /user/ongoingra { > proxy_pass http://192.168.1.210/user/ongoingra; > } > > > but I am not able to get the result of the following request > > /user/ongoingra/display_ra_list?from_period=&to_period=&type=20 > just like the same other request also > > i.e. /user/completedra/display_ra_list?type=20 > > > Please suggest which rule will fulfill my request to redirect ? It seems you did not read location documentation: Also, using the "=" prefix it is possible to define an exact match of URI and location. Obviously "/user/ongoingra/" and "/user" do not match exactly "/user/ongoingra/display_ra_list". Also "location /user/ongoingra" matches "/user/ongoingra/display_ra_list", but does not match "/user/completedra/display_ra_list". Where should these URLs be proxied to ? Probably, you need location /user { proxy_pass http://192.168.1.210; } -- Igor Sysoev From agentzh at gmail.com Tue Mar 27 14:14:30 2012 From: agentzh at gmail.com (agentzh) Date: Tue, 27 Mar 2012 22:14:30 +0800 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: <1cffaea19ed9cad9fce8c60c439d8d16@none.at> References: <44da09fe8f8f1aed3291586d974f13c9@none.at> <4dfa1597c08acd8d75ca2b58f285567f@none.at> <1cffaea19ed9cad9fce8c60c439d8d16@none.at> Message-ID: On Tue, Mar 27, 2012 at 8:25 PM, Aleksandar Lazic wrote: > > Which module is the best to fork and start to implement ;-) > > https://github.com/agentzh/ > > The 'native wire protocol' is HTTP ;-) > > http://fallabs.com/kyototycoon/spex.html#protocol > Oh, then we need a library named lua-resty-http then :) Just check out how lua-resty-memcached and lua-resty-redis are implemented. And here's a (extremely) naive http 1.0 client implemented atop cosocket: https://groups.google.com/group/openresty/browse_thread/thread/55a3461e633bbf10 Best, -agentzh From al-nginx at none.at Tue Mar 27 19:44:22 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Tue, 27 Mar 2012 21:44:22 +0200 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: <44da09fe8f8f1aed3291586d974f13c9@none.at> <4dfa1597c08acd8d75ca2b58f285567f@none.at> <1cffaea19ed9cad9fce8c60c439d8d16@none.at> Message-ID: On 27-03-2012 16:14, agentzh wrote: > On Tue, Mar 27, 2012 at 8:25 PM, Aleksandar Lazic > wrote: >> >> Which module is the best to fork and start to implement ;-) >> >> https://github.com/agentzh/ >> >> The 'native wire protocol' is HTTP ;-) >> >> http://fallabs.com/kyototycoon/spex.html#protocol >> > > Oh, then we need a library named lua-resty-http then :) Just check > out > how lua-resty-memcached and lua-resty-redis are implemented. Can I use http://w3.impa.br/~diego/software/luasocket/ or is this blocking, I think so?! br Aleks From francis at daoine.org Tue Mar 27 20:17:38 2012 From: francis at daoine.org (Francis Daly) Date: Tue, 27 Mar 2012 21:17:38 +0100 Subject: when front proxy meet reverse proxy In-Reply-To: References: Message-ID: <20120327201738.GA3899@craic.sysops.org> On Tue, Mar 27, 2012 at 07:43:22PM +0800, maven apache wrote: Hi there, I don't understand your intended data flow. Can you describe it more explicitly? In general terms, "something" makes a http request to nginx; that "something" is "the client". nginx is configured to proxy_pass a request related to the original one to a back-end server; that back-end server is "upstream". client talks to nginx, and gets a response from nginx. The client doesn't know or care about upstream. nginx talks to upstream and gets a response from upstream. nginx doesn't know or care how upstream generates the response. If a web browser is configured to use a proxy server, then as far as nginx is concerned, that proxy server is "the client", not the web browser. >From your description, it sounds like "some javascript running in the browser" is "the client". It's not clear (to me) what is "nginx" and what is "upstream". If you can explain more, it might help others to answer your question. f -- Francis Daly francis at daoine.org From axel50397 at gmail.com Tue Mar 27 21:46:43 2012 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue, 27 Mar 2012 23:46:43 +0200 Subject: Custom configuration Message-ID: <-1284977343496617773@unknownmsgid> Hi ! I'm using NGinx since few weeks. One of our customers wants his mp3 downloaded instead of being opened by the browser. .htaccess aren't read, so I've decided to add a config file for his domain, containing the "option" types, to add "mp3" as "application/octet-stream". It's working well, but his website is now ugly, because the instruction also applies for .css O_O > root at shadow [/etc/cpnginx/custom]# cat domain.com > types { > application/octet-stream mp3; > } Is it a normal behavious, did I miss something? Thank you for your help ! -- Cheers, Adnan RIHAN. Pr?sident-Fondateur de l'association Virtual-Info (Loi 1901), h?bergement Web et Serveurs de jeux. Technicien-Sup?rieur d?veloppeur d'applications Web et Syst?me. 3e ann?e ? {Epitech}. Envoy? de mon iPhone ? From cliff at develix.com Tue Mar 27 22:15:37 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 27 Mar 2012 15:15:37 -0700 Subject: Custom configuration In-Reply-To: <-1284977343496617773@unknownmsgid> References: <-1284977343496617773@unknownmsgid> Message-ID: <1332886537.2069.15.camel@portable-evil> On Tue, 2012-03-27 at 23:46 +0200, Adnan RIHAN wrote: > It's working well, but his website is now ugly, because the > instruction also applies for .css O_O > > > root at shadow [/etc/cpnginx/custom]# cat domain.com > > types { > > application/octet-stream mp3; > > } When you use the types directive, it *replaces* all the types with whatever you specify. You don't define any mimetypes besides mp3, so Nginx uses the default (application/octet-stream) for anything it doesn't recognize, which now includes css. Try something like this instead: location ~* \.mp3$ { types { application/octet-stream mp3; } } See also: http://wiki.nginx.org/HttpCoreModule#types As an aside, you could also just edit /etc/nginx/mime.types and change the type for mp3 files. Regards, Cliff From agentzh at gmail.com Wed Mar 28 02:32:20 2012 From: agentzh at gmail.com (agentzh) Date: Wed, 28 Mar 2012 10:32:20 +0800 Subject: [ANN] ngx_openresty stable version 1.0.11.28 released! In-Reply-To: References: <44da09fe8f8f1aed3291586d974f13c9@none.at> <4dfa1597c08acd8d75ca2b58f285567f@none.at> <1cffaea19ed9cad9fce8c60c439d8d16@none.at> Message-ID: On Wed, Mar 28, 2012 at 3:44 AM, Aleksandar Lazic wrote: > Can I use > > http://w3.impa.br/~diego/software/luasocket/ > No :) > or is this blocking, I think so?! > LuaSocket will be blocking in the context of ngx_lua. But ngx_lua's cosocket API is intentionally designed to be compatible with the LuaSocket API (and also with some useful functionality additions). See http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp Best regards, -agentzh From adnan at rihan.fr Wed Mar 28 05:16:25 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Wed, 28 Mar 2012 07:16:25 +0200 Subject: Custom configuration In-Reply-To: <1332886537.2069.15.camel@portable-evil> References: <-1284977343496617773@unknownmsgid> <1332886537.2069.15.camel@portable-evil> Message-ID: <153CE1A091FB43E6A44E7AA14A73AC0F@gmail.com> I've done this: > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be > location ~* \.mp3$ { > types { > application/octet-stream mp3; > } > } But, after rebuilding vhost and restarted nginx, the mp3 are currently audio/mpeg (referring to firefox). Is there a way to check if the config is correctly "set" ? Thanks for your help. --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le mercredi 28 mars 2012 ? 00:15, Cliff Wells a ?crit : > On Tue, 2012-03-27 at 23:46 +0200, Adnan RIHAN wrote: > > > It's working well, but his website is now ugly, because the > > instruction also applies for .css O_O > > > > > root at shadow [/etc/cpnginx/custom]# cat domain.com (http://domain.com) > > > types { > > > application/octet-stream mp3; > > > } > > > > > > > > > > When you use the types directive, it *replaces* all the types with > whatever you specify. You don't define any mimetypes besides mp3, so > Nginx uses the default (application/octet-stream) for anything it > doesn't recognize, which now includes css. > > Try something like this instead: > > location ~* \.mp3$ { > types { application/octet-stream mp3; } > } > > See also: > http://wiki.nginx.org/HttpCoreModule#types > > As an aside, you could also just edit /etc/nginx/mime.types and change > the type for mp3 files. > > Regards, > Cliff > > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 28 05:31:04 2012 From: nginx-forum at nginx.us (niraj) Date: Wed, 28 Mar 2012 01:31:04 -0400 (EDT) Subject: rewrite proxy flag set problem In-Reply-To: <93f51c1c0f37415b621ae6a794042639.NginxMailingListEnglish@forum.nginx.org> References: <20120327085508.GA12789@nginx.com> <93f51c1c0f37415b621ae6a794042639.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi Igor Thnx for helping again. My personal view for that doc is its a very brief document. I have read before I post the above mail. I dont get the fully understand from that doc... suppose what is meaning of the following location /user/ { ===== I have add slash / at the end of /user proxy_pass http://192.168.1.210; } what will be the effect.......... If what is meaning of the following location /user/ { ===== I have add slash / at the end of /user proxy_pass http://192.168.1.210/; ===== i have add slash / at the end of http://192.168.1.210 } what will be the effect .............. If what is meaning of the following location /user { proxy_pass http://192.168.1.210/; ===== i have add slash / at the end of http://192.168.1.210 } what will be the effect ............ Its very difficult to understand all this above stuff with that document only..... Tnks for your reply. Sorry for taking too much your valuable time. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224274,224512#msg-224512 From cliff at develix.com Wed Mar 28 06:02:45 2012 From: cliff at develix.com (Cliff Wells) Date: Tue, 27 Mar 2012 23:02:45 -0700 Subject: Custom configuration In-Reply-To: <153CE1A091FB43E6A44E7AA14A73AC0F@gmail.com> References: <-1284977343496617773@unknownmsgid> <1332886537.2069.15.camel@portable-evil> <153CE1A091FB43E6A44E7AA14A73AC0F@gmail.com> Message-ID: <1332914565.2069.21.camel@portable-evil> On Wed, 2012-03-28 at 07:16 +0200, Adnan RIHAN wrote: > I've done this: > > > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be > > location ~* \.mp3$ { > > types { > > application/octet-stream mp3; > > } > > } > > But, after rebuilding vhost and restarted nginx, the mp3 are currently > audio/mpeg (referring to firefox). > Is there a way to check if the config is correctly "set" ? Start by posting more of your configuration. Cliff From nginx-forum at nginx.us Wed Mar 28 07:34:44 2012 From: nginx-forum at nginx.us (ilmetu) Date: Wed, 28 Mar 2012 03:34:44 -0400 (EDT) Subject: block dos attack nginx behind cloudflare and loadbalancer Message-ID: i have 4 webserver behind cloudflare and a loadbalancer, nginx is the web browser, php-fpm manage the php pages. i don't know how to block a simple dos attack ... i'm able to detect this attack by use the http_limit_req module from nginx http://wiki.nginx.org/HttpLimitReqModule but this is not block the attack at all, yes can mitigate but webservers are hit and hit again, and php-fpm goes to 80% and in a minute the website is unreachable. i'm trying to find a way to block this kind of request. i know how to block certain ip address or certain useragent with nginx but i want to do it automatically. I think that i cannot block the ip with iptables because the request come from the loadbalancer :( but i'm still able to detect the correct ip address with the set_real_ip_from and real_ip_header X-Forwarded-For with nginx. i have the log file (error.log) filled with the correct ip address as you can see: 2012/03/27 18:34:02 [error] 31234#0: *1283 limiting connections by zone "staging", client: XX.XX.XX.XXX, server: www.xxxxxxx.com, request: "HEAD /it HTTP/1.1", host: "www.xxxxxxx.com" Someone have an idea and can teach me how to block automatically this ip? thanks in advance! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224517,224517#msg-224517 From adnan at rihan.fr Wed Mar 28 07:48:26 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Wed, 28 Mar 2012 09:48:26 +0200 Subject: Custom configuration In-Reply-To: <1332914565.2069.21.camel@portable-evil> References: <-1284977343496617773@unknownmsgid> <1332886537.2069.15.camel@portable-evil> <153CE1A091FB43E6A44E7AA14A73AC0F@gmail.com> <1332914565.2069.21.camel@portable-evil> Message-ID: <72106A2BAB6F4CAEB5BD8AFAA5EEE9D6@gmail.com> I'm actually using NGinx as webserver, for a hosting service, with CPanel. CPNginx, the name of the module. > root at shadow [/etc/cpnginx]# ls > ./ data.conf localkey.txt uninstall.sh > ../ direct/ md5.txt version.txt > cpanelproxy.conf expires/ nginx.cont.template vhost.conf > custom/ fileextensions.txt php.ini > root at shadow [/etc/cpnginx]# cat cpanelproxy.conf > ###### Security ######## > server_tokens off; > > ###### To redirect cpanel.yourdomain.com ###########################3 > > server { > access_log off; > error_log logs/vhost-error_log warn; > listen 80; > server_name cpanel.* www.cpanel.*; > location / { > client_max_body_size 10m; > client_body_buffer_size 128k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 4k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > proxy_redirect http://www.cpanel.*:8888 http://www.cpanel.*; > proxy_redirect http://cpanel.*:8888 http://cpanel.*; > proxy_pass http://127.0.0.1:2082/; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > } > ################# To redirect whm.yourdomain.com ##################### > server { > access_log off; > error_log logs/vhost-error_log warn; > listen 80; > server_name whm.* www.whm.*; > location / { > client_max_body_size 10m; > client_body_buffer_size 128k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 4k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > proxy_redirect http://www.whm.*:8888 http://www.whm.*; > proxy_redirect http://whm.*:8888 http://whm.*; > proxy_pass http://127.0.0.1:2086/; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > } > ######### To redirect webmail.yourdomain.com ################## > server { > access_log off; > error_log logs/vhost-error_log warn; > listen 80; > server_name webmail.* www.webmail.*; > location / { > client_max_body_size 10m; > client_body_buffer_size 128k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 4k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > proxy_redirect http://www.webmail.*:8888 http://www.webmail.*; > proxy_redirect http://webmail.*:8888 http://webmail.*; > proxy_pass http://127.0.0.1:2095/; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > } > ############# To redirect webdisk.yourdomain.com ################## > server { > access_log off; > error_log logs/vhost-error_log warn; > listen 80; > server_name webdisk.* www.webdisk.*; > location / { > client_max_body_size 10m; > client_body_buffer_size 128k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 4k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > proxy_redirect http://www.webdisk.*:8888 http://www.webdisk.*; > proxy_redirect http://webdisk.*:8888 http://webdisk.*; > proxy_pass http://127.0.0.1:2077/; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > } > ################### WHM report ################################################# > server { > error_log logs/vhost-error_log warn; > listen 80; > location /whm-server-status { > access_log /usr/local/apache/logs/access_log; > proxy_pass http://127.0.0.1:8888/whm-server-status; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > } > root at shadow [/etc/cpnginx]# cat nginx.cont.template > # cPanel Nginx Master configuration > user nobody; > error_log logs/error.log; > #Number of worker you need > worker_processes 1; > # How many connections a worker can handle maximum. > events { > worker_connections 50000; > } > http { > include mime.types; > default_type application/octet-stream; > sendfile on; > server_names_hash_max_size 10000; > server_names_hash_bucket_size 1024; > tcp_nopush on; > tcp_nodelay on; > keepalive_timeout 10; > gzip on; > gzip_min_length 1100; > gzip_buffers 4 32k; > gzip_types text/plain application/x-javascript text/xml text/css; > ignore_invalid_headers on; > client_header_timeout 3m; > client_body_timeout 3m; > send_timeout 3m; > include "/usr/local/nginx/conf/vhost.conf"; > include "/etc/cpnginx/cpanelproxy.conf"; > } And finally > root at shadow [/etc/cpnginx]# cat vhost.conf > client_max_body_size 2000m; > client_body_buffer_size 512k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 32k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; In custom, there is only one file, containing the previous posted config. Thanks for your help. --- Ragards, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le mercredi 28 mars 2012 ? 08:02, Cliff Wells a ?crit : > On Wed, 2012-03-28 at 07:16 +0200, Adnan RIHAN wrote: > > I've done this: > > > > > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be (http://mega-sound.be) > > > location ~* \.mp3$ { > > > types { > > > application/octet-stream mp3; > > > } > > > } > > > > > > > > > But, after rebuilding vhost and restarted nginx, the mp3 are currently > > audio/mpeg (referring to firefox). > > Is there a way to check if the config is correctly "set" ? > > > > > Start by posting more of your configuration. > > Cliff > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 28 08:11:23 2012 From: nginx-forum at nginx.us (lockev3.0) Date: Wed, 28 Mar 2012 04:11:23 -0400 (EDT) Subject: Default_server catch all block not working In-Reply-To: <02f48feaa0cfe20f4e2b8bed64c98cc8.NginxMailingListEnglish@forum.nginx.org> References: <4b142fa24c8249c90f455f6736fe5ccf.NginxMailingListEnglish@forum.nginx.org> <02f48feaa0cfe20f4e2b8bed64c98cc8.NginxMailingListEnglish@forum.nginx.org> Message-ID: no answers at all :( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221572,224520#msg-224520 From nginx-forum at nginx.us Wed Mar 28 08:34:02 2012 From: nginx-forum at nginx.us (Abold) Date: Wed, 28 Mar 2012 04:34:02 -0400 (EDT) Subject: Changes in 1.0.14-2~squeeze Message-ID: <70124ce07be184c757131d74e3e9067b.NginxMailingListEnglish@forum.nginx.org> Hi, What changes has been made in 1.0.14-2~squeeze ? There is new package, but there is no information what changed in it. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224524,224524#msg-224524 From andrew at nginx.com Wed Mar 28 08:53:20 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Wed, 28 Mar 2012 12:53:20 +0400 Subject: block dos attack nginx behind cloudflare and loadbalancer In-Reply-To: References: Message-ID: <2C73A404-FD25-41F0-AFC4-CAE355BAB660@nginx.com> Hi, On Mar 28, 2012, at 11:34 AM, ilmetu wrote: > i have 4 webserver behind cloudflare and a loadbalancer, nginx is the > web browser, php-fpm manage the php pages. i don't know how to block a > simple dos attack ... > > i'm able to detect this attack by use the http_limit_req module from > nginx http://wiki.nginx.org/HttpLimitReqModule > > but this is not block the attack at all, yes can mitigate but webservers > are hit and hit again, and php-fpm goes to 80% and in a minute the > website is unreachable. > > i'm trying to find a way to block this kind of request. > > i know how to block certain ip address or certain useragent with nginx > but i want to do it automatically. I think that i cannot block the ip > with iptables because the request come from the loadbalancer :( but i'm > still able to detect the correct ip address with the set_real_ip_from > and real_ip_header X-Forwarded-For with nginx. > > i have the log file (error.log) filled with the correct ip address as > you can see: > > 2012/03/27 18:34:02 [error] 31234#0: *1283 limiting connections by zone > "staging", client: XX.XX.XX.XXX, server: www.xxxxxxx.com, request: "HEAD > /it HTTP/1.1", host: "www.xxxxxxx.com" > > Someone have an idea and can teach me how to block automatically this > ip? Can you show your limit_conn/limit_req configuration? http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html http://nginx.org/en/docs/http/ngx_http_limit_req_module.html > > thanks in advance! > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224517,224517#msg-224517 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed Mar 28 09:15:43 2012 From: nginx-forum at nginx.us (ilmetu) Date: Wed, 28 Mar 2012 05:15:43 -0400 (EDT) Subject: block dos attack nginx behind cloudflare and loadbalancer In-Reply-To: <2C73A404-FD25-41F0-AFC4-CAE355BAB660@nginx.com> References: <2C73A404-FD25-41F0-AFC4-CAE355BAB660@nginx.com> Message-ID: <10d0b87b954397ffba9eed79505ba831.NginxMailingListEnglish@forum.nginx.org> hi, this is my configuration : # Create a global request accounting pool to prevent DOS limit_zone staging $binary_remote_addr 5m; limit_conn staging 5; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224517,224526#msg-224526 From defan at nginx.com Wed Mar 28 09:42:58 2012 From: defan at nginx.com (Andrey Belov) Date: Wed, 28 Mar 2012 13:42:58 +0400 Subject: block dos attack nginx behind cloudflare and loadbalancer In-Reply-To: <10d0b87b954397ffba9eed79505ba831.NginxMailingListEnglish@forum.nginx.org> References: <2C73A404-FD25-41F0-AFC4-CAE355BAB660@nginx.com> <10d0b87b954397ffba9eed79505ba831.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hello! On Mar 28, 2012, at 13:15 , ilmetu wrote: > hi, this is my configuration : > > > # Create a global request accounting pool to prevent DOS > limit_zone staging $binary_remote_addr 5m; > limit_conn staging 5; You're trying to limit a number of connections using limit_conn module. The thing is that a lot of requests may proceed through a single connection. If you want to set a maximum allowed requests rate, you should use limit_req module instead: http://nginx.org/en/docs/http/ngx_http_limit_req_module.html Best regards, Andrey. From apachemaven0 at gmail.com Wed Mar 28 11:16:16 2012 From: apachemaven0 at gmail.com (maven apache) Date: Wed, 28 Mar 2012 19:16:16 +0800 Subject: when front proxy meet reverse proxy In-Reply-To: <20120327201738.GA3899@craic.sysops.org> References: <20120327201738.GA3899@craic.sysops.org> Message-ID: Since I am not good at English,so I make a picture in the attach,hope you can get it. 2012/3/28 Francis Daly > On Tue, Mar 27, 2012 at 07:43:22PM +0800, maven apache wrote: > > Hi there, > > I don't understand your intended data flow. > > Can you describe it more explicitly? > > In general terms, "something" makes a http request to nginx; that > "something" is "the client". nginx is configured to proxy_pass a request > related to the original one to a back-end server; that back-end server is > "upstream". > > client talks to nginx, and gets a response from nginx. The client doesn't > know or care about upstream. > > nginx talks to upstream and gets a response from upstream. nginx doesn't > know or care how upstream generates the response. > > If a web browser is configured to use a proxy server, then as far as nginx > is concerned, that proxy server is "the client", not the web browser. > > From your description, it sounds like "some javascript running in the > browser" is "the client". > > It's not clear (to me) what is "nginx" and what is "upstream". > > If you can explain more, it might help others to answer your question. > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Google.png Type: image/png Size: 26426 bytes Desc: not available URL: From nginx-forum at nginx.us Wed Mar 28 11:52:37 2012 From: nginx-forum at nginx.us (kustodian) Date: Wed, 28 Mar 2012 07:52:37 -0400 (EDT) Subject: Nginx Doesn't Log FastCGI Errors Message-ID: I have recently migrated my Nginx+PHP-FPM server from a Centos 5 to a Centos 6 server and I basically migrated the whole configuration from the old server to the new one with minor changes. I compiled the newest versions of Nginx (1.0.14) and PHP (5.3.10), Centos 5 had 1.0.2 and 5.3.2. The problem is that Nginx doesn't log FastCGI errors in its error.log, it's logging it's own errors without a problem. I'm talking about the errors which look like this: "2012/03/28 07:56:01 [error] 14919#0: *697095886 FastCGI sent in stderr: "CSRF state token does not match one provided" while reading response header from upstream..." I tried to change many things, but I can't make the FastCGI errors to be logged in the Nginx error.log. nginx.conf: http://pastebin.com/ABMm0c5h php-fpm.conf: http://pastebin.com/kFuztqXN php.ini loggin section: http://pastebin.com/bVWdTgCi Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224536,224536#msg-224536 From mdounin at mdounin.ru Wed Mar 28 12:06:05 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 28 Mar 2012 16:06:05 +0400 Subject: Nginx Doesn't Log FastCGI Errors In-Reply-To: References: Message-ID: <20120328120605.GB13466@mdounin.ru> Hello! On Wed, Mar 28, 2012 at 07:52:37AM -0400, kustodian wrote: > I have recently migrated my Nginx+PHP-FPM server from a Centos 5 to a > Centos 6 server and I basically migrated the whole configuration from > the old server to the new one with minor changes. I compiled the newest > versions of Nginx (1.0.14) and PHP (5.3.10), Centos 5 had 1.0.2 and > 5.3.2. > > The problem is that Nginx doesn't log FastCGI errors in its error.log, > it's logging it's own errors without a problem. I'm talking about the > errors which look like this: > > "2012/03/28 07:56:01 [error] 14919#0: *697095886 FastCGI sent in stderr: > "CSRF state token does not match one provided" while reading response > header from upstream..." > > I tried to change many things, but I can't make the FastCGI errors to be > logged in the Nginx error.log. > > nginx.conf: http://pastebin.com/ABMm0c5h > php-fpm.conf: http://pastebin.com/kFuztqXN > php.ini loggin section: http://pastebin.com/bVWdTgCi This is php regression, see here: https://bugs.php.net/bug.php?id=61045 There are also reports that catch_workers_output = yes in php-fpm config should help, see here (in Russian): http://mailman.nginx.org/pipermail/nginx-ru/2012-March/046217.html Maxim Dounin From f.bonnet at esiee.fr Wed Mar 28 13:00:52 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Wed, 28 Mar 2012 15:00:52 +0200 Subject: roundcube on nginx ? Message-ID: <4F730B84.3080508@esiee.fr> Hello I'm new to nginx ... I wonder if it is possible to run the Rouncube webmail over nginx ? Thank you From nginx-forum at nginx.us Wed Mar 28 13:26:38 2012 From: nginx-forum at nginx.us (djlebersilvestre) Date: Wed, 28 Mar 2012 09:26:38 -0400 (EDT) Subject: Nginx + Rails (Thin Server) - Double Bad Gateway Problem Message-ID: <7c24505137854763f77246d62eef66d2.NginxMailingListEnglish@forum.nginx.org> Hi, I'm facing a strange problem using Nginx with reverse proxy to a ruby Thin Server. When someone calls an unrouteable path in our Rails App, Nginx launches a 502 - Bad Gateway correctly. When Nginx receives another resquest (just after the 502), that is valid and routeable, it launches directly again a 502 - Bad Gateway without passing the request to the Thin Server (we can check this in the nginx logs and the app logs). When I call the same valid URL again, the Nginx passes the call to the Thin Server and it returns to normal operation. It seems to cache something in Nginx. When this happens and only in the third call it gets back to normal track. I've researched the Internet for this issue but nothing conclusive... As a workaround, I've changed the configuration disabiling the next_upstream. This resolved my problem, but I've lost the next_upstream feature that calls the others servers when one of them fail... Here is our nginx configuration: --------------------------------------------------------------------------- upstream reg-prov { server 127.0.0.1:5010; server 127.0.0.1:5011; server 127.0.0.1:5012; server 127.0.0.1:5013; } server { listen 443; ssl on; ssl_certificate /etc/nginx/conf.d/server.crt; ssl_certificate_key /etc/nginx/conf.d/server.key; server_name reg-prov.registro.systemintegration.locaweb.com.br; access_log /var/log/nginx/reg-prov.access.log; root /var/www/reg-prov/public; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto https; proxy_redirect off; proxy_next_upstream off; if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename.html) { rewrite (.*) $1.html break; } if (!-f $request_filename) { proxy_pass http://reg-prov; break; } } } --------------------------------------------------------------------------- Nginx version: 0.7.67-3+squeeze2 Here is the behavior I described (log files). With the next upstream DISABLED (the workaround): --------------------------------------------------------------------------- ******************** * Nginx Access Log * ******************** >>> First Call (invalid) 187.45.255.164 - - [28/Mar/2012:10:14:11 -0300] "GET /domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas HTTP/1.1" 502 173 "-" "Ruby" >>> Second Call (valid) 187.45.255.164 - - [28/Mar/2012:10:14:21 -0300] "GET /domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas HTTP/1.1" 200 125 "-" "Ruby" *********** * App Log * *********** >>> First Call (invalid) [2012-03-28 10:14:11] INFO -- : Started GET "/domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:14:11 -0300 >>> Second Call (valid) [2012-03-28 10:14:21] INFO -- : Started GET "/domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:14:21 -0300 [2012-03-28 10:14:21] INFO -- : Processing by DomainAvailabilityController#verisign as XML [2012-03-28 10:14:21] INFO -- : Parameters: {"ticket"=>"ST-28035-WPQ4MirFJIKxwagfIIUe-cas", "id"=>"disponivel.com"} [2012-03-28 10:14:21] INFO -- : Guessed service url: "nmst.api.systemintegration.locaweb.com.br" [2012-03-28 10:14:21] INFO -- : Validate CAS URI = https://sso.systemintegration.locaweb.com.br/cas-sys/serviceValidate?service=nmst.api.systemintegration.locaweb.com.br&ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas [2012-03-28 10:14:21] INFO -- : Ticket "ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for service "nmst.api.systemintegration.locaweb.com.br" belonging to user "registro" is VALID. [2012-03-28 10:14:21] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] User-Agent: Ruby [2012-03-28 10:14:21] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] Accept: */*; q=0.5, application/xml [2012-03-28 10:14:21] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] Referer: [2012-03-28 10:14:21] INFO -- : Rendered domain_availability/verisign.verisign_domain_availability.builder (5.3ms) [2012-03-28 10:14:21] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] Response: true [2012-03-28 10:14:21] INFO -- : Completed 200 OK in 224ms (Views: 15.4ms | ActiveRecord: 0.0ms) - Path: /domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas --------------------------------------------------------------------------- Now with the next upstream ENABLED: --------------------------------------------------------------------------- ******************** * Nginx Access Log * ******************** >>> First Call (invalid) 187.45.255.164 - - [28/Mar/2012:10:21:51 -0300] "GET /domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas HTTP/1.1" 502 173 "-" "Ruby" >>> Second Call (valid) 187.45.255.164 - - [28/Mar/2012:10:21:55 -0300] "GET /domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas HTTP/1.1" 502 173 "-" "Ruby" >> Nginx does not call the app, it returns 502 directly. Here it seems to cache something... >>> Third Call (valid) 187.45.255.164 - - [28/Mar/2012:10:22:00 -0300] "GET /domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas HTTP/1.1" 200 125 "-" "Ruby" >> Success... *********** * App Log * *********** >>> First Call (invalid) [2012-03-28 10:21:51] INFO -- : Started GET "/domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:21:51 -0300 [2012-03-28 10:21:51] INFO -- : Started GET "/domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:21:51 -0300 [2012-03-28 10:21:51] INFO -- : Started GET "/domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:21:51 -0300 [2012-03-28 10:21:51] INFO -- : Started GET "/domain_availability/disponivel.mx?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:21:51 -0300 >> Here we have the 4 calls because the next upstream is enabled, only when the last server is called the error is returned by nginx, so he keep trying with all servers. >>> Second Call (valid) >> Nothing happens in the app log. It gets nothing from nginx... >>> Third Call (valid) [2012-03-28 10:22:00] INFO -- : Started GET "/domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for 187.45.255.164 at 2012-03-28 10:22:00 -0300 [2012-03-28 10:22:00] INFO -- : Processing by DomainAvailabilityController#verisign as XML [2012-03-28 10:22:00] INFO -- : Parameters: {"ticket"=>"ST-28035-WPQ4MirFJIKxwagfIIUe-cas", "id"=>"disponivel.com"} [2012-03-28 10:22:00] INFO -- : Guessed service url: "nmst.api.systemintegration.locaweb.com.br" [2012-03-28 10:22:00] INFO -- : Validate CAS URI = https://sso.systemintegration.locaweb.com.br/cas-sys/serviceValidate?service=nmst.api.systemintegration.locaweb.com.br&ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas [2012-03-28 10:22:00] INFO -- : Ticket "ST-28035-WPQ4MirFJIKxwagfIIUe-cas" for service "nmst.api.systemintegration.locaweb.com.br" belonging to user "registro" is VALID. [2012-03-28 10:22:00] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] User-Agent: Ruby [2012-03-28 10:22:00] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] Accept: */*; q=0.5, application/xml [2012-03-28 10:22:00] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] Referer: [2012-03-28 10:22:00] INFO -- : Rendered domain_availability/verisign.verisign_domain_availability.builder (6.1ms) [2012-03-28 10:22:00] INFO -- : [127.0.0.1 DomainAvailabilityController#verisign disponivel.com registro] Response: true [2012-03-28 10:22:00] INFO -- : Completed 200 OK in 233ms (Views: 16.9ms | ActiveRecord: 0.0ms) - Path: /domain_availability/disponivel.com?ticket=ST-28035-WPQ4MirFJIKxwagfIIUe-cas --------------------------------------------------------------------------- Thanks in advance! Daniel Silvestre Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224548,224548#msg-224548 From al-nginx at none.at Wed Mar 28 13:55:19 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Wed, 28 Mar 2012 15:55:19 +0200 Subject: roundcube on nginx ? In-Reply-To: <4F730B84.3080508@esiee.fr> References: <4F730B84.3080508@esiee.fr> Message-ID: <549bfc09fa85e5c0e151c632a84bca41@none.at> Hi, On 28-03-2012 15:00, Frank Bonnet wrote: > Hello > > I'm new to nginx ... > > I wonder if it is possible to run the Rouncube webmail > over nginx ? Yes. Classicle php setup with php-fpm ;-) BR Aleks From nginx-forum at nginx.us Wed Mar 28 13:56:26 2012 From: nginx-forum at nginx.us (kustodian) Date: Wed, 28 Mar 2012 09:56:26 -0400 (EDT) Subject: Nginx Doesn't Log FastCGI Errors In-Reply-To: <20120328120605.GB13466@mdounin.ru> References: <20120328120605.GB13466@mdounin.ru> Message-ID: <8899f2f3f228d93d24fff338d4733280.NginxMailingListEnglish@forum.nginx.org> Thank you very much for the reply. I was trying everything, I searched everywhere and I couldn't find the solution. Just to note for others, setting "catch_workers_output = yes" doesn't work, you can either patch php with a fix provided in the bug https://bugs.php.net/bug.php?id=61045, or use PHP 5.3.8, which I would recommend since the patch didn't come from the official PHP developer. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224536,224554#msg-224554 From mdounin at mdounin.ru Wed Mar 28 14:00:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 28 Mar 2012 18:00:41 +0400 Subject: nginx-1.1.18 Message-ID: <20120328140040.GI13466@mdounin.ru> Changes with nginx 1.1.18 28 Mar 2012 *) Change: keepalive connections are no longer disabled for Safari by default. *) Feature: the $connection_requests variable. *) Feature: $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd and $tcpinfo_rcv_space variables. *) Feature: the "worker_cpu_affinity" directive now works on FreeBSD. *) Feature: the "xslt_param" and "xslt_string_param" directives. Thanks to Samuel Behan. *) Bugfix: in configure tests. Thanks to Piotr Sikora. *) Bugfix: in the ngx_http_xslt_filter_module. *) Bugfix: nginx could not be built on Debian GNU/Hurd. Maxim Dounin From guzman.braso at gmail.com Wed Mar 28 14:07:11 2012 From: guzman.braso at gmail.com (=?ISO-8859-1?B?R3V6beFuIEJyYXPz?=) Date: Wed, 28 Mar 2012 11:07:11 -0300 Subject: when front proxy meet reverse proxy In-Reply-To: References: <20120327201738.GA3899@craic.sysops.org> Message-ID: Hi... I saw the picture but don't see any problem for nginx there, your problem in that picture seems to be that you want your backend to access crossdomain server but your backend do not have internet acces. If that's the case, and you don't need to support thousands of cross domains, you can configure Nginx to be reverse proxy of cross domain server and use it to access internet from your backend, so when the backends want to access crossdomain, it does so through nginx and nginx indeed have internet access. One good thing of doing this is that if you are already parsing with any tool your logs, you will have nice stats of your crossdomain servers behaviors (eg: backend generation time, etc) Or maybe I got it all wrong, in that case, please discard this message :) On Wed, Mar 28, 2012 at 8:16 AM, maven apache wrote: > Since I am not good at English,so I make a picture in the attach,hope you > can get it. > > > 2012/3/28 Francis Daly >> >> On Tue, Mar 27, 2012 at 07:43:22PM +0800, maven apache wrote: >> >> Hi there, >> >> I don't understand your intended data flow. >> >> Can you describe it more explicitly? >> >> In general terms, "something" makes a http request to nginx; that >> "something" is "the client". nginx is configured to proxy_pass a request >> related to the original one to a back-end server; that back-end server is >> "upstream". >> >> client talks to nginx, and gets a response from nginx. The client doesn't >> know or care about upstream. >> >> nginx talks to upstream and gets a response from upstream. nginx doesn't >> know or care how upstream generates the response. >> >> If a web browser is configured to use a proxy server, then as far as nginx >> is concerned, that proxy server is "the client", not the web browser. >> >> From your description, it sounds like "some javascript running in the >> browser" is "the client". >> >> It's not clear (to me) what is "nginx" and what is "upstream". >> >> If you can explain more, it might help others to answer your question. >> >> ? ? ? ?f >> -- >> Francis Daly ? ? ? ?francis at daoine.org >> >> _______________________________________________ >> 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 -- Guzm?n Bras? N??ez Senior Perl Developer / Sysadmin Web: http://guzman.braso.info Mobile: +598 98 674020 From nginx-forum at nginx.us Wed Mar 28 14:27:36 2012 From: nginx-forum at nginx.us (gtuhl) Date: Wed, 28 Mar 2012 10:27:36 -0400 (EDT) Subject: Nginx as Load Balancer Connection Issues In-Reply-To: <8c7edebe2730969674b0e1970692830c.NginxMailingListEnglish@forum.nginx.org> References: <8c7edebe2730969674b0e1970692830c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4ee4422cd0e3c2a3b58c06d615b8aa02.NginxMailingListEnglish@forum.nginx.org> Looks like that was for the 1.1.18 development release. Is this what will become the 1.2.0 stable in a couple weeks? Seems I'll need to wait for that one to get http 1.1 keepalive upstreams in stable. gtuhl Wrote: ------------------------------------------------------- > Alexandr Gomoliako Wrote: > -------------------------------------------------- > ----- > > On Tue, Mar 20, 2012 at 11:33 PM, gtuhl > > wrote: > > > I'm thinking about giving the development > > version with the upstream > > > keepalive over http 1.1 a try. > > > > > > Are people using that version in production? > > ?Is there a release > > > schedule/estimate anywhere that indicates > when > > that feature might > > > trickle over to stable? > > > > According to their roadmap -- in 6 days :) > > http://trac.nginx.org/nginx/roadmap > > > > This is excellent news. Also apologies for > somehow missing this page, was exactly what I was > looking for. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220894,224560#msg-224560 From apachemaven0 at gmail.com Wed Mar 28 14:27:07 2012 From: apachemaven0 at gmail.com (maven apache) Date: Wed, 28 Mar 2012 22:27:07 +0800 Subject: when front proxy meet reverse proxy In-Reply-To: References: <20120327201738.GA3899@craic.sysops.org> Message-ID: 2012/3/28 Guzm?n Bras? > Hi... > > I saw the picture but don't see any problem for nginx there, your > problem in that picture seems to be that you want your backend to > access crossdomain server but your backend do not have internet acces. > Yes,this is what I want. > > If that's the case, and you don't need to support thousands of cross > domains, you can configure Nginx to be reverse proxy of cross domain > server and use it to access internet from your backend, so when the > backends want to access crossdomain, it does so through nginx and > nginx indeed have internet access. > Can you explain more about use the nginx be the reverse proxy of the cross domain? > > One good thing of doing this is that if you are already parsing with > any tool your logs, you will have nice stats of your crossdomain > servers behaviors (eg: backend generation time, etc) > > Or maybe I got it all wrong, in that case, please discard this message :) > > > On Wed, Mar 28, 2012 at 8:16 AM, maven apache > wrote: > > Since I am not good at English,so I make a picture in the attach,hope you > > can get it. > > > > > > 2012/3/28 Francis Daly > >> > >> On Tue, Mar 27, 2012 at 07:43:22PM +0800, maven apache wrote: > >> > >> Hi there, > >> > >> I don't understand your intended data flow. > >> > >> Can you describe it more explicitly? > >> > >> In general terms, "something" makes a http request to nginx; that > >> "something" is "the client". nginx is configured to proxy_pass a request > >> related to the original one to a back-end server; that back-end server > is > >> "upstream". > >> > >> client talks to nginx, and gets a response from nginx. The client > doesn't > >> know or care about upstream. > >> > >> nginx talks to upstream and gets a response from upstream. nginx doesn't > >> know or care how upstream generates the response. > >> > >> If a web browser is configured to use a proxy server, then as far as > nginx > >> is concerned, that proxy server is "the client", not the web browser. > >> > >> From your description, it sounds like "some javascript running in the > >> browser" is "the client". > >> > >> It's not clear (to me) what is "nginx" and what is "upstream". > >> > >> If you can explain more, it might help others to answer your question. > >> > >> f > >> -- > >> Francis Daly francis at daoine.org > >> > >> _______________________________________________ > >> 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 > > > > -- > Guzm?n Bras? N??ez > Senior Perl Developer / Sysadmin > Web: http://guzman.braso.info > Mobile: +598 98 674020 > > _______________________________________________ > 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 Mar 28 14:38:54 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 28 Mar 2012 18:38:54 +0400 Subject: Nginx + Rails (Thin Server) - Double Bad Gateway Problem In-Reply-To: <7c24505137854763f77246d62eef66d2.NginxMailingListEnglish@forum.nginx.org> References: <7c24505137854763f77246d62eef66d2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120328143854.GM13466@mdounin.ru> Hello! On Wed, Mar 28, 2012 at 09:26:38AM -0400, djlebersilvestre wrote: > Hi, > > I'm facing a strange problem using Nginx with reverse proxy to a ruby > Thin Server. > When someone calls an unrouteable path in our Rails App, Nginx launches > a 502 - Bad Gateway correctly. > When Nginx receives another resquest (just after the 502), that is valid > and routeable, it launches directly again a 502 - Bad Gateway without > passing the request to the Thin Server (we can check this in the nginx > logs and the app logs). > When I call the same valid URL again, the Nginx passes the call to the > Thin Server and it returns to normal operation. > > It seems to cache something in Nginx. When this happens and only in the > third call it gets back to normal track. > I've researched the Internet for this issue but nothing conclusive... > As a workaround, I've changed the configuration disabiling the > next_upstream. > This resolved my problem, but I've lost the next_upstream feature that > calls the others servers when one of them fail... As long as an upstream server fails and triggers proxy_next_upstream, the upstream server in question is marked dead and won't get any requests till fail_timeout passes, see http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server It looks like in your case all servers fail to handle request properly and just close connection, hence all of them are marked down. On next request nginx sees that all backends are down, complains about "no live upstreams" to error log, returns error and marks all backends up again for quick recovery. This is expected behaviour. Correct solution for your problem is to fix upstream servers to properly return HTTP response in case of errors instead of just closing connection. Something like 404 (as long as I see it's appropriate in your case) will be a good choice. Maxim Dounin From f.bonnet at esiee.fr Wed Mar 28 14:50:28 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Wed, 28 Mar 2012 16:50:28 +0200 Subject: roundcube on nginx ? In-Reply-To: <549bfc09fa85e5c0e151c632a84bca41@none.at> References: <4F730B84.3080508@esiee.fr> <549bfc09fa85e5c0e151c632a84bca41@none.at> Message-ID: <4F732534.9010508@esiee.fr> On 03/28/2012 03:55 PM, Aleksandar Lazic wrote: > Hi, > > On 28-03-2012 15:00, Frank Bonnet wrote: >> Hello >> >> I'm new to nginx ... >> >> I wonder if it is possible to run the Rouncube webmail >> over nginx ? > > Yes. > > Classicle php setup with php-fpm ;-) > > BR > Aleks OK thank you From f.bonnet at esiee.fr Wed Mar 28 14:53:24 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Wed, 28 Mar 2012 16:53:24 +0200 Subject: roundcube on nginx ? In-Reply-To: <549bfc09fa85e5c0e151c632a84bca41@none.at> References: <4F730B84.3080508@esiee.fr> <549bfc09fa85e5c0e151c632a84bca41@none.at> Message-ID: <4F7325E4.2070608@esiee.fr> On 03/28/2012 03:55 PM, Aleksandar Lazic wrote: > Hi, > > On 28-03-2012 15:00, Frank Bonnet wrote: >> Hello >> >> I'm new to nginx ... >> >> I wonder if it is possible to run the Rouncube webmail >> over nginx ? > > Yes. > > Classicle php setup with php-fpm ;-) > > BR > Aleks anyone tried with FreeBSD ? thanks From sb at waeme.net Wed Mar 28 15:35:46 2012 From: sb at waeme.net (Sergey Budnevitch) Date: Wed, 28 Mar 2012 19:35:46 +0400 Subject: Changes in 1.0.14-2~squeeze In-Reply-To: <70124ce07be184c757131d74e3e9067b.NginxMailingListEnglish@forum.nginx.org> References: <70124ce07be184c757131d74e3e9067b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <80B42BF9-46BB-4097-BF44-34D3A942AA31@waeme.net> On 28.03.2012, at 12:34, Abold wrote: > Hi, > > What changes has been made in 1.0.14-2~squeeze ? > There is new package, but there is no information what changed in it. 1.0.14-2 close this bug: http://trac.nginx.org/nginx/ticket/131 Bug itself may affect only new installation when other process listens on 80 port. From f.bonnet at esiee.fr Wed Mar 28 15:40:59 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Wed, 28 Mar 2012 17:40:59 +0200 Subject: roundcube on nginx ? In-Reply-To: <4F7325E4.2070608@esiee.fr> References: <4F730B84.3080508@esiee.fr> <549bfc09fa85e5c0e151c632a84bca41@none.at> <4F7325E4.2070608@esiee.fr> Message-ID: <4F73310B.6090603@esiee.fr> On 03/28/2012 04:53 PM, Frank Bonnet wrote: > On 03/28/2012 03:55 PM, Aleksandar Lazic wrote: >> Hi, >> >> On 28-03-2012 15:00, Frank Bonnet wrote: >>> Hello >>> >>> I'm new to nginx ... >>> >>> I wonder if it is possible to run the Rouncube webmail >>> over nginx ? >> >> Yes. >> >> Classicle php setup with php-fpm ;-) >> >> BR >> Aleks > > anyone tried with FreeBSD ? OK I found a tuto , it works well From jdorfman at netdna.com Wed Mar 28 15:50:46 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Wed, 28 Mar 2012 08:50:46 -0700 Subject: Articles or tips about the Nginx resolver module? Message-ID: Hello, I can't seem to find any good tutorials on what can be done with ngx_resolver. For example I am trying to find the best way to dynamically update the proxy_pass directive in a vhosts file. Thanks in advance. Regards, Justin Dorfman -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Wed Mar 28 16:01:58 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 28 Mar 2012 17:01:58 +0100 Subject: when front proxy meet reverse proxy In-Reply-To: References: <20120327201738.GA3899@craic.sysops.org> Message-ID: On 28 March 2012 15:27, maven apache wrote: > 2012/3/28 Guzm?n Bras? >> I saw the picture but don't see any problem for nginx there, your >> problem in that picture seems to be that you want your backend to >> access crossdomain server but your backend do not have internet acces. > > Yes,this is what I want. > >> If that's the case, and you don't need to support thousands of cross >> domains, you can configure Nginx to be reverse proxy of cross domain >> server and use it to access internet from your backend, so when the >> backends want to access crossdomain, it does so through nginx and >> nginx indeed have internet access. > > Can you explain more about use the nginx be the reverse proxy of the cross > domain? You need to tell nginx it should accept requests for the different cross-domain FQDNs you're using, and proxy_pass them in nginx as appropriate. Then arrange for your app to make its requests to nginx, not the unreachable cross-domain server. You may need to hosts-file the FQDNs on your app server if you can't change the app and make it separate its understanding of the HTTP Host header ("cross.domain.whatever.com") from the actual IP it should talk (nginx). It's a pretty simple setup. We *could* write the nginx config to do this for you, but we'd be depriving you of the excellent learning experience you'll get doing it yourself ;-) Have fun! Jonathan From adnan at rihan.fr Wed Mar 28 16:09:50 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Wed, 28 Mar 2012 18:09:50 +0200 Subject: Custom configuration In-Reply-To: <72106A2BAB6F4CAEB5BD8AFAA5EEE9D6@gmail.com> References: <-1284977343496617773@unknownmsgid> <1332886537.2069.15.camel@portable-evil> <153CE1A091FB43E6A44E7AA14A73AC0F@gmail.com> <1332914565.2069.21.camel@portable-evil> <72106A2BAB6F4CAEB5BD8AFAA5EEE9D6@gmail.com> Message-ID: <5781F7E8D6A54CACAF4759E8A9818888@gmail.com> Sorry but, did I paste enough config files ? Is there an error ? :/ --- Regards, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le mercredi 28 mars 2012 ? 09:48, Adnan RIHAN a ?crit : > I'm actually using NGinx as webserver, for a hosting service, with CPanel. CPNginx, the name of the module. > > > root at shadow [/etc/cpnginx]# ls > > ./ data.conf localkey.txt uninstall.sh (http://uninstall.sh) > > ../ direct/ md5.txt version.txt > > cpanelproxy.conf expires/ nginx.cont.template vhost.conf > > custom/ fileextensions.txt php.ini > > > > root at shadow [/etc/cpnginx]# cat cpanelproxy.conf > > ###### Security ######## > > server_tokens off; > > > > ###### To redirect cpanel.yourdomain.com (http://cpanel.yourdomain.com) ###########################3 > > > > server { > > access_log off; > > error_log logs/vhost-error_log warn; > > listen 80; > > server_name cpanel.* www.cpanel (http://www.cpanel).*; > > location / { > > client_max_body_size 10m; > > client_body_buffer_size 128k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 4k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > proxy_redirect http://www.cpanel.*:8888 http://www.cpanel.*; > > proxy_redirect http://cpanel.*:8888 http://cpanel.*; > > proxy_pass http://127.0.0.1:2082/; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > > > } > > ################# To redirect whm.yourdomain.com (http://whm.yourdomain.com) ##################### > > server { > > access_log off; > > error_log logs/vhost-error_log warn; > > listen 80; > > server_name whm.* www.whm (http://www.whm).*; > > location / { > > client_max_body_size 10m; > > client_body_buffer_size 128k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 4k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > proxy_redirect http://www.whm.*:8888 http://www.whm.*; > > proxy_redirect http://whm.*:8888 http://whm.*; > > proxy_pass http://127.0.0.1:2086/; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > > > } > > ######### To redirect webmail.yourdomain.com (http://webmail.yourdomain.com) ################## > > server { > > access_log off; > > error_log logs/vhost-error_log warn; > > listen 80; > > server_name webmail.* www.webmail (http://www.webmail).*; > > location / { > > client_max_body_size 10m; > > client_body_buffer_size 128k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 4k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > proxy_redirect http://www.webmail.*:8888 http://www.webmail.*; > > proxy_redirect http://webmail.*:8888 http://webmail.*; > > proxy_pass http://127.0.0.1:2095/; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > > > } > > ############# To redirect webdisk.yourdomain.com (http://webdisk.yourdomain.com) ################## > > server { > > access_log off; > > error_log logs/vhost-error_log warn; > > listen 80; > > server_name webdisk.* www.webdisk (http://www.webdisk).*; > > location / { > > client_max_body_size 10m; > > client_body_buffer_size 128k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 4k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > proxy_redirect http://www.webdisk.*:8888 http://www.webdisk.*; > > proxy_redirect http://webdisk.*:8888 http://webdisk.*; > > proxy_pass http://127.0.0.1:2077/; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > > > } > > ################### WHM report ################################################# > > server { > > error_log logs/vhost-error_log warn; > > listen 80; > > location /whm-server-status { > > access_log /usr/local/apache/logs/access_log; > > proxy_pass http://127.0.0.1:8888/whm-server-status; > > proxy_set_header Host $host; > > proxy_set_header X-Real-IP $remote_addr; > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > } > > } > > > > > > root at shadow [/etc/cpnginx]# cat nginx.cont.template > > # cPanel Nginx Master configuration > > user nobody; > > error_log logs/error.log; > > #Number of worker you need > > worker_processes 1; > > # How many connections a worker can handle maximum. > > events { > > worker_connections 50000; > > } > > http { > > include mime.types; > > default_type application/octet-stream; > > sendfile on; > > server_names_hash_max_size 10000; > > server_names_hash_bucket_size 1024; > > tcp_nopush on; > > tcp_nodelay on; > > keepalive_timeout 10; > > gzip on; > > gzip_min_length 1100; > > gzip_buffers 4 32k; > > gzip_types text/plain application/x-javascript text/xml text/css; > > ignore_invalid_headers on; > > client_header_timeout 3m; > > client_body_timeout 3m; > > send_timeout 3m; > > include "/usr/local/nginx/conf/vhost.conf"; > > include "/etc/cpnginx/cpanelproxy.conf"; > > } > > > > > And finally > > root at shadow [/etc/cpnginx]# cat vhost.conf > > client_max_body_size 2000m; > > client_body_buffer_size 512k; > > proxy_send_timeout 90; > > proxy_read_timeout 90; > > proxy_buffer_size 32k; > > proxy_buffers 16 32k; > > proxy_busy_buffers_size 64k; > > proxy_temp_file_write_size 64k; > > proxy_connect_timeout 30s; > > > > In custom, there is only one file, containing the previous posted config. > > Thanks for your help. > --- > Ragards, Adnan RIHAN. > Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. > Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. > Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). > > > Le mercredi 28 mars 2012 ? 08:02, Cliff Wells a ?crit : > > > On Wed, 2012-03-28 at 07:16 +0200, Adnan RIHAN wrote: > > > I've done this: > > > > > > > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be (http://mega-sound.be) > > > > location ~* \.mp3$ { > > > > types { > > > > application/octet-stream mp3; > > > > } > > > > } > > > > > > > > > > > > > But, after rebuilding vhost and restarted nginx, the mp3 are currently > > > audio/mpeg (referring to firefox). > > > Is there a way to check if the config is correctly "set" ? > > > > > > > > > Start by posting more of your configuration. > > > > Cliff > > > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org (mailto:nginx at nginx.org) > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Wed Mar 28 16:10:59 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Wed, 28 Mar 2012 17:10:59 +0100 Subject: Default_server catch all block not working In-Reply-To: <02f48feaa0cfe20f4e2b8bed64c98cc8.NginxMailingListEnglish@forum.nginx.org> References: <4b142fa24c8249c90f455f6736fe5ccf.NginxMailingListEnglish@forum.nginx.org> <02f48feaa0cfe20f4e2b8bed64c98cc8.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 22 March 2012 16:32, lockev3.0 wrote: > At last I got it ! Well, to be honest I will say Maxim Dounim helped me > thru my logs. In the end it was so simple ::: My load balancer in front > of my Nginx's always looked thru IP so no host name ever matched any of > my server_name's. Solution simple :: Do the balancer refer to nodes thru > a locally resolved hostname also put as a new server_name. > ...........simple like crazyness when it comes. > > The thing now is I have following block and it works quite right. But If > I mean to use the commented return 444 instead of the rewrite ==> al my > web ?start returning 503 !!! and nothing's functioning .......always the > strange things to me. > > server { > ? ? ? ?listen 80 default_server; > ? ? ? ?server_name ?_; > ? ? ? ?error_log ? ? ? /var/log/nginx/000default-error.log error; > ? ? ? ?location / { > ? ? ? ? ? ? ? ?proxy_set_header Host $host; > ? ? ? ? ? ? ? ?rewrite .* http://somewherelse.net permanent; > ? ? ? ? ? ? ? ?#return 444; > ? ? ? ?} > } Er, WTF? You use the non-standard 444 ("444 closes the connection without sending any headers") and you expect your downstream to do something with that *other* than correctly respond to requests with a 503 Service Unavailable? What you describe is *exactly* what I'd expect to see. Either your understanding/expectations are faulty, or you haven't explained yourself correctly. Jonathan From cliff at develix.com Wed Mar 28 17:14:26 2012 From: cliff at develix.com (Cliff Wells) Date: Wed, 28 Mar 2012 10:14:26 -0700 Subject: Custom configuration In-Reply-To: <72106A2BAB6F4CAEB5BD8AFAA5EEE9D6@gmail.com> References: <-1284977343496617773@unknownmsgid> <1332886537.2069.15.camel@portable-evil> <153CE1A091FB43E6A44E7AA14A73AC0F@gmail.com> <1332914565.2069.21.camel@portable-evil> <72106A2BAB6F4CAEB5BD8AFAA5EEE9D6@gmail.com> Message-ID: <1332954866.15838.5.camel@portable-evil> On Wed, 2012-03-28 at 09:48 +0200, Adnan RIHAN wrote: Which vhost is the one in question? Can you paste *only* the relevant server block? Most of what you pasted appears to be specific to running cPanel (I don't have any cPanel installs to check). Also, you mention stuff in "custom", but I don't see where any of the config you pasted includes a "custom" config. Cliff From nginx-forum at nginx.us Wed Mar 28 18:31:19 2012 From: nginx-forum at nginx.us (locojohn) Date: Wed, 28 Mar 2012 14:31:19 -0400 (EDT) Subject: Custom configuration In-Reply-To: <-1284977343496617773@unknownmsgid> References: <-1284977343496617773@unknownmsgid> Message-ID: Adnan, For the following to work you need headers module installed: location ~ /(?(?!/).+\.mp3)$ { types { application/octet-stream mp3; } add_header Content-Disposition "attachment; filename=\"$filename\""; } Kind regards, Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224499,224577#msg-224577 From baishen.lists at gmail.com Wed Mar 28 19:42:45 2012 From: baishen.lists at gmail.com (Bai Shen) Date: Wed, 28 Mar 2012 15:42:45 -0400 Subject: Custom error pages In-Reply-To: <20120316151856.GP18773@craic.sysops.org> References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> <20120316151856.GP18773@craic.sysops.org> Message-ID: I got my error page to show up. However, the css and image files don't load. I tried changing the location, but that doesn't seem to work. Any suggestions? Thanks. On Fri, Mar 16, 2012 at 11:18 AM, Francis Daly wrote: > On Fri, Mar 16, 2012 at 09:43:39AM -0400, Bai Shen wrote: > > Hi there, > > > I added this into my config file, and put my-503-error.html in the same > > location as the default 50x.html file, but all I get is a generic 404 > error > > page. > > You got an error page. > > What does the error log say? > > Either put your 503 file there; or configure "root" so that it is correct > within this location{}. > > If you're still having problems, please follow the "debug" instructions > to make it easier for people to help you. > > Details on the web site, but in brief: > > what did you do? > what did you see? > what did you expect to see? > > and the more specific you are, the easier it will be for someone else to > reproduce the problem you are reporting. > > Good luck with it, > > f > -- > Francis Daly francis at daoine.org > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Wed Mar 28 21:16:19 2012 From: francis at daoine.org (Francis Daly) Date: Wed, 28 Mar 2012 22:16:19 +0100 Subject: Custom error pages In-Reply-To: References: <20120313234023.GJ18773@craic.sysops.org> <20120315192409.GM18773@craic.sysops.org> <20120316151856.GP18773@craic.sysops.org> Message-ID: <20120328211619.GB3899@craic.sysops.org> On Wed, Mar 28, 2012 at 03:42:45PM -0400, Bai Shen wrote: Hi there, > I got my error page to show up. However, the css and image files don't > load. I tried changing the location, but that doesn't seem to work. > > Any suggestions? Try changing the location again. Maybe it will work this time. Or alternatively: Please fill in the details: > > what did you do? That will be something like "curl -i http://myserver/myfile.css" > > what did you see? That will be whatever you got back -- the content of /var/tmp/myfile.css, or the content of another file, or some error message. There might be more details available in log files. > > what did you expect to see? That will be something like "http 200 and the content of /usr/local/nginx/html/myfile.css". > > and the more specific you are, the easier it will be for someone else to > > reproduce the problem you are reporting. Provide the relevant part of nginx.conf from a machine where you saw the problem. If you don't know what is the relevant part, provide the whole thing. It doesn't have to be your "live" config, but it should be a config that you ran on a test machine. The smaller the config, the better. If you make it easy for someone to run the same server config as you, and run the same client commands as you, and see the same error output as you; then you make it easy for that person to try to help resolve the problem you saw. If you don't, you don't. f -- Francis Daly francis at daoine.org From adnan at rihan.fr Wed Mar 28 22:50:44 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Thu, 29 Mar 2012 00:50:44 +0200 Subject: Custom configuration In-Reply-To: References: <-1284977343496617773@unknownmsgid> Message-ID: > Which vhost is the one in question? Can you paste *only* the relevant > server block? @Cliff: I didn't find them :/ I've asked the CPanel module devs to tell me where are the vhosts. Actually, I think nginx is just a "proxy" to apache, but it's strange... It means apache is still running and .htaccess working... I'll tell you as soon as I have the response. > Also, you mention stuff in "custom", but I don't see where any of the > config you pasted includes a "custom" config. My custom conf is in "/custom/". This is what I had before @locojohn tip. > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be > location ~* \.mp3$ { > types { > application/octet-stream mp3; > } > } > For the following to work you need headers module installed: Sorry but, what do you mean? Isn't "headers" a standard module ? How to check the compiled modules please ? > location ~ /(?(?!/).+\.mp3)$ { > types { > application/octet-stream mp3; > } add_header Content-Disposition "attachment; filename=\"$filename\""; > } > > This is my new custom config file. Nothing changed. Still audio/mpeg :/ --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le mercredi 28 mars 2012 ? 20:31, locojohn a ?crit : > Adnan, > > For the following to work you need headers module installed: > > location ~ /(?(?!/).+\.mp3)$ { > types { > application/octet-stream mp3; > } > add_header Content-Disposition "attachment; > filename=\"$filename\""; > } > > Kind regards, > > Andrejs > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224499,224577#msg-224577 > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 28 22:57:34 2012 From: nginx-forum at nginx.us (locojohn) Date: Wed, 28 Mar 2012 18:57:34 -0400 (EDT) Subject: Custom configuration In-Reply-To: References: Message-ID: <0faeff32f70441359c55d2ac397d0f8b.NginxMailingListEnglish@forum.nginx.org> > Sorry but, what do you mean? Isn't "headers" a standard module ? How to check the compiled modules please ? nginx -V Try my solution, it works for me. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224499,224582#msg-224582 From adnan at rihan.fr Wed Mar 28 23:07:36 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Thu, 29 Mar 2012 01:07:36 +0200 Subject: Custom configuration In-Reply-To: <0faeff32f70441359c55d2ac397d0f8b.NginxMailingListEnglish@forum.nginx.org> References: <0faeff32f70441359c55d2ac397d0f8b.NginxMailingListEnglish@forum.nginx.org> Message-ID: @Cliff: Here is the customer's vhost: > root at shadow [/etc/cpnginx/custom]# cat /usr/local/nginx/conf/vhost.conf | grep domain.com > ########### Vhost configuration of mega-sound.be > server_name domain.com www.domain.com; > access_log /usr/local/apache/domlogs/domain.com; > proxy_redirect http://www.domain.com:8888 http://www.mega-sound.be; > proxy_redirect http://domain.com:8888 http://domain.com; > proxy_redirect http://domain.com:8888 http://domain.com; > include "/etc/cpnginx/custom/domain.com"; @locojohn: Here is the custom file: > root at shadow [/etc/cpnginx/custom]# cat domain.com > location ~ /(?(?!/).+\.mp3)$ { > types { > application/octet-stream mp3; > } > add_header Content-Disposition "attachment; filename=\"$filename\""; > } @locojohn: I'm using your custom config :/ . Plus, here is my nginx -V: > root at shadow [/etc/cpnginx/custom]# /usr/local/nginx/sbin/nginx -V > nginx version: nginx/1.0.11 > built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) > configure arguments: --prefix=/usr/local/nginx --with-openssl=/usr/ When I access a .mp3, here is the answer: > HTTP/1.1 200 OK > Server: nginx > Date: Wed, 28 Mar 2012 23:06:25 GMT > Content-Type: audio/mpeg > Content-Length: 8976405 > Last-Modified: Mon, 26 Mar 2012 18:50:14 GMT > Connection: keep-alive > Expires: Thu, 29 Mar 2012 23:06:25 GMT > Cache-Control: max-age=86400 > Accept-Ranges: bytes Thank you for your help. --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le jeudi 29 mars 2012 ? 00:57, locojohn a ?crit : > > Sorry but, what do you mean? Isn't "headers" a standard module ? How > > to check the compiled modules please ? > > nginx -V > > Try my solution, it works for me. > > Andrejs > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224499,224582#msg-224582 > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed Mar 28 23:15:26 2012 From: nginx-forum at nginx.us (locojohn) Date: Wed, 28 Mar 2012 19:15:26 -0400 (EDT) Subject: Custom configuration In-Reply-To: References: Message-ID: Adnan, if it doesn't set the "Content-Disposition" header as per my example, then it doesn't match the location in which this header is set. It is likely that some other location has preference and so the code I provided will never be triggered. Look into your nginx config more closely. Also, check the error log, do you get any warnings? Sometimes, PCRE library may throw a warning, maybe you can use alternative location syntax compatible with an older version of PCRE: ... location ~ /(?P(?!/).+\.mp3)$ { ... Are your mp3 links static at all? Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224499,224584#msg-224584 From adnan at rihan.fr Wed Mar 28 23:21:40 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Thu, 29 Mar 2012 01:21:40 +0200 Subject: Custom configuration In-Reply-To: References: Message-ID: <21214544208C4AF5934EAF8E3CF464C9@gmail.com> Unfortunately, it doesn't work. Here is a link example: http://www.mega-sound.be/adata/428.mp3 Actually, the first thing i've tried, is: > types { > application/octet-stream mp3; > } > The only failure, is that with that, even CSS are downloaded (so, webste screwed up), and now I know that I HAVE to use "location". I gave you an example link, the mp3 are in: /home/customer/www/adata/428.mp3, they're directly downloadable... And poor me, the dev of CPNginx plugin told me that they don't support custom config, so they won't help me T_T --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le jeudi 29 mars 2012 ? 01:15, locojohn a ?crit : > Adnan, if it doesn't set the "Content-Disposition" header as per my > example, then it doesn't match the location in which this header is set. > It is likely that some other location has preference and so the code I > provided will never be triggered. Look into your nginx config more > closely. Also, check the error log, do you get any warnings? > Sometimes, PCRE library may throw a warning, maybe you can use > alternative location syntax compatible with an older version of PCRE: > > ... > location ~ /(?P(?!/).+\.mp3)$ { > ... > > Are your mp3 links static at all? > > Andrejs > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224499,224584#msg-224584 > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at develix.com Thu Mar 29 00:15:54 2012 From: cliff at develix.com (Cliff Wells) Date: Wed, 28 Mar 2012 17:15:54 -0700 Subject: Custom configuration In-Reply-To: References: Message-ID: <1332980154.20728.4.camel@portable-evil> On Wed, 2012-03-28 at 19:15 -0400, locojohn wrote: > Adnan, if it doesn't set the "Content-Disposition" header as per my > example, then it doesn't match the location in which this header is set. > It is likely that some other location has preference and so the code I > provided will never be triggered. I'm fairly certain this is exactly what is happening. Either solution should work fine, but only if the location is properly matched. Again, it's not the preferred solution, but directly editing mime.types would probably work. Cliff From adnan at rihan.fr Thu Mar 29 00:36:21 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Thu, 29 Mar 2012 02:36:21 +0200 Subject: Custom configuration In-Reply-To: <1332980154.20728.4.camel@portable-evil> References: <1332980154.20728.4.camel@portable-evil> Message-ID: <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> Mmmh... Ok. I see, maybe there will never be any match, as there is only "proxy_redirect" in vhosts; > ########### Vhost configuration of mega-sound.be > server_name mega-sound.be www.mega-sound.be; > access_log /usr/local/apache/domlogs/mega-sound.be; > proxy_redirect http://www.mega-sound.be:8888 http://www.mega-sound.be; > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > include "/etc/cpnginx/custom/mega-sound.be"; Apache is still listening on :8888 Is there a chance with this conf, to match any "location" as there is no "document_root" or equivalent ? I mean, location is system based or URL based? If it's system, I don't know. If it's URL based, there should be a match since the first test. Isn't it ? --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le jeudi 29 mars 2012 ? 02:15, Cliff Wells a ?crit : > On Wed, 2012-03-28 at 19:15 -0400, locojohn wrote: > > Adnan, if it doesn't set the "Content-Disposition" header as per my > > example, then it doesn't match the location in which this header is set. > > It is likely that some other location has preference and so the code I > > provided will never be triggered. > > > > > I'm fairly certain this is exactly what is happening. Either solution > should work fine, but only if the location is properly matched. > > Again, it's not the preferred solution, but directly editing mime.types > would probably work. > > Cliff > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 29 08:50:50 2012 From: nginx-forum at nginx.us (TECK) Date: Thu, 29 Mar 2012 04:50:50 -0400 (EDT) Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <820c0844d4c5883295babcfec8c1d191.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9c697e5f0e57431e0ace67e7522c776a.NginxMailingListEnglish@forum.nginx.org> More updates on the SSL issue. I have the following configuration: http { ... ssl_prefer_server_ciphers on; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_session_cache shared:SSL:5m; ssl_session_timeout 10m; ... } If I disable the ssl_prefer_server_ciphers, the [crit] errors are gone. On the other hand, I cannot use anymore the RC4. Any idea what could cause this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224381,224593#msg-224593 From samit04 at gmail.com Thu Mar 29 11:52:49 2012 From: samit04 at gmail.com (Samit Pal) Date: Thu, 29 Mar 2012 17:22:49 +0530 Subject: nginx stats In-Reply-To: References: Message-ID: Folks, I'am interested in nginx stats like per return status numbers, bytes served etc. I run nginx in a reverse proxy mode. I know parsing logs will give that, but I wanted to know if there any module which gives these stats. I looked in the stub module, i think these stats are not there. Thanks samit From andrew at nginx.com Thu Mar 29 11:56:40 2012 From: andrew at nginx.com (Andrew Alexeev) Date: Thu, 29 Mar 2012 15:56:40 +0400 Subject: nginx stats In-Reply-To: References: Message-ID: On Mar 29, 2012, at 3:52 PM, Samit Pal wrote: > Folks, > > I'am interested in nginx stats like per return status numbers, bytes > served etc. I run nginx in a reverse proxy mode. I know parsing logs > will give that, but I wanted to know if there any module which gives > these stats. I looked in the stub module, i think these stats are not > there. Yes, the stub one is quite limited. We've been working on a much better version, which is going to appear soon. > Thanks > samit From neil.mckee.ca at gmail.com Thu Mar 29 12:12:48 2012 From: neil.mckee.ca at gmail.com (Neil Mckee) Date: Thu, 29 Mar 2012 05:12:48 -0700 Subject: nginx stats In-Reply-To: References: Message-ID: <366D9E98-20CC-4891-A76C-4541E0FF1679@gmail.com> One option is nginx-sflow-module. It reports counters (and transactions) using a standard binary format over UDP - so you can have a whole web-farm reporting to a single port on another server. No log-file-tailing required. If you send the sFlow feed to Ganglia, for example, it will pull out the counters and trend them. If your transaction rate is high you can reduce the load by configuring random sampling on the transaction logging, but the counters will still be 100% accurate. http://code.google.com/p/nginx-sflow-module/ It works in conjunction with hsflowd, so you also get CPU, mem, I/O stats for each server: http://host-sflow.sourceforge.net If anything is missing that should be counted/sampled for a reverse-proxy scenario, please let me know. The sFlow-HTTP spec is here: http://sflow.org/sflow_http.txt Neil On Mar 29, 2012, at 4:52 AM, Samit Pal wrote: > Folks, > > I'am interested in nginx stats like per return status numbers, bytes > served etc. I run nginx in a reverse proxy mode. I know parsing logs > will give that, but I wanted to know if there any module which gives > these stats. I looked in the stub module, i think these stats are not > there. > > Thanks > samit > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From kworthington at gmail.com Thu Mar 29 14:06:08 2012 From: kworthington at gmail.com (Kevin Worthington) Date: Thu, 29 Mar 2012 10:06:08 -0400 Subject: nginx-1.1.18 In-Reply-To: <20120328140040.GI13466@mdounin.ru> References: <20120328140040.GI13466@mdounin.ru> Message-ID: Hello Nginx Users, Now available: Nginx 1.1.18 For Windows http://goo.gl/lH8ED (32-bit and 64-bit versions) These versions are to support legacy users who are already using Cygwin based builds of Nginx. Officially supported native Windows binaries are at nginx.org. Thank you, Kevin -- Kevin Worthington kworthington *@~ #gmail} [dot) {com] http://www.kevinworthington.com/ http://twitter.com/kworthington On 3/28/12, Maxim Dounin wrote: > Changes with nginx 1.1.18 28 Mar 2012 > > *) Change: keepalive connections are no longer disabled for Safari by > default. > > *) Feature: the $connection_requests variable. > > *) Feature: $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd and > $tcpinfo_rcv_space variables. > > *) Feature: the "worker_cpu_affinity" directive now works on FreeBSD. > > *) Feature: the "xslt_param" and "xslt_string_param" directives. > Thanks to Samuel Behan. > > *) Bugfix: in configure tests. > Thanks to Piotr Sikora. > > *) Bugfix: in the ngx_http_xslt_filter_module. > > *) Bugfix: nginx could not be built on Debian GNU/Hurd. > > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > From wrr at mixedbit.org Thu Mar 29 14:32:32 2012 From: wrr at mixedbit.org (Jan Wrobel) Date: Thu, 29 Mar 2012 16:32:32 +0200 Subject: Enforcing authentication requests for all resources under specific path Message-ID: Hi, I'm working on an application independent authentication and authorization layer that utilizes nginx with auth request module. The two are working great for me, but I run into an issue that I don't know how to solve, maybe you can help? Is there a way to enforce auth requests for all resources under a specific path? Say I want to protect all resources in /protected: location /protected/ { auth_request /auth/is_authenticated/; error_page 403 /auth/login/; error_page 401 /auth/noauthorized/; } This works but only until more specific location is added: location /protected/blog { #.... } Which, due to location matching rules, takes precedence over the '/protected' location, and auth requests for blog are not issued. Is there any way around it other than repeating auth_request configuration for each location? I can think of two solutions, but each has quite substantial limitations: 1. configure auth_request in server {} section, but this authorizes all requests, not only ones in '/protected' 2. Run separate nginx instance configured to do authorization only and passing all allowed requests downstream. This would introduce additional performance and maintenance overhead. Is there any better way? thanks, Jan From igor at sysoev.ru Thu Mar 29 14:44:30 2012 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 29 Mar 2012 18:44:30 +0400 Subject: Enforcing authentication requests for all resources under specific path In-Reply-To: References: Message-ID: <20120329144430.GD25053@nginx.com> On Thu, Mar 29, 2012 at 04:32:32PM +0200, Jan Wrobel wrote: > Hi, > > I'm working on an application independent authentication and > authorization layer that utilizes nginx with auth request module. The > two are working great for me, but I run into an issue that I don't > know how to solve, maybe you can help? > > Is there a way to enforce auth requests for all resources under a > specific path? Say I want to protect all resources in /protected: > > location /protected/ { > auth_request /auth/is_authenticated/; > error_page 403 /auth/login/; > error_page 401 /auth/noauthorized/; > } > > This works but only until more specific location is added: > > location /protected/blog { > #.... > } > > Which, due to location matching rules, takes precedence over the > '/protected' location, and auth requests for blog are not issued. > > Is there any way around it other than repeating auth_request > configuration for each location? > > I can think of two solutions, but each has quite substantial limitations: > 1. configure auth_request in server {} section, but this authorizes > all requests, not only ones in '/protected' > 2. Run separate nginx instance configured to do authorization only and > passing all allowed requests downstream. This would introduce > additional performance and maintenance overhead. > > Is there any better way? I believe the best way to configure is to set explicitly necessery directives in all locations where they are required. This leads to maintainable configuration. -- Igor Sysoev From linux at ramyallam.com Thu Mar 29 15:51:31 2012 From: linux at ramyallam.com (Ramy Allam) Date: Thu, 29 Mar 2012 15:51:31 +0000 Subject: nginx upstream prematurely closed connection Message-ID: Hello, I'm using nginx as a reverse proxy to handle static files with apache to handle dynamic file .php I'm receiving too many errors ( Bad Gateway 502 ) when i'm using vBulletin , joomla , wordpress in PHP Post or curl() inside php. I reviewed log i noticed this error is frequently appears: "upstream prematurely closed connection while reading response header from upstream" Nginx version: nginx/1.0.11Apache/2.2.22PHP 5.2.17 Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 29 16:43:12 2012 From: nginx-forum at nginx.us (djlebersilvestre) Date: Thu, 29 Mar 2012 12:43:12 -0400 (EDT) Subject: Nginx + Rails (Thin Server) - Double Bad Gateway Problem In-Reply-To: <20120328143854.GM13466@mdounin.ru> References: <20120328143854.GM13466@mdounin.ru> Message-ID: Thanks Maxim, I've discovered that the configuration in rails systemintegration / production environment was different from development. So, if someone called a URL that wasn't routable, the server responded empty response instead of sending a 404. When I switched the config, the server started to send 404 and Nginx worked correctly. # config/environments/production.rb # Show exception templates (must be on to launch 404 when invalid route is called) config.action_dispatch.show_exceptions = true Daniel Silvestre Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224548,224617#msg-224617 From wrr at mixedbit.org Thu Mar 29 17:21:05 2012 From: wrr at mixedbit.org (Jan Wrobel) Date: Thu, 29 Mar 2012 19:21:05 +0200 Subject: Enforcing authentication requests for all resources under specific path In-Reply-To: <20120329144430.GD25053@nginx.com> References: <20120329144430.GD25053@nginx.com> Message-ID: On Thu, Mar 29, 2012 at 4:44 PM, Igor Sysoev wrote: > On Thu, Mar 29, 2012 at 04:32:32PM +0200, Jan Wrobel wrote: >> Is there any better way? > > I believe the best way to configure is to set explicitly necessery > directives in all locations where they are required. This leads to > maintainable configuration. In my case this is not too good option. I need authentication layer configuration to be independent from applications configuration. In case of authentication (not only auth request but also auth basic) repeating configuration for each location, without 'catch them all' rule could lead to holes that are hard to notice. For example if I configure authentication correctly for blog/*html but forget to do it for blog/*.png the mistake will likely be unnoticed :/ Anyway, if there are no other options, I'll try using auth_request in server{} section. Thanks, Jan From tdgh2323 at hotmail.com Thu Mar 29 18:01:50 2012 From: tdgh2323 at hotmail.com (Micheal Wolfskill) Date: Thu, 29 Mar 2012 18:01:50 +0000 Subject: HttpLimitZoneModule and HttpLimitReqModule.. possible to list IPs banned? Message-ID: Hello All, I have this inside my httpd {}.. Is there anyway to list the IPs that have been banned? If not what is the closest way to do this? limit_req_zone $limit zone=notabot:5m rate=200r/s; limit_req zone=notabot burst=200 nodelay; geo $notabot { default 1; #google 64.233.160.0/19 0; 65.52.0.0/14 0; 66.102.0.0/20 0; 66.249.64.0/19 0; 72.14.192.0/18 0; 74.125.0.0/16 0; 209.85.128.0/17 0; 216.239.32.0/19 0; #My IPs 127.0.0.1/32 0; 200.122.149.9 0; } map $notabot $limit { 1 $binary_remote_addr; 0 ""; } Thanks --Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu Mar 29 20:25:35 2012 From: nginx-forum at nginx.us (goldenaxez) Date: Thu, 29 Mar 2012 16:25:35 -0400 (EDT) Subject: How to solve the problem of "405 not allowed"? In-Reply-To: References: <0f5a7655c4c4966f79b764d0c974d75a.NginxMailingListEnglish@forum.nginx.org> <63d620952a4a8185eb9a41fd44e226f0.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0b0c39a6ad1b23dd661944921a0fa8a4.NginxMailingListEnglish@forum.nginx.org> fernandokosh Wrote: ------------------------------------------------------- > I have the same issue here running Rails 2 apps > virtual hosts on Debian Squeeze. > In my case I, the error occur when I perform > update with the PUT method. > That's solve my problem: > > location / { > error_page 405 = $uri; > try_files $uri @unicorn_app; > } > > Thank you! Hello fernandokosh, Thank you for your post. I tried really works.But this time I'm getting a 500 internal server error. My site not open the directly. I have to open www.vantila.com/index.html. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2414,224626#msg-224626 From francis at daoine.org Thu Mar 29 20:29:39 2012 From: francis at daoine.org (Francis Daly) Date: Thu, 29 Mar 2012 21:29:39 +0100 Subject: Enforcing authentication requests for all resources under specific path In-Reply-To: References: <20120329144430.GD25053@nginx.com> Message-ID: <20120329202939.GC3899@craic.sysops.org> On Thu, Mar 29, 2012 at 07:21:05PM +0200, Jan Wrobel wrote: Hi there, > In my case this is not too good option. I need authentication layer > configuration to be independent from applications configuration. In Because of the way nginx configuration works, they can't be completely independent. But you could try nesting locations: location /protected/ { auth_request etc... location /protected/blog { blog config... } location ~ png { png config... } } (And of course you'll want no top-level regex locations; but that's good practice anyway.) Quick testing suggests that the auth request module does inherit these configurations. f -- Francis Daly francis at daoine.org From wrr at mixedbit.org Thu Mar 29 20:53:22 2012 From: wrr at mixedbit.org (Jan Wrobel) Date: Thu, 29 Mar 2012 22:53:22 +0200 Subject: Enforcing authentication requests for all resources under specific path In-Reply-To: <20120329202939.GC3899@craic.sysops.org> References: <20120329144430.GD25053@nginx.com> <20120329202939.GC3899@craic.sysops.org> Message-ID: On Thu, Mar 29, 2012 at 10:29 PM, Francis Daly wrote: > On Thu, Mar 29, 2012 at 07:21:05PM +0200, Jan Wrobel wrote: > > Hi there, > >> In my case this is not too good option. I need authentication layer >> configuration to be independent from applications configuration. In > > Because of the way nginx configuration works, they can't be completely > independent. > > But you could try nesting locations: > > location /protected/ { > ?auth_request etc... > > ?location /protected/blog { > ? ?blog config... > ?} > > ?location ~ png { > ? ?png config... > ?} > > } > > (And of course you'll want no top-level regex locations; but that's good > practice anyway.) > > Quick testing suggests that the auth request module does inherit these > configurations. Thanks, this works! Jan From nginx-forum at nginx.us Thu Mar 29 21:09:05 2012 From: nginx-forum at nginx.us (stormflake) Date: Thu, 29 Mar 2012 17:09:05 -0400 (EDT) Subject: 1.0.5 vs 1.0.10 Message-ID: <9c2ce052ecb02bd1b9742ab3116d56da.NginxMailingListEnglish@forum.nginx.org> Hi, I recently copied configuration files that worked correctly in 1.0.5 which no longer work in 1.0.10 I tested using curl: curl -k -H 'X-Forwarded-For: 1.2.3.4' -F data=@1327833493.xml -F username=user -F password=pass https://example.com The response I get is: curl: (35) Unknown SSL protocol error in connection to example.com:443 Any ideas why this only poses issues in 1.0.10 and not in 1.0.5 ? What changes are required, or is this a bug? Configuration: ## nginx.conf server { ... include conf.d/*.conf ... passenger module ... } ## conf.d/ssl.conf server { listen 443 default ssl; server_name _; ssl on; ssl_certificate path/to/cert; ssl_certificate_key path/to/key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; } ## conf.d/app.rb server { listen 80; listen 443; log_format main2 '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$request_body" "$http_x_forwarded_for" "$http_x_forward_for"' ; error_log /home//app/log/nginx-error.log; server_name example.com; root /home/app/public; # <--- be sure to point to 'public'! access_log /home/app/log/nginx-access.log main2; passenger_set_cgi_param HTTP_X_FORWARDED_FOR $http_x_forwarded_for; passenger_enabled on; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224629,224629#msg-224629 From jdorfman at netdna.com Fri Mar 30 00:11:47 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Thu, 29 Mar 2012 17:11:47 -0700 Subject: could not build the referers_hash Message-ID: Hello, I am trying to reload nginx and keep getting this error: nginx: [emerg] could not build the referers_hash, you should increase referers_hash_bucket_size: 64 nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed Nginx Version: 1.0.8 nginx.conf - https://gist.github.com/a113dd815b591fa841c3 Thanks in advance. Regards, Justin Dorfman -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at develix.com Fri Mar 30 01:41:57 2012 From: cliff at develix.com (Cliff Wells) Date: Thu, 29 Mar 2012 18:41:57 -0700 Subject: could not build the referers_hash In-Reply-To: References: Message-ID: <1333071717.2082.3.camel@portable-evil> On Thu, 2012-03-29 at 17:11 -0700, Justin Dorfman wrote: > nginx: [emerg] could not build the referers_hash, you should increase > referers_hash_bucket_size: 64 I hate to ask the obvious, but did you try increasing referers_hash_bucket_size? server { referers_hash_bucket_size 128; } This variable seems undocumented (aside from a note it appeared in 1.0.5), but the error message appears helpful enough. Regards, Cliff From jdorfman at netdna.com Fri Mar 30 02:04:01 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Thu, 29 Mar 2012 19:04:01 -0700 Subject: could not build the referers_hash In-Reply-To: <1333071717.2082.3.camel@portable-evil> References: <1333071717.2082.3.camel@portable-evil> Message-ID: Hey Cliff, I did, same issue. The way we ended up "fixing" it was deleting all of the vhosts and syncing them from another PoP. Thanks Regards, Justin Dorfman On Thu, Mar 29, 2012 at 6:41 PM, Cliff Wells wrote: > On Thu, 2012-03-29 at 17:11 -0700, Justin Dorfman wrote: > > > nginx: [emerg] could not build the referers_hash, you should increase > > referers_hash_bucket_size: 64 > > > I hate to ask the obvious, but did you try increasing > referers_hash_bucket_size? > > server { > referers_hash_bucket_size 128; > } > > This variable seems undocumented (aside from a note it appeared in > 1.0.5), but the error message appears helpful enough. > > Regards, > Cliff > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Mar 30 03:14:46 2012 From: nginx-forum at nginx.us (neoesque) Date: Thu, 29 Mar 2012 23:14:46 -0400 (EDT) Subject: I got 502 and error_log print upstream sent invalid status "0" Message-ID: Hi everyone, I have a php-fpm backend. And sometimes I got nginx return 502. After I check the error_log I found each 502s are caused by upstream sent invalid status "0" while reading response header from upstream The error_log are in the form "upstream sent invalid status "0" while reading response header from upstream client: 127.0.0.1, server: xxxx, request: "xxxxx HTTP/1.0", upstream: "fastcgi://unix:/dev/shm/api-php.socket:", host: "xxxx", referrer: "xxxx"" Does anyone have same experience? I have no idea after search Google 'upstream sent invalid status "0"' I think it is caused by PHP. But why does it sent status '0'? Yours Sincerely. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224638,224638#msg-224638 From mdounin at mdounin.ru Fri Mar 30 03:27:55 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Mar 2012 07:27:55 +0400 Subject: I got 502 and error_log print upstream sent invalid status "0" In-Reply-To: References: Message-ID: <20120330032747.GQ13466@mdounin.ru> Hello! On Thu, Mar 29, 2012 at 11:14:46PM -0400, neoesque wrote: > Hi everyone, > > I have a php-fpm backend. And sometimes I got nginx return 502. After I > check the error_log I found each 502s are caused by upstream sent > invalid status "0" while reading response header from upstream > > The error_log are in the form "upstream sent invalid status "0" while > reading response header from upstream client: 127.0.0.1, server: xxxx, > request: "xxxxx HTTP/1.0", upstream: > "fastcgi://unix:/dev/shm/api-php.socket:", host: "xxxx", referrer: > "xxxx"" > > Does anyone have same experience? I have no idea after search Google > 'upstream sent invalid status "0"' > > I think it is caused by PHP. But why does it sent status '0'? The message in question means nginx got header line "Status: 0" from php. Most likely it's what you php code did, not php by itself. Maxim Dounin From mdounin at mdounin.ru Fri Mar 30 03:40:59 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Mar 2012 07:40:59 +0400 Subject: 1.0.5 vs 1.0.10 In-Reply-To: <9c2ce052ecb02bd1b9742ab3116d56da.NginxMailingListEnglish@forum.nginx.org> References: <9c2ce052ecb02bd1b9742ab3116d56da.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20120330034059.GR13466@mdounin.ru> Hello! On Thu, Mar 29, 2012 at 05:09:05PM -0400, stormflake wrote: > Hi, > > I recently copied configuration files that worked correctly in 1.0.5 > which no longer work in 1.0.10 > > I tested using curl: curl -k -H 'X-Forwarded-For: 1.2.3.4' -F > data=@1327833493.xml -F username=user -F password=pass > https://example.com > > The response I get is: curl: (35) Unknown SSL protocol error in > connection to example.com:443 > > Any ideas why this only poses issues in 1.0.10 and not in 1.0.5 ? What > changes are required, or is this a bug? [...] Most likely you're hitting this bug, as fixed in nginx 1.0.11: *) Bugfix: a segmentation fault might occur in a worker process if SNI was used; the bug had appeared in 1.0.9. Upgrade to nginx 1.0.14 or follow the workaround outlined here: http://trac.nginx.org/nginx/ticket/54#comment:3 Maxim Dounin From nginx-forum at nginx.us Fri Mar 30 03:44:24 2012 From: nginx-forum at nginx.us (neoesque) Date: Thu, 29 Mar 2012 23:44:24 -0400 (EDT) Subject: I got 502 and error_log print upstream sent invalid status "0" In-Reply-To: <20120330032747.GQ13466@mdounin.ru> References: <20120330032747.GQ13466@mdounin.ru> Message-ID: <632050f063f3301601f3139b9899b349.NginxMailingListEnglish@forum.nginx.org> Hi, Maxim Thanks, I'll check those PHP codes. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224638,224642#msg-224642 From mdounin at mdounin.ru Fri Mar 30 03:49:50 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Mar 2012 07:49:50 +0400 Subject: HttpLimitZoneModule and HttpLimitReqModule.. possible to list IPs banned? In-Reply-To: References: Message-ID: <20120330034950.GS13466@mdounin.ru> Hello! On Thu, Mar 29, 2012 at 06:01:50PM +0000, Micheal Wolfskill wrote: > I have this inside my httpd {}.. Is there anyway to list the IPs > that have been banned? If not what is the closest way to do > this? > > limit_req_zone $limit zone=notabot:5m rate=200r/s; > limit_req zone=notabot burst=200 nodelay; Right now the only way is to check error logs, nginx will log "... limiting requests ... by zone ..." for each request rejected by limit_req (at level set by limit_req_log_level, "error" by default). The same applies to limit_conn as well. Maxim Dounin From nbubingo at gmail.com Fri Mar 30 03:52:50 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Fri, 30 Mar 2012 11:52:50 +0800 Subject: HttpLimitZoneModule and HttpLimitReqModule.. possible to list IPs banned? In-Reply-To: References: Message-ID: You can have a look at my limit_access module: https://github.com/yaoweibin/nginx_limit_access_module It can add/delete/display the banned IP. But it only can add single IP, not a range of IP. 2012/3/30 Micheal Wolfskill : > Hello All, > > I have this inside my httpd {}.. Is there anyway to list the IPs that have > been banned?? If not what is the closest way to do this? > > ?limit_req_zone $limit zone=notabot:5m rate=200r/s; > limit_req zone=notabot burst=200 nodelay; > > ??? geo $notabot { > ??????? default 1; > ??????? #google > ??????? 64.233.160.0/19 0; > ??????? 65.52.0.0/14 0; > ??????? 66.102.0.0/20 0; > ??????? 66.249.64.0/19 0; > ??????? 72.14.192.0/18 0; > ??????? 74.125.0.0/16 0; > ??????? 209.85.128.0/17 0; > ??????? 216.239.32.0/19 0; > ??????? #My IPs > ??????? 127.0.0.1/32 0; > ??????? 200.122.149.9 0; > ??? } > ??? map $notabot $limit { > ??????? 1 $binary_remote_addr; > ??????? 0 ""; > ??? } > > Thanks > --Mike > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Fri Mar 30 03:56:58 2012 From: nginx-forum at nginx.us (neoesque) Date: Thu, 29 Mar 2012 23:56:58 -0400 (EDT) Subject: I got 502 and error_log print upstream sent invalid status "0" In-Reply-To: References: Message-ID: <7396114fe370ce617beeaa3238c6e6d9.NginxMailingListEnglish@forum.nginx.org> OH! You are right, Maxim. Those errors are retrieving other webpage by using curl. And the upstreams return status code 0 seldomly. Thank you. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224638,224645#msg-224645 From arissirajawali at gmail.com Fri Mar 30 04:19:17 2012 From: arissirajawali at gmail.com (aris) Date: Fri, 30 Mar 2012 11:19:17 +0700 Subject: install nginx dan php debian Message-ID: please help me, I just wanted to start the install nginx and php on debian linux, that I question is: how to install nginx and php on debian, please send it to me once in the tutorial how to install nginx and php. Thank you so much before -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Mar 30 04:31:36 2012 From: nginx-forum at nginx.us (niraj) Date: Fri, 30 Mar 2012 00:31:36 -0400 (EDT) Subject: error during login in my cgi/perl application Message-ID: <7c4e5333397f50245250d1bbc8de67f8.NginxMailingListEnglish@forum.nginx.org> Hi I am trying to run my application which having html+cgi/perl files. during the login its giving the following error. In Browser I am getting the following error 502 Bad Gateway and In error log file 2012/03/30 09:58:05 [error] 29619#0: *1 upstream closed prematurely FastCGI stdout while reading response header from upstream, client: 192.168.1.44, server: localhost, request: "GET /cgi-bin/baybuy_vendx/index.cgi?vendx_action=myoffice_commonuser&userid=53616c7465645f5f1fed4bcaa10a7da569ecb5a53e5a718a&page=1b662ecc4610f940ec530e3bc8762169&BusinessGrID=1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "192.168.1.225:90", referrer: "http://192.168.1.225:90/cgi-bin/baybuy_vendx/index.cgi?vendx_action=validate_both2" Please guide for the same. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224647,224647#msg-224647 From adnan at rihan.fr Fri Mar 30 05:08:37 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Fri, 30 Mar 2012 07:08:37 +0200 Subject: Custom configuration In-Reply-To: <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> References: <1332980154.20728.4.camel@portable-evil> <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> Message-ID: Hi, Finally I need your help :/ The "CPNginx" devs have a website with a ticket support system, but they're telling me that they don't support custom configuration... I've told them I need their help because they know how they built their module and how they made it work, they still just answer "You need to do it by yourself"... What can I do T_T ? --- Regards, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le jeudi 29 mars 2012 ? 02:36, Adnan RIHAN a ?crit : > Mmmh... > > Ok. I see, maybe there will never be any match, as there is only "proxy_redirect" in vhosts; > > ########### Vhost configuration of mega-sound.be (http://mega-sound.be) > > server_name mega-sound.be www.mega-sound.be (http://www.mega-sound.be); > > access_log /usr/local/apache/domlogs/mega-sound.be (http://mega-sound.be); > > proxy_redirect http://www.mega-sound.be:8888 http://www.mega-sound.be; > > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > > include "/etc/cpnginx/custom/mega-sound.be (http://mega-sound.be)"; > > > > > Apache is still listening on :8888 > Is there a chance with this conf, to match any "location" as there is no "document_root" or equivalent ? > I mean, location is system based or URL based? > > If it's system, I don't know. If it's URL based, there should be a match since the first test. > Isn't it ? > --- > Cordialement, Adnan RIHAN. > Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. > Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. > Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). > > > Le jeudi 29 mars 2012 ? 02:15, Cliff Wells a ?crit : > > > On Wed, 2012-03-28 at 19:15 -0400, locojohn wrote: > > > Adnan, if it doesn't set the "Content-Disposition" header as per my > > > example, then it doesn't match the location in which this header is set. > > > It is likely that some other location has preference and so the code I > > > provided will never be triggered. > > > > > > > > > I'm fairly certain this is exactly what is happening. Either solution > > should work fine, but only if the location is properly matched. > > > > Again, it's not the preferred solution, but directly editing mime.types > > would probably work. > > > > Cliff > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org (mailto:nginx at nginx.org) > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adnan at rihan.fr Fri Mar 30 07:11:11 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Fri, 30 Mar 2012 09:11:11 +0200 Subject: Custom configuration In-Reply-To: References: <1332980154.20728.4.camel@portable-evil> <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> Message-ID: Hey everybody ! Here are some news. I've compiled nginx with HttpHeadersMoreModule (http://wiki.nginx.org/NginxHttpHeadersMoreModule), to add custom headers in order to see if the location is or isn't matched. Here is what I tried: URL: http://www.mega-sound.be/adata/428.mp3 Custom config file: > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be > location ~* \.mp3$ { > more_set_headers 'X-MyHeader: .mp3'; > } > > location /adata { > more_set_headers 'X-MyHeader: adata'; > } > > more_set_headers 'X-MyMasterHeader: set'; The headers sent: > GET /adata/428.mp3 HTTP/1.1 > Host: www.mega-sound.be > User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 > Accept-Encoding: gzip, deflate > Connection: keep-alive > Referer: http://www.mega-sound.be/ > Cookie: cookie-data > If-Modified-Since: Mon, 26 Mar 2012 18:50:14 GMT > Cache-Control: max-age=0 And received > HTTP/1.1 200 OK > Server: nginx > Date: Fri, 30 Mar 2012 07:03:58 GMT > Content-Type: audio/mpeg > Content-Length: 8976405 > Last-Modified: Mon, 26 Mar 2012 18:50:14 GMT > Connection: keep-alive > X-MyMasterHeader: set > Expires: Sat, 31 Mar 2012 07:03:58 GMT > Cache-Control: max-age=86400 > Accept-Ranges: bytes Do you have an idea :/ ? Thank you for your help. --- Cheers, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le vendredi 30 mars 2012 ? 07:08, Adnan RIHAN a ?crit : > Hi, > > Finally I need your help :/ > > The "CPNginx" devs have a website with a ticket support system, but they're telling me that they don't support custom configuration... > I've told them I need their help because they know how they built their module and how they made it work, they still just answer "You need to do it by yourself"... > > What can I do T_T ? > --- > Regards, Adnan RIHAN. > Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. > Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. > Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). > > > Le jeudi 29 mars 2012 ? 02:36, Adnan RIHAN a ?crit : > > > Mmmh... > > > > Ok. I see, maybe there will never be any match, as there is only "proxy_redirect" in vhosts; > > > ########### Vhost configuration of mega-sound.be (http://mega-sound.be) > > > server_name mega-sound.be (http://mega-sound.be) www.mega-sound.be (http://www.mega-sound.be); > > > access_log /usr/local/apache/domlogs/mega-sound.be (http://mega-sound.be); > > > proxy_redirect http://www.mega-sound.be:8888 http://www.mega-sound.be; > > > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > > > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > > > include "/etc/cpnginx/custom/mega-sound.be (http://mega-sound.be)"; > > > > > > > > > Apache is still listening on :8888 > > Is there a chance with this conf, to match any "location" as there is no "document_root" or equivalent ? > > I mean, location is system based or URL based? > > > > If it's system, I don't know. If it's URL based, there should be a match since the first test. > > Isn't it ? > > --- > > Cordialement, Adnan RIHAN. > > Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. > > Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. > > Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). > > > > > > Le jeudi 29 mars 2012 ? 02:15, Cliff Wells a ?crit : > > > > > On Wed, 2012-03-28 at 19:15 -0400, locojohn wrote: > > > > Adnan, if it doesn't set the "Content-Disposition" header as per my > > > > example, then it doesn't match the location in which this header is set. > > > > It is likely that some other location has preference and so the code I > > > > provided will never be triggered. > > > > > > > > > > > > > I'm fairly certain this is exactly what is happening. Either solution > > > should work fine, but only if the location is properly matched. > > > > > > Again, it's not the preferred solution, but directly editing mime.types > > > would probably work. > > > > > > Cliff > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org (mailto:nginx at nginx.org) > > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.bonnet at esiee.fr Fri Mar 30 08:29:27 2012 From: f.bonnet at esiee.fr (Frank Bonnet) Date: Fri, 30 Mar 2012 10:29:27 +0200 Subject: install nginx dan php debian In-Reply-To: References: Message-ID: <4F756EE7.401@esiee.fr> On 03/30/2012 06:19 AM, aris wrote: > please help me,I justwanted tostart theinstallnginxandphpondebianlinux, > thatI questionis:how toinstallnginxandphpondebian,pleasesend it to > meoncein thetutorialhow toinstallnginxandphp. > Thank you so muchbefore > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx http://www.howtoforge.com/installing-php-5.3-nginx-and-php-fpm-on-ubuntu-debian -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Fri Mar 30 08:36:20 2012 From: francis at daoine.org (Francis Daly) Date: Fri, 30 Mar 2012 09:36:20 +0100 Subject: Custom configuration In-Reply-To: References: <1332980154.20728.4.camel@portable-evil> <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> Message-ID: <20120330083620.GD3899@craic.sysops.org> On Fri, Mar 30, 2012 at 07:08:37AM +0200, Adnan RIHAN wrote: Hi there, > What can I do T_T ? Read http://nginx.org/en/docs/http/request_processing.html Look in your config file. Be aware of "include" directives. Look in every server{} block. Look at "listen" and "server_name" directives in each server{} block. Identify which one server{} block is being used to handle this request. Post the config for that server{}. (If you can additionally identify which one location{} block within that server{} block is being used for this request, then you could limit what you post to: the server{} block outside of all location{}s, plus the content of that one location{}. But that's probably more work than is necessary.) If you can enable the debug log (will probably require rebuilding nginx), then you will see lots of information about what nginx thinks is happening. But posting the relevant part of the config file is the best way to make it easy for people help you. f -- Francis Daly francis at daoine.org From surfchen at gmail.com Fri Mar 30 09:01:26 2012 From: surfchen at gmail.com (Chen Ze) Date: Fri, 30 Mar 2012 17:01:26 +0800 Subject: install nginx dan php debian In-Reply-To: <4F756EE7.401@esiee.fr> References: <4F756EE7.401@esiee.fr> Message-ID: Google and RTFM On Fri, Mar 30, 2012 at 4:29 PM, Frank Bonnet wrote: > On 03/30/2012 06:19 AM, aris wrote: > > please help me,?I just?wanted to?start > the?install?nginx?and?php?on?debian?linux, > that?I question?is:?how to?install?nginx?and?php?on?debian,?please?send it > to me?once?in the?tutorial?how to?install?nginx?and?php. > ??Thank you so much?before > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > http://www.howtoforge.com/installing-php-5.3-nginx-and-php-fpm-on-ubuntu-debian > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Fri Mar 30 10:56:59 2012 From: nginx-forum at nginx.us (teen9xpro) Date: Fri, 30 Mar 2012 06:56:59 -0400 (EDT) Subject: [Help] Convert htaccess apache to nginx Message-ID: <133a0648629ec62985c1c3740ec11b38.NginxMailingListEnglish@forum.nginx.org> Someone can help me covert the code below to apache nginx RewriteEngine On RewriteRule ^([0-9]+)$ /showthread.php?t=$1 [NC,QSA,L] RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap|api\.php) RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/ RewriteRule ^(.+)$ vbseo.php [L,QSA] I know change [L] to Last but what is NC QSA. Thanks for help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224658,224658#msg-224658 From mdounin at mdounin.ru Fri Mar 30 12:01:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 30 Mar 2012 16:01:23 +0400 Subject: nginx upstream prematurely closed connection In-Reply-To: References: Message-ID: <20120330120123.GU13466@mdounin.ru> Hello! On Thu, Mar 29, 2012 at 03:51:31PM +0000, Ramy Allam wrote: > Hello, > I'm using nginx as a reverse proxy to handle static files with apache to handle dynamic file .php > I'm receiving too many errors ( Bad Gateway 502 ) when i'm using vBulletin , joomla , wordpress in PHP Post or curl() inside php. > I reviewed log i noticed this error is frequently appears: > "upstream prematurely closed connection while reading response header from upstream" > Nginx version: nginx/1.0.11Apache/2.2.22PHP 5.2.17 > Thanks Such messages usually appear due to upstream server crash and/or process termination due to some limits (memory, cpu, execution time...). Try looking into apache logs and/or system logs to see what happens. Maxim Dounin From sparshgupta at gmail.com Fri Mar 30 12:53:00 2012 From: sparshgupta at gmail.com (Sparsh Gupta) Date: Fri, 30 Mar 2012 18:23:00 +0530 Subject: Bug Report: error_page causes hot looping under heavy load Message-ID: I compiled a stable release 1.0.14 with no 3rd party modules and under heavy load, gdb is showing hot looping around when error_page directive is used. The CPU (all 8 cores) reaches 100% usage and the server stops responding to further requests I am happy to share my configurations but its a very simple arrangement with varnish server being the backend for proxy_pass. I am using apache-benchmark to test it. Thanks Sparsh Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: From arissirajawali at gmail.com Fri Mar 30 13:28:09 2012 From: arissirajawali at gmail.com (aris) Date: Fri, 30 Mar 2012 20:28:09 +0700 Subject: install nginx dan php debian In-Reply-To: References: <4F756EE7.401@esiee.fr> Message-ID: dear all, why is my nginx 403 Forbidden? Where such errors please help me, thank you On Fri, Mar 30, 2012 at 4:01 PM, Chen Ze wrote: > Google and RTFM > > On Fri, Mar 30, 2012 at 4:29 PM, Frank Bonnet wrote: > > On 03/30/2012 06:19 AM, aris wrote: > > > > please help me, I just wanted to start > > the install nginx and php on debian linux, > > that I question is: how to install nginx and php on debian, please send > it > > to me once in the tutorial how to install nginx and php. > > Thank you so much before > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > http://www.howtoforge.com/installing-php-5.3-nginx-and-php-fpm-on-ubuntu-debian > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.lavier at davromaniak.eu Fri Mar 30 13:34:38 2012 From: cyril.lavier at davromaniak.eu (Cyril Lavier) Date: Fri, 30 Mar 2012 15:34:38 +0200 Subject: install nginx dan php debian In-Reply-To: References: <4F756EE7.401@esiee.fr> Message-ID: <4F75B66E.80909@davromaniak.eu> On 03/30/2012 03:28 PM, aris wrote: > dear all, > why is my nginx 403 Forbidden? > Where such errors > please help me, thank you > > > On Fri, Mar 30, 2012 at 4:01 PM, Chen Ze > wrote: > > Google and RTFM > > On Fri, Mar 30, 2012 at 4:29 PM, Frank Bonnet > wrote: > > On 03/30/2012 06:19 AM, aris wrote: > > > > please help me, I just wanted to start > > the install nginx and php on debian linux, > > that I question is: how > to install nginx and php on debian, please send it > > to me once in the tutorial how to install nginx and php. > > Thank you so much before > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > > > http://www.howtoforge.com/installing-php-5.3-nginx-and-php-fpm-on-ubuntu-debian > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx Hi Aris. Could you post your configuration ? Please don't use an oversized font when writing to the list. Thanks. -- Cyril "Davromaniak" Lavier KeyID 59E9A881 http://www.davromaniak.eu -------------- next part -------------- An HTML attachment was scrubbed... URL: From sparshgupta at gmail.com Fri Mar 30 13:36:17 2012 From: sparshgupta at gmail.com (Sparsh Gupta) Date: Fri, 30 Mar 2012 19:06:17 +0530 Subject: Bug Report: error_page causes hot looping under heavy load In-Reply-To: References: Message-ID: Upon further debugging, the possible issue is at the following line: src/http/ngx_http_upstream_round_robin.c:433 for ( ;; ) { rrp->current = ngx_http_upstream_get_peer(rrp->peers); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0, "get rr peer, current: %ui %i", rrp->current, rrp->peers->peer[rrp->current].current_weight); n = rrp->current / (8 * sizeof(uintptr_t)); m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t)); The pc->tries is a ridiculously large number, which causes looping. Here is the configuration used to reproduce the error: worker_processes 1; worker_rlimit_nofile 32768; error_log /var/log/nginx/error.log warn; events { worker_connections 16384; use epoll; } http { access_log off; upstream a { server 10.56.140.8 backup; server 10.56.140.2 backup; server 10.56.140.4 backup; server 10.56.140.6 backup; } upstream b { server 10.56.140.16 max_fails=100 fail_timeout=5s; server 10.56.140.8 backup; server 10.56.140.2 backup; server 10.56.140.4 backup; server 10.56.140.6 backup; } server { listen 80; location = /j.php { include /etc/nginx/proxy.conf; #with some timeout variables which are not relevant here I think proxy_pass http://b; error_page 403 404 500 502 503 504 = @fallback; } location @fallback { proxy_pass http://a; } } } Sparsh Gupta On 30 March 2012 18:23, Sparsh Gupta wrote: > I compiled a stable release 1.0.14 with no 3rd party modules and under > heavy load, gdb is showing hot looping around when error_page directive > is used. The CPU (all 8 cores) reaches 100% usage and the server stops > responding to further requests > > I am happy to share my configurations but its a very simple arrangement > with varnish server being the backend for proxy_pass. I am using > apache-benchmark to test it. > > Thanks > Sparsh Gupta > -------------- next part -------------- An HTML attachment was scrubbed... URL: From krjeschke at omniti.com Fri Mar 30 14:06:28 2012 From: krjeschke at omniti.com (Katherine Jeschke) Date: Fri, 30 Mar 2012 10:06:28 -0400 Subject: Surge 2012 CFP is Open! Message-ID: Surge 2012, the scalability conference, September 27-28, Baltimore, MD has opened its CFP. Please visit http://omniti.com/surge/2012/cfp for details. -- Katherine Jeschke Director of Marketing and Creative Services OmniTI Computer Consulting, Inc. 7070 Samuel Morse Drive, Ste.150 Columbia, MD 21046 O: 443-325-1357, 222 F: 410/872-4911 C: 443/643-6140 omniti.com Surge2012: http://omniti.com/surge/2012 PG Corridor Days - DC: http://pgday.bwpug.org/ The information contained in this electronic message and any attached documents is privileged, confidential, and protected from disclosure. If you are not the intended recipient, note that any review, disclosure, copying, distribution, or use of the contents of this electronic message or any attached documents is prohibited. If you have received this communication in error, please destroy it and notify us immediately by telephone (1-443-325-1360) or by electronic mail (info at omniti.com). Thank you. From cliff at develix.com Fri Mar 30 15:17:22 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 30 Mar 2012 08:17:22 -0700 Subject: could not build the referers_hash In-Reply-To: References: <1333071717.2082.3.camel@portable-evil> Message-ID: <1333120642.2082.7.camel@portable-evil> On Thu, 2012-03-29 at 19:04 -0700, Justin Dorfman wrote: > Hey Cliff, > > > I did, same issue. The way we ended up "fixing" it was deleting all > of the vhosts and syncing them from another PoP. How large did you make the value? With a large number of vhosts the value might need to be significantly higher. Also, I'm not sure of the context for this value, it might need to be at the http level. There's also a related value, referers_hash_bucket_size that might need to be increased. The only information I found was from this thread (translated from Russian via google): 2011/7/19 Igor Sysoev : > Changes in nginx 1.0.5 19.07.2011 > > > *) Feature: the referer_hash_max_size and > Referer_hash_bucket_size. > Thank you Witold Filipczyk. With these guidelines, there are some problems: - In the error messages as they are called, and referers_hash_max_size referers_hash_bucket_size - The default value for referer_hash_max_size in the error message described as a 128 (actually - 2048) - It is not clear how to find exactly where the problem that is, such as the diagnosis is nginx: [emerg] could not build the referers_hash, you should increase referers_hash_bucket_size: 64 But that's not enough, as the context for referer_hash_max_size server and location Regards, Cliff From szun at informatik.hu Fri Mar 30 15:17:49 2012 From: szun at informatik.hu (Vuki) Date: Fri, 30 Mar 2012 17:17:49 +0200 Subject: install nginx dan php debian References: <4F756EE7.401@esiee.fr> Message-ID: <1215987271.1017595069@informatik.hu> Hi! Check file permissions and the index directive, and index files! Vukii ------- Original message ------- > From: aris > To: surfchen at gmail.com > Cc: nginx at nginx.org > Sent: '12-03-30, 15:28 > > dear all, > why is?my?nginx?403 Forbidden? > Where?such errors > please?help me,?thank you > > > On Fri, Mar 30, 2012 at 4:01 PM, Chen Ze wrote: >> Google and RTFM >> >> On Fri, Mar 30, 2012 at 4:29 PM, Frank Bonnet wrote: >>> On 03/30/2012 06:19 AM, aris wrote: >>> >>> please help me,?I just?wanted to?start >>> the?install?nginx?and?php?on?debian?linux, >>> that?I question?is:?how to?install?nginx?and?php?on?debian,?please?send it >>> to me?once?in the?tutorial?how to?install?nginx?and?php. >>> ??Thank you so much?before >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >>> >>> >>> http://www.howtoforge.com/installing-php-5.3-nginx-and-php-fpm-on-ubuntu-debian >>> >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://mailman.nginx.org/mailman/listinfo/nginx >> From adnan at rihan.fr Fri Mar 30 15:45:05 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Fri, 30 Mar 2012 17:45:05 +0200 Subject: Custom configuration In-Reply-To: <20120330083620.GD3899@craic.sysops.org> References: <1332980154.20728.4.camel@portable-evil> <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> <20120330083620.GD3899@craic.sysops.org> Message-ID: Ok. Then, here is the vhost: > ################################################################# > ########### Vhost configuration of mega-sound.be > ################################################################# > server { > access_log off; > error_log logs/vhost-error_log warn; > listen 80; > server_name mega-sound.be www.mega-sound.be; > location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ { > expires 24h; > root /home/megasoun/public_html; > error_page 404 = @apache; > access_log /usr/local/apache/domlogs/mega-sound.be; > log_not_found off; > } > location ~ /\.ht { > deny all; > } > > location / { > log_not_found off; > > client_max_body_size 2000m; > client_body_buffer_size 512k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 32k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > > proxy_redirect http://www.mega-sound.be:8888 http://www.mega-sound.be; > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > proxy_pass http://87.98.132.48:8888/; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > location @apache { > internal; > > client_max_body_size 2000m; > client_body_buffer_size 512k; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 32k; > proxy_buffers 16 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > proxy_connect_timeout 30s; > > proxy_redirect http://mega-sound.be:8888 http://mega-sound.be; > proxy_pass http://87.98.132.48:8888; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > include "/etc/cpnginx/custom/mega-sound.be"; > } Here is the included file: > root at shadow [/usr/local/nginx/conf]# cat /etc/cpnginx/custom/mega-sound.be > location ~* \.mp3$ { > more_set_headers 'X-MyHeader: .mp3'; > } > > location /adata { > more_set_headers 'X-MyHeader: adata'; > } > > more_set_headers 'X-MyMasterHeader: set'; > more_set_headers 'X-My2Header: $request_uri'; Here is the HTTP Headers for the root URL (www.mega-sound.be): > HTTP/1.1 200 OK > Server: nginx > Date: Fri, 30 Mar 2012 15:41:35 GMT > Content-Type: text/html > Transfer-Encoding: chunked > Connection: keep-alive > X-Powered-By: PHP/5.3.10 > Expires: Thu, 19 Nov 1981 08:52:00 GMT > Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 > Pragma: no-cache > Set-Cookie: slrememberme=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT > X-MyMasterHeader: set > X-My2Header: / > Content-Encoding: gzip Here is the headers for an MP3 (http://www.mega-sound.be/adata/362.mp3): > HTTP/1.1 200 OK > Server: nginx > Date: Fri, 30 Mar 2012 15:43:04 GMT > Content-Type: audio/mpeg > Content-Length: 3258859 > Last-Modified: Wed, 22 Feb 2012 13:52:13 GMT > Connection: keep-alive > X-MyMasterHeader: set > X-My2Heade: /adata/362.mp3 > Expires: Sat, 31 Mar 2012 15:43:04 GMT > Cache-Control: max-age=86400 > Accept-Ranges: bytes Is it enough ? Thank you for your help. --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le vendredi 30 mars 2012 ? 10:36, Francis Daly a ?crit : > On Fri, Mar 30, 2012 at 07:08:37AM +0200, Adnan RIHAN wrote: > > Hi there, > > > What can I do T_T ? > > Read http://nginx.org/en/docs/http/request_processing.html > > Look in your config file. Be aware of "include" directives. Look in > every server{} block. Look at "listen" and "server_name" directives in > each server{} block. > > Identify which one server{} block is being used to handle this request. > > Post the config for that server{}. > > (If you can additionally identify which one location{} block within > that server{} block is being used for this request, then you could > limit what you post to: the server{} block outside of all location{}s, > plus the content of that one location{}. But that's probably more work > than is necessary.) > > > If you can enable the debug log (will probably require rebuilding > nginx), then you will see lots of information about what nginx thinks > is happening. > > But posting the relevant part of the config file is the best way to make > it easy for people help you. > > f > -- > Francis Daly francis at daoine.org (mailto:francis at daoine.org) > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdorfman at netdna.com Fri Mar 30 16:08:54 2012 From: jdorfman at netdna.com (Justin Dorfman) Date: Fri, 30 Mar 2012 09:08:54 -0700 Subject: could not build the referers_hash In-Reply-To: <1333120642.2082.7.camel@portable-evil> References: <1333071717.2082.3.camel@portable-evil> <1333120642.2082.7.camel@portable-evil> Message-ID: Hey Cliff, Here are the current values: server_names_hash_max_size 65536; server_names_hash_bucket_size 256; The number of vhosts we have on that cluster is 23,252 (not all active, need to clean that up.) Are those values sufficient for the amount of vhosts? FYI We have 32gb of ram if that makes any difference. Regards, Justin Dorfman On Fri, Mar 30, 2012 at 8:17 AM, Cliff Wells wrote: > On Thu, 2012-03-29 at 19:04 -0700, Justin Dorfman wrote: > > Hey Cliff, > > > > > > I did, same issue. The way we ended up "fixing" it was deleting all > > of the vhosts and syncing them from another PoP. > > How large did you make the value? With a large number of vhosts the > value might need to be significantly higher. Also, I'm not sure of the > context for this value, it might need to be at the http level. > > There's also a related value, referers_hash_bucket_size that might need > to be increased. > > The only information I found was from this thread (translated from > Russian via google): > > 2011/7/19 Igor Sysoev : > > Changes in nginx 1.0.5 19.07.2011 > > > > > > *) Feature: the referer_hash_max_size and > > Referer_hash_bucket_size. > > Thank you Witold Filipczyk. > > With these guidelines, there are some problems: > - In the error messages as they are called, and referers_hash_max_size > referers_hash_bucket_size > - The default value for referer_hash_max_size in the error message > described as a 128 (actually - 2048) > - It is not clear how to find exactly where the problem > that is, such as the diagnosis is > nginx: [emerg] could not build the referers_hash, you should increase > referers_hash_bucket_size: 64 > But that's not enough, as the context for referer_hash_max_size server > and location > > > Regards, > Cliff > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri Mar 30 16:33:34 2012 From: nginx-forum at nginx.us (stormflake) Date: Fri, 30 Mar 2012 12:33:34 -0400 (EDT) Subject: 1.0.5 vs 1.0.10 In-Reply-To: <9c2ce052ecb02bd1b9742ab3116d56da.NginxMailingListEnglish@forum.nginx.org> References: <9c2ce052ecb02bd1b9742ab3116d56da.NginxMailingListEnglish@forum.nginx.org> Message-ID: <11db4a5ddd1c7ed7b82867d1cd170054.NginxMailingListEnglish@forum.nginx.org> thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224629,224678#msg-224678 From francis at daoine.org Fri Mar 30 18:14:35 2012 From: francis at daoine.org (Francis Daly) Date: Fri, 30 Mar 2012 19:14:35 +0100 Subject: Custom configuration In-Reply-To: References: <1332980154.20728.4.camel@portable-evil> <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> <20120330083620.GD3899@craic.sysops.org> Message-ID: <20120330181435.GE3899@craic.sysops.org> On Fri, Mar 30, 2012 at 05:45:05PM +0200, Adnan RIHAN wrote: Hi there, > Then, here is the vhost: Great, this shows why things are working the way they are. > > location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ { This is the first regex location that matches mp3 urls, so this is the one that will be used. For what I think you want to do, you should remove "|mp3" from up there, and then have the separate "~* \.mp3$" location later. > > expires 24h; > > root /home/megasoun/public_html; > > error_page 404 = @apache; > > access_log /usr/local/apache/domlogs/mega-sound.be; > > log_not_found off; Based on the rest of the config, you can probably move some of those to "outside all locations", so that they will be inherited into all locations that don't otherwise set them. > > location / { > > proxy_pass http://87.98.132.48:8888/; > > } > > location @apache { > > proxy_pass http://87.98.132.48:8888; > > } > > include "/etc/cpnginx/custom/mega-sound.be"; > > } > > root at shadow [/usr/local/nginx/conf]# cat /etc/cpnginx/custom/mega-sound.be As above, because this is included last in the main file, the mp3 location here can never match. So if you remove the "|mp3" up there, then this one will match: > > location ~* \.mp3$ { > > more_set_headers 'X-MyHeader: .mp3'; and now you can set your types, or do whatever else is needed, and have it take effect. (If your default or server-level "root" is not correct for this location, you'll want to set that in here too.) Because of the nginx location matching rules, this next location won't be used for /adata/123.mp3, but will be used for /adata/123.html. You can test that by putting a file of the right name in the right ("root"/adata) directory, and seeing the X- header appearing. > > location /adata { > > more_set_headers 'X-MyHeader: adata'; > > } And these two are outside of all locations, so apply to everything that does not override them. > > more_set_headers 'X-MyMasterHeader: set'; > > more_set_headers 'X-My2Header: $request_uri'; > Here is the HTTP Headers for the root URL (www.mega-sound.be): This is expected to be proxy_pass'ed to port 8888, and you can see that your "all" more_set_headers directives did apply. > > HTTP/1.1 200 OK > > X-MyMasterHeader: set > > X-My2Header: / > Here is the headers for an MP3 (http://www.mega-sound.be/adata/362.mp3): This would match your original long location, so will be the file /home/megasoun/public_html/adata/362.mp3 if it exists, and proxied to port 8888 if it doesn't. Again, your "all" more_set_headers apply. > > HTTP/1.1 200 OK > > Content-Type: audio/mpeg > > X-MyMasterHeader: set > > X-My2Heade: /adata/362.mp3 If you remove "|mp3" from the first location; or just "include" this file at the top instead of the bottom of the server{} block, then your custom mp3 location would apply; and you should see your extra configuration being used. (Without "root" set right, though, you may just end up with a 404.) http://www.nginx.org/r/location for the details on how nginx chooses which one location{} block will be used for the current request, if it's unclear. All the best, f -- Francis Daly francis at daoine.org From trm.nagios at gmail.com Fri Mar 30 18:53:43 2012 From: trm.nagios at gmail.com (trm asn) Date: Sat, 31 Mar 2012 00:23:43 +0530 Subject: Maintenance Page Message-ID: Dear List, I am looking for a maintenance page while working on the upstream Tomcat server. Below is my nginx.conf file. Is there anything wrong in this config , as it's not redirecting to the maintenance.html page. ####################################################################### # This is the main Nginx configuration file. ####################################################################### user www-server; pid logs/nginx.pid; worker_processes 8; error_log /usr/local/nginx/logs/error.log; #---------------------------------------------------------------------- # Events Module #---------------------------------------------------------------------- events { worker_connections 1024; } #---------------------------------------------------------------------- # HTTP Core Module #---------------------------------------------------------------------- http { include /usr/local/nginx/conf/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /usr/local/nginx/logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; upstream backend { # ip_hash; server 192.168.65.102:8080 srun_id=a; #server 192.168.65.103:8080; jvm_route $cookie_JSESSIONID reverse; } server { listen 80; server_name report-int.example.com; root /var/www/example.com/; location / { if (-f $document_root/maintenance.html) { return 503; } proxy_pass http://backend; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } error_page 503 @maintenance; location @maintenance { rewrite ^(.*)$ /maintenance.html break; } error_page 404 /404.html; location = /404.html { root /usr/local/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/local/nginx/html; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Fri Mar 30 19:38:53 2012 From: francis at daoine.org (Francis Daly) Date: Fri, 30 Mar 2012 20:38:53 +0100 Subject: Maintenance Page In-Reply-To: References: Message-ID: <20120330193853.GF3899@craic.sysops.org> On Sat, Mar 31, 2012 at 12:23:43AM +0530, trm asn wrote: Hi there, > I am looking for a maintenance page while working on the upstream Tomcat > server. Below is my nginx.conf file. Is there anything wrong in this config > , as it's not redirecting to the maintenance.html page. This config seems to work for me. When the appropriate maintenance.html is present, a request for /echo/foo returns 503 and the maintenance content; otherwise, the request returns the upstream response for /echo/foo. What responses do you get from curl -i http://report-int.example.com/echo/foo when /var/www/example.com/maintenance.html is present, and is not present? (And is there anything unusual in the output of "nginx -V" and "nginx -v"?) f -- Francis Daly francis at daoine.org From cliff at develix.com Fri Mar 30 21:50:07 2012 From: cliff at develix.com (Cliff Wells) Date: Fri, 30 Mar 2012 14:50:07 -0700 Subject: could not build the referers_hash In-Reply-To: References: <1333071717.2082.3.camel@portable-evil> <1333120642.2082.7.camel@portable-evil> Message-ID: <1333144207.2204.8.camel@portable-evil> On Fri, 2012-03-30 at 09:08 -0700, Justin Dorfman wrote: > Hey Cliff, > > > Here are the current values: > > > server_names_hash_max_size 65536; > server_names_hash_bucket_size 256; These are not the hashes you are looking for =) Your error message specified "you should increase referers_hash_bucket_size", indicating that it is currently 64. Regards, Cliff From adnan at rihan.fr Fri Mar 30 23:35:52 2012 From: adnan at rihan.fr (Adnan RIHAN) Date: Sat, 31 Mar 2012 01:35:52 +0200 Subject: Custom configuration In-Reply-To: <20120330181435.GE3899@craic.sysops.org> References: <1332980154.20728.4.camel@portable-evil> <17306FE53A1D4698A9A3BEC4BF08E977@gmail.com> <20120330083620.GD3899@craic.sysops.org> <20120330181435.GE3899@craic.sysops.org> Message-ID: <29F3677F1E1C48B5ACDA3E994F177D1E@gmail.com> I knew that location are matched 1 time but I didn't noticed the |mp3 T_T Thank you very much, I'm understanding more and more nginx. I think it's done, I just have to deal with the CPanel NGinx module devs to change include place (in order to avoid this case another time). Good night ! --- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), h?bergeur Web et Serveurs de Jeux. Consultant (http://rihan.fr/)-Technicien Sup?rieur en Informatique de Gestion. Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)). Le vendredi 30 mars 2012 ? 20:14, Francis Daly a ?crit : > On Fri, Mar 30, 2012 at 05:45:05PM +0200, Adnan RIHAN wrote: > > Hi there, > > > Then, here is the vhost: > > Great, this shows why things are working the way they are. > > > > location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ { > > This is the first regex location that matches mp3 urls, so this is the > one that will be used. > > For what I think you want to do, you should remove "|mp3" from up there, > and then have the separate "~* \.mp3$" location later. > > > > expires 24h; > > > root /home/megasoun/public_html; > > > error_page 404 = @apache; > > > access_log /usr/local/apache/domlogs/mega-sound.be (http://mega-sound.be); > > > log_not_found off; > > > > > > > > Based on the rest of the config, you can probably move some of those to > "outside all locations", so that they will be inherited into all locations > that don't otherwise set them. > > > > > location / { > > > proxy_pass http://87.98.132.48:8888/; > > > } > > > > > > > > > > location @apache { > > > proxy_pass http://87.98.132.48:8888; > > > } > > > > > > > > > > include "/etc/cpnginx/custom/mega-sound.be (http://mega-sound.be)"; > > > } > > > > > > > > > > root at shadow [/usr/local/nginx/conf]# cat /etc/cpnginx/custom/mega-sound.be (http://mega-sound.be) > > As above, because this is included last in the main file, the mp3 location > here can never match. > > So if you remove the "|mp3" up there, then this one will match: > > > > location ~* \.mp3$ { > > > more_set_headers 'X-MyHeader: .mp3'; > > > > > > > > and now you can set your types, or do whatever else is needed, and have > it take effect. > > (If your default or server-level "root" is not correct for this location, > you'll want to set that in here too.) > > Because of the nginx location matching rules, this next location won't > be used for /adata/123.mp3, but will be used for /adata/123.html. You can > test that by putting a file of the right name in the right ("root"/adata) > directory, and seeing the X- header appearing. > > > > location /adata { > > > more_set_headers 'X-MyHeader: adata'; > > > } > > > > > > > > And these two are outside of all locations, so apply to everything that > does not override them. > > > > more_set_headers 'X-MyMasterHeader: set'; > > > more_set_headers 'X-My2Header: $request_uri'; > > > > > > > > > Here is the HTTP Headers for the root URL (www.mega-sound.be (http://www.mega-sound.be)): > > This is expected to be proxy_pass'ed to port 8888, and you can see that > your "all" more_set_headers directives did apply. > > > > HTTP/1.1 200 OK > > > X-MyMasterHeader: set > > > X-My2Header: / > > > > > > > > > Here is the headers for an MP3 (http://www.mega-sound.be/adata/362.mp3): > > This would match your original long location, so will be the file > /home/megasoun/public_html/adata/362.mp3 if it exists, and proxied to > port 8888 if it doesn't. Again, your "all" more_set_headers apply. > > > > HTTP/1.1 200 OK > > > Content-Type: audio/mpeg > > > X-MyMasterHeader: set > > > X-My2Heade: /adata/362.mp3 > > > > > > > > If you remove "|mp3" from the first location; or just "include" this file > at the top instead of the bottom of the server{} block, then your custom > mp3 location would apply; and you should see your extra configuration > being used. (Without "root" set right, though, you may just end up with > a 404.) > > http://www.nginx.org/r/location for the details on how nginx chooses > which one location{} block will be used for the current request, if > it's unclear. > > All the best, > > f > -- > Francis Daly francis at daoine.org (mailto:francis at daoine.org) > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://mailman.nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture =?utf-8?Q?d=E2=80=99e=CC=81cran_?=2012-03-31 =?utf-8?Q?a=CC=80_?=01.34.16.png Type: image/png Size: 29857 bytes Desc: not available URL: From mdounin at mdounin.ru Fri Mar 30 23:53:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 31 Mar 2012 03:53:41 +0400 Subject: Bug Report: error_page causes hot looping under heavy load In-Reply-To: References: Message-ID: <20120330235341.GY13466@mdounin.ru> Hello! On Fri, Mar 30, 2012 at 07:06:17PM +0530, Sparsh Gupta wrote: > Upon further debugging, the possible issue is at the following line: > > src/http/ngx_http_upstream_round_robin.c:433 > for ( ;; ) { > rrp->current = ngx_http_upstream_get_peer(rrp->peers); > > ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0, > "get rr peer, current: %ui %i", > rrp->current, > > rrp->peers->peer[rrp->current].current_weight); > > n = rrp->current / (8 * sizeof(uintptr_t)); > m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t)); > > > > The pc->tries is a ridiculously large number, which causes looping. Here is > the configuration used to reproduce the error: > > worker_processes 1; > worker_rlimit_nofile 32768; > error_log /var/log/nginx/error.log warn; > events { worker_connections 16384; use epoll; } > > http { > access_log off; > > upstream a { > server 10.56.140.8 backup; > server 10.56.140.2 backup; > server 10.56.140.4 backup; > server 10.56.140.6 backup; > } > > upstream b { > server 10.56.140.16 max_fails=100 fail_timeout=5s; > server 10.56.140.8 backup; > server 10.56.140.2 backup; > server 10.56.140.4 backup; > server 10.56.140.6 backup; > } > > server { > listen 80; > > location = /j.php { > include /etc/nginx/proxy.conf; #with some timeout variables > which are not relevant here I think > proxy_pass http://b; > error_page 403 404 500 502 503 504 = @fallback; > } > > location @fallback { > proxy_pass http://a; > } > } > } Upstream "a" have only backup servers, and this is what causes problems. This is in fact configuration error (you have to define at least one non-backup server, else "backup" flag doesn't make sense). But obviously this should be either rejected during configuration parsing or handled somehow, CPU hog is a bug, thank you for report. With the following patch nginx will reject such configuration during configuration parsing: --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -49,6 +49,13 @@ ngx_http_upstream_init_round_robin(ngx_c n += server[i].naddrs; } + if (n == 0) { + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "no servers in upstream \"%V\" in %s:%ui", + &us->host, us->file_name, us->line); + return NGX_ERROR; + } + peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t) + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1)); if (peers == NULL) { Maxim Dounin > > > Sparsh Gupta > > > On 30 March 2012 18:23, Sparsh Gupta wrote: > > > I compiled a stable release 1.0.14 with no 3rd party modules and under > > heavy load, gdb is showing hot looping around when error_page directive > > is used. The CPU (all 8 cores) reaches 100% usage and the server stops > > responding to further requests > > > > I am happy to share my configurations but its a very simple arrangement > > with varnish server being the backend for proxy_pass. I am using > > apache-benchmark to test it. > > > > Thanks > > Sparsh Gupta > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx From duanemulder at rattyshack.ca Sat Mar 31 00:24:30 2012 From: duanemulder at rattyshack.ca (Duane Mulder) Date: Sat, 31 Mar 2012 00:24:30 +0000 Subject: nginx proxing to large remote svn repository. Message-ID: <270645307-1333153470-cardhu_decombobulator_blackberry.rim.net-2093313502-@b13.c9.bise6.blackberry> Hello all: I currently have nginx 1.0.5 proxying http to remote svn server. The svn repo is over 400G in size and constitutes all large binary files with a active userbase of about 4000. All works fine connecting directly with an svn client. Adding nginx in the mix we are seeing occasional time out errors in the nginx log. I have adjusted the some of the config time outs to be 75 seconds with no obvious luck. We are also seeing problems with the svn clients aborting with no recorded nginx error. What I am wondering is, are there buffering streaming other config options that I am missing ? Should I move to a newer version of nginx ? Regards, Duane Sent from my BlackBerry device on the Rogers Wireless Network From zhuzhaoyuan at gmail.com Sat Mar 31 04:35:41 2012 From: zhuzhaoyuan at gmail.com (Joshua Zhu) Date: Sat, 31 Mar 2012 12:35:41 +0800 Subject: [ANNOUNCE] Tengine-1.2.4 Message-ID: Hi folks! We're pleased to announce that Tengine-1.2.4 has been released. You can either download the tar ball from http://tengine.taobao.org/download/tengine-1.2.4.tar.gz , or checkout the code from https://github.com/taobao/tengine As this release, Tengine is based on Nginx-1.0.14. The highlight is a brand new 'user_agent' module which would be a good replacement for the 'browser' module in standard Nginx. It's more efficient and flexible than the 'browser' module. Other changes include: * Feature: added the 'log_escape' directive. * Bugfix: fixed a bug in the limit_req module. * Bugfix: fixed a bug in subrequest. Regards, -- Joshua Zhu Senior Software Engineer Server Platforms Team at Taobao -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Mar 31 06:11:09 2012 From: nginx-forum at nginx.us (drook) Date: Sat, 31 Mar 2012 02:11:09 -0400 (EDT) Subject: status module, OS difference Message-ID: Hi. I'm using nginx stub_status module to get graphs on cacti. I'm also using it on various platforms, like Linux/Solaris/FreeBSD (someone will say that such a zoo is a bad idea, but still). Graphs on my cacti looks different for these systems. The graphs themselves will probably add more distraction so I will show pure numbers: Solaris (this one runs php-fpm plus it serves the distros repository, most of connections are distro downloads; /dev/poll, multi_accept): Active connections: 104 server accepts handled requests 58558789 58558789 58528647 Reading: 4 Writing: 100 Waiting: 0 Linux (php-fpm, epoll, multi_accept): Active connections: 326 server accepts handled requests 1013 1013 1812 Reading: 31 Writing: 2 Waiting: 293 FreeBSD (php-fpm, kqueue, multi_accept): Active connections: 5 server accepts handled requests 1659837 1659837 1659799 Reading: 0 Writing: 5 Waiting: 0 Notice that everywhere except Linux the number of waiting connections is 0, and on Linux the number of reading connections is significant. That really looks weird to me, because (I will probably get another wave of 'man, you really should get rid of this zoo', and I promise I will) these servers serve the same backend pool (in the same time the difference between the total number of connection is normal and I can explain this). Why is that ? Is that because of the difference in the way these systems handle connections or is that because of the difference in platform-specific code (including the code that counts connections) ? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224700,224700#msg-224700 From nginx-forum at nginx.us Sat Mar 31 09:20:10 2012 From: nginx-forum at nginx.us (etrader) Date: Sat, 31 Mar 2012 05:20:10 -0400 (EDT) Subject: How to remove PHP X-Powered-By? Message-ID: <8fc83abd77e9886ad3c2e9f28d759683.NginxMailingListEnglish@forum.nginx.org> I add custom X-Powered-By with "add_header X-Powered-By custom;" However, when serving PHP fastcgi in the location, PHP X-Powered-By will also be added to make the X-Powered-By as X-Powered-By: PHP/5.3.3-1ubuntu9.10 custom How can I totally remove PHP X-Powered-By to have my own custom one only? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224706,224706#msg-224706 From nginx-forum at nginx.us Sat Mar 31 09:36:37 2012 From: nginx-forum at nginx.us (locojohn) Date: Sat, 31 Mar 2012 05:36:37 -0400 (EDT) Subject: How to remove PHP X-Powered-By? In-Reply-To: <8fc83abd77e9886ad3c2e9f28d759683.NginxMailingListEnglish@forum.nginx.org> References: <8fc83abd77e9886ad3c2e9f28d759683.NginxMailingListEnglish@forum.nginx.org> Message-ID: <45730383cf3fbe48542901b3d9dc8483.NginxMailingListEnglish@forum.nginx.org> In php.ini: expose_php = off Actually, you could do some googling before asking a question. Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224706,224707#msg-224707 From 911csj at gmail.com Sat Mar 31 09:50:48 2012 From: 911csj at gmail.com (yeti+) Date: Sat, 31 Mar 2012 17:50:48 +0800 Subject: How to remove PHP X-Powered-By? In-Reply-To: <45730383cf3fbe48542901b3d9dc8483.NginxMailingListEnglish@forum.nginx.org> References: <8fc83abd77e9886ad3c2e9f28d759683.NginxMailingListEnglish@forum.nginx.org> <45730383cf3fbe48542901b3d9dc8483.NginxMailingListEnglish@forum.nginx.org> Message-ID: try "fastcgi_hide_header X-Powered-By;" 2012/3/31 locojohn > In php.ini: > > expose_php = off > > Actually, you could do some googling before asking a question. > > Andrejs > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,224706,224707#msg-224707 > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat Mar 31 14:29:33 2012 From: nginx-forum at nginx.us (etrader) Date: Sat, 31 Mar 2012 10:29:33 -0400 (EDT) Subject: How to remove PHP X-Powered-By? In-Reply-To: <45730383cf3fbe48542901b3d9dc8483.NginxMailingListEnglish@forum.nginx.org> References: <8fc83abd77e9886ad3c2e9f28d759683.NginxMailingListEnglish@forum.nginx.org> <45730383cf3fbe48542901b3d9dc8483.NginxMailingListEnglish@forum.nginx.org> Message-ID: <51c9e4f10c464930c321f91392e6c1bf.NginxMailingListEnglish@forum.nginx.org> Thanks Andrejs! Sorry, it was my failure! locojohn Wrote: ------------------------------------------------------- > In php.ini: > > expose_php = off > > Actually, you could do some googling before asking > a question. > > Andrejs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224706,224719#msg-224719 From micah at quixotix.com Sat Mar 31 15:52:09 2012 From: micah at quixotix.com (Micah Carrick) Date: Sat, 31 Mar 2012 08:52:09 -0700 Subject: Set cache expiration based on request filename Message-ID: Hey folks, My Django website uses a subdomain to serve static content and as such I have 'expires' set to max. However, there is now one image on that domain that get's re-generated every 10 minutes. How would I go about forcing just that one filename to NOT be cached by the browser? This is what I have: server { listen 80; listen 443; ssl on; server_name static.example.com; expires max; add_header Cache-Control public; access_log off; root /home/username/public_html/static.example.com/; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From axel50397 at gmail.com Sat Mar 31 15:56:27 2012 From: axel50397 at gmail.com (Adnan RIHAN) Date: Sat, 31 Mar 2012 17:56:27 +0200 Subject: Set cache expiration based on request filename In-Reply-To: References: Message-ID: <-648723160580968573@unknownmsgid> I think you want to use "location" directive, and an expires inside ;) -- Cordialement, Adnan RIHAN. Pr?sident-Fondateur de l'association Virtual-Info (Loi 1901), h?bergement Web et Serveurs de jeux. Technicien-Sup?rieur d?veloppeur d'applications Web et Syst?me. 3e ann?e ? {Epitech}. Envoy? de mon iPhone ? Le 31 mars 2012 ? 17:52, Micah Carrick a ?crit : Hey folks, My Django website uses a subdomain to serve static content and as such I have 'expires' set to max. However, there is now one image on that domain that get's re-generated every 10 minutes. How would I go about forcing just that one filename to NOT be cached by the browser? This is what I have: server { listen 80; listen 443; ssl on; server_name static.example.com; expires max; add_header Cache-Control public; access_log off; root /home/username/public_html/static.example.com/; } _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From micah at quixotix.com Sat Mar 31 16:28:19 2012 From: micah at quixotix.com (Micah Carrick) Date: Sat, 31 Mar 2012 09:28:19 -0700 Subject: Set cache expiration based on request filename In-Reply-To: <-648723160580968573@unknownmsgid> References: <-648723160580968573@unknownmsgid> Message-ID: Boy do I feel foolish. Of course. Thanks! On Sat, Mar 31, 2012 at 8:56 AM, Adnan RIHAN wrote: > I think you want to use "location" directive, and an expires inside ;) > > -- > Cordialement, Adnan RIHAN. > Pr?sident-Fondateur de l'association Virtual-Info (Loi 1901), > h?bergement Web et Serveurs de jeux. > Technicien-Sup?rieur d?veloppeur d'applications Web et Syst?me. > 3e ann?e ? {Epitech}. > Envoy? de mon iPhone ? > > Le 31 mars 2012 ? 17:52, Micah Carrick a ?crit : > > Hey folks, > > My Django website uses a subdomain to serve static content and as such I > have 'expires' set to max. However, there is now one image on that domain > that get's re-generated every 10 minutes. How would I go about forcing just > that one filename to NOT be cached by the browser? > > This is what I have: > > server { > listen 80; > listen 443; > ssl on; > server_name static.example.com; > expires max; > add_header Cache-Control public; > access_log off; > root /home/username/public_html/static.example.com/; > } > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From duanemulder at rattyshack.ca Sat Mar 31 20:21:25 2012 From: duanemulder at rattyshack.ca (Duane Mulder) Date: Sat, 31 Mar 2012 20:21:25 +0000 Subject: Set cache expiration based on request filename In-Reply-To: References: Message-ID: <653450772-1333225286-cardhu_decombobulator_blackberry.rim.net-822116736-@b13.c9.bise6.blackberry> Sent from my BlackBerry device on the Rogers Wireless Network -----Original Message----- From: Micah Carrick Sender: nginx-bounces at nginx.orgDate: Sat, 31 Mar 2012 08:52:09 To: Reply-To: nginx at nginx.org Subject: Set cache expiration based on request filename _______________________________________________ nginx mailing list nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx From nginx at yqed.com Sat Mar 31 22:39:37 2012 From: nginx at yqed.com (Floren Munteanu) Date: Sat, 31 Mar 2012 18:39:37 -0400 Subject: Socket leaks., pread and [crit] SSL_Write() in 1.0.14 In-Reply-To: <20120326164754.GL13466@mdounin.ru> References: <3b3f2c2eddfdd3e59d242463275e502e.NginxMailingListEnglish@forum.nginx.org> <00cd479fdbb8bdf2f9f844e88607f8bd.NginxMailingListEnglish@forum.nginx.org> <20120326164754.GL13466@mdounin.ru> Message-ID: Hi Maxim, On 3/26/2012 12:47 PM, Maxim Dounin wrote: > As already suggested - you may build nginx with any particular > openssl version statically, by using --with-openssl= configure > argument. I followed your advice and built a backlevel RPM for libcripto.so6 and libssl.so6 so none of the deps are broken in CentOS 5. Then, I built the OpenSSL 1.0.1 RPM's and rebuilt Nginx against the latest libs: # yum list openssl* nginx Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.manchester.icecolo.com * extras: mirrors.manchester.icecolo.com * updates: mirrors.manchester.icecolo.com Installed Packages nginx.x86_64 1.0.14-1.el5 installed openssl.x86_64 1.0.1-1.el5 installed openssl-libs.x86_64 1.0.1-1.el5 installed openssl098e.x86_64 0.9.8e-1.el5 installed # nginx -V nginx version: nginx/1.0.14 built by gcc 4.1.2 20080704 (Red Hat 4.1.2-52) TLS SNI support enabled configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/client --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/subsys/nginx --with-cc-opt='-O3 -g -m64 -mtune=nocona -m128bit-long-double -mmmx -msse3 -mfpmath=sse' --with-file-aio --with-http_addition_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --with-poll_module --with-rtsig_module --with-select_module http { ... ssl_prefer_server_ciphers on; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_session_cache shared:SSL:5m; ssl_session_timeout 10m; ... server { listen 192.168.1.3:443 ssl default_server; server_name www.domain.com; access_log off; error_log /var/log/nginx/localhost.error.log error; root /var/www/domain.com; index index.php index.html; ssl_certificate domain.com.crt; ssl_certificate_key domain.com.key; ... } } Even if I eliminated the OpenSSL version issues, I still have random [crit] SSL_write() failures at the same frequency as before. They are also accompanied by open socket alerts, of this format: [alert] 2380#0: open socket #34 left in connection 12 I'm looking forward to your suggestions. Regards, Floren